{"id":13468220,"url":"https://github.com/maaaaz/nmaptocsv","last_synced_at":"2025-12-25T05:48:53.072Z","repository":{"id":4771946,"uuid":"5923300","full_name":"maaaaz/nmaptocsv","owner":"maaaaz","description":"A simple python script to convert Nmap output to CSV","archived":false,"fork":false,"pushed_at":"2023-10-13T11:14:08.000Z","size":47,"stargazers_count":393,"open_issues_count":6,"forks_count":96,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-03-06T00:17:03.261Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maaaaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-09-23T15:25:00.000Z","updated_at":"2025-03-05T07:36:21.000Z","dependencies_parsed_at":"2024-01-16T06:10:48.566Z","dependency_job_id":"20ebfb6d-8b49-4bfb-a284-72a38e03f81b","html_url":"https://github.com/maaaaz/nmaptocsv","commit_stats":{"total_commits":36,"total_committers":1,"mean_commits":36.0,"dds":0.0,"last_synced_commit":"3c0558bb110a9baac6c79109151f7466bfc1ee23"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maaaaz%2Fnmaptocsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maaaaz%2Fnmaptocsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maaaaz%2Fnmaptocsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maaaaz%2Fnmaptocsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maaaaz","download_url":"https://codeload.github.com/maaaaz/nmaptocsv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245597201,"owners_count":20641859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-07-31T15:01:07.244Z","updated_at":"2025-12-25T05:48:53.064Z","avatar_url":"https://github.com/maaaaz.png","language":"Python","funding_links":[],"categories":["Python","Python (1887)","\u003ca id=\"a76463feb91d09b3d024fae798b92be6\"\u003e\u003c/a\u003e侦察\u0026\u0026信息收集\u0026\u0026子域名发现与枚举\u0026\u0026OSINT","\u003ca id=\"170048b7d8668c50681c0ab1e92c679a\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"94c01f488096fafc194b9a07f065594c\"\u003e\u003c/a\u003enmap"],"readme":"NmaptoCSV\n============\n\nDescription\n-----------\nA simple python script to convert Nmap output to CSV\n\nFeatures\n--------\n* Support of Nmap version 5, 6, 7 normal format output (default format, `-oN` option)\n* Support of Nmap any version Grepable format output (`-oG` option) and XML (`-oX`)\n* Parsing main information : IP, FQDN, rDNS, MAC address and vendor, open ports, tcp/udp protocols, listening services and versions, OS, Number of hops to the target, and script output\n* Custom output format following the main items\n\nUsage\n-----\nPass the Nmap output via stdin or from a specified file (`-i`).  \nThe processed dump can be collected at stdout or to a specified file (`-o`).\n\n### Options\n```\nusage: nmaptocsv [-h] [-i INPUT] [-x XML_INPUT] [-o OUTPUT] [-f FORMAT] [-S]\n                 [-d DELIMITER] [-n] [-s]\n\noptional arguments:\n  -h, --help            show this help message and exit\n\nMandatory parameters:\n  -i INPUT, --input INPUT\n                        Nmap scan output file in normal (-oN) or Grepable\n                        (-oG) format (stdin if not specified)\n  -x XML_INPUT, --xml-input XML_INPUT\n                        Nmap scan output file in XML (-oX) format\n\nOutput parameters:\n  -o OUTPUT, --output OUTPUT\n                        CSV output filename (stdout if not specified)\n  -f FORMAT, --format FORMAT\n                        CSV column format { fqdn, rdns, hop_number, ip,\n                        mac_address, mac_vendor, port, protocol, os, script,\n                        service, version } (default: ip-fqdn-port-protocol-\n                        service-version)\n  -S, --script          Adds the script column in output, alias for -f \"ip-\n                        fqdn-port-protocol-service-version-script\"\n  -d DELIMITER, --delimiter DELIMITER\n                        CSV output delimiter (default \";\"). Ex: -d \",\"\n  -n, --no-newline      Do not insert a newline between each host. By default,\n                        a newline is added for better readability\n  -s, --skip-header     Do not print the CSV header\n```\n\n### Nmap Normal format (default output format -oN)\n```\n$ python nmaptocsv.py -i test.nmap -f ip-fqdn-port-protocol-service-version-os\nIP;FQDN;PORT;PROTOCOL;SERVICE;VERSION;OS\n192.168.1.2;Test.lan;135;tcp;msrpc;Microsoft Windows RPC;Windows 7 Professional 7601 Service Pack 1 (Windows 7 Professional 6.1)\n192.168.1.2;Test.lan;139;tcp;netbios-ssn;;Windows 7 Professional 7601 Service Pack 1 (Windows 7 Professional 6.1)\n192.168.1.2;Test.lan;445;tcp;netbios-ssn;;Windows 7 Professional 7601 Service Pack 1 (Windows 7 Professional 6.1)\n192.168.1.2;Test.lan;5357;tcp;http;Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP);Windows 7 Professional 7601 Service Pack 1 (Windows 7 Professional 6.1)\n\n\n$ python nmaptocsv.py -i test.nmap -f ip-fqdn-port-protocol-service-version -d ',' | csvlook\n|--------------+----------+------+----------+-------------+------------------------------------------|\n|  IP          | FQDN     | PORT | PROTOCOL | SERVICE     | VERSION                                  |\n|--------------+----------+------+----------+-------------+------------------------------------------|\n|  192.168.1.2 | Test.lan | 135  | tcp      | msrpc       | Microsoft Windows RPC                    |\n|  192.168.1.2 | Test.lan | 139  | tcp      | netbios-ssn |                                          |\n|  192.168.1.2 | Test.lan | 445  | tcp      | netbios-ssn |                                          |\n|  192.168.1.2 | Test.lan | 5357 | tcp      | http        | Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)  |\n|  |\n|--------------+----------+------+----------+-------------+------------------------------------------|\n\n$ nmap -sV -p- localhost -oN - | python nmaptocsv.py \nIP;FQDN;PORT;PROTOCOL;SERVICE;VERSION\n127.0.0.1;localhost;22;tcp;ssh;OpenSSH 7.6p1 Debian 2 (protocol 2.0)\n127.0.0.1;localhost;80;tcp;http;Apache httpd 2.4.29 ((Debian))\n127.0.0.1;localhost;5432;tcp;postgresql;PostgreSQL DB 9.5.4\n127.0.0.1;localhost;5433;tcp;postgresql;PostgreSQL DB 9.6.0 or later\n127.0.0.1;localhost;5434;tcp;postgresql;PostgreSQL DB 9.6.0 or later\n```\n\n### Nmap Grepable format (-oG)\n```\n$ cat scan.gnmap\n# Nmap 6.01 scan initiated Thu Nov 22 11:28:15 2012 as: nmap -p- -sV -oA scan 10.0.0.0/24 \nHost: 10.0.0.1 (test1.local)\tStatus: Up\nHost: 10.0.0.1 (test1.local)\tPorts: 23/open/tcp//telnet//Cisco router telnetd/\tIgnored State: closed (65534)\nHost: 10.0.0.2 (test2.local)\tStatus: Up\nHost: 10.0.0.2 (test2.local)\tPorts: 23/open/tcp//telnet//Cisco router telnetd/\tIgnored State: closed (65534)\nHost: 10.0.0.3 (test3.local)\tStatus: Up\nHost: 10.0.0.3 (test3.local)\tPorts: 23/open/tcp//telnet//Cisco router telnetd/\tIgnored State: closed (65534)\nHost: 10.0.0.50 (test50.local)\tStatus: Up\nHost: 10.0.0.50 (test50.local)\tPorts: 22/open/tcp//ssh//OpenSSH 3.8.1p1 Debian 8.sarge.6 (protocol 2.0)/, 80/open/tcp//http//Apache httpd 1.3.33 ((Debian GNU|Linux) PHP|4.3.10-19)/, 111/open/tcp//rpcbind (rpcbind V2)/(rpcbind:100000*2-2)/2 (rpc #100000)/, 113/open/tcp//ident///, 684/open/tcp//status (status V1)/(status:100024*1-1)/1 (rpc #100024)/, 5432/open/tcp//postgresql//PostgreSQL DB (French)/\tIgnored State: closed (65529)\nHost: 10.0.0.100 (test100.local)\tStatus: Up\nHost: 10.0.0.100 (test100.local)\tPorts: 80/closed/tcp//http///, 5432/open/tcp//postgresql//PostgreSQL DB (French)/, 19999/filtered/tcp/////\tIgnored State: closed (65532)\n\n$ python nmaptocsv.py -i scan.gnmap -f ip-fqdn\nIP;FQDN\n10.0.0.1;test1.local\n\n10.0.0.2;test2.local\n\n10.0.0.3;test3.local\n\n10.0.0.50;test50.local\n\n10.0.0.100;test100.local\n\n\n$ cat scan.gnmap | python nmaptocsv.py \nIP;FQDN;PORT;PROTOCOL;SERVICE;VERSION\n10.0.0.1;test1.local;23;tcp;telnet;Cisco router telnetd\n\n10.0.0.2;test2.local;23;tcp;telnet;Cisco router telnetd\n\n10.0.0.3;test3.local;23;tcp;telnet;Cisco router telnetd\n\n10.0.0.50;test50.local;22;tcp;ssh;OpenSSH 3.8.1p1 Debian 8.sarge.6 (protocol 2.0)\n10.0.0.50;test50.local;80;tcp;http;Apache httpd 1.3.33 ((Debian GNU|Linux) PHP|4.3.10-19)\n10.0.0.50;test50.local;111;tcp;rpcbind (rpcbind V2);(rpcbind:100000*2-2)/2 (rpc #100000)\n10.0.0.50;test50.local;113;tcp;ident;\n10.0.0.50;test50.local;684;tcp;status (status V1);(status:100024*1-1)/1 (rpc #100024)\n10.0.0.50;test50.local;5432;tcp;postgresql;PostgreSQL DB (French)\n\n10.0.0.100;test100.local;5432;tcp;postgresql;PostgreSQL DB (French)\n```\n\nDependencies and installation\n-----------------------------\n* A Python interpreter with version 2.7 or 3.X\n  * Python 2.6 works with .nmap and .gnmap files but not with .xml ones\n* The **easiest way** to setup everything: `pip install nmaptocsv` and then directly use `$ nmaptocsv`\n  * Or git clone that repository and `pip install -r requirements.txt` and then `python nmaptocsv.py`\n\nChangelog\n---------\n* version 1.6 - 06/13/2019: Python 3 support\n* version 1.5 - 09/30/2018: few bugs fixed in XML parsing + script alias format added\n* version 1.4 - 08/16/2018: few bugs fixed + XML parsing implementation\n* version 1.3 - 08/13/2018: fixing the README layout on PyPI\n* version 1.2 - 01/07/2018: script output parsing addition\n* version 1.1 - 01/07/2018: Cleaning the code, fixing some parsing bugs, delimiter option addition and made newline default\n* version 1.0 - from 2012 to 2013\n\nCopyright and license\n---------------------\nNmaptocsv is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nNmaptocsv is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  \n\nSee the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with nmaptocsv. \nIf not, see http://www.gnu.org/licenses/.\n\nContact\n-------\n* Thomas Debize \u003c tdebize at mail d0t com \u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaaaaz%2Fnmaptocsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaaaaz%2Fnmaptocsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaaaaz%2Fnmaptocsv/lists"}