msfdb:msf数据库管理命令

1、查看msf数据库连接状态

msf > db_status
[*] postgresql selected, no connection    //未连接

2、msfdb命令

msf > msfdb      //msfdb可以在命令行直接使用
[*] exec: msfdb Manage a metasploit framework database msfdb init # initialize the database          //初始化数据库
msfdb reinit # delete and reinitialize the database  //清空配置重新初始化数据库
msfdb delete # delete database and stop using it    //删除数据库并停止使用
msfdb start # start the database         //启动数据库
msfdb stop # stop the database         //停止数据库

3、初始化数据库

msf > msfdb init
[*] exec: msfdb init Creating database user 'msf'
为新角色输入的口令:
再输入一遍:
Creating databases 'msf' and 'msf_test'
Creating configuration file in /usr/share/metasploit-framework/config/database.yml
Creating initial database schema

4、查看msf数据库配置文件

root@kali:~# cat /usr/share/metasploit-framework/config/database.yml
development:
adapter: postgresql
database: msf
username: msf
password: EUsDzzKRsyxvmwmPI+dZ2KF1rojkKeEKqNRvNbV7LdY=
host: localhost
port:
pool:
timeout: production:
adapter: postgresql
database: msf
username: msf
password: EUsDzzKRsyxvmwmPI+dZ2KF1rojkKeEKqNRvNbV7LdY=
host: localhost
port:
pool:
timeout: test:
adapter: postgresql
database: msf_test
username: msf
password: EUsDzzKRsyxvmwmPI+dZ2KF1rojkKeEKqNRvNbV7LdY=
host: localhost
port:
pool:
timeout:

5、启动或重启msf

root@kali:~# msfconsole

 ______________________________________________________________________________
| |
| 3Kom SuperHack II Logon |
|______________________________________________________________________________|
| |
| |
| |
| User Name: [ security ] |
| |
| Password: [ ] |
| |
| |
| |
| [ OK ] |
|______________________________________________________________________________|
| |
| https://metasploit.com |
|______________________________________________________________________________| =[ metasploit v4.15.5-dev ]
+ -- --=[ exploits - auxiliary - post ]
+ -- --=[ payloads - encoders - nops ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ] msf > db_status
[*] postgresql connected to msf

最新文章

  1. centos7.x/RedHat7.x重命名网卡名称
  2. 小数量宽带用户的福音,Panabit 云计费easyradius 接口隆重发布,PA宽带计费系统
  3. Android创建桌面快捷图标
  4. DB2 WIN7 WIN8在指示的文件系统中找不到数据库目录
  5. Spring中的创建与销毁
  6. Signal and Slots
  7. 4_SSRF
  8. 【The Time Traveller's Wife】
  9. mac与windows共享键盘鼠标(synergy)
  10. Sql server not in优化
  11. 【AGC013C】Ants on a Circle 弹性碰撞
  12. kali sudo apt install 无法定位软件包
  13. 用Redis作Mysql数据库缓存
  14. numpy random
  15. elastalert邮件报警
  16. centos安装dlib
  17. Spring IOC 容器源码分析
  18. Donsen法则
  19. 基于Python的信用评分卡模型分析(一)
  20. 【BZOJ】【1014】【JLOI2008】火星人prefix

热门文章

  1. Python开发环境Wing IDE的Blender的Python代码调试技巧
  2. Java -GUI开发九九乘法表
  3. [topcoder]TheGridDivTwo
  4. Maven报错:Missing artifact jdk.tools:jdk.tools:jar:1.6
  5. webpack了解
  6. MySQL入门很简单: 7 触发器
  7. 二维码生成的WEB api方法
  8. cocos2d-x推断sprite点击
  9. 快算24点,POJ(3983)
  10. nbu8.1配置群集SQL Server实例的备份