irnmap
Description
A Ruby library for nmap, the worlds best port scanner.
Features
- Provides a Ruby library for running nmap.
- Provides a Parser for nmap XML files.
Examples
Run Nmap from Ruby Script:
require 'nmap/program'
Nmap::Program.scan do |nmap|
nmap.syn_scan = true
nmap.service_scan = true
nmap.os_fingerprint = true
nmap.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/program'
Nmap::Program.sudo_scan do |nmap|
nmap.syn_scan = true
# ...
end
Parse Nmap XML scan files:
require 'nmap/xml'
xml = Nmap::XML.new('scan.xml')
xml.hosts.each do |host|
puts "IP: #{host.ip}"
puts "OS: #{host.os}"
host.each_open_port do |port|
puts "Port: #{port}"
puts "Service: #{port.service}"
end
end
Requirements
Install
$ gem install irnmap
License
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.