Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyOffensive Tools

PyOffensive Tools

Small offensive-security tools written in Python.
Network reconnaissance and lab utilities, each with a focused CLI.

Python stdlib only MIT Educational use only

⚠️ Educational use only. These tools are for authorized security testing, labs, and CTF practice. Only run them against systems you own or have explicit written permission to test. Unauthorized use is illegal in most jurisdictions and is solely your responsibility.


What is it?

A collection of small offensive-security tools, built as personal learning exercises. Each tool lives in its own module with a focused CLI, sensible defaults, and no external dependencies beyond what it actually needs.

Tools

Tool Module What it does
Port Scanner tools.port_scanner Fast concurrent TCP port scanner with optional banner grabbing.
ICMP Scanner tools.icmp_scanner Host discovery by parallel ICMP echo (ping sweep).
Keylogger keylogger.main Keystroke capture reported over email (Gmail SMTP).

Demo

Terminal demo

Getting started

Requires Python 3.10+. The port and ICMP scanners are stdlib-only; only the keylogger needs pynput.

git clone https://github.com/danielvaldess/Pyoffensive-tools.git
cd Pyoffensive-tools
pip3 install -r requirements.txt

Usage

Port scanner

Concurrent TCP connect scanner with optional banner grabbing.

# scan a range
python3 -m tools.port_scanner -t 192.168.1.1 -p 1-1024

# scan specific ports and grab banners
python3 -m tools.port_scanner -t example.com -p 22,80,443 -b

# tune concurrency
python3 -m tools.port_scanner -t 10.0.0.5 -p 1-65535 -w 200
Flag Description
-t, --target Host to scan (IP or hostname). Required.
-p, --ports 80, 22,80,443 or 1-1024. Required.
-b, --banner Attempt to grab a service banner.
-w, --workers Max concurrent workers (default: 100).
-v, --verbose Debug logging.

ICMP host discovery

Parallel ping sweep. Accepts a single host, a last-octet range, or a CIDR block.

python3 -m tools.icmp_scanner -t 192.168.1.1-254
python3 -m tools.icmp_scanner -t 192.168.1.0/24
python3 -m tools.icmp_scanner -t 192.168.1.10

Keylogger

Reports captured keystrokes over Gmail SMTP (app password required). See docs/keylogger.md for details.

export SMTP_USERNAME=you@gmail.com
export SMTP_APP_PASSWORD=your-app-password
python3 -m keylogger.main

Repository layout

Pyoffensive-tools/
├── tools/                 # Network reconnaissance (stdlib-only)
│   ├── port_scanner.py    #   concurrent TCP port scanner
│   └── icmp_scanner.py    #   ICMP host discovery
├── keylogger/             # Keystroke capture + email reporting
│   ├── keylogger.py
│   └── main.py
├── docs/                  # Per-tool documentation + README assets
│   ├── port_scanner.md
│   ├── icmp_scanner.md
│   └── keylogger.md
├── .env.example           # Keylogger credential template
└── requirements.txt

Legal & ethics

These tools exist to learn how offensive security works — and, by extension, how to defend against it. Use them only in environments you are authorized to test: your own lab, a CTF, or an engagement with written permission. Never against third parties.

License

MIT

Author

Daniel ValdésLinkedIn · GitHub