Skip to content

Commit ab33fc8

Browse files
author
Brent Cook
committed
Land rapid7#5211, parse nmap's tunnel attribute
2 parents ee07809 + 74ad81c commit ab33fc8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/msf/core/db_manager/import/nmap.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ def import_nmap_xml(args={}, &block)
164164
data[:host] = hobj || addr
165165
data[:info] = extra if not extra.empty?
166166
data[:task] = args[:task]
167-
if p["name"] != "unknown"
168-
data[:name] = p["name"]
169-
end
167+
data[:name] = p['tunnel'] ? "#{p['tunnel']}/#{p['name'] || 'unknown'}" : p['name']
170168
report_service(data)
171169
}
172170
#Parse the scripts output

lib/rex/parser/nmap_nokogiri.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ def collect_port_data
277277
port_hash[:state] = determine_port_state(v)
278278
when "name"
279279
port_hash[:name] = v
280+
when "tunnel"
281+
port_hash[:name] = "#{v}/#{port_hash[:name] || 'unknown'}"
280282
when "reason"
281283
port_hash[:reason] = v
282284
when "product"

0 commit comments

Comments
 (0)