{"id":48289407,"url":"https://github.com/dreizehnutters/nmap2csv","last_synced_at":"2026-04-04T23:01:32.481Z","repository":{"id":293634431,"uuid":"984665829","full_name":"dreizehnutters/nmap2csv","owner":"dreizehnutters","description":"A CLI tool to parse Nmap XML files into clear, readable CSV reports, extracting host, service, port, and protocol details with advanced filtering options.","archived":false,"fork":false,"pushed_at":"2025-05-16T10:01:08.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-16T10:44:18.536Z","etag":null,"topics":["automation","cli","csv","nmap","reporting","xml"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dreizehnutters.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-16T09:54:26.000Z","updated_at":"2025-05-16T10:07:33.000Z","dependencies_parsed_at":"2025-05-16T10:54:22.423Z","dependency_job_id":null,"html_url":"https://github.com/dreizehnutters/nmap2csv","commit_stats":null,"previous_names":["dreizehnutters/nmap2csv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dreizehnutters/nmap2csv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreizehnutters%2Fnmap2csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreizehnutters%2Fnmap2csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreizehnutters%2Fnmap2csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreizehnutters%2Fnmap2csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dreizehnutters","download_url":"https://codeload.github.com/dreizehnutters/nmap2csv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreizehnutters%2Fnmap2csv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31418287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","cli","csv","nmap","reporting","xml"],"created_at":"2026-04-04T23:01:27.236Z","updated_at":"2026-04-04T23:01:32.443Z","avatar_url":"https://github.com/dreizehnutters.png","language":"Ruby","readme":"# Nmap2CSV\r\n![nmap-parser-logo](https://img.shields.io/badge/nmap-parser-blue?style=flat-square\u0026logo=ruby\u0026logoColor=white)\r\n\r\nThis CLI tool is yet another **Nmap XML file(s)** parser to extract host and service information and generates detailed CSV reports. It supports both individual XML files and directories containing multiple Nmap reports.\r\n\r\nThis tool is intended to parse large-scale Nmap scans and make the extracted host and service data more digestible and actionable-especially when dealing with numerous targets or comprehensive scans.\r\n\r\n---\r\n\r\n\r\n## Usage\r\n\r\n```bash\r\n./nmap2csv.rb -f \u003cfile_or_directory\u003e [--output \u003coutput_directory\u003e]\r\n```\r\n\r\n\r\n#### CSV Outputs\r\n\r\n#### **Services CSV**\r\n```csv\r\n\"IP-Address\";\"Hostname\";\"Mac\";\"Mac-Vendor\";\"OS name\";\"Port\";\"Protocol\";\"Service\";\"State\";\"Tunnel\";\"HTTP-Title\";\"Info\";\"CPE\";\"Vulners\"\r\n\"45.33.32.156\";\"scanme.nmap.org\";\"\";\"\";\"Actiontec MI424WR-GEN3I WAP\";\"22\";\"tcp\";\"ssh\";\"open\";\"\";\"\";\"OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.13 Ubuntu Linux; protocol 2.0\";\"cpe:/a:openbsd:openssh:6.6.1p1\";\"https://vulners.com/cve/CVE-2023-38408\"\r\n\"45.33.32.156\";\"scanme.nmap.org\";\"\";\"\";\"Actiontec MI424WR-GEN3I WAP\";\"80\";\"tcp\";\"http\";\"open\";\"\";\"Go ahead and ScanMe!\";\"Apache httpd 2.4.7 (Ubuntu)\";\"cpe:/a:apache:http_server:2.4.7\";\"https://vulners.com/githubexploit/C94CBDE1-4CC5-5C06-9D18-23CAB216705E\"\r\n```\r\n\r\n![example output](.img/image.png)\r\n\r\n#### **Hosts CSV**\r\n```csv\r\n\"IP-Address\";\"Hostname\";\"Mac\";\"Mac-Vendor\";\"OS\"\r\n\"45.33.32.156\";\"scanme.nmap.org\";\"\";\"\";\"Actiontec MI424WR-GEN3I WAP\"\r\n```\r\n---\r\n\r\n## Features\r\n\r\n- Extracts **host details** and generates a `hosts.csv` file containing:\r\n  - IP addresses\r\n  - MAC addresses\r\n  - Hostnames\r\n  - Operating System information (OS name, flavor, and service pack).\r\n\r\n- Extracts **service details** and generates a `services.csv` file containing:\r\n  - IP addresses, Hostnames, MAC addresses, OS information.\r\n  - Port information (number, protocol type `tcp/udp`, state).\r\n  - Service attributes:\r\n    - Service name (with confidence filtering; only services with a confidence \u003e 5 are included).\r\n    - `tunnel` attribute (e.g., SSL).\r\n    - Script ID `http-title` output (e.g., HTTP content title for that port/service).\r\n    - Product, version, and extra information.\r\n    - `CPE` if present and vulns\r\n\r\n- Supports:\r\n  - Single XML file parsing.\r\n  - Directory-level parsing of all `.xml` files.\r\n  - Deduplication to avoid duplicate entries in CSV files.\r\n\r\n- Flexible and allows output to a custom directory.\r\n\r\n---\r\n\r\n## Nmap Settings\r\n\r\nNmap parameters I tend to reuse...\r\n```bash\r\nnmap -sV --script='default or vulners or http-headers or http-server-header or https-redirect or banner or smb-* or *-version' \\\r\n  -oX discovery scanme.nmap.org\r\n```\r\n\r\n[Checkout my Nmap runner script!](https://gist.github.com/dreizehnutters/c235ffeb2b4b8e915908e335738381de)\r\n\r\n---\r\n\r\n## Installation\r\n\r\n### Prerequisites\r\n- **Ruby** (version 2.6 or higher)\r\n- The `nokogiri` gem: Install it using:\r\n  ```bash\r\n  gem install nokogiri\r\n  ```\r\n\r\n### Download the Tool\r\n\r\nClone the repository to your local machine:\r\n```bash\r\ngit clone https://github.com/dreizehnutters/nmap2csv.git\r\ncd nmap2csv\r\nchmod +x nmap2csv.rb\r\n```\r\n\r\n---\r\n\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\r\n\r\n---\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreizehnutters%2Fnmap2csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdreizehnutters%2Fnmap2csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreizehnutters%2Fnmap2csv/lists"}