parsenmap 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/bin/parsenmap +31 -0
- data/lib/parsenmap.rb +31 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 321a4d6d4f8b8eb03774a1cc332d2de5b57f7f5626d2bca80b9fba689b8afc2b
|
4
|
+
data.tar.gz: ffa88a2a1592c145cb30defa8cd70e3bf04ad61a80913a2805036b7f8d47feb7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 882a64d32097c405ff904981807001930d33e3699ae7944d7f2ee9463f4dcfdee11a495165f47ba01a2e3f2225bc2cf2e8850f24e4cedfd4c31c08b6b695612b
|
7
|
+
data.tar.gz: 178911d283121e05291709c076432724feee3f61eb4d7d1ce987f6dbad89eb26a24f934ac354e1f0eb98f0a64094498796f802ab11c6b185e5a7b2c39fd6801c
|
data/bin/parsenmap
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#############################
|
3
|
+
#Author = Royce Davis
|
4
|
+
#Last edited February 2, 2011
|
5
|
+
#############################
|
6
|
+
require 'rubygems'
|
7
|
+
require 'nmap/parser'
|
8
|
+
|
9
|
+
unless ARGV.length > 0
|
10
|
+
puts "Generates a .txt file containing the open pots summary and the .nmap information\r\n"
|
11
|
+
puts "USAGE:\t./parsenmap <nmap xml file>\r\n\n"
|
12
|
+
exit!
|
13
|
+
end
|
14
|
+
|
15
|
+
ports = Array.new
|
16
|
+
portstring = String.new
|
17
|
+
parser = Nmap::Parser.parsefile("#{ARGV[0]}")
|
18
|
+
parser.hosts("up") do |host|
|
19
|
+
[:tcp, :udp].each do |type|
|
20
|
+
host.getports(type, "open") do |port|
|
21
|
+
string = port.state.to_s
|
22
|
+
unless string.include? "filtered"
|
23
|
+
srv = port.service
|
24
|
+
ports << port.num unless ports.include? port.num
|
25
|
+
puts "#{host.addr}\t#{port.num}\t#{srv.name}\t#{srv.product}\t#{srv.version}\t#{srv.extrainfo}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
ports.each { |port| portstring << port.to_s + "," }
|
data/lib/parsenmap.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#############################
|
3
|
+
#Author = Royce Davis
|
4
|
+
#Last edited February 2, 2011
|
5
|
+
#############################
|
6
|
+
require 'rubygems'
|
7
|
+
require 'nmap/parser'
|
8
|
+
|
9
|
+
unless ARGV.length > 0
|
10
|
+
puts "Generates a .txt file containing the open pots summary and the .nmap information\r\n"
|
11
|
+
puts "USAGE:\t./parsenmap <nmap xml file>\r\n\n"
|
12
|
+
exit!
|
13
|
+
end
|
14
|
+
|
15
|
+
ports = Array.new
|
16
|
+
portstring = String.new
|
17
|
+
parser = Nmap::Parser.parsefile("#{ARGV[0]}")
|
18
|
+
parser.hosts("up") do |host|
|
19
|
+
[:tcp, :udp].each do |type|
|
20
|
+
host.getports(type, "open") do |port|
|
21
|
+
string = port.state.to_s
|
22
|
+
unless string.include? "filtered"
|
23
|
+
srv = port.service
|
24
|
+
ports << port.num unless ports.include? port.num
|
25
|
+
puts "#{host.addr}\t#{port.num}\t#{srv.name}\t#{srv.product}\t#{srv.version}\t#{srv.extrainfo}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
ports.each { |port| portstring << port.to_s + "," }
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: parsenmap
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Royce Davis
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-05 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A simple ruby script to parse Nmap .xml files
|
14
|
+
email: royce@pentestgeek.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- bin/parsenmap
|
20
|
+
- lib/parsenmap.rb
|
21
|
+
homepage: https://rubygems.org/gems/parsenmap
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.7.8
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: Parsenmap
|
45
|
+
test_files: []
|