![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
A Ruby API to nmap, the exploration tool and security / port scanner. Allows automating nmap and parsing nmap XML files.
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
$ sudo apt install nmap
$ sudo dnf install nmap
$ brew install nmap
$ gem install ruby-nmap
See {file:LICENSE.txt} for license information.
FAQs
Unknown package
We found that ruby-nmap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.