A friendly Ruby DSL to nmap.
$ gem install nmapr
Build a nmap
scan command in friendly, readable way.
Nmapr.scan :cmd do
target '192.168.0.2'
ports :common
sequential
detect :os
verbose
end
# => "nmap 192.168.0.2 -p 1-1024 -r -O -v"
Run those commands.
result = Nmapr.scan :run do
targets 'localhost'
ports 22, 24
detect :version
end
# Check stdout, stderr and status of command.
result[:stdout]
result[:stderr]
result[:status]
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Nmapr project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.