Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
ruby-nmap — A Ruby interface to nmap, the exploration tool and security / port scanner. Allows automating nmap and parsing nmap XML files. | Kitploit
Tools/GitHubGitHub/postmodern/ruby-nmap
ReconnaissanceVulnerability ScannersNetwork MappingPort ScanningScripting & AutomationInformation Gathering
GitHubpostmodern/ruby-nmap

ruby-nmap

A Ruby interface to nmap, the exploration tool and security / port scanner. Allows automating nmap and parsing nmap XML files.

View Repository
2975138Jan 12, 2026Reviewed by Kitploit
Share

ruby-nmap

CI Code Climate Gem Version

  • Source
  • Issues
  • Documentation

Description

A Ruby API to nmap, the exploration tool and security / port scanner. Allows automating nmap and parsing nmap XML files.

Features

  • Provides a Ruby API for automating nmap.
  • Provides a Parser for enumerating nmap XML scan files.
  • Supports the full Nmap XML DTD.

Examples

Run Nmap from Ruby:

require 'nmap/command'

Nmap::Command.run do |nmap|
  nmap.connect_scan   = true
  nmap.service_scan   = true
  nmap.output_xml     = 'scan.xml'
  nmap.verbose        = true

  nmap.ports   = [20, 21, 22, 23, 25, 80, 110, 443, 512, 522, 8080, 1080]
  nmap.targets = '192.168.1.*'
end

Run sudo nmap from Ruby:

require 'nmap/command'

Nmap::Command.sudo do |nmap|
  nmap.syn_scan       = true
  nmap.os_fingerprint = true
  nmap.service_scan   = true
  nmap.output_xml     = 'scan.xml'
  nmap.verbose        = true

  nmap.ports   = [20, 21, 22, 23, 25, 80, 110, 443, 512, 522, 8080, 1080]
  nmap.targets = '192.168.1.*'
end

Parse Nmap XML scan files:

require 'nmap/xml'

Nmap::XML.open('scan.xml') do |xml|
  xml.each_host do |host|
    puts "[#{host.ip}]"

    host.each_port do |port|
      puts "  #{port.number}/#{port.protocol}\t#{port.state}\t#{port.service}"
    end
  end
end

Print NSE script output from an XML scan file:

require 'nmap/xml'

Nmap::XML.open('nse.xml') do |xml|
  xml.each_host do |host|
    puts "[#{host.ip}]"

    host.scripts.each do |name,output|
      output.each_line { |line| puts "  #{line}" }
    end

    host.each_port do |port|
      puts "  [#{port.number}/#{port.protocol}]"

      port.scripts.each do |id,script|
        puts "    [#{id}]"

        script.output.each_line { |line| puts "      #{line}" }
      end
    end
  end
end

Requirements

  • ruby >= 2.0.0
  • nmap >= 5.00
  • nokogiri ~> 1.3
  • command_mapper ~> 0.3

Install

  • Debian / Ubuntu:
$ sudo apt install nmap
  • Fedora / RedHat:
$ sudo dnf install nmap
  • Homebrew:
$ brew install nmap
$ gem install ruby-nmap

License

See {file:LICENSE.txt} for license information.

Download Tool

Related Tools

  • amass

    In-depth attack surface mapping and asset discovery

  • subfinder

    Fast passive subdomain enumeration tool.

  • reconftw

    reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    Callisto

    jetp1ane/callisto

    Automated binary vulnerability analysis tool that decompiles executables via Ghidra, scans pseudo-C code with Semgrep, and validates findings using GPT-3.5-Turbo to reduce false positives.

    2.2k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    843
  • 3

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    446
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    369
  • 5

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    359
  • 6

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    332

Explore all tools

Browse our collection of tools

View all tools →