Skip to content

Commit

Permalink
can now list offline hooked browsers, plus added README
Browse files Browse the repository at this point in the history
  • Loading branch information
xntrik committed Jul 26, 2011
1 parent 11d0852 commit b70db68
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README
@@ -0,0 +1,44 @@

Copyright 2011 Wade Alcorn wade@bindshell.net

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

================================================

Remote BeEF Metasploit Plugin

Version 0.1 - 26th July 2011

1. Installation & Usage
a) Copy these files into your metasploit folder (this should copy beef.rb into your msf/plugins/ folder, and the beef/ folder into your msf/lib/ folder)
b) Start metasploit
c) msf > load beef
[*] BeEF Bridge for Metasploit 0.1
[+] Type beef_help for a command listing
[*] Successfully loaded plugin: beef
d) msf > beef_help
Command Help text
------- ---------
Generic Commands
----------------- -----------------
beef_connect Connect to a remote BeEF server.
beef_disconnect Disconnect from the remote BeEF server.
beef_help Display this help listing.

Hooked Browser Commands
----------------- -----------------
beef_online List available hooked browsers and their details.
beef_offline List previously hooked browsers and their details.
beef_import Import available hooked browsers into db_hosts.

e) If you want to "beef_import", you'll need to db_connect first
32 changes: 32 additions & 0 deletions plugins/beef.rb
Expand Up @@ -21,6 +21,7 @@ def commands
"beef_help" => "Get help on all commands",
"beef_import" => "Import available hooked browsers into metasploit",
"beef_online" => "List available hooked browsers",
"beef_offline" => "List previously hooked browsers",
"beef_test" => "Testing adding a host"
}
end
Expand Down Expand Up @@ -109,6 +110,7 @@ def cmd_beef_help(*args)
tbl << [ "Hooked Browser Commands",""]
tbl << [ "-----------------", "-----------------"]
tbl << [ "beef_online", "List available hooked browsers and their details."]
tbl << [ "beef_offline","List previously hooked browsers and their details."]
tbl << [ "beef_import", "Import available hooked browsers into db_hosts."]
puts "\n"
puts tbl.to_s + "\n"
Expand Down Expand Up @@ -178,6 +180,36 @@ def cmd_beef_online(*args)
puts "\n"
puts tbl.to_s + "\n"
end

def cmd_beef_offline(*args)
hb = nil
begin
if @remotebeef.session.connected.nil?
print_status("You aren't connected")
return
else
hb = @remotebeef.zombiepoll.hooked
end
rescue
print_status("You don't appear to be connected")
return
end

tbl = Rex::Ui::Text::Table.new(
'Columns' =>
[
'Id',
'IP',
'OS'
])
hb['hooked-browsers']['offline'].each{ |x|
tbl << [x[0].to_s , x[1]['ip'].to_s, beef_logo_to_os(x[1]['os_icon'].to_s)]
}
puts "\n"
puts "Previously hooked browsers within BeEF"
puts "\n"
puts tbl.to_s + "\n"
end
end

def initialize(framework, opts)
Expand Down

0 comments on commit b70db68

Please sign in to comment.