Debian安装MSF(install msf on debain)
Debian 安装msf:
# nano /etc/apt/sources.list
写入kali linux源:
deb https://http.kali.org/kali kali main non-free contribdeb-src https://http.kali.org/kali kali main non-free contrib
deb https://security.kali.org/kali-security kali/updates main contrib non-free
添加公钥:
sudo apt-key adv –keyserver pgp.mit.edu –recv-keys ED444FF07D8D0BF6 # apt-get update #apt-get postgresql /*postgresql 默认安装最新版本 #sudo -u postgres psql # apt-get metasploit /*安装msf # service metasploit start #service postgresql start
postgres设定
# sudo -u postgres psql postgres=# ALTER USER postgres WITH PASSWORD ‘passwd’; /* 修改postgres默认密码 postgres=# \q /* 退出 修改linux系统的postgres用户的密码 # sudo passwd -d postgres /*删除linux 系统postgres用户密码 # sudo -u postgres passwd /*设置新密码(密码与数据库用户密码相同) 创建数据库账户/数据库 psql -U postgres -h 127.0.0.1 create user “msf” with password ‘mysql’ nocreatedb; create database “msfdb” with owner=”msf”;
开机自启动:
# update-rc.d postgresql enable
# update-rc.d metasploit enable
启动MSF
#msfconsole
db_connect msf:test@127.0.0.1:5432/msfdb /*MSF连接postgres
创建数据库配置文件
# sudo mkdir /opt/metasploit/config/
# sudo vi /opt/metasploit/config/database.yml
内容格式:
production: adapter: "postgresql" database: "metasploitdb" username: "msfuser" password: "msfpassword" port: 5432 host: "localhost" pool: 256 timeout: 5
添加配置文件到你的环境
# export MSF_DATABASE_CONFIG=/opt/local/config/database.yml
相关命令:
查看PostgreSQL是否启动
ps -aux | grep -i postgresql
查看PostgreSQL的端口情况
netstat -tnpl | grep postgresql 或者 ss -ant
查看msf的配置数据库用户和密码
cat /opt/metasploit/config/database.yml