{"id":23647637,"url":"https://github.com/ronin-rb/ronin-nmap","last_synced_at":"2025-08-31T22:32:46.488Z","repository":{"id":152903557,"uuid":"610415446","full_name":"ronin-rb/ronin-nmap","owner":"ronin-rb","description":"A Ruby library for working with nmap.","archived":false,"fork":false,"pushed_at":"2024-08-04T21:05:52.000Z","size":178,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T14:22:28.269Z","etag":null,"topics":["hacktoberfest","infosec","network-scanning","nmap","nmap-commands","nmap-xml","recon","ruby"],"latest_commit_sha":null,"homepage":"https://ronin-rb.dev","language":"Ruby","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/ronin-rb.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"COPYING.txt","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},"funding":{"open_collective":"ronin-rb","patreon":"roninrb"}},"created_at":"2023-03-06T18:20:09.000Z","updated_at":"2024-08-04T21:05:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"9507dbc5-8e80-45b7-b392-fd51de78746a","html_url":"https://github.com/ronin-rb/ronin-nmap","commit_stats":{"total_commits":104,"total_committers":2,"mean_commits":52.0,"dds":0.05769230769230771,"last_synced_commit":"27727dcb60f2183f644e18196c1e4f0be645abe0"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronin-rb%2Fronin-nmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronin-rb%2Fronin-nmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronin-rb%2Fronin-nmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronin-rb%2Fronin-nmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ronin-rb","download_url":"https://codeload.github.com/ronin-rb/ronin-nmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231583890,"owners_count":18395959,"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":["hacktoberfest","infosec","network-scanning","nmap","nmap-commands","nmap-xml","recon","ruby"],"created_at":"2024-12-28T14:28:54.538Z","updated_at":"2025-08-31T22:32:46.479Z","avatar_url":"https://github.com/ronin-rb.png","language":"Ruby","funding_links":["https://opencollective.com/ronin-rb","https://patreon.com/roninrb"],"categories":[],"sub_categories":[],"readme":"# ronin-nmap\n\n[![CI](https://github.com/ronin-rb/ronin-nmap/actions/workflows/ruby.yml/badge.svg)](https://github.com/ronin-rb/ronin-nmap/actions/workflows/ruby.yml)\n[![Code Climate](https://codeclimate.com/github/ronin-rb/ronin-nmap.svg)](https://codeclimate.com/github/ronin-rb/ronin-nmap)\n\n* [Website](https://ronin-rb.dev/)\n* [Source](https://github.com/ronin-rb/ronin-nmap)\n* [Issues](https://github.com/ronin-rb/ronin-nmap/issues)\n* [Documentation](https://ronin-rb.dev/docs/ronin-nmap/frames)\n* [Discord](https://discord.gg/6WAb3PsVX9) |\n  [Mastodon](https://infosec.exchange/@ronin_rb)\n\n## Description\n\nronin-nmap is a Ruby library for working with nmap. ronin-nmap can parse nmap\nXML, convert nmap XML into JSON or CSV, or import nmap XML into the [ronin-db]\ndatabase.\n\n## Features\n\n* Supports automating `nmap` using [ruby-nmap].\n* Supports parsing and filtering nmap XML.\n* Supports converting nmap XML into JSON or CSV.\n* Supports importing nmap XML data into the [ronin-db] database.\n\n## Synopsis\n\n```\nUsage: ronin-nmap [options]\n\nOptions:\n    -V, --version                    Prints the version and exits\n    -h, --help                       Print help information\n\nArguments:\n    [COMMAND]                        The command name to run\n    [ARGS ...]                       Additional arguments for the command\n\nCommands:\n    completion\n    convert\n    dump\n    grep\n    help\n    import\n    new\n    print\n    scan\n```\n\nImport an nmap XML scan file into [ronin-db]\\:\n\n```shell\n$ ronin-nmap import scan.xml\n```\n\nPerform an nmap scan and import it's results into the [ronin-db]\\:\n\n```shell\n$ ronin-nmap scan --import -- -sT -sV -p 22,25,80,443\n```\n\nParse and filter an nmap XML scan file:\n\n```shell\n$ ronin-nmap parse --hosts-with-port 443 scan.xml\n```\n\nDump a nmap XML scan file to a list of `IP:PORT` pairs:\n\n```shell\n$ ronin-nmap dump --print-ip-ports scan.xml\n```\n\nDump a nmap XML scan file to a list of `HOST:PORT` pairs:\n\n```shell\n$ ronin-nmap dump --print-host-ports scan.xml\n```\n\nDump a nmap XML scan file to a list of `http`://` or `https://` URIs:\n\n```shell\n$ ronin-nmap dump --print-uris scan.xml\n```\n\nConvert an nmap XML scan file to CSV:\n\n```shell\n$ ronin-nmap convert scan.xml scan.csv\n```\n\nConvert an nmap XML scan file to JSON:\n\n```shell\n$ ronin-nmap convert scan.xml scan.json\n```\n\nGenerate a new nmap scanner Ruby script:\n\n```shell\n$ ronin-nmap new scanner.rb --target example.com --ports 22,80,443,8000-9000\n```\n\nGenerate a new nmap XML parser script:\n\n```shell\n$ ronin-nmap new parser.rb --parser --xml-file path/to/nmap.xml --printing\n```\n\n## Examples\n\nPerforming an `nmap` scan and returning the parsed nmap XML data:\n\n```ruby\nrequire 'ronin/nmap'\n\nxml = Ronin::Nmap.scan(syn_scan: true, ports: [80, 443], targets: '192.168.1.*')\n# =\u003e #\u003cNmap::XML: ...\u003e\n\nxml = Ronin::Nmap.scan do |nmap|\n  nmap.syn_scan = true\n  nmap.ports    = [80, 443]\n  nmap.targets  = '192.168.1.*'\nend\n# =\u003e #\u003cNmap::XML: ...\u003e\n```\n\nAccessesing the nmap XML scan data:\n\n```ruby\nxml.hosts\n# =\u003e [#\u003cNmap::XML::Host: 192.168.1.1\u003e, ...]\n\nhost = xml.host\n# =\u003e #\u003cNmap::XML::Host: scanme.nmap.org\u003e\n\nxml.host.open_ports\n# =\u003e [#\u003cNmap::XML::Port: 22\u003e,\n#     #\u003cNmap::XML::Port: 80\u003e,\n#     #\u003cNmap::XML::Port: 9929\u003e,\n#     #\u003cNmap::XML::Port: 31337\u003e,\n#     #\u003cNmap::XML::Port: 123\u003e]\n\nport = xml.host.open_ports.first\n# =\u003e #\u003cNmap::XML::Port: 22\u003e\n\nport.state\n# =\u003e :open\n\nport.protocol\n# =\u003e :tcp\n\nport.service\n# =\u003e #\u003cNmap::XML::Service:0x00007f5614e68248 @node=#\u003cNokogiri::XML::Element:0x7ada0 name=\"service\" attribute_nodes=[#\u003cNokogiri::XML::Attr:0x7aecc name=\"name\" value=\"ssh\"\u003e, #\u003cNokogiri::XML::Attr:0x7b05c name=\"extrainfo\" value=\"protocol 2.0\"\u003e, #\u003cNokogiri::XML::Attr:0x7b1ec name=\"servicefp\" value=\"SF-Port22-TCP:V=6.45%I=7%D=4/17%Time=55316FE1%P=x86_64-redhat-linux-gnu%r(NULL,29,\\\"SSH-2\\\\.0-OpenSSH_6\\\\.6\\\\.1p1\\\\x20Ubuntu-2ubuntu2\\\\r\\\\n\\\");\"\u003e, #\u003cNokogiri::XML::Attr:0x7b37c name=\"method\" value=\"probed\"\u003e, #\u003cNokogiri::XML::Attr:0x7b50c name=\"conf\" value=\"10\"\u003e]\u003e\u003e\n\nport.scripts\n# =\u003e {\"ssh-hostkey\"=\u003e...,\n#     \"ssh2-enum-algos\"=\u003e...}\n```\n\nPrinting the parsed nmap XML data:\n\n```ruby\nxml.each_host do |host|\n  puts \"[ #{host.ip} ]\"\n\n  host.each_port do |port|\n    puts \"  #{port.number}/#{port.protocol}\\t#{port.state}\\t#{port.service}\"\n\n    port.scripts.each do |id,script|\n      puts \"    [ #{id} ]\"\n\n      script.output.each_line { |line| puts \"      #{line}\" }\n    end\n  end\nend\n```\n\n## Requirements\n\n* [Ruby] \u003e= 3.0.0\n* [nmap] \u003e= 5.00\n* [ruby-nmap] ~\u003e 1.0\n* [ronin-core] ~\u003e 0.2\n* [ronin-db] ~\u003e 0.2\n\n## Install\n\n```shell\n$ gem install ronin-nmap\n```\n\n### Gemfile\n\n```ruby\ngem 'ronin-nmap', '~\u003e 0.1'\n```\n\n### gemspec\n\n```ruby\ngem.add_dependency 'ronin-nmap', '~\u003e 0.1'\n```\n\n## Development\n\n1. [Fork It!](https://github.com/ronin-rb/ronin-nmap/fork)\n2. Clone It!\n3. `cd ronin-nmap/`\n4. `./scripts/setup`\n5. `git checkout -b my_feature`\n6. Code It!\n7. `bundle exec rake spec`\n8. `git push origin my_feature`\n\n## License\n\nCopyright (c) 2023-2025 Hal Brodigan (postmodern.mod3@gmail.com)\n\nronin-nmap is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published\nby the Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nronin-nmap is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with ronin-nmap.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n[Ruby]: https://www.ruby-lang.org\n[nmap]: http://www.insecure.org/\n[ruby-nmap]: https://github.com/postmodern/ruby-nmap#readme\n[ronin-core]: https://github.com/ronin-rb/ronin-core#readme\n[ronin-db]: https://github.com/ronin-rb/ronin-db#readme\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronin-rb%2Fronin-nmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fronin-rb%2Fronin-nmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronin-rb%2Fronin-nmap/lists"}