在最后一步,你将首次启动 Metasploit 控制台,这将触发初始设置过程。这包括设置 Metasploit 用于存储项目信息(包括主机数据、漏洞和收集到的证据)的数据库。
要启动控制台,只需在终端中输入 msfconsole 并按 Enter 键。
msfconsole
首次运行 Metasploit 时,它将显示初始设置向导:
** Welcome to Metasploit Framework Initial Setup **
Please answer a few questions to get started.
Would you like to use and setup a new database (recommended)?
输入 yes 并按 Enter 键继续进行数据库设置。
Would you like to use and setup a new database (recommended)? yes
Running the 'init' command for the database:
Creating database at /home/labex/.msf4/db
Creating db socket file at /tmp
Starting database at /home/labex/.msf4/db...waiting for server to start.... done
server started
success
Creating database users
Writing client authentication configuration file /home/labex/.msf4/db/pg_hba.conf
Stopping database at /home/labex/.msf4/db
Starting database at /home/labex/.msf4/db...waiting for server to start.... done
server started
success
Creating initial database schema
Database initialization successful
Database initialization successful
** Metasploit Framework Initial Setup Complete **
设置完成后,你将看到熟悉的 Metasploit 启动横幅和提示符:
Metasploit tip: Display the Framework log using the log command, learn
more with help log
Call trans opt: received. 2-19-98 13:24:18 REC:Loc
Trace program: running
wake up, Neo...
the matrix has you
follow the white rabbit.
knock, knock, Neo.
(`. ,-,
` `. ,;' /
`. ,'/ .'
`. X /.'
.-;--''--.._` ` (
.' / `
, ` ' Q '
, , `._ \
,.| ' `-.;_'
: . ` ; ` ` --,.._;
' ` , ) .'
`._ , ' /_
; ,''-,;' ``-
``-..__``--`
https://metasploit.com
=[ metasploit v6.4.x-dev- ]
+ -- --=[ 2,564 exploits - 1,315 auxiliary - 1,680 payloads ]
+ -- --=[ 431 post - 49 encoders - 13 nops - 9 evasion ]
Metasploit Documentation: https://docs.metasploit.com/
The Metasploit Framework is a Rapid7 Open Source Project
msf >
为了确认数据库已正确连接,请在 Metasploit 控制台中运行 db_status 命令。
db_status
预期的输出是:
[*] Connected to msf. Connection type: postgresql.
这确认你的 Metasploit 实例已成功连接到 PostgreSQL 数据库。要退出 Metasploit 控制台,只需输入 exit。
exit