A Python script that takes Nmap XML output and turns it into a CherryTree (.ctd) file. Hosts, ports, and services are organized in a tree format, with suggested tools for follow-up testing.
- Reads Nmap XML scans
- Creates a CherryTree document with hosts and ports structured in a hierarchy
- Includes basic tool suggestions based on detected services and OS when possible
- Closed and filtered ports are ignored
- Hosts with no open ports are skipped
- If OS detection is present, hosts are labeled (e.g.,
192.168.1.10-Wfor Windows,192.168.1.20-Lfor Linux)
- Suggestions are based on services and OS when known
- Windows hosts: tools like
crackmapexec,evil-winrm, RDP clients - Linux hosts: tools like
enum4linuxfor Samba - Web services are detected separately from WinRM/Microsoft HTTPAPI to avoid confusion
The generated file is organized for quick navigation:
192.168.1.10-W (DC01.domain.local)
└── Port Scan
├── 445/tcp
│ ├── Service Info
│ └── Tool Recommendations
└── 3389/tcp
├── Service Info
└── Tool Recommendations
- Python 3.6+
- Nmap (for scans)
- CherryTree (for viewing/editing the
.ctdfile)
- Download the script:
wget https://raw.githubusercontent.com/mattman059/CherryMap/main/cherrymap.py
chmod +x cherrymap.py- Install CherryTree if needed:
# Debian/Ubuntu
sudo apt install cherrytree
# Arch
sudo pacman -S cherrytree
# Or download from https://www.giuspen.com/cherrytree/Save results in XML format:
nmap -sV -oX scan_results.xml 192.168.1.0/24
nmap -sV -sC -O -oX scan_results.xml 192.168.1.0/24
nmap -A -oX scan_results.xml 192.168.1.1-254Common flags:
-sV: service version detection (needed for recommendations)-O: OS detection (enables OS-specific filtering)-sC: default NSE scripts-oX: XML output (required for this script)
python3 cherrymap.py -i scan_results.xml -o pentest_notes.ctdcherrytree pentest_notes.ctdusage: cherrymap.py [-h] -i INPUT -o OUTPUT
Convert Nmap XML output to CherryTree format
options:
-h, --help show this help message and exit
-i INPUT Input Nmap XML file
-o OUTPUT Output CherryTree file (.ctd)
192.168.1.100-W (webserver.local)
├── IP Address: 192.168.1.100
├── Hostname: webserver.local
├── OS: Windows Server 2019 (Accuracy: 95%)
└── Open Ports: 3
Each open port includes:
- Port number/protocol
- State
- Service info (name, product, version)
- NSE script output (if available)
- Tool suggestions
- Web (HTTP/HTTPS): gobuster, ffuf, nikto, whatweb
- SMB/NetBIOS: smbclient, smbmap, netexec, enum4linux
- SSH: ssh client, brute force tools
- RDP (Windows): xfreerdp, rdesktop, hydra
- Databases: mysql, psql, mongo client, impacket-mssqlclient
- LDAP/Kerberos: ldapsearch, ldapdomaindump, kerbrute
- DNS: dig, host, dnsenum, fierce
- SNMP: snmpwalk, onesixtyone
- Web service detection attempts to skip false positives like WinRM or Microsoft HTTPAPI
- OS-aware recommendations filter Windows vs Linux tools where possible
- Run an Nmap scan and save XML
- Convert with the script
- Open the
.ctdfile in CherryTree - Navigate to a host, check suggested tools, and run what’s useful
- Add notes and keep track of credentials or working commands
- No hosts in output: Make sure the scan found live hosts and was saved in XML (
-oX) - Missing recommendations: Use
-sVin Nmap to capture service info - OS not detected: Add
-O(requires sudo). OS detection isn’t always reliable, but the script still works without it
For security testing and research only. Make sure you have permission before scanning any system.