Cyber security

Nmap Analysis Tool – Enhancing Network Security Through Advanced Analysis And Reporting

This CLI python script is designed to be used by security consultants, IT admins and network engineers to do two things, compare two Nmap XML files to create a spreadsheet that compares IPs, ports and services between the files, and create a markdown report using GPT.

Screenshots

Features

Comprehensive Nmap XML Parsing

  • Multiple File Support: Parse and analyze two Nmap XML output files.
  • Structured Data: Converts Nmap’s XML output into a structured format for further processing.

Comparative Analysis

  • Change Detection: Compare results from two Nmap scans to identify new, altered, or removed services and ports. Useful for when you scan the same IPs from different source IPs or over time.
  • Excel Reporting: Automatically generates detailed Excel spreadsheets with the comparison results and some stats.

Statistical Overview And Visualization

  • Network Exposure Statistics: Offers statistical analysis on detected services and open ports.
  • Excel Visualizations: Includes pie charts in Excel reports for a graphical representation of the network’s security posture.

AI-Powered Insights With GPT

  • GPT Report Generation: Uses OpenAI’s GPT to generate insightful analysis reports based on Nmap result stats. The tool uses a hardcoded prompt that sets the tone and requirements, then the script inserts the stats (no identifying information is provided) and if -c –context has been provided, it’ll add the context to the bottom of the prompt.
  • Customizable Context: Enhance GPT analysis by providing additional context, tailoring the report to specific needs.

Usage

The script prints the help page if no args are passed, or you can access with python nmap-analysis.py -h

  • Comparing Nmap Scans:
python nmap-analysis.py compare -ff (--first-nmap-file) path/to/first.xml -lf (--last-nmap-file) path/to/second.xml
  • Generating a GPT Report:
python nmap-analysis.py gpt-report -gf (--gpt-nmap-file) path/to/nmap.xml -c (--context) "Your optional context here"

Installation and Setup

Prerequisites

  • 3.10+ probably (created using 3.12)
  • An OpenAI API key for GPT report generation that is set in local env

Secure Installation with venv

  1. Clone the Repository:
git clone https://github.com/yourusername/nmap-analysis-tool.git
cd nmap-analysis-tool

2. Create a Virtual Environment:

python3 -m venv venv
  1. Activate the Virtual Environment:
  • On Windows:
.\venv\Scripts\activate
Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

ShadowDumper – Advanced Techniques For LSASS Memory Extraction

Shadow Dumper is a powerful tool used to dump LSASS (Local Security Authority Subsystem Service)…

13 hours ago

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

2 weeks ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

3 weeks ago

Red Team Certification – A Comprehensive Guide To Advancing In Cybersecurity Operations

Embark on the journey of becoming a certified Red Team professional with our definitive guide.…

3 weeks ago

CVE-2024-5836 / CVE-2024-6778 : Chromium Sandbox Escape via Extension Exploits

This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…

4 weeks ago

Rust BOFs – Unlocking New Potentials In Cobalt Strike

This took me like 4 days (+2 days for an update), but I got it…

4 weeks ago