Skip to content

VikasOffical/Penetration-Toolkit

Repository files navigation

πŸ”₯ Penetration Testing Toolkit πŸ”₯

COMPANY: CODETECH IT SOLUTIONS

NAME: GYANMOTAY VIKAS

INTERN ID: CT12RGV

DOMAIN: CYBER SECURITY & ETHICAL HACKING

DURATION: 8 WEEKS

MENTOR: NELLA SANTOSH

πŸš€ Overview

Welcome to the Python-based modular penetration testing toolkitβ€”your go-to solution for ethical hacking and security testing. Designed for professionals and cybersecurity enthusiasts, this toolkit provides a robust set of modules for network scanning, brute-force attacks, and vulnerability assessment.

⚑ Key Features

βœ… Port Scanner – Discover open ports on a target system effortlessly.

βœ… Brute-Force Attack – Automate login attacks using a dictionary-based approach.

βœ… Vulnerability Scanner – Detect SQL Injection and Cross-Site Scripting (XSS) vulnerabilities.

βœ… Utility Functions – Validate IP addresses and enhance testing accuracy.

πŸ› οΈ Installation

Ensure you have Python installed (version 3.x recommended) and install the required dependencies:

pip install -r requirements.txt

🎯 Usage Guide

Easily run penetration tests using command-line arguments:

πŸ” 1. Port Scanning

Scan for open ports within a specific range:

python main.py scan --start <start_port> --end <end_port>

Example:

python main.py scan 192.168.1.1 --start 20 --end 100

πŸ”‘ 2. Brute-Force Attack

Test login credentials with a password list:

python main.py brute <password_file>

Example:

python main.py brute http://example.com/login admin passwords.txt

πŸ›‘οΈ 3. Vulnerability Scanning

Scan for SQL Injection and XSS vulnerabilities:

python main.py vuln

Example:

python main.py vuln http://example.com/search query

πŸ“‚ Project Structure

πŸ“¦ toolkit/ β”œβ”€β”€ init.py

β”œβ”€β”€ port_scanner.py

β”œβ”€β”€ brute_forcer.py

β”œβ”€β”€ vulnerability_scanner.py

β”œβ”€β”€ utils.py

πŸ“œ main.py

πŸ“œ requirements.txt

πŸ“‚ tests/ β”œβ”€β”€ test_brute_forcer.py

β”œβ”€β”€ test_port_scanner.py

β”œβ”€β”€ test_utils.py

βœ… Running Tests

Run unit tests to ensure functionality:

pytest

🀝 Contributing

We welcome contributions! Fork the repo, create a feature branch, and submit a pull request. Report bugs or suggest features via GitHub Issues.

⚠️ Disclaimer

🚨 This toolkit is for educational and ethical hacking purposes only. Unauthorized or malicious use is strictly prohibited and may lead to legal consequences.

πŸ“œ License

This project is open-source and licensed under the MIT License. Feel free to use and modify it for ethical hacking and research purposes.

πŸ”₯ Stay ethical, hack responsibly, and secure the digital world! πŸ”₯

OUTPUT:

1. Port Scanner

Command: python main.py scan 127.0.0.1 --start 1 --end 1024

Output: Scanning ports: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1024/1024 [00:10<00:00, 100.00 ports/s] Open ports: [22, 80, 443]

2. Brute Forcer

Command: python main.py brute http://example.com/login admin passwords.txt

Output: Trying password: password123 Trying password: admin123 Login successful: ('admin', 'admin123')

3. Vulnerability Scanner

Command: python main.py vuln http://example.com/search?query=test query

Output: Testing for SQL Injection... SQL Injection vulnerability found!

Testing for XSS... XSS vulnerability found!

4. Error Handling

Example: Invalid IP Address

Command: python main.py scan invalid_ip --start 1 --end 100

Output: Invalid IP address

5. Progress Bar (Port Scanner with tqdm)

Command: python main.py scan 127.0.0.1 --start 1 --end 1024

Output: Scanning ports: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1024/1024 [00:10<00:00, 100.00 ports/s] Open ports: [22, 80, 443]

6. Colored Output

Example: Successful Login

Command: python main.py brute http://example.com/login admin passwords.txt

Output: Trying password: password123 Trying password: admin123 Login successful: ('admin', 'admin123') # This line will be green

Example: Failed Login

Command: python main.py brute http://example.com/login admin wrong_passwords.txt

Output: Trying password: wrong1 Trying password: wrong2 Login failed # This line will be red

7. Reporting

Example: JSON Report

Command: python main.py scan 127.0.0.1 --start 1 --end 1024 --format json

Output: json Copy { "target": "127.0.0.1", "open_ports": [22, 80, 443], "timestamp": "2023-10-15T12:34:56Z" }

8. Unit Tests

Command: python -m pytest tests/

Output: ============================= test session starts ============================= collected 3 items

tests/test_port_scanner.py . [ 33%] tests/test_brute_forcer.py . [ 66%] tests/test_utils.py . [100%]

============================== 3 passed in 0.05s ==============================

9. Interactive Shell Mode

Command: python main.py shell

Output: Welcome to the Penetration Testing Toolkit shell! Type 'help' for a list of commands.

scan 127.0.0.1 --start 1 --end 1024 Scanning ports: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1024/1024 [00:10<00:00, 100.00 ports/s] Open ports: [22, 80, 443]

brute http://example.com/login admin passwords.txt Trying password: password123 Trying password: admin123 Login successful: ('admin', 'admin123')

exit Goodbye!

Releases

No releases published

Packages

 
 
 

Contributors

Languages