实验环境
centos7_x64
实验软件
metasploit-framework-6.3.45%2B20231125112655_1rapid7-1.el6.x86_64.rpm
软件安装
rpm -ivh metasploit-framework-6.3.45%2B20231125112655_1rapid7-1.el6.x86_64.rpm
yum install -y postgresql11 postgresql11-server
/usr/pgsql-11/bin/postgresql-11-setup initdb
Initializing database ... OK
systemctl start postgresql-11 && systemctl enable postgresql-11
su - postgres && psql
postgres=# create user msf_test with password '123456' nocreatedb; 创建用户配置密码
postgres=# create database msf1 with owner ='msf_test'; 创建数据库
postgres=# \q
cp -pv /var/lib/pgsql/11/data/pg_hba.conf /var/lib/pgsql/11/data/pg_hba.conf.bak
cat /var/lib/pgsql/11/data/pg_hba.conf
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
systemctl restart postgresql-11 重启服务 检测配置文件
touch /opt/metasploit-framework/database.yml && cat /opt/metasploit-framework/database.yml
production:
adapter: postgresql
database: msf1
username: msf_test
password: 123456
host: 127.0.0.1
port: 5432
pool: 75
timeout: 5
cp -pv /etc/bashrc /etc/bashrc.bak
echo export MSF_DATABASE_CONFIG=/opt/metasploit-framework/database.yml >> /etc/bashrc
source ~/.bashrc
msfconsole
Metasploit tip: View advanced module options with advanced
______________________________________________________________________________
| |
| 3Kom SuperHack II Logon |
|______________________________________________________________________________|
| |
| |
| |
| User Name: [ security ] |
| |
| Password: [ ] |
| |
| |
| |
| [ OK ] |
|______________________________________________________________________________|
| |
| https://metasploit.com |
|______________________________________________________________________________|
=[ metasploit v6.3.45-dev- ]
+ -- --=[ 2376 exploits - 1232 auxiliary - 416 post ]
+ -- --=[ 1388 payloads - 46 encoders - 11 nops ]
+ -- --=[ 9 evasion ]
Metasploit Documentation: https://docs.metasploit.com/
msf6 > workspace
* default
msf6 > workspace -a test
[*] Added workspace: test