Report identified hosts to network extension

This commit is contained in:
Brendan Coles
2015-01-30 06:57:01 +00:00
parent 53a05d1901
commit 16ecb32e46
2 changed files with 32 additions and 0 deletions

View File

@@ -26,5 +26,21 @@ class Ping_sweep < BeEF::Core::Command
content['fail'] = 'No active hosts have been discovered.'
end
save content
configuration = BeEF::Core::Configuration.instance
if configuration.get("beef.extension.network.enable") == true
session_id = @datastore['beefhook']
cid = @datastore['cid'].to_i
# save the network host
if @datastore['results'] =~ /host=([\d\.]+) is alive/
ip = $1
print_debug("Hooked browser has network interface #{ip}")
r = BeEF::Core::Models::NetworkHost.new(:hooked_browser_id => session_id, :ip => ip, :cid => cid)
r.save
end
end
end
end