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

Kali2017 Metasploit连接postgresql数据库的更多相关文章

  1. bt5 r3下metasploit连接postgresql数据库

    一.查看PostgreSQL使用的端口,默认为7337 #: netstat -tnpl |grep postgres 二.查看Msf配置,里面有默认的用户名和密码 默认配置文件:/opt/metas ...

  2. kali linux 系列教程之metasploit 连接postgresql可能遇见的问题

    kali linux 系列教程之metasploit 连接postgresql可能遇见的问题 文/玄魂   目录 kali linux 下metasploit 连接postgresql可能遇见的问题. ...

  3. msf连接PostgreSQL数据库

    一.启动PostgreSQL服务######################################################################?root@root:~# ...

  4. ASP.NET MVC 使用 Petapoco 微型ORM框架+NpgSql驱动连接 PostgreSQL数据库

    前段时间在园子里看到了小蝶惊鸿 发布的有关绿色版的Linux.NET——“Jws.Mono”.由于我对.Net程序跑在Linux上非常感兴趣,自己也看了一些有关mono的资料,但是一直没有时间抽出时间 ...

  5. 视频教程--ASP.NET MVC 使用 Petapoco 微型ORM框架+NpgSql驱动连接 PostgreSQL数据库

    说好的给园子里的朋友们录制与<ASP.NET MVC 使用 Petapoco 微型ORM框架+NpgSql驱动连接 PostgreSQL数据库> 这篇博客相对应的视频,由于一个月一来没有时 ...

  6. Entity Freamwork 6连接PostgreSql数据库

    原文 Entity Freamwork 6连接PostgreSql数据库 开发环境 VS 2015  Update 1   Postgre Sql 9.4 使用过程 1.使用Nuget在项目中添加对E ...

  7. Abp.NHibernate连接PostgreSQl数据库

    Abp.NHibernate动态库连接PostgreSQl数据库 初次接触Abp框架,其框架中封装的操作各类数据的方法还是很好用的,本人还在进一步的学习当中,并将利用abp.NHibernate类库操 ...

  8. typescript-koa-postgresql 实现一个简单的rest风格服务器 —— 连接 postgresql 数据库

    接上一篇,这里使用 sequelize 来连接 postgresql 数据库 1.安装 sequelize,数据库驱动 pg yarn add sequelize sequelize-typescri ...

  9. powerdesigner连接postgresql数据库生成pdm及word文档

    1.准备软件: powerdesigner165与postgresql的驱动:psqlodbc_11_01_0000 2.安装并破解完成powerdesigner165 参看链接:https://ww ...

随机推荐

  1. angularjs ng-if 慎用 备忘

    ng-if.ng-show一般情况下可以通用,二者的最明显区别就是: ng-if判断为false时,页面dom节点不会被创建,其子节点下也不会渲染,从而也就加快了dom的加载速度:ng-show则仅是 ...

  2. lucene中文学习地址推荐

    Lucene原理与代码分析http://www.cnblogs.com/forfuture1978/category/300665.html Lucene5.5学习(1)-初尝Lucene全文检索引擎 ...

  3. Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b

    Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b ...

  4. 如何在SecureCRT中给linux上传和下载文件

    方法/步骤     需要上传或者下载,需要使用rz和sz命令.如果linux上没有这两个命令工具,则需要先安装.可以使用yum安装.运行命令yum install lrzsz.   安装完成后就可以使 ...

  5. Do not set "root" as "NOPASSWD" in sudoers file

    cat /etc/sudoers root    ALL=(ALL)ALL: ALL do not change it to root    ALL=(ALL)NOPASSWD: ALL Since ...

  6. Redis 基础概念和命令

    Redis 是什么 Redis是一种基于键值对(key-value)的NoSQL数据库. 为什么使用Redis 速度快 Redis的时间颗粒度一般是微秒,慢查询的默认值是10 000微秒,即10毫秒. ...

  7. 笨办法学Python(二十一)

    习题 21: 函数可以返回东西 你已经学过使用 = 给变量命名,以及将变量定义为某个数字或者字符串.接下来我们将让你见证更多奇迹.我们要演示给你的是如何使用 = 以及一个新的 Python 词汇ret ...

  8. 关于(void**)及其相关的理解

    #define LOADBASSFUNCTION (f) *((void **)&f)=(void*)GetProcAddress (hBass,# f) 这一句话使用*((void**)&a ...

  9. ARM实验3 ——串口实验

    uart串口实验 实验内容: 编写UART模块程序,通过串口将信息打印到终端. 实验目的: 熟悉开发环境的使用. 掌握exynos4412处理器的UART功能. 实验平台: FS4412开发板,ecl ...

  10. Socket的基本使用步骤

    Socket的基本使用步骤 一.使用Socket,首先需要导入这几个系统头文件 #import <sys/socket.h> #import <netinet/in.h> #i ...