1、下载并安装termux,更新源并获取软件升级包。
$ apt update && apt upgrade #获取更新
$ apt install curl proot wget #安装curl和proot wget
2、安装并配置zsh
$ wget https://github.com/Cabbagec/termux-ohmyzsh/raw/master/install.sh
$ chmod +x install.sh ./install.sh
3、安装MSF和Postgresql
$ termux-chroot
$ wget https://Auxilus.github.io/metasploit.sh
$ chmod +x metasploit.sh && ./metasploit.sh
安装10~20分钟
4、配置Postgresql数据库
$ mkdir ~/.msfdb $ initdb ~/.msfdb |
创建存放数据库文件的文件夹并初始化数据库
$ pg_ctl -D ~/.msfdb -l ~/.msfdb/msfdb.log start $ pg_ctl -D ~/.msfdb -l ~/.msfdb/msfdb.log stop |
启动和停止Postgresql服务(指定~/.msfdb/msfdb.log为数据库日志文件,主要用于排查BUG)
$ createuser msf $ createdb msfdb |
创建名为msf的数据库用户
5、启动msf并手动连接数据库
$ msfconsole |
启动时会出现一行warning
$ db_connect msf@msfdb |
连接数据库
$ db_status |
查看数据库连接状态
$ db_rebuild_cache |
重新生成模块数据库缓存
如果安装后还是不行的话
$ rm metasploit.sh #删掉原来的文件 $ wget https://raw.githubusercontent.com/ZCKun/gitskills/master/metasploit.sh #重新下载metasploit.sh $ chmod +x metasploit && ./metasploit #将会重新进行安装 |
上文内容不用于商业目的,如涉及知识产权问题,请权利人联系博为峰小编(021-64471599-8017),我们将立即处理。