{ "info": { "author": "Thomas D.", "author_email": "tdebize@mail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Information Technology", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Security" ], "description": "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 < tdebize at mail d0t com >", "description_content_type": "text/markdown; charset=UTF-8;", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/maaaaz/nmaptocsv", "keywords": "nmap scan output csv gnmap xml", "license": "LGPL", "maintainer": "", "maintainer_email": "", "name": "nmaptocsv", "package_url": "https://pypi.org/project/nmaptocsv/", "platform": "", "project_url": "https://pypi.org/project/nmaptocsv/", "project_urls": { "Homepage": "https://github.com/maaaaz/nmaptocsv" }, "release_url": "https://pypi.org/project/nmaptocsv/1.6/", "requires_dist": null, "requires_python": ">=2.7", "summary": "A simple python script to convert Nmap output to CSV", "version": "1.6" }, "last_serial": 5397846, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "4e6ee12a66426ab50c7617570858e3a1", "sha256": "ce6b55f59376bab370561cd893401087214da7b2203cfae13e8396c664fbad46" }, "downloads": -1, "filename": "nmaptocsv-1.1.tar.gz", "has_sig": false, "md5_digest": "4e6ee12a66426ab50c7617570858e3a1", "packagetype": "sdist", "python_version": "source", "requires_python": "<3", "size": 8588, "upload_time": "2018-01-07T18:31:20", "url": "https://files.pythonhosted.org/packages/9a/e8/a00f4168cfc8682681ad8368a5008f66775743f76b15b7ea156eee179dfc/nmaptocsv-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "e4588138df62a7a830fa9db4f1d64e06", "sha256": "dc7e8cf7e23fbf5621248c614afef5bcca7cf62e3a4097d817925a1bec5062a1" }, "downloads": -1, "filename": "nmaptocsv-1.2.tar.gz", "has_sig": false, "md5_digest": "e4588138df62a7a830fa9db4f1d64e06", "packagetype": "sdist", "python_version": "source", "requires_python": "<3", "size": 8892, "upload_time": "2018-01-07T22:38:40", "url": "https://files.pythonhosted.org/packages/34/bd/3215ca5180c88f232aa22ec89e0e635483ae62f6c622b3c5497005487f22/nmaptocsv-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "ee304ed5d86c643b0995e214ce8ab219", "sha256": "c4268e210cedb68158e7aa842825b1de82158979e2b96f276bf3d0dd27f3d0d7" }, "downloads": -1, "filename": "nmaptocsv-1.3.tar.gz", "has_sig": false, "md5_digest": "ee304ed5d86c643b0995e214ce8ab219", "packagetype": "sdist", "python_version": "source", "requires_python": "<3", "size": 8968, "upload_time": "2018-08-13T16:59:16", "url": "https://files.pythonhosted.org/packages/e2/75/8dbe3583afe7bb5cfbb78485b02c2db5ba53ce885e6407814a0b51cdfe23/nmaptocsv-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "7552c472fef9cc99c89099c14387ae96", "sha256": "c2207ec5a7b316ade92a7c9ddd4a80990776790a9f48b7d0694d340c31b3bd20" }, "downloads": -1, "filename": "nmaptocsv-1.4.tar.gz", "has_sig": false, "md5_digest": "7552c472fef9cc99c89099c14387ae96", "packagetype": "sdist", "python_version": "source", "requires_python": "<3", "size": 10268, "upload_time": "2018-08-16T17:50:03", "url": "https://files.pythonhosted.org/packages/31/c7/e4a517dd7a20063d734f18ba7a2ab1543a6c4833accf9769342c740f0b78/nmaptocsv-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "31221a9d3ce97189a049daddef81634d", "sha256": "21f9207a4210a8c2fcce0993fa3a224bd839c9ab72c7400c852824f83483fd13" }, "downloads": -1, "filename": "nmaptocsv-1.5.tar.gz", "has_sig": false, "md5_digest": "31221a9d3ce97189a049daddef81634d", "packagetype": "sdist", "python_version": "source", "requires_python": "<3", "size": 10387, "upload_time": "2018-09-30T14:00:13", "url": "https://files.pythonhosted.org/packages/0d/3d/c81189e3408f4d54de99e83a20624c98188fe9c94a9714a643311695f4fc/nmaptocsv-1.5.tar.gz" } ], "1.6": [ { "comment_text": "", "digests": { "md5": "202ae3b69ac27d0d85966a0cca54fe28", "sha256": "f1c11ee12966b7e74db584b0f28164df4b9dda31c6cffae0a192e3373944cb5d" }, "downloads": -1, "filename": "nmaptocsv-1.6.tar.gz", "has_sig": false, "md5_digest": "202ae3b69ac27d0d85966a0cca54fe28", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 10709, "upload_time": "2019-06-13T21:38:46", "url": "https://files.pythonhosted.org/packages/c2/1e/21153a2bf2d4e9608f0290ff029afa6ba5b93bd1cd87508267c1a5e5999d/nmaptocsv-1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "202ae3b69ac27d0d85966a0cca54fe28", "sha256": "f1c11ee12966b7e74db584b0f28164df4b9dda31c6cffae0a192e3373944cb5d" }, "downloads": -1, "filename": "nmaptocsv-1.6.tar.gz", "has_sig": false, "md5_digest": "202ae3b69ac27d0d85966a0cca54fe28", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 10709, "upload_time": "2019-06-13T21:38:46", "url": "https://files.pythonhosted.org/packages/c2/1e/21153a2bf2d4e9608f0290ff029afa6ba5b93bd1cd87508267c1a5e5999d/nmaptocsv-1.6.tar.gz" } ] }