Unlock the power of your Nmap data with the nmap-did-what project. This simple yet effective solution employs a Python script to transform Nmap XML outputs into a user-friendly SQLite database, which is then visualized in Grafana. Experience streamlined insights through stunning dashboards, all set up with Docker for hassle-free deployment.
nmap-did-what is an innovative mini-project that integrates a Grafana Docker container with a Python script to efficiently parse Nmap XML output and store it in an SQLite database. This powerful combination allows users to visualize Nmap scan details through an intuitive Grafana dashboard, enhancing your network scanning capabilities with compelling data presentations.
Project Overview
The nmap-did-what project comprises two core components:
- Python Script: This script,
nmap-to-sqlite.py
, extracts data from Nmap XML files and saves it into an SQLite database, enabling structured data manipulation and quick access. - Grafana Dashboard: Deployed via a Docker container, this pre-configured Grafana dashboard is designed to visualize the parsed Nmap scan data seamlessly.
File Structure
Here's a breakdown of the important files included in this repository:
- nmap-to-sqlite.py: The script responsible for parsing Nmap XML output.
- Dockerfile: Builds a Docker image based on the Grafana official image, integrating necessary configurations for SQLite data sources.
- docker-compose.yml: Facilitates the setup of the Grafana container and ensures persistent storage of configuration and data.
- dashboard.yml: Specifies Grafana dashboard settings.
- datasource.yml: Configures Grafana to utilize the SQLite database for Nmap scan data.
- /data/nmap_results.db: The designated location within the container for the SQLite database.
How to Use
To leverage the functionalities of the nmap-did-what project, ensure that you have Docker and Docker Compose installed. Follow these steps to get started:
-
Clone the Repository:
git clone https://github.com/hackertarget/nmap-did-what.git
-
Parse Nmap XML Output: Execute the following command to convert your Nmap XML output into an SQLite database:
cd nmap-did-what/data/ python nmap-to-sqlite.py nmap_output.xml
-
Start the Grafana Container: Launch the Grafana dashboard using Docker Compose:
cd nmap-did-what docker-compose up -d
-
Access Grafana: After the container is running, access the Grafana dashboard in your web browser at:
http://localhost:3000
Use the default credentials (admin/admin) to log in and view your Nmap dashboard loaded with scan data.
Customization Options
- Tailor the
nmap-to-sqlite.py
script to extract additional data from your Nmap scans or modify the database structure to fit your needs. - Personalize your Grafana dashboard by adjusting existing settings or creating new dashboard configurations, enhancing the visualization according to your preferences.
- Automate your network scanning process by setting up a cron job for executing nmap scans periodically, parsing results with the nmap-to-sqlite.py script, and keeping the database updated effortlessly.
Acknowledgments
Special thanks to the Nmap and Grafana communities for their exceptional open-source tools, which make powerful network scanning and data visualization achievable.