如何在mac上搭建beef | 您所在的位置:网站首页 › beef教程 › 如何在mac上搭建beef |
说明 在这里先进行说明,这里的beef是xss攻击的平台,笔者的mac版本是10.12.3 安装beefbeef上传在github上,切换到你想安装的目录执行: git clonehttps://github.com/beefproject/beef ,首先你的mac上必须安装了git cd beef 切换到beef安装目录,执行./beef,这时候发现报错,ruby的版本太低,如果没有报错的读者不需要看下一章了。 切换ruby版本打开mac上的终端,执行ruby -v 查看版本,一般比要求安装的版本低的。 这里使用rvm进行ruby的版本更换,rvm是一个ruby的多版本管理器,在终端中执行如下进行安装:curl -sSL https://get.rvm.io | bash -s stable 安装好了rvm,但是你仍然不能使用命令,必须要执行: source~/.bashrc source~/.bash_profile 这两个命令使得在你打开的终端中你可以使用rvm,所以关闭重新打开之后就失效了,这个时候之需要进行环境变量的配置即可。(在此不做任何的说明) rvm list --列出已经安装的ruby版本 rvm list known --列出已知的ruby的版本 rvm install 2.2.0 --在这里选择2.2.0版本安装,版本好你可以自行选择 rvm use ruby-2.2.0 --更换ruby的版本,但是可能出现问题 错误信息: RVM is not a function, selecting rubies with 'rvm use ...' will not work. You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use `/bin/bash --login` as the command. Please visit https://rvm.io/integration/gnome-terminal/ for an example. 解决方法:执行下面两个命令 echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"' >>~/.bashrc source ~/.bashrc 之后在执行之前的rvm use ruby-2.2.0 然后你可以执行ruby -v 看到版本已经更换了 另外的问题现在ruby的版本已经换好了,在beef文件夹下执行./beef,但是仍然报错 错误原因: /Users/wyc/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError) from /Users/wyc/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /Users/wyc/Documents/beef/core/loader.rb:9:in `' from /Users/wyc/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /Users/wyc/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from ./beef:25:in `'解决方法:重新安装bundler执行:gem install bundler bundle install ./beef 但是发现还是有问题: installing robots (0.10.1)的时候超时,这个很好解决,重新执行bundle install即可知道不超时为止。 之后在gem install nokogiri -v '1.7.1'时报错,查看日志发现是编译的时候错误: ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 笔者在网上找了好久,最终在stackoverflow找到解决方法(在此感谢dalao): 执行以下两个命令: brew install libxml2 bundle config build.nokogiri --use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2 再次执行bundle install发现终于打包成功了(鼓掌) 访问如果所有的问题都解决了,那么执行./beef之后,终端打印信息: [18:45:00][*]Bind socket [imapeudora1] listening on [0.0.0.0:2000]. [18:45:00][*]Browser Exploitation Framework (BeEF) 0.4.7.0-alpha [18:45:00]|Twit: @beefproject [18:45:00]|Site: http://beefproject.com [18:45:00]|Blog: http://blog.beefproject.com [18:45:00]|_Wiki: https://github.com/beefproject/beef/wiki [18:45:00][*]Project Creator:Wade Alcorn(@WadeAlcorn) [18:45:01][*]BeEF is loading. Wait a few seconds... [18:45:03][*]12 extensions enabled. [18:45:03][*]293 modules enabled. [18:45:03][*]2 network interfaces were detected. [18:45:03][+]running on network interface: 127.0.0.1 [18:45:03]|Hook URL: http://127.0.0.1:3000/hook.js [18:45:03]|_UI URL:http://127.0.0.1:3000/ui/panel [18:45:03][+]running on network interface: 192.168.1.111 [18:45:03]|Hook URL: http://192.168.1.111:3000/hook.js [18:45:03]|_UI URL:http://192.168.1.111:3000/ui/panel [18:45:03][!]Warning: Default username and password in use! [18:45:03][*]RESTful API key: b23f862afc0d9838b04ea7965644b8727a7d0dd9 [18:45:03][*]HTTP Proxy: http://127.0.0.1:6789 [18:45:03][*]BeEF server started (press control+c to stop) 好了访问http://127.0.0.1:3000/ui/panel吧 user/password:beef/beef 终于在mac上安装成功!! 在这里做一个补充: rvm的命令使用是暂时的,如果想要登陆即用,可执行以下命令: cd /etc sudo vim profile 在文件profile末尾添加export PATH=/users/wyc/.rvm/bin:$PATH(/users/wyc/.rvm/bin是你自己mac上安装的目录) 之后保存即可,vim编辑器的使用在此不做说明 |
CopyRight 2018-2019 实验室设备网 版权所有 |