0X001-msf环境配置

安装Kali系统

推荐使用虚拟机,太简单不赘述。

配置数据库

开启开机启动

1
2
vim /etc/rc.local 添加
/etc/init.d/postgresql start

启动数据库

1
2
service postgresql start 
systemctl restart postgresql

创建新用户

1
2
3
4
>> su postgres
>> pssql
>> create user "msfuser" with password 'msfpassword' nocreatedb;
>> create database "msfdb" with owner="msfuser";

编辑database.yml文件

1
2
3
4
5
6
7
8
>>cd /usr/share/metasploit-framework/config
>> cp database.yml.example database.yml
>> vim database.yml
...
database: msfdb
username: msfuser
password:msfpassword
...

编辑postgresql,本地启动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
>> cd /etc/postgresql/10/main
>> cp pg_hba.conf pg_hba.conf.backup
>> vim pg_hba.conf
...
# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust

...

启动msf,查看状态

1
2
>> msfconsole
>> db_status

Reference

https://www.secpulse.com/archives/33281.html

https://www.jianshu.com/p/9c82ccb2aaf7

https://blog.csdn.net/sanbingyutuoniao123/article/details/52209653

https://docs.kali.org/general-use/starting-metasploit-framework-in-kali