Skip to content

Latest commit

 

History

History
182 lines (140 loc) · 6.52 KB

README.md

File metadata and controls

182 lines (140 loc) · 6.52 KB

🛡️ Python Pentesting Toolkit

A modular Python-based toolkit for practicing and automating common penetration testing and reconnaissance tasks. It includes utilities for web reconnaissance, network scanning, password hash cracking, and SSH testing, with tools available through an interactive CLI or as standalone scripts.


🚀 Features & Modules

The toolkit is organized into four core functional categories across 7 dedicated tools:

Category Tool Description Key Capabilities
🌐 Web Reconnaissance Directory Enumerator Discovers hidden directories and endpoints on a target web application. Custom wordlists, optional file extensions (.php, .html, etc.), non-404 response filtering.
Subdomain Enumerator Brute-forces and discovers active subdomains for a target domain. Fast HTTP probing using wordlists.
File Downloader Utility for downloading single files or bulk assets from a URL list. Streamed downloads for large files, error resilience, automated directory creation.
📡 Network Security Port Scanner Scans TCP ports on target host/IP to discover open services. Custom port ranges, socket connection testing, automatic common service banner mapping (FTP, SSH, HTTP, HTTPS, SMB, RDP, MySQL, etc.).
ARP Scanner Discovers active hosts and maps IP to MAC addresses on a local subnet. Scapy-powered Layer 2 ARP broadcast requests, VPN interface detection and warnings.
🔐 Authentication SSH Brute Forcer Tests SSH credentials against a target server using dictionary attacks. Built with Paramiko, configurable port/timeout, automated host key policy handling.
🔑 Cryptography Password Hash Cracker Cracks cryptographic hashes using dictionary attacks. Supports MD5, SHA-1, SHA-256, SHA-512, and any algorithm supported by hashlib.

📁 Project Structure

python-toolkit/
├── toolkit.py                        # Central interactive CLI menu runner
├── requirements.txt                  # Third-party Python dependencies
├── tools/                            # Core tool modules
│   ├── auth/                         # Authentication testing
│   │   └── ssh_bruteforcer.py
│   ├── crypto/                       # Cryptographic attacks
│   │   └── password_hash_cracker.py
│   ├── network/                      # Network scanning & discovery
│   │   ├── arp_scanner.py
│   │   └── port_scanner.py
│   └── web/                          # Web reconnaissance
│       ├── directory_enumerator.py
│       ├── file_downloader.py
│       └── subdomain_enumerator.py
└── wordlists/                        # Built-in sample wordlists & loader
    ├── common_directories.txt        # Common directory & file paths
    ├── load_wordlist.py              # Wordlist parser utility
    ├── numbers.txt                   # Number list for brute-forcing
    ├── subdomains.txt                # Common subdomain prefixes
    └── wordlist.txt                  # General password & token dictionary

⚙️ Installation & Setup

1. Clone the Repository

git clone https://github.com/anahmed404/python-pentesting-toolkit.git
cd python-pentesting-toolkit

2. Create and Activate a Virtual Environment

On Windows (PowerShell):

python -m venv .venv
.\.venv\Scripts\Activate.ps1

(If PowerShell blocks script execution, run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser)

On Linux / macOS:

python3 -m venv .venv
source .venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

Dependencies:

  • paramiko - For SSH protocol interaction and brute forcing.
  • requests - For HTTP/HTTPS requests and web asset enumeration.
  • scapy - For crafting and sending raw network packets (ARP scanning).

💻 Usage

Option 1: Interactive Menu (Recommended)

Run the main toolkit with the interactive menu:

python toolkit.py
========================================
   Python Pentester Toolkit
========================================
  1. Directory Enumeration
  2. Subdomain Enumeration
  3. File Downloader
  4. Port Scan
  5. ARP Scan
  6. SSH Brute Force
  7. Password Hash Cracker
  8. Exit
========================================

Follow the interactive prompts to choose a tool and enter parameters.


Option 2: Standalone Tool Usage

Each tool can also be run independently from the command line:

1. Subdomain Enumeration

python tools/web/subdomain_enumerator.py example.com wordlists/subdomains.txt

2. Directory Enumeration

python tools/web/directory_enumerator.py https://example.com wordlists/common_directories.txt

3. File Downloader

# Single file download
python tools/web/file_downloader.py https://example.com/payload.bin

# Batch download from a list of URLs
python tools/web/file_downloader.py wordlists/urls.txt

4. Port Scanner

python tools/network/port_scanner.py 192.168.1.10 1024

5. ARP Scanner (Local Subnet Discovery)

Note: Raw packet creation requires administrator/root privileges.

# Linux / macOS (Root)
sudo python3 tools/network/arp_scanner.py 192.168.1.0/24 eth0

# Windows (Run PowerShell as Administrator)
python tools/network/arp_scanner.py 192.168.1.0/24 "Wi-Fi"

6. Password Hash Cracker

# Default (MD5)
python tools/crypto/password_hash_cracker.py <hash> wordlists/wordlist.txt md5

# SHA-256
python tools/crypto/password_hash_cracker.py <hash> wordlists/wordlist.txt sha256

7. SSH Brute Forcer

python tools/auth/ssh_bruteforcer.py <target_ip> <username> wordlists/wordlist.txt 22

🛠️ VS Code Interpreter Setup

If VS Code shows import warnings:

  1. Press Ctrl + Shift + P (or Cmd + Shift + P on macOS).
  2. Search for Python: Select Interpreter.
  3. Select .\.venv\Scripts\python.exe (Windows) or ./.venv/bin/python (Linux/macOS).
  4. Reload VS Code (Ctrl + Shift + P -> Developer: Reload Window).

⚠️ Legal & Ethical Disclaimer

This toolkit is developed strictly for educational, research, and authorized security assessment purposes.

Running security scans, brute-force attacks, or enumeration tools against systems without prior explicit written permission from the system owner is illegal and unethical. Always obtain proper authorization before testing.