Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/host/detect_airdroid/module.rb
1154 views
1
#
2
# Copyright (c) 2006-2025 Wade Alcorn - [email protected]
3
# Browser Exploitation Framework (BeEF) - https://beefproject.com
4
# See the file 'doc/COPYING' for copying permission
5
#
6
7
class Detect_airdroid < BeEF::Core::Command
8
def self.options
9
[
10
{ 'name' => 'ipHost', 'ui_label' => 'IP or Hostname', 'value' => '127.0.0.1' },
11
{ 'name' => 'port', 'ui_label' => 'Port', 'value' => '8888' }
12
]
13
end
14
15
def post_execute
16
save({ 'airdroid' => @datastore['airdroid'] })
17
18
configuration = BeEF::Core::Configuration.instance
19
return unless configuration.get('beef.extension.network.enable') == true
20
return unless @datastore['results'] =~ /^proto=(https?)&ip=([\d.]+)&port=(\d+)&airdroid=Installed$/
21
22
proto = Regexp.last_match(1)
23
ip = Regexp.last_match(2)
24
port = Regexp.last_match(3)
25
session_id = @datastore['beefhook']
26
type = 'Airdroid'
27
28
if BeEF::Filters.is_valid_ip?(ip)
29
print_debug("Hooked browser found 'Airdroid' [proto: #{proto}, ip: #{ip}, port: #{port}]")
30
BeEF::Core::Models::NetworkService.create(hooked_browser_id: session_id, proto: proto, ip: ip, port: port, type: type)
31
end
32
end
33
end
34
35