版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011946741/article/details/86416594
在ArchLinux上安装了BlackArch套件后,在使用Metasploit的过程中,发现Metasploit在连接PostgreSQL时不成功,主要是因为还未对之进行初始化,在确保安装好PostgreSQL数据库后,需要首先安装msf框架对该数据库的初始化工具msfdb-blackarch(看起来好像是blackarch的定制版):
pacman -S msfdb-blackarch
直接进行查看其使用帮助:
Manage the metasploit framework database
msfdb-blackarch init # start and initialize the database
msfdb-blackarch reinit # delete and reinitialize the database
msfdb-blackarch delete # delete database and stop using it
msfdb-blackarch start # start the database
msfdb-blackarch stop # stop the database
msfdb-blackarch status # check service status
msfdb-blackarch run # start the database and run msfconsole
可知使用init或reinit命令可对之进行初始化,在确保PostgreSQL关闭的情况下以root用户进行执行即可完成初始化,在执行脚步完成后,可以看到添加了账户msf,但未显示该账户密码,不过无大碍,通过msfdb-blackarch run命令,一键进行数据库的启动,msfconsole的启动,以及数据库的连接。
$ sudo msfdb-blackarch run
[+] Starting database
.,,. .
.\$$$$$L..,,==aaccaacc%#s$b. d8, d8P
d8P #$$$$$$$$$$$$$$$$$$$$$$$$$$$b. `BP d888888p
d888888P '7$$$$\""""''^^`` .7$$$|D*"'``` ?88'
d8bd8b.d8p d8888b ?88' d888b8b _.os#$|8*"` d8P ?8b 88P
88P`?P'?P d8b_,dP 88P d8P' ?88 .oaS###S*"` d8P d8888b $whi?88b 88b
d88 d8 ?8 88b 88b 88b ,88b .osS$$$$*" ?88,.d88b, d88 d8P' ?88 88P `?8b
d88' d88b 8b`?8888P'`?8b`?88P'.aS$$$$Q*"` `?88' ?88 ?88 88b d88 d88
.a#$$$$$$"` 88b d8P 88b`?8888P'
,s$$$$$$$"` 888888P' 88n _.,,,ass;:
.a$$$$$$$P` d88P' .,.ass%#S$$$$$$$$$$$$$$'
.a$###$$$P` _.,,-aqsc#SS$$$$$$$$$$$$$$$$$$$$$$$$$$'
,a$$###$$P` _.,-ass#S$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$####SSSS'
.a$$$$$$$$$$SSS$$$$$$$$$$$$$$$$$$$$$$$$$$$$SS##==--""''^^/$$$$$$'
_______________________________________________________________ ,&$$$$$$'_____
ll&&$$$$'
.;;lll&&&&'
...;;lllll&'
......;;;llll;;;....
` ......;;;;... . .
=[ metasploit v4.17.23-dev ]
+ -- --=[ 1824 exploits - 1033 auxiliary - 316 post ]
+ -- --=[ 540 payloads - 44 encoders - 10 nops ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]
msf > db_status
[*] postgresql connected to msf
msf >
连接正常的情况下,通过db_status可以看到"postgresql connected to msf"这样的提示。