A Cloudflare IUAM session grabber
Project description
CFSession
A python script utilizing undetected-chromedriver to collect session cookies in a cloudflare IUAM protected site
How it works
It relies on a modified selenium (undetected-chromedriver) to cloak on sites that block selenium based sessions. When a program is able to pass through the IAUM or Captcha verification the program immedietely saves the session token to cache to be able to access to the site right away without needing to verify again when program closes(until the token expires).
The library wraps around requests library.
Tested request types:
- GET
- POST
Untested request types: but functionally implemented:
- PUT
- PATCH
- DELETE
Usage:
Normal Usage:
import CFSession
if __name__ == "__main__":
session = CFSession.cfSession()
res = session.get("https://nowsecure.nl") #A Cloudflare protected site
print(res.content)
#Context Manager
with CFSession.cfSession() as session:
res = session.get("https://nowsecure.nl")
print(res.content)
Installation:
python3 -m pip install CFSession
or
pip3 install CFSession
Question:
Why not just scrape fully on selenium? There are some use cases that selenium might potentially cause more workloads than using requests directly, as selenium is a programmable browser, the output as well are dynamic and often not consistent. This does not say that requests does not apply to this problem. There are also some uses like, IUAM sites completely blocks requests library and your program is heavily written soley for requests then this might be for you.
Is this just a requests wrapper? not fully. I havent implemented the entire requests functions and will probably will not be adding until I have certain understanding on how they work. So I rely on people accessing the 'deep level' code that I have intentionally kept open incase there are some specific use cases
for example you can directly access the requests.Session object directly in the cfSession object
from CFSession import cfSession
cfs = cfSession()
cfs.session #<--- A requests.Session object
Disclaimer:
This library was created with the sole purpose of educational purposes only, any rules/laws/ToS broken should only be held at the sole responsibility of the user.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file CFSession-0.2.0.tar.gz.
File metadata
- Download URL: CFSession-0.2.0.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e17863efbb2c9a190c22bf66c54976e3723114ed27fde2c983633d14b0e9e94
|
|
| MD5 |
5466c55db353c65fbbf36037d3b1a12f
|
|
| BLAKE2b-256 |
7aea66f1a9bc7470345b02091e499b47a8ddf7af51bdf0bcd71190773c7ab1ef
|
File details
Details for the file CFSession-0.2.0-py3-none-any.whl.
File metadata
- Download URL: CFSession-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc9f8b6fa86b3c0075ee72e902f1ec1c006c72b925884e4a10b22fda9daeaf18
|
|
| MD5 |
0131280ef0d9c769c59deac2f6267b8a
|
|
| BLAKE2b-256 |
fc564664f93642fc5a0d26fb593a17c9f2eb53370f558488d48e2fdd4e5564ed
|