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.2.0.tar.gz (7.8 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.2.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bloodhound_nmap-0.2.0.tar.gz
  • Upload date:
  • Size: 7.8 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.2.0.tar.gz
Algorithm Hash digest
SHA256 1e997ab23745d0c7b9ea33078a423a2aa699cc33d80bee2f2a99f02787b62583
MD5 94d677a544c84f9220c3e10d5c1c47c1
BLAKE2b-256 35f318729df9aea95c954680abb54a956142fde0f3828c37acc6b0f91221fc2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bloodhound_nmap-0.2.0.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bloodhound_nmap-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41bb4ad193195c3a267609a69a1172df49f6c94953755e4a5cac6e793b6d68c3
MD5 daa38d59189b9be56fb2bd3f489251a1
BLAKE2b-256 c0ca19812f644fbe6d6c827b69a0fd344026b94346075db3bfe9c6d8a7340a32

See more details on using hashes here.

Provenance

The following attestation bundles were made for bloodhound_nmap-0.2.0-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