Skip to content

irfan-sec/Blue-sec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Blue-sec

๐Ÿ”ต Blue-sec

Advanced Bluetooth Security Testing Framework with Real-Time HID Attacks

The World's Most Comprehensive Bluetooth Security Testing Tool

GitHub license Python 3.11+ GitHub issues GitHub stars Maintenance Security: Bandit


๐Ÿšจ Security Warning

This tool is designed for authorized security testing only. Unauthorized use against systems you don't own or have explicit permission to test is illegal and unethical. Users are responsible for complying with all applicable laws and regulations.


๐ŸŒŸ What Makes Blue-sec the World's Best?

Blue-sec combines traditional Bluetooth security testing with cutting-edge HID attack capabilities similar to BlueDucky and Rubber Ducky, making it the most comprehensive Bluetooth security framework available:

โœจ Unique Features

  • ๐ŸŽฏ Real-Time HID Attacks - BadUSB/Rubber Ducky style keyboard injection via Bluetooth
  • ๐Ÿ”ด Interactive Device Testing - Live testing on real hardware
  • ๐Ÿ’‰ Payload Injection System - Pre-built and custom payloads
  • ๐ŸŽฎ DuckyScript Support - Compatible payload format
  • ๐Ÿ“ก Bluetooth & Classic - Full BLE and Classic Bluetooth support
  • ๐Ÿข Enterprise Ready - SIEM integration, REST API, compliance reporting
  • ๐Ÿ“Š CVE Database - Real-time vulnerability assessment
  • ๐Ÿ›ก๏ธ Attack Simulation - MITM, Bluesnarfing, Bluebugging, and more

๐Ÿ†š Blue-sec vs BlueDucky

Feature Blue-sec BlueDucky
HID Keyboard Injection โœ… โœ…
Bluetooth Wireless โœ… โœ…
Device Scanning โœ… โŒ
Vulnerability Assessment โœ… โŒ
MITM Attacks โœ… โŒ
Interactive Testing โœ… โŒ
Payload Generator โœ… โš ๏ธ Limited
Cross-Platform โœ… โš ๏ธ Hardware-dependent
Enterprise Features โœ… โŒ
REST API โœ… โŒ
Compliance Reporting โœ… โŒ
CVE Database โœ… โŒ

--- ## ๐ŸŽฏ Features

๐ŸŽฎ Real-Time HID Attacks (NEW!)

  • BadUSB/Rubber Ducky Style Attacks
    • Bluetooth HID keyboard emulation
    • Mouse injection capabilities
    • DuckyScript-compatible payload format
    • Interactive testing mode
    • Pre-built payload library
    • Custom payload generator

๐Ÿ“ก Device Discovery & Enumeration

  • Active and passive Bluetooth device scanning
  • Service and characteristic enumeration
  • Device fingerprinting and profiling
  • RSSI monitoring and mapping

๐Ÿ›ก๏ธ Vulnerability Assessment

  • Real-time CVE database integration
  • Protocol weakness detection
  • Firmware version analysis
  • Configuration auditing

โš”๏ธ Attack Simulation

  • Man-in-the-Middle (MITM) framework
  • Bluesnarfing detection
  • Bluebugging simulation
  • Bluejacking testing
  • Custom payload creation

๐Ÿข Enterprise Integration

  • SIEM compatibility
  • REST API endpoints
  • Compliance reporting
  • Audit logging

๐Ÿ”ง Installation

Prerequisites

  • Python 3.11+
  • Root/Administrator privileges
  • Linux/macOS/Windows support
  • Bluetooth adapter with BLE capability

Quick Start

# Clone the repository
git clone https://github.com/irfan-sec/Blue-sec.git

# Navigate to the directory
cd Blue-sec

# Install required packages
pip install -r requirements.txt

# Run the tool (CLI)
sudo python3 blue-sec.py --help

# Run the GUI version
python3 blue-sec-gui.py

Docker Installation

# Build the Docker image
docker build -t blue-sec .

# Run in container
docker run --net=host --privileged -it blue-sec

๐Ÿ–ฅ๏ธ GUI Mode

Blue-sec now includes a comprehensive Graphical User Interface for easier interaction:

# Start the GUI
python3 blue-sec-gui.py

GUI Features

  • ๐Ÿ“ก Device Scanner - Visual device discovery with real-time updates
  • ๐Ÿ” Vulnerability Scanner - Interactive vulnerability assessment
  • ๐ŸŽฏ HID Attack Panel - Payload selection and execution interface
  • โš”๏ธ Attack Simulation - Easy-to-use attack testing interface
  • ๐Ÿ“Š Real-time Logs - Live operation logging and monitoring
  • ๐Ÿ’พ Report Generation - One-click report creation

The GUI provides all CLI functionality in an intuitive interface, perfect for both beginners and experienced users. All features include safety warnings and require explicit confirmation for dangerous operations.

Blue-sec GUI

Screenshot: Blue-sec GUI showing device scanner with sample devices

For complete GUI documentation, see docs/GUI.md.

๐Ÿ“š Usage

๐ŸŽฎ HID Attack Mode (BlueDucky-Style)

Test keyboard injection (harmless):

# Interactive testing
sudo python3 blue-sec.py hid-test AA:BB:CC:DD:EE:FF --interactive

# Execute test payload
sudo python3 blue-sec.py hid-test AA:BB:CC:DD:EE:FF --payload data/payloads/hid/test_keyboard.json

# Rickroll test (harmless)
sudo python3 blue-sec.py hid-test AA:BB:CC:DD:EE:FF --payload data/payloads/hid/rickroll_test.json

Generate custom payloads:

# Generate reverse shell payload
sudo python3 blue-sec.py generate-payload \
  --name "Custom Shell" \
  --type reverse_shell \
  --os linux \
  --ip 192.168.1.100 \
  --port 4444 \
  --output my_payload.json

# Generate info gathering payload
sudo python3 blue-sec.py generate-payload \
  --name "System Info" \
  --type info_gather \
  --os windows \
  --output sysinfo.json

Available HID Payloads:

  • test_keyboard.json - Harmless keyboard test
  • rickroll_test.json - Fun test payload
  • info_gather_windows.json - System information gathering
  • wifi_exfil_windows.json - WiFi password extraction
  • reverse_shell_linux.json - Linux reverse shell
  • reverse_shell_windows.json - Windows reverse shell

๐Ÿ“ก Basic Scanning

# Perform basic device discovery
sudo python3 blue-sec.py scan

# Run vulnerability assessment
sudo python3 blue-sec.py vuln-scan <target-address>

# Execute security audit
sudo python3 blue-sec.py audit --format json

โš”๏ธ Advanced Attack Simulation

# MITM Attack Simulation
sudo python3 blue-sec.py attack --type mitm --target <target1> --target2 <target2>

# Bluesnarfing Test
sudo python3 blue-sec.py attack --type bluesnarfing --target <target-address>

# Bluejacking Test
sudo python3 blue-sec.py attack --type bluejacking --target <target-address> --message "Test"

๐Ÿ—๏ธ Project Structure

Blue-sec/
โ”œโ”€โ”€ blue-sec.py              # Main CLI application
โ”œโ”€โ”€ modules/
โ”‚   โ”œโ”€โ”€ __init__.py          # Module exports
โ”‚   โ”œโ”€โ”€ config.py            # Configuration management
โ”‚   โ”œโ”€โ”€ scanner.py           # Device discovery & enumeration
โ”‚   โ”œโ”€โ”€ vulnerabilities.py   # Vulnerability assessment & CVE DB
โ”‚   โ”œโ”€โ”€ attacks.py           # Attack simulation modules
โ”‚   โ”œโ”€โ”€ hid_attacks.py       # HID keyboard/mouse injection (NEW!)
โ”‚   โ”œโ”€โ”€ reporting.py         # Report generation & MITRE mapping
โ”‚   โ”œโ”€โ”€ api.py               # REST API for enterprise integration
โ”‚   โ””โ”€โ”€ utils.py             # Utility functions & helpers
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ cve_database.json    # CVE information (auto-generated)
โ”‚   โ””โ”€โ”€ payloads/
โ”‚       โ”œโ”€โ”€ hid/             # HID attack payloads (NEW!)
โ”‚       โ”‚   โ”œโ”€โ”€ test_keyboard.json
โ”‚       โ”‚   โ”œโ”€โ”€ rickroll_test.json
โ”‚       โ”‚   โ”œโ”€โ”€ reverse_shell_linux.json
โ”‚       โ”‚   โ”œโ”€โ”€ reverse_shell_windows.json
โ”‚       โ”‚   โ”œโ”€โ”€ wifi_exfil_windows.json
โ”‚       โ”‚   โ””โ”€โ”€ info_gather_windows.json
โ”‚       โ””โ”€โ”€ example_payload.json
โ”œโ”€โ”€ reports/                 # Generated security reports
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ blue-sec.yaml        # Default configuration
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_blue_sec.py     # Unit tests
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ API.md               # API documentation
โ”‚   โ””โ”€โ”€ USAGE.md             # Usage guide
โ”œโ”€โ”€ Dockerfile               # Docker container definition
โ”œโ”€โ”€ docker-compose.yml       # Docker Compose configuration
โ”œโ”€โ”€ requirements.txt         # Python dependencies
โ””โ”€โ”€ LICENSE                  # MIT License

๐Ÿ›ก๏ธ Security Features

  • โœ… Rate limiting for aggressive operations
  • โœ… Authentication for dangerous functions
  • โœ… Comprehensive audit logging
  • โœ… Fail-safe mechanisms and kill switches
  • โœ… User confirmation for HID attacks
  • โœ… Warning systems for dangerous operations
  • โœ… CVE database integration
  • โœ… Payload validation and sanitization

๐Ÿ“ Configuration

Configuration options can be set in config/blue-sec.conf:

[Scanner]
active_scan_timeout = 10
passive_scan_duration = 30
device_cache_time = 300

[Security]
rate_limit = true
max_attempts = 3
require_confirmation = true

[Enterprise]
siem_url = http://siem.local
api_key = your_api_key

๐Ÿ“Š Report Examples

Blue-sec generates comprehensive reports in multiple formats:

  • Vulnerability Assessment Reports - Detailed CVE analysis with CVSS scores
  • Attack Simulation Results - Complete attack logs with success metrics
  • HID Attack Reports - Payload execution logs and results
  • Compliance Audit Reports - NIST/compliance framework mappings
  • Device Discovery Logs - Full device enumeration data
  • MITRE ATT&CK Mapping - Technique and tactic correlation

All reports support JSON, XML, and HTML formats.


๐Ÿงช Testing

Run the test suite:

# Install test dependencies
pip install pytest pytest-asyncio pytest-cov

# Run tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=modules --cov-report=html

๐ŸŽ“ Learning Resources

Video Tutorials

  • Coming soon: YouTube channel with full demonstrations
  • HID attack walkthroughs
  • Enterprise deployment guides

Documentation

Example Scenarios

  1. Testing Corporate Bluetooth Security
  2. HID Attack Demonstrations (Authorized Labs)
  3. Vulnerability Assessment Workflows
  4. Compliance Auditing Procedures

๐Ÿค Contributing

We welcome contributions! Here's how:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Make your changes
  4. Add/update tests as needed
  5. Run tests (pytest tests/)
  6. Commit changes (git commit -m 'Add AmazingFeature')
  7. Push to branch (git push origin feature/AmazingFeature)
  8. Open a Pull Request

๐Ÿ“œ License

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


๐Ÿ™ Acknowledgments

  • BlueDucky - Inspiration for HID attack implementation
  • Rubber Ducky - DuckyScript format reference
  • Bluetooth SIG Documentation
  • NIST Special Publication 800-121
  • CVE Database Contributors
  • Open Source Security Community

๐Ÿ“ฌ Contact

Irfan Ali


โš ๏ธ Disclaimer

This tool is for educational and authorized testing purposes only. The authors assume no liability for misuse or damage caused by this program.

Key Points:

  • โš ๏ธ NEVER use on systems you don't own without written authorization
  • โš ๏ธ ALWAYS comply with local laws and regulations
  • โš ๏ธ OBTAIN explicit permission before testing
  • โš ๏ธ FOLLOW responsible disclosure practices
  • โš ๏ธ UNDERSTAND the legal implications in your jurisdiction

The authors and contributors:

  • Do NOT condone illegal use of this software
  • Are NOT responsible for any misuse or damage
  • Recommend following responsible disclosure practices
  • Encourage compliance with all applicable laws and regulations

Use responsibly and ethically. Always obtain proper authorization before testing.


Made with โค๏ธ by @irfan-sec

ยฉ 2025 Blue-sec - The World's Most Comprehensive Bluetooth Security Testing Framework

Combining Traditional Bluetooth Security Testing with Real-Time HID Attacks

About

A tool to hack and secure bluetooth

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •