← Back to projects
Purple Team Nmap Automation

Purple Team Nmap Automation

A Purple Team security project focused on automating network reconnaissance with Python and Nmap, improving scan readability through XML-to-HTML transformation, and integrating scan output into defensive monitoring and detection workflows.

Category
Security Project
Stack
Python Nmap XSLT Linux Snort UFW Splunk Security Onion
Date
Dec 10, 2024

The Challenge

Traditional network reconnaissance often relies on manual scans or static cron jobs, which limits repeatability, visibility, and defensive correlation.

The goal of this project was to design an automated scanning workflow that could support both offensive reconnaissance and defensive detection within a Purple Team context.

The solution needed to generate consistent, readable artifacts while preserving raw data for forensic analysis and monitoring.

My Approach

I focused on treating reconnaissance as a repeatable, auditable process rather than a one-off activity.

Instead of running Nmap directly, I built Python-based automation layers to control scan execution, manage output, and improve readability.

Each scan was designed to produce both machine-readable and human-readable artifacts to support investigation, detection tuning, and reporting.

Build Process

Developed Python scripts to automate Nmap execution with configurable targets, options, and output handling

Implemented preconfigured scan wrappers for rapid and repeatable reconnaissance

Added support for interface selection and source IP spoofing to simulate adversarial scanning behavior

Captured scan results in XML format to preserve full technical detail

Converted XML output into formatted HTML reports using XSLT for improved readability

Organized scan artifacts with timestamps to enable historical comparison and monitoring

Security Focus

This project emphasized understanding how reconnaissance activity appears from both attacker and defender perspectives.

Automated scans were correlated with defensive tooling such as Snort, UFW logs, Splunk, and Security Onion to observe detection behavior.

Readable scan reports improved analyst efficiency while retaining raw XML for deeper inspection.

The workflow reinforced the importance of visibility, repeatability, and traceability in security operations.

Results

Successfully built an automated reconnaissance pipeline that produces consistent, auditable scan artifacts.

Improved the readability and usability of Nmap results without sacrificing technical detail.

Demonstrated how offensive automation can be leveraged to strengthen defensive detection and monitoring.

Delivered a practical foundation for future enhancements such as scan diffing, SIEM integration, and containerized execution.

Want to dig into the code?

This project is fully documented on GitHub, including notes, commits, and future ideas.