Update BrowserDetails to store textual OID-style key/value data

This commit is contained in:
Brendan Coles
2019-02-26 15:22:54 +00:00
parent 25988d1728
commit 03424c804e
22 changed files with 546 additions and 428 deletions

View File

@@ -9,9 +9,9 @@ class Detect_activex < BeEF::Core::Command
content = {}
content['activex'] = @datastore['activex']
save content
if @datastore['results'] =~ /^activex=(Yes|No)/
bd = BeEF::Core::Models::BrowserDetails.set(@datastore['beefhook'], 'HasActiveX', $1)
end
if @datastore['results'] =~ /^activex=(Yes|No)/
bd = BeEF::Core::Models::BrowserDetails.set(@datastore['beefhook'], 'browser.capabilities.activex', $1)
end
end
end

View File

@@ -5,10 +5,13 @@
#
class Detect_vlc < BeEF::Core::Command
def post_execute
content = {}
content['vlc'] = @datastore['vlc']
save content
end
def post_execute
content = {}
content['vlc'] = @datastore['vlc']
save content
if @datastore['results'] =~ /^vlc=(Yes|No)/
bd = BeEF::Core::Models::BrowserDetails.set(@datastore['beefhook'], 'browser.capabilities.vlc', $1)
end
end
end

View File

@@ -9,9 +9,9 @@ class Detect_wmp < BeEF::Core::Command
content = {}
content['wmp'] = @datastore['wmp']
save content
if @datastore['results'] =~ /^wmp=(Yes|No)/
bd = BeEF::Core::Models::BrowserDetails.set(@datastore['beefhook'], 'HasWMP', $1)
end
if @datastore['results'] =~ /^wmp=(Yes|No)/
bd = BeEF::Core::Models::BrowserDetails.set(@datastore['beefhook'], 'browser.capabilities.wmp', $1)
end
end
end

View File

@@ -24,7 +24,7 @@ class Spyder_eye < BeEF::Core::Command
# save screenshot file
begin
timestamp = Time.now.localtime.strftime("%Y-%m-%d_%H-%M-%S")
ip = BeEF::Core::Models::BrowserDetails.get(session_id, 'IP')
ip = BeEF::Core::Models::BrowserDetails.get(session_id, 'browser.ipaddress')
filename = "#{$home_dir}/screenshot_#{ip}_-_#{timestamp}_#{@datastore['cid']}.png"
File.open(filename, 'wb') do |file|
data = @datastore['results'].gsub(/^image=data:image\/(png|jpg);base64,/, "")

View File

@@ -17,7 +17,7 @@ class Get_internal_ip_webrtc < BeEF::Core::Command
if @datastore['results'] =~ /IP is ([\d\.,]+)/
ips = $1.to_s.split(/,/)
if !ips.nil? && !ips.empty?
os = BeEF::Core::Models::BrowserDetails.get(session_id, 'OsName')
os = BeEF::Core::Models::BrowserDetails.get(session_id, 'host.os.name')
ips.uniq.each do |ip|
next unless ip =~ /^[\d\.]+$/
next if ip =~ /^0\.0\.0\.0$/