Skip to content

anonymous121029034720384234234/py-network-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—    β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— 
β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•    β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•—     β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•‘   β•šβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•—    β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
β•šβ•β•  β•šβ•β•β•β•β•šβ•β•β•β•β•β•β•   β•šβ•β•    β•šβ•β•β•β•šβ•β•β•  β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•šβ•β•  β•šβ•β•    β•šβ•β•     β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β• 

πŸ›‘οΈ Advanced Network Penetration Testing Toolkit

Python License Platform SSH Status

Professional-grade network reconnaissance and SSH penetration testing framework with advanced evasion capabilities

πŸš€ Quick Start β€’ πŸ“– Documentation β€’ 🎯 Exploitation β€’ πŸ›‘οΈ Defense β€’ βš–οΈ Legal


⚠️ LEGAL DISCLAIMER

πŸ”΄ FOR AUTHORIZED TESTING ONLY

This tool is designed for educational purposes and authorized penetration testing only. Unauthorized access to computer systems is illegal and may result in criminal charges.

βœ… Authorized Use:

  • Your own systems and networks
  • Systems with explicit written permission
  • Educational lab environments
  • Professional penetration testing engagements

❌ Unauthorized Use:

  • Any system you don't own
  • Public networks or infrastructure
  • Corporate systems without permission
  • Any malicious or harmful intent

By using this tool, you agree to take full responsibility for your actions and comply with all applicable laws.


πŸš€ Features

🌐 Network Reconnaissance & Discovery

  • πŸ” Advanced Network Discovery: Intelligent ping sweeps with customizable timing
  • πŸ”Ž Multi-Protocol Port Scanning: TCP connect scanning with service fingerprinting
  • 🎨 Banner Grabbing & Versioning: Automated service identification and version detection
  • ⚑ Multi-Threading: High-performance concurrent scanning across multiple hosts
  • πŸ“Š Progress Tracking: Real-time scanning progress with ETA estimates

πŸ” SSH Security Assessment Framework

  • πŸ” Deep SSH Fingerprinting: Comprehensive SSH server analysis and version detection
  • πŸ›‘οΈ Configuration Auditing: Automated detection of SSH misconfigurations
  • πŸ“ Vulnerability Database: CVE mapping and exploit availability checking
  • πŸ“ˆ Risk Assessment: Automated security scoring and prioritization
  • πŸ“„ Detailed Reporting: Professional-grade vulnerability assessment reports

🎯 Advanced SSH Exploitation Engine

πŸ’¬ User Enumeration

  • CVE-2018-15473: Timing-based username enumeration exploit
  • Stealth Mode: Randomized delays and connection pacing to evade detection
  • Custom Wordlists: Configurable username dictionaries
  • Smart Analysis: Statistical timing analysis for accurate results

πŸ”‘ Credential Attack Framework

  • Dictionary Attacks: High-performance brute force with custom wordlists
  • Smart Brute Force: Intelligent credential combinations and common patterns
  • Stealth Brute Force: Advanced evasion with randomized delays and IP rotation
  • Session Management: Persistent attack sessions with resume capabilities
  • Fail2ban Evasion: Adaptive timing to bypass intrusion detection systems

πŸ›‘οΈ Evasion & Anti-Detection

  • Connection Rate Limiting: Configurable delays between attempts
  • Randomized Timing: Variable delays to mimic human behavior
  • Connection Pooling: Distributed attacks across multiple connections
  • Error Handling: Graceful handling of defensive countermeasures

βš™οΈ Advanced Configuration System

  • πŸ“ YAML Configuration: Flexible parameter management through config.yaml
  • 🎯 Custom Port Lists: Configurable scanning profiles for different scenarios
  • ⏱️ Timing Controls: Fine-grained timeout and delay customization
  • πŸ—ΊοΈ Network Profiles: Pre-configured settings for different network types
  • πŸ“Š Performance Tuning: Thread pool and connection optimization

πŸ“¦ Installation

Prerequisites

# Ensure Python 3.6+ is installed
python3 --version

# Install required dependencies
pip3 install paramiko pyyaml colorama

Quick Install

# Clone the repository
git clone https://github.com/floriankostov/network_scanner.git
cd network_scanner

# Make executable (Unix/Linux/macOS)
chmod +x scanner.py

# Run the scanner
python3 scanner.py

Docker Installation (Optional)

# Build Docker image
docker build -t network-scanner .

# Run in container
docker run -it --network host network-scanner

πŸ”§ Usage Guide

πŸš€ Quick Start

python3 scanner.py

The scanner provides an intuitive menu system:

╔══════════════════════════════════════════════════════════════════╗
β•‘                    NETWORK SCANNER TOOLKIT                      β•‘
β•‘                  Professional Penetration Testing               β•‘
╠══════════════════════════════════════════════════════════════════╣
β•‘  1. πŸ“‘ Extended Port Scan    - Comprehensive port discovery     β•‘
β•‘  2. ⚑ Basic Port Scan       - Quick essential port check       β•‘
β•‘  3. πŸ” SSH Security Testing  - Advanced SSH vulnerability scan  β•‘
β•‘  4. 🎯 Custom Target Scan    - Manual IP/range specification   β•‘
β•‘  5. ❌ Exit                   - Quit the application            β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸ” Network Discovery

# Automatic network detection
[+] Network: 192.168.1.0/24 (254 hosts)
[+] Gateway: 192.168.1.1
[+] Local IP: 192.168.1.100

# Custom network specification
python3 scanner.py --network 10.0.0.0/16

🎯 SSH Exploitation Capabilities

πŸ’¬ Username Enumeration (CVE-2018-15473)

# Standard enumeration
[EXPLOIT] CVE-2018-15473 Username Enumeration
[+] Target: 192.168.1.50:22 (OpenSSH 7.4)
[+] Testing 100 common usernames...
[βœ“] Valid users found: admin, user, test

# Stealth enumeration with evasion
[STEALTH] Enabling anti-detection measures
[+] Random delays: 0.5-2.0 seconds
[+] Connection variation: randomized
[βœ“] Valid users found: admin (confirmed)

πŸ”‘ Advanced Brute Force Attacks

# Smart brute force
[EXPLOIT] Smart SSH Brute Force
[+] Target: 192.168.1.50:22
[+] Valid users: admin, user
[+] Wordlist: 500 common passwords
[βœ“] Credentials found: admin:password123

# Stealth brute force with fail2ban evasion
[STEALTH] Advanced evasion enabled
[+] Adaptive delays: 3-8 seconds
[+] Connection resets: every 5 attempts
[+] IP rotation: enabled
[!] Intrusion detection bypass: active

πŸ›‘οΈ Defense Bypass Features

  • Timing Randomization: Variable delays between 0.1-10 seconds
  • Connection Management: Automatic connection cycling to avoid detection
  • Error Analysis: Smart handling of fail2ban and IDS responses
  • Rate Limiting: Adaptive speed adjustment based on target responses

πŸ”§ Advanced Configuration

πŸ“ Configuration File (config.yaml)

# Network scanning settings
network:
  ping_timeout: 1.0
  port_timeout: 3.0
  thread_count: 50
  max_hosts: 254

# SSH exploitation settings
ssh:
  timeout: 10.0
  retry_count: 3
  stealth_mode: true
  delay_min: 0.5
  delay_max: 2.0
  
# Exploitation parameters
exploits:
  user_enumeration:
    max_users: 100
    timing_threshold: 0.05
  brute_force:
    max_attempts: 50
    wordlist_size: 500
    fail2ban_detection: true

🎯 Custom Port Lists

port_lists:
  basic: [22, 80, 443, 8080]
  extended: [21, 22, 23, 25, 53, 80, 110, 143, 443, 993, 995, 8080]
  comprehensive: [1-1000, 3389, 5432, 5900, 8080-8090]

πŸ›‘οΈ Defense and Remediation

πŸ”’ SSH Hardening Recommendations

Immediate Actions

# Disable root login
echo "PermitRootLogin no" >> /etc/ssh/sshd_config

# Require key-based authentication
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config

# Change default port
echo "Port 2222" >> /etc/ssh/sshd_config

# Restart SSH service
systemctl restart sshd

Long-term Security Measures

  1. Intrusion Detection: Install and configure fail2ban
  2. Network Segmentation: Isolate SSH access with firewall rules
  3. Monitoring: Implement SSH connection logging and alerting
  4. Regular Updates: Keep SSH software updated with security patches
  5. Access Control: Use SSH certificates and centralized key management

🚨 Detection Signatures

Log Patterns to Monitor

# Username enumeration attempts
grep "Invalid user" /var/log/auth.log

# Brute force detection
grep "Failed password" /var/log/auth.log | head -10

# Connection frequency analysis
awk '{print $1, $2, $3, $11}' /var/log/auth.log | grep "sshd" | sort | uniq -c

Fail2ban Configuration

[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 3600
findtime = 600

πŸ”¬ Technical Deep Dive

🎯 CVE-2018-15473 Exploitation Technical Details

Vulnerability Overview

  • CVE ID: CVE-2018-15473
  • Affected Versions: OpenSSH < 7.7, Cisco IOS, and others
  • Impact: Username enumeration via timing attack
  • CVSS Score: 5.3 (Medium)

Exploitation Methodology

  1. Timing Analysis: Measure response times for valid vs invalid usernames
  2. Statistical Validation: Use multiple samples to confirm timing differences
  3. Evasion Techniques: Randomize delays to avoid detection
  4. Result Validation: Cross-reference with common username patterns
# Simplified timing attack pseudocode
def enumerate_users(target, usernames):
    timings = {}
    for user in usernames:
        start = time.time()
        try_authentication(target, user, "invalid_password")
        end = time.time()
        timings[user] = end - start
    
    # Analyze timing patterns
    return analyze_timing_anomalies(timings)

πŸ” Anti-Detection Mechanisms

Stealth Mode Features

  • Jitter Introduction: Random delays between 0.1-10 seconds
  • Connection Cycling: Establish new connections periodically
  • Request Spacing: Adaptive timing based on target responses
  • Error Handling: Graceful handling of defensive measures

πŸ“Š Example Scan Results

Network Discovery Output

╔══════════════════════════════════════════════════════════════════╗
β•‘                       NETWORK SCAN RESULTS                      β•‘
╠══════════════════════════════════════════════════════════════════╣
β•‘ Network: 192.168.1.0/24                                         β•‘
β•‘ Active Hosts: 12/254                                             β•‘
β•‘ Scan Duration: 45.3 seconds                                     β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸ“‘ DISCOVERED HOSTS:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ IP Address      β”‚ Hostname         β”‚ Response Time               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 192.168.1.1     β”‚ gateway.local    β”‚ 1.2ms                      β”‚
β”‚ 192.168.1.50    β”‚ server.local     β”‚ 2.1ms                      β”‚
β”‚ 192.168.1.100   β”‚ workstation.localβ”‚ 0.8ms                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

SSH Vulnerability Report

╔══════════════════════════════════════════════════════════════════╗
β•‘                    SSH VULNERABILITY REPORT                     β•‘
β•‘                      Target: 192.168.1.50:22                   β•‘
╠══════════════════════════════════════════════════════════════════╣
β•‘ SSH Version: OpenSSH 7.4                                        β•‘
β•‘ Risk Level: HIGH                                                 β•‘
β•‘ Vulnerabilities: 3 Critical, 2 High, 1 Medium                  β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸ”΄ CRITICAL VULNERABILITIES:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CVE-2018-15473  β”‚ Username Enumeration via Timing Attack        β”‚
β”‚ Status          β”‚ βœ… EXPLOITABLE - 3 valid users discovered     β”‚
β”‚ Impact          β”‚ Information Disclosure, Attack Preparation    β”‚
β”‚ Users Found     β”‚ admin, user, test                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Brute Force     β”‚ Weak Authentication Configuration              β”‚
β”‚ Status          β”‚ βœ… EXPLOITABLE - Password auth enabled        β”‚
β”‚ Impact          β”‚ Unauthorized Access, Credential Compromise    β”‚
β”‚ Attempts        β”‚ 45/50 tested, 1 credential found             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ’₯ EXPLOITATION RESULTS:
╔══════════════════════════════════════════════════════════════════╗
β•‘ βœ… Successfully compromised SSH service                          β•‘
β•‘ πŸ”‘ Credential: admin:password123                                β•‘
β•‘ 🎯 Access Level: Administrative                                 β•‘
β•‘ ⚠️  Recommend immediate credential change and hardening         β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

🀝 Contributing

We welcome contributions from the security community! Please follow these guidelines:

πŸ”„ Development Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/new-exploit
  3. Commit changes: git commit -am 'Add new SSH exploit'
  4. Push to branch: git push origin feature/new-exploit
  5. Create a Pull Request

πŸ“ Contribution Guidelines

  • Ethical Focus: All contributions must be for educational/defensive purposes
  • Code Quality: Follow Python PEP 8 standards
  • Documentation: Include comprehensive documentation for new features
  • Testing: Add unit tests for new exploitation modules
  • Security: Include appropriate warnings and safeguards

πŸ› Bug Reports

Please include:

  • Python version and OS
  • Complete error messages
  • Steps to reproduce
  • Expected vs actual behavior

πŸ“š Resources and References

πŸ”— Security Resources

πŸ“– Related Projects

  • Nmap - Network discovery and security auditing
  • Hydra - Password cracking tool
  • SSH-Audit - SSH configuration auditing

πŸŽ“ Educational Content


βš–οΈ License

This project is licensed under the Educational Use License - see the LICENSE file for details.

Educational Use Only: This software is intended solely for educational purposes and authorized security testing. Any malicious use is strictly prohibited and may result in criminal prosecution.


πŸ™ Acknowledgments

  • OpenSSH Team for maintaining secure SSH implementations
  • Security Research Community for responsible vulnerability disclosure
  • OWASP for security testing methodologies
  • Python Community for excellent networking libraries

⚠️ Remember: With great power comes great responsibility

Use this tool ethically, legally, and responsibly.

Report Issues β€’ Request Features β€’ Security Contact

About

Advanced network penetration testing toolkit with SSH vulnerability assessment, CVE-2018-15473 exploitation, stealth brute force capabilities, and fail2ban evasion techniques. Professional-grade security testing framework for authorized penetration testing engagements.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages