metasploit 链接postgresql数据库:sql
打开postgresql服务:service postgresql startshell
进入postgresql数据库,设置默认用户密码、建立新用户、设置新用户权限、建立数据库: 数据库
shell # sudo -u postgres psql #进入postgresql默认的用户 缓存
postgres=# alter user postgres with password '密码'; #设置默认用户的登陆密码 ( 非必须步骤,必须是单引号 )ide
postgres=# create user 用户名 with password '密码' nocreatedb; #建立带密码的新用户 post
postgres=# create database 数据库名 with owner = '用户名'; #建立数据库并指定数据库的所属用户 测试
postgres=# \q #退出psqlspa
进入metasploit,链接数据库:postgresql
shell # msfconsoleorm
msf > db_status #查看msf的数据库的状态
msf > db_connect 用户名:密码@主机地址\数据库名 #经过用户名密码链接psql
msf > db_status #检查msf的数据库的状态
4. 经过database.yml配置文件配置,位置:\usr\share\metasploit-frameword\config\database.yml
** msf如何链接psql数据库 ** 我的思考 **
我的思考:
1.msf为何要链接postgresql?
答:首先, 链接数据库以后搜索msf中模块的速度能够大大提升;
其次, 链接数据库以后,使用msf的痕迹会被保存下来,方便以后导出编写***测试报告。
因此, 链接psql数据库不是必须的操做,可是为了提升***测试的效率,方便往后的写报告,仍是应该链接数据库,建立缓存。