Skip to main content

Transform Nmap scan results into BloodHound-compatible OpenGraph format for network analysis

Project description

Bloodhound Nmap Scanner

Transform your network reconnaissance into beautiful BloodHound graphs!

A powerful Python tool that combines the network discovery capabilities of Nmap with the graph visualization power of BloodHound's OpenGraph format. Turn your port scans into actionable intelligence!

Features

  • Smart Network Scanning: Leverage Nmap's powerful scanning engine
  • Subnet Expansion: Automatically expand CIDR notation (192.168.1.0/24) into individual hosts
  • BloodHound Integration: Export results directly to OpenGraph JSON format
  • Flexible Configuration: JSON-based configuration for easy customization
  • Security Focused: Built for defensive security and network analysis
  • Easy to Use: Simple command-line interface

Quick Start

Prerequisites

  • Python 3.9+
  • Nmap installed on your system
  • Root/Administrator privileges (for some scan types)

Installation

  1. Install from PyPI:

    pip install bloodhound-nmap
    
  2. Or clone the repository:

    git clone https://github.com/rreichel3/bloodhound-nmap.git
    cd bloodhound-nmap
    pip install -e .
    

Usage

  1. Create your scan configuration:

    cp scan_config.json my_scan.json
    # Edit my_scan.json with your targets
    
  2. Run the scan:

    python main.py my_scan.json
    
  3. Import results into BloodHound!

Configuration Format

Create a JSON configuration file with your scan parameters:

{
  "hosts": [
    "127.0.0.1",
    "192.168.1.0/24",
    "scanme.nmap.org"
  ],
  "ports": [22, 80, 443, 3389, 8080],
  "output_file": "my_scan_results.json"
}

Configuration Options

Field Type Description Example
hosts Array List of IPs, hostnames, or CIDR subnets ["10.0.0.1", "192.168.1.0/24"]
ports Array/String Ports to scan [80, 443] or "1-1000"
output_file String Output filename (optional) "results.json"

What Gets Scanned?

For each discovered host, the tool captures:

  • Host Information: IP address, hostname, state
  • Operating System: Detected OS and accuracy
  • Open Ports: All discovered open ports
  • Services: Service names, products, versions
  • BloodHound Properties: Everything formatted for graph analysis

Example Output

{
  "nodes": [
    {
      "id": "web-server-01",
      "kinds": ["Computer", "Server"],
      "properties": {
        "ip_address": "192.168.1.100",
        "hostname": "web-server-01",
        "state": "up",
        "os_name": "Linux 3.2 - 4.9",
        "open_ports": ["22/tcp", "80/tcp", "443/tcp"],
        "port_count": 3,
        "service_80_tcp_name": "http",
        "service_443_tcp_name": "https"
      }
    }
  ]
}

Advanced Usage

Large Network Scanning

{
  "hosts": ["10.0.0.0/16"],
  "ports": "1-65535",
  "output_file": "enterprise_scan.json"
}

Quick Service Discovery

{
  "hosts": ["target.company.com"],
  "ports": [21, 22, 23, 25, 53, 80, 110, 443, 993, 995, 3389],
  "output_file": "service_discovery.json"
}

Safety Features

  • Subnet Limits: Automatically limits subnet expansion to 1024 hosts
  • Defensive Only: Built for security analysis and network documentation
  • Error Handling: Graceful handling of network issues and invalid targets

Contributing

Contributions welcome! This tool is designed for defensive security purposes only. Please ensure all contributions align with this mission.

License

MIT License

Acknowledgments

  • Nmap Team: For the incredible network scanning capabilities
  • BloodHound Team: For revolutionizing attack path analysis
  • Python-Nmap: For the excellent Python bindings

Happy Scanning! Remember to always scan responsibly and only on networks you own or have explicit permission to test!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bloodhound_nmap-0.1.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bloodhound_nmap-0.1.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file bloodhound_nmap-0.1.2.tar.gz.

File metadata

  • Download URL: bloodhound_nmap-0.1.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bloodhound_nmap-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ac759ac87343b62b69bdc12fdf2ea727a0f7e8a8d7702bf03c233b105313cda7
MD5 0ade7379c30b57deeb2873607372b3d4
BLAKE2b-256 f1e6483d331e2a2f15070f3c2c151070e0ff53d06d3ccb6b914e244c8f9bef06

See more details on using hashes here.

Provenance

The following attestation bundles were made for bloodhound_nmap-0.1.2.tar.gz:

Publisher: publish-to-pypi.yml on rreichel3/bloodhound-nmap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bloodhound_nmap-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bloodhound_nmap-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cae8e3444560623eade453b18ef967fbee4f78b5a653b4867261fcc9796fb67d
MD5 5e2c48b29c140e8f02662c8bbb09a106
BLAKE2b-256 db66ed6a013589894915132dbfcce3fe65b2bd486cdd84a7ce4df8d826852382

See more details on using hashes here.

Provenance

The following attestation bundles were made for bloodhound_nmap-0.1.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on rreichel3/bloodhound-nmap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page