246 字
1 分钟
WSL安装metasploit
https://mirrors.tuna.tsinghua.edu.cn/help/debian/清华的debian国内镜像
将系统语言改为中文
sudo dpkg-reconfigure locales#勾上zh_CN GB2312 zh_CN.GBK GBK zh_CN.UTF-8 UTF-8#重启生效安装metasploit-framework
sudo nano /etc/apt/sources.list#加入下面这一行deb http://mirrors.aliyun.com/kali kali-rolling main non-free contribsudo wget -q -O - https://archive.kali.org/archive-key.asc | sudo apt-key addsudo apt updatesudo apt install metasploit-framework连接数据库
WSL中metasploit链接数据库有点麻烦,如果按照正常操作会报下面这个错误。
msfconsole>db_statuspostgresql selected,no connect>msfdb initSystem has not been booted with systemd as init system (PID 1). Can't operate.原理是wsl启动的时候没systemd。
解决方法
启动数据库服务
msfdb initsudo service postgresql startsudo service postgresql status手动建立数据库用户,数据库
#cd /etc/postgresql/13/mainsudo -u postgres psqlalter user postgres password 'root';create user msf with password 'metasploit' createdb;create database msf with owner=msf;quit在metasploit中链接
msfconsole#db_connect 数据库用户名:数据库密码@数据库ip[:数据库端口]/数据库名db_connect msf:metasploit@127.0.0.1:5958/msfdb_status设置自动连接
sudo nano /usr/share/metasploit-framework/config/database.yml将里面username,password改成自己设置的。
WSL安装metasploit
https://tski.uk/blog/wsl-metasploit-config/