Sha256: 1ba2e4da8b1811361bb6d1c67777ffa70eda5636cf69ea084c502298fe94e2e2
Contents?: true
Size: 513 Bytes
Versions: 5
Compression:
Stored size: 513 Bytes
Contents
# # Author: Waldemar Hummer (hummer@dsg.tuwien.ac.at) # provides "ports" ports Mash.new output = `nmap localhost | grep -e "[0-9][0-9]*\\/" 2>&1` # build list of ports output.split("\n").each do |line| if line.include?("/") port = line.split(" ")[0].split("/")[0].strip type = line.split(" ")[0].split("/")[1].strip status = line.split(" ")[1].strip service = line.split(" ")[2].strip ports[port] = [] if !ports[port] ports[port].push({"type" => type, "status" => status}) end end
Version data entries
5 entries across 5 versions & 1 rubygems