Library for website analysis and requests
Project description
About WebPT
WebPT is a library for analyzing and crawling websites, the library is designed to be used by Pentesters and developers to make their code easier.
Installation
git clone https://github.com/saharavitan/webpt.git
Recommended Python Version:
WebPT currently supports Python 3
- The recommended version for Python 3 is >=3.6.x
Dependencies:
WebPT depends on the re, requests, bs4, urllib, threading and time python modules.
These dependencies can be installed using the requirements file:
- Installation on Windows:
c:\python38\python.exe -m pip install -r requirements.txt
- Installation on Linux
sudo pip install -r requirements.txt
Make Request Attributes
| Short Form | Description |
|---|---|
| request | - |
Request Analysis Attributes
| Short Form | Description |
|---|---|
| method | - |
| protocol | - |
| url | - |
| data | - |
| cookies | - |
| headers | - |
| params | - |
| path | - |
| status_code | - |
| response | - |
| redirect | - |
Spider Attributes
| Short Form | Description |
|---|---|
| links | - |
| gui | - |
Examples
Using WebPT as a module in your python scripts
MakeRequest Example
import webpt
request = webpt.make_request(url, method='POST', data="param1=val1¶m2=val2").request
import webpt
request = webpt.make_request(url).request
Spider Example
import webpt
get_links = webpt.spider("https://example.com").links
import webpt
print(webpt.spider("https://example.com").gui)
Request Analysis Example
import webpt
request = """POST /api/scope.php HTTP/1.1
Host: example.com
Connection: close
Content-Length: 69
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: https://example.com
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://example.com/
Accept-Encoding: gzip, deflate
Accept-Language: he-IL,he;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: __cfduid=d77a6a7e8c8303932379a959c941da11a1604046519; PHPSESSID=fpehjl7lamt1akovf990bd2gfl
csrf=3dff02bd9e7f4d014ff7218d2f3a80dc&target=https%3A%2F%2Fexample.co.il"""
req = webpt.request_analysis(request)
method = req.method
protocol = req.protocol
url = req.url
data = req.data
headers = req.headers
params = req.params
path = req.path
status_code = req.status_code
response = req.response
redirect = req.redirect
Author
Version
Current version is 1.0
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 webpt-1.2.tar.gz.
File metadata
- Download URL: webpt-1.2.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03bfbdb6d0aa2f48aa3783c310f508540d38362d9bae702d25171d07dd9db2f6
|
|
| MD5 |
40504f4788e4693e9cf0739f8affb4da
|
|
| BLAKE2b-256 |
daa7155437117c9a4d8616978ab0ce9ddb799a6001309ebeaa902b23af1c818f
|
File details
Details for the file webpt-1.2-py3-none-any.whl.
File metadata
- Download URL: webpt-1.2-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff9cc3b960f8ac2ed4c3f4623121af5618e96397e04ca93450c8e50cd1560762
|
|
| MD5 |
4c61d082facee0a3f54e3fd87ffa6b4e
|
|
| BLAKE2b-256 |
19e8e50fc6966aaf7e1e9e329ad894b7a138175be84275be4fa8e551b1d7c3ec
|