Use filters

This commit is contained in:
Brendan Coles
2015-02-04 08:36:44 +00:00
parent f329c7331a
commit c099be75ed
10 changed files with 29 additions and 19 deletions

View File

@@ -24,9 +24,11 @@ class Detect_cups < BeEF::Core::Command
port = $3
session_id = @datastore['beefhook']
cid = @datastore['cid'].to_i
print_debug("Hooked browser found 'CUPS' [proto: #{proto}, ip: #{ip}, port: #{port}]")
r = BeEF::Core::Models::NetworkService.new(:hooked_browser_id => session_id, :proto => proto, :ip => ip, :port => port, :type => 'CUPS', :cid => cid)
r.save
if BeEF::Filters.is_valid_ip?(ip)
print_debug("Hooked browser found 'CUPS' [proto: #{proto}, ip: #{ip}, port: #{port}]")
r = BeEF::Core::Models::NetworkService.new(:hooked_browser_id => session_id, :proto => proto, :ip => ip, :port => port, :type => 'CUPS', :cid => cid)
r.save
end
end
end
end

View File

@@ -24,6 +24,7 @@ class Get_internal_ip_webrtc < BeEF::Core::Command
ips.uniq.each do |ip|
next unless ip =~ /^[\d\.]+$/
next if ip =~ /^0\.0\.0\.0$/
next unless BeEF::Filters.is_valid_ip?(ip)
print_debug("Hooked browser has network interface #{ip}")
r = BeEF::Core::Models::NetworkHost.new(:hooked_browser_id => session_id, :ip => ip, :os => os, :cid => cid)
r.save