zoukankan      html  css  js  c++  java
  • Kali2017 Metasploit连接postgresql数据库

    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: 5432
      pool: 5
      timeout: 5
    
    production:
      adapter: postgresql
      database: msf
      username: msf
      password: EUsDzzKRsyxvmwmPI+dZ2KF1rojkKeEKqNRvNbV7LdY=
      host: localhost
      port: 5432
      pool: 5
      timeout: 5
    
    test:
      adapter: postgresql
      database: msf_test
      username: msf
      password: EUsDzzKRsyxvmwmPI+dZ2KF1rojkKeEKqNRvNbV7LdY=
      host: localhost
      port: 5432
      pool: 5
      timeout: 5

    5、启动或重启msf

    root@kali:~# msfconsole
                                                      
    
     ______________________________________________________________________________
    |                                                                              |
    |                          3Kom SuperHack II Logon                             |
    |______________________________________________________________________________|
    |                                                                              |
    |                                                                              |
    |                                                                              |
    |                 User Name:          [   security    ]                        |
    |                                                                              |
    |                 Password:           [               ]                        |
    |                                                                              |
    |                                                                              |
    |                                                                              |
    |                                   [ OK ]                                     |
    |______________________________________________________________________________|
    |                                                                              |
    |                                                       https://metasploit.com |
    |______________________________________________________________________________|
    
    
           =[ metasploit v4.15.5-dev                          ]
    + -- --=[ 1673 exploits - 959 auxiliary - 294 post        ]
    + -- --=[ 489 payloads - 40 encoders - 9 nops             ]
    + -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]
    
    msf > db_status
    [*] postgresql connected to msf
  • 相关阅读:
    加快火狐启动速度的几种方法 Leone
    我国的社保到底是多交好,还是少交好? Leone
    “情商”和“智商”究竟有哪些区别? Leone
    Atitti 知识图谱构建方法attilax 总结
    Atitit 知识图谱的数据来源
    Atitit java 二维码识别 图片识别
    Atitit 跨平台异常处理(2)异常转换 java c# js异常对象结构比较and转换
    Atitit 异常机制与异常处理的原理与概论
    Atitti knn实现的具体四个距离算法 欧氏距离、余弦距离、汉明距离、曼哈顿距离
    屏幕取词技术实现原理
  • 原文地址:https://www.cnblogs.com/captainRoB/p/7376743.html
Copyright © 2011-2022 走看看