Skip to content

Commit 400b0f4

Browse files
committed
parse url to report host in old config
1 parent f3d953f commit 400b0f4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/post/multi/gather/dbvis_enum.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def pareseNewConfigFile(raw_xml)
200200
end
201201

202202

203-
# New config file parse function
203+
# New config file parse function
204204
def pareseOldConfigFile(raw_xml)
205205

206206
db_table = Rex::Ui::Text::Table.new(
@@ -254,6 +254,12 @@ def pareseOldConfigFile(raw_xml)
254254

255255
# Fill the tab
256256
dbs.each do |db|
257+
if (db[:Url] =~ /[\S+\s+]+[\/]+([\S+\s+]+):[\S+]+/i)
258+
if ::Rex::Socket.is_ipv4?($1.to_s)
259+
print_good("Reporting #{$1} ")
260+
report_host(:host => $1.to_s);
261+
end
262+
end
257263
db_table << [ db[:Alias] , db[:Type] , db[:Userid], db[:Url]]
258264
end
259265
return db_table

0 commit comments

Comments
 (0)