beef 0.4.2.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (7) hide show
  1. data/README +70 -0
  2. data/README.databases +30 -0
  3. data/VERSION +1 -0
  4. data/beef +112 -0
  5. data/config.yaml +69 -0
  6. data/install +138 -0
  7. metadata +229 -0
data/README ADDED
@@ -0,0 +1,70 @@
1
+
2
+ Copyright 2011 Wade Alcorn wade@bindshell.net
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ Most of the contents of this file will eventually be added to /install.rb. In the meantime tips, hints and guides for installing beef should be kept here.
17
+
18
+ =============================================
19
+
20
+ 1. Prerequisites (platform independent)
21
+ 2. Prerequisites (Windows)
22
+ 3. Prerequisites (Linux)
23
+ 4. Prerequisites (Mac OSX)
24
+ 5. Install instructions
25
+
26
+
27
+
28
+ 1. Prerequisites (platform independent)
29
+
30
+ Beef requires ruby 1.9
31
+
32
+
33
+ 2. Prerequisites (Windows)
34
+
35
+ Windows requires the sqlite.dll. Simply grab the zip file below and extract it to your Ruby bin directory:
36
+
37
+ http://www.sqlite.org/sqlitedll-3_7_0_1.zip
38
+
39
+
40
+ 3. Prerequisites (Linux)
41
+
42
+ !!! This must be done PRIOR to running the Beef installer !!!
43
+
44
+ On linux you will need to find the packages specific to your distribution for sqlite. An example for Ubuntu systems is:
45
+
46
+ sudo apt-get install libsqlite3-dev sqlite3 sqlite3-doc
47
+
48
+
49
+ You also need to install the ruby-dev package (required for mkmf)
50
+
51
+ sudo apt-get install ruby-dev
52
+
53
+
54
+ 4. Prerequisites (Mac OSX)
55
+
56
+ Make sure you have XCode installed - which provided the sqlite support Beef needs
57
+ Sqlite support is native in MacOS 10.6+
58
+
59
+
60
+ 5. Install instructions
61
+
62
+ Obtain application code either by downloading an archive from http://code.google.com/p/beef/downloads/list or checking out the source from http://code.google.com/p/beef/source/checkout
63
+
64
+ Navigate to the ruby source directory and run:
65
+
66
+ ruby install
67
+
68
+ The installer verifies required gems, including any specific version dependencies
69
+
70
+ The installer offers a choice of auto-installing missing gems or provides the command so you can install gems manually
@@ -0,0 +1,30 @@
1
+ MySQL Notes:
2
+ * It's recommended to install MySQL >= 5.5.x
3
+ * Your system will require MySQL, MySQL-Server, MySQL-Devel and Ruby's MySQL libraries installed
4
+ * You will also need to "sudo gem install dm-mysql-adapter"
5
+
6
+ * UTF8 notes. Update/Add in my.cnf (or my.ini on Win) the following. Then save and reboot MySQL.
7
+ - Read more here: http://cameronyule.com/2008/07/configuring-mysql-to-use-utf-8
8
+ [mysql]
9
+ default-character-set=utf8
10
+ [mysqld]
11
+ character-set-server=utf8
12
+ collation-server=utf8_general_ci
13
+ init-connect='SET NAMES utf8'
14
+ [client]
15
+ default-character-set=utf8
16
+
17
+ * Please note that the db must exists. Schema will be created automatically.
18
+ mysql> CREATE DATABASE beef CHARACTER SET utf8 COLLATE utf8_general_ci;
19
+ mysql> grant all privileges on beef.* to 'beef'@'localhost' identified by 'beef123';
20
+
21
+
22
+
23
+ Postgres Notes
24
+ * You will need to install the postgresql package as well as the libpq-dev package
25
+ * You will need to "sudo gem install dm-postgres-adapter"
26
+ * As the postgres user:
27
+ - createuser -P beef
28
+ - createdb --owner=beef beef
29
+ * you may also need to change the pg_hba.conf file in /etc/postgresql so that the local all all optionis labeled as either trust or md5
30
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.4.2.10-alpha
data/beef ADDED
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #
4
+ # Copyright 2011 Wade Alcorn wade@bindshell.net
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ # @note Version check to ensure BeEF is running Ruby 1.9 >
20
+ if RUBY_VERSION < '1.9'
21
+ puts "\n"
22
+ puts "Ruby version " + RUBY_VERSION + " is no longer supported. Please upgrade 1.9 or later."
23
+ puts "\n"
24
+ exit
25
+ end
26
+
27
+ $:.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '.'))
28
+ $root_dir = File.expand_path('..', __FILE__)
29
+
30
+ # @note Prevent some errors on encoding: encoding handling changed (improved) from 1.8.7 to 1.9.1/2.
31
+ if RUBY_VERSION =~ /1.9/
32
+ Encoding.default_external = Encoding::UTF_8
33
+ Encoding.default_internal = Encoding::UTF_8
34
+ end
35
+
36
+ # @note Require core loader's
37
+ require 'core/loader'
38
+
39
+ # @note Starts configuration system
40
+ config = BeEF::Core::Configuration.instance
41
+
42
+ # @note Loads enabled extensions
43
+ BeEF::Extensions.load
44
+
45
+ # @note Prints BeEF welcome message
46
+ #BeEF::Extension::Console::Banners.print_ascii_art
47
+ BeEF::Extension::Console::Banners.print_welcome_msg
48
+
49
+ # @note Loads enabled modules
50
+ BeEF::Modules.load
51
+
52
+ # @note Disable reverse dns
53
+ Socket.do_not_reverse_lookup = true
54
+
55
+ # @note Database setup - use DataMapper::Logger.new($stdout, :debug) for development debugging
56
+ case config.get("beef.database.driver")
57
+ when "sqlite"
58
+ DataMapper.setup(:default, "sqlite3://#{$root_dir}/#{config.get("beef.database.db_file")}")
59
+ when "mysql","postgres"
60
+ DataMapper.setup(:default,
61
+ :adapter => config.get("beef.database.driver"),
62
+ :host => config.get("beef.database.db_host"),
63
+ :username => config.get("beef.database.db_user"),
64
+ :password => config.get("beef.database.db_passwd"),
65
+ :database => config.get("beef.database.db_name"),
66
+ :encoding => config.get("beef.database.db_encoding")
67
+ )
68
+ else
69
+ print_error 'No default database selected. Please add one in config.yaml'
70
+ end
71
+
72
+ # @note Resets the database if the -x flag was passed
73
+ # @todo Change reference from Extension::Console to Core::Console once the console extension is merged with the core
74
+ if BeEF::Extension::Console.resetdb?
75
+ print_info 'Resetting the database for BeEF.'
76
+ DataMapper.auto_migrate!
77
+ else
78
+ DataMapper.auto_upgrade!
79
+ end
80
+
81
+ # @note Extensions may take a moment to load, thus we print out a please wait message
82
+ print_info 'BeEF is loading. Wait a few seconds...'
83
+
84
+ # @note Execute migration procedure, checks for new modules
85
+ BeEF::Core::Migration.instance.update_db!
86
+
87
+ # @note Create HTTP Server and prepare it to run
88
+ http_hook_server = BeEF::Core::Server.instance
89
+ http_hook_server.prepare
90
+
91
+ # @note Prints information back to the user before running the server
92
+ BeEF::Extension::Console::Banners.print_loaded_extensions
93
+ BeEF::Extension::Console::Banners.print_loaded_modules
94
+ BeEF::Extension::Console::Banners.print_network_interfaces_count
95
+ BeEF::Extension::Console::Banners.print_network_interfaces_routes
96
+
97
+ # @note Call the API method 'pre_http_start'
98
+ BeEF::API::Registrar.instance.fire(BeEF::API::Server, 'pre_http_start', http_hook_server)
99
+
100
+ # @note Start the HTTP Server, we addtionally check whether we load the Console Shell or not
101
+ if config.get("beef.extension.console.shell.enable") == true
102
+ puts ""
103
+ begin
104
+ FileUtils.mkdir_p(File.expand_path(config.get("beef.extension.console.shell.historyfolder")))
105
+ BeEF::Extension::Console::Shell.new(BeEF::Extension::Console::Shell::DefaultPrompt,
106
+ BeEF::Extension::Console::Shell::DefaultPromptChar,{'config' => config, 'http_hook_server' => http_hook_server}).run
107
+ rescue Interrupt
108
+ end
109
+ else
110
+ print_info 'BeEF server started (press control+c to stop)'
111
+ http_hook_server.start
112
+ end
@@ -0,0 +1,69 @@
1
+ #
2
+ # Copyright 2011 Wade Alcorn wade@bindshell.net
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # BeEF Configuration file
17
+
18
+ beef:
19
+ version: '0.4.2.10-alpha'
20
+ debug: false
21
+
22
+ restrictions:
23
+ # subnet of browser ip addresses that can hook to the framework
24
+ permitted_hooking_subnet: "0.0.0.0/0"
25
+ # subnet of browser ip addresses that can connect to the UI
26
+ # permitted_ui_subnet = "127.0.0.1/32"
27
+ permitted_ui_subnet: "0.0.0.0/0"
28
+
29
+ http:
30
+ host: "0.0.0.0"
31
+ port: "3000"
32
+ # if running behind a nat set the public ip address here
33
+ #public: ""
34
+ dns: "localhost"
35
+ panel_path: "/ui/panel"
36
+ hook_file: "/hook.js"
37
+ hook_session_name: "BEEFHOOK"
38
+ session_cookie_name: "BEEFSESSION"
39
+
40
+ database:
41
+ # For information on using other databases please read the
42
+ # README.databases file
43
+
44
+ # supported DBs: sqlite, mysql, postgres
45
+ driver: "sqlite"
46
+
47
+ # db_file is only used for sqlite
48
+ db_file: "beef.db"
49
+
50
+ # db connection information is only used for mysql/postgres
51
+ db_host: "localhost"
52
+ db_name: "beef"
53
+ db_user: "beef"
54
+ db_passwd: "beef123"
55
+ db_encoding: "UTF-8"
56
+
57
+ crypto_default_value_length: 80
58
+
59
+ # You may override default extension configuration parameters here
60
+ extension:
61
+ requester:
62
+ enable: true
63
+ proxy:
64
+ enable: true
65
+ metasploit:
66
+ enable: false
67
+ console:
68
+ shell:
69
+ enable: false
data/install ADDED
@@ -0,0 +1,138 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #
4
+ # Copyright 2011 Wade Alcorn wade@bindshell.net
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'rubygems'
20
+
21
+ puts "\nWelcome to the BeEF installer!"
22
+
23
+ if RUBY_VERSION < '1.9'
24
+ puts "\n"
25
+ puts "Ruby version " + RUBY_VERSION + " is no longer supported. Please upgrade 1.9 or later."
26
+ puts "\n"
27
+ exit
28
+ end
29
+
30
+ puts "\nPlease make sure you have installed SQLite before proceeding. For instructions on how to do this please see the README file"
31
+
32
+ # array of required gems - add to as needed (specify a version if needed eg "gem_name, =x.x.x")
33
+ $gems_required = ["ansi", "term-ansicolor", "dm-core", "json", "data_objects", "do_sqlite3", "sqlite3", "dm-sqlite-adapter",
34
+ "parseconfig", "erubis", "dm-migrations", "librex"]
35
+
36
+ # array of missing non-version specific gems installed
37
+ $gems_missing = Array.new
38
+
39
+ # array of missing version specific gems installed
40
+ $gems_missing_version = Array.new
41
+
42
+ # check all required gems (dependencies) are present
43
+ def dep_check
44
+ $gems_required.each do |current_gem|
45
+ begin
46
+ if current_gem.include? ","
47
+ tokens = current_gem.split(",")
48
+ gem tokens[0], tokens[1]
49
+ else
50
+ gem current_gem
51
+ end
52
+ rescue Gem::LoadError
53
+ if current_gem.include? ","
54
+ $gems_missing_version << current_gem
55
+ else
56
+ $gems_missing << current_gem
57
+ end
58
+ end
59
+ end
60
+ if $gems_missing.length == 0 && $gems_missing_version.length == 0
61
+ return true
62
+ else
63
+ return false
64
+ end
65
+ end
66
+
67
+ # display install options
68
+ def display_opts
69
+ puts "\n1) Install all required gems automatically\n" + "2) List required gems and exit so they can be installed manually\n" + "3) Exit installer\n\n"
70
+ option = gets
71
+ return option
72
+ end
73
+
74
+ # generate install command for missing gems
75
+ def install_command
76
+ if (RUBY_PLATFORM =~ /linux/ or RUBY_PLATFORM =~ /darwin/) and Process.uid != 0
77
+ cmd = "sudo gem install"
78
+ $gems_missing.each do |current_gem|
79
+ cmd = cmd + " #{current_gem}"
80
+ end
81
+ if $gems_missing_version.length != 0
82
+ $gems_missing_version.each do |current_gem|
83
+ if cmd == "sudo gem install"
84
+ cmd = cmd + " #{current_gem}"
85
+ else
86
+ cmd = cmd + " && sudo gem install #{current_gem}"
87
+ end
88
+ end
89
+ end
90
+ else
91
+ cmd = "gem install"
92
+ $gems_missing.each do |current_gem|
93
+ cmd = cmd + " #{current_gem}"
94
+ end
95
+ if $gems_missing_version.length != 0
96
+ $gems_missing_version.each do |current_gem|
97
+ if cmd == "gem install"
98
+ cmd = cmd + " #{current_gem}"
99
+ else
100
+ cmd = cmd + " & gem install #{current_gem}"
101
+ end
102
+ end
103
+ end
104
+ end
105
+ cmd = cmd.delete "," "'"
106
+ cmd = cmd.gsub("=", "-v")
107
+ cmd += " --no-rdoc --no-ri"
108
+ return cmd
109
+ end
110
+
111
+ # install missing gems
112
+ def install_gems
113
+ puts install_command + "\n"
114
+ system(install_command)
115
+ end
116
+
117
+ dep_met = dep_check()
118
+
119
+ if dep_met == false
120
+ puts "\nSome gems required by BEeF are not present on your system please select an option to continue:"
121
+ option = display_opts
122
+ while option != "1\n" and option != "2\n" and option != "3\n"
123
+ puts "\nInvalid option entered, please select a valid option to continue:"
124
+ option = display_opts
125
+ end
126
+ if option == "1\n"
127
+ install_gems
128
+ elsif option == "2\n"
129
+ cmd = install_command
130
+ puts "\nPlease run the following command to update and install all required gems:\n\n" + cmd + "\n\n"
131
+ elsif option == "3\n"
132
+ puts "\nExiting...\n\n"
133
+ end
134
+ else
135
+ puts "\nAll required gems are present - please run 'ruby beef' to start using BEeF\n\n"
136
+ puts "\nThe Default username/password are beef/beef\n\n"
137
+ puts "\nAll feedback welcome - http://beef.googlecode.com/\n\n"
138
+ end
metadata ADDED
@@ -0,0 +1,229 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: beef
3
+ version: !ruby/object:Gem::Version
4
+ hash: 195
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 2
10
+ - 10
11
+ - 2
12
+ version: 0.4.2.10.2
13
+ platform: ruby
14
+ authors:
15
+ - Wade Alcorn
16
+ - Michele Orru
17
+ - Ben Passmore
18
+ - Scott Brown
19
+ - A. Saafan
20
+ autorequire:
21
+ bindir: .
22
+ cert_chain: []
23
+
24
+ date: 2011-11-16 00:00:00 Z
25
+ dependencies:
26
+ - !ruby/object:Gem::Dependency
27
+ name: ansi
28
+ prerelease: false
29
+ requirement: &id001 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ hash: 3
35
+ segments:
36
+ - 0
37
+ version: "0"
38
+ type: :runtime
39
+ version_requirements: *id001
40
+ - !ruby/object:Gem::Dependency
41
+ name: term-ansicolor
42
+ prerelease: false
43
+ requirement: &id002 !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ hash: 3
49
+ segments:
50
+ - 0
51
+ version: "0"
52
+ type: :runtime
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ name: dm-core
56
+ prerelease: false
57
+ requirement: &id003 !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ hash: 3
63
+ segments:
64
+ - 0
65
+ version: "0"
66
+ type: :runtime
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
69
+ name: json
70
+ prerelease: false
71
+ requirement: &id004 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 3
77
+ segments:
78
+ - 0
79
+ version: "0"
80
+ type: :runtime
81
+ version_requirements: *id004
82
+ - !ruby/object:Gem::Dependency
83
+ name: data_objects
84
+ prerelease: false
85
+ requirement: &id005 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ hash: 3
91
+ segments:
92
+ - 0
93
+ version: "0"
94
+ type: :runtime
95
+ version_requirements: *id005
96
+ - !ruby/object:Gem::Dependency
97
+ name: do_sqlite3
98
+ prerelease: false
99
+ requirement: &id006 !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ hash: 3
105
+ segments:
106
+ - 0
107
+ version: "0"
108
+ type: :runtime
109
+ version_requirements: *id006
110
+ - !ruby/object:Gem::Dependency
111
+ name: sqlite3
112
+ prerelease: false
113
+ requirement: &id007 !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ hash: 3
119
+ segments:
120
+ - 0
121
+ version: "0"
122
+ type: :runtime
123
+ version_requirements: *id007
124
+ - !ruby/object:Gem::Dependency
125
+ name: dm-sqlite-adapter
126
+ prerelease: false
127
+ requirement: &id008 !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ hash: 3
133
+ segments:
134
+ - 0
135
+ version: "0"
136
+ type: :runtime
137
+ version_requirements: *id008
138
+ - !ruby/object:Gem::Dependency
139
+ name: parseconfig
140
+ prerelease: false
141
+ requirement: &id009 !ruby/object:Gem::Requirement
142
+ none: false
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ hash: 3
147
+ segments:
148
+ - 0
149
+ version: "0"
150
+ type: :runtime
151
+ version_requirements: *id009
152
+ - !ruby/object:Gem::Dependency
153
+ name: erubis
154
+ prerelease: false
155
+ requirement: &id010 !ruby/object:Gem::Requirement
156
+ none: false
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ hash: 3
161
+ segments:
162
+ - 0
163
+ version: "0"
164
+ type: :runtime
165
+ version_requirements: *id010
166
+ - !ruby/object:Gem::Dependency
167
+ name: dm-migrations
168
+ prerelease: false
169
+ requirement: &id011 !ruby/object:Gem::Requirement
170
+ none: false
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ hash: 3
175
+ segments:
176
+ - 0
177
+ version: "0"
178
+ type: :runtime
179
+ version_requirements: *id011
180
+ description: The Browser Exploitation Framework (BeEF) is a security tool that provides practical client side attack vectors.
181
+ email: henryzlo@gmail.com
182
+ executables:
183
+ - beef
184
+ extensions: []
185
+
186
+ extra_rdoc_files: []
187
+
188
+ files:
189
+ - README
190
+ - README.databases
191
+ - VERSION
192
+ - beef
193
+ - config.yaml
194
+ - install
195
+ - ./beef
196
+ homepage: http://beefproject.com
197
+ licenses: []
198
+
199
+ post_install_message:
200
+ rdoc_options: []
201
+
202
+ require_paths: .
203
+ required_ruby_version: !ruby/object:Gem::Requirement
204
+ none: false
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ hash: 3
209
+ segments:
210
+ - 0
211
+ version: "0"
212
+ required_rubygems_version: !ruby/object:Gem::Requirement
213
+ none: false
214
+ requirements:
215
+ - - ">="
216
+ - !ruby/object:Gem::Version
217
+ hash: 3
218
+ segments:
219
+ - 0
220
+ version: "0"
221
+ requirements: []
222
+
223
+ rubyforge_project:
224
+ rubygems_version: 1.7.2
225
+ signing_key:
226
+ specification_version: 3
227
+ summary: Browser Exploitation Framework.
228
+ test_files: []
229
+