今天做了一下msf连接数据库的配置,中间碰到了一些坑点这里就不详细叙述了,开始正确的操作方式。

首先对postgresql进行配置以方便连接。

root@kali:~# service postgresql start                       #启动数据库
root@kali:~# service postgresql status                      

root@kali:~# sudo -u postgres psql
psql (10.1)
输入 "help" 来获取帮助信息.

postgres=# alter user postgres password 'admin';
ALTER ROLE
postgres=# \q

root@kali:~# msfconsole                                           #测试数据库连接状态
### ###
msf > db_connect msf:admin@localhost/msf
[*] Rebuilding the module cache in the background...
msf > db_status
[*] postgresql connected to msf
msf > search 2015-0531
[!] Module database cache not built yet, using slow search #这里要稍等一下才会正常,可以考虑关闭应用重启一下
msf > exit
修改数据库文件:postgresql.conf和pg_hba.conf
文件第一处(59行)

文件第二处   (88行)

第二个文件最会添加。

在文档最后添加

连接数据库

这里因为之前有msf了所以从新创一个msf4(正常的可略过)

这里如果没有database.yml文件可以先cp database.yml.example database.yml  然后进行修改。

root@kali:/usr/share/metasploit-framework/config# cp database.yml.example database.yml
root@kali:/usr/share/metasploit-framework/config# vi database.yml
root@kali:/usr/share/metasploit-framework/config# cat database.yml
# Please only use postgresql bound to a TCP port.
# Only postgresql is supportable for metasploit-framework
# these days. (No SQLite, no MySQL).
#
# To set up a metasploit database, follow the directions hosted at:
# http://r-7.co/MSF-DEV#set-up-postgresql
development: &pgsql
adapter: postgresql
database: msf #修改这里
username: msf #这里
password: admin #还有这里
host: localhost
port: 5432
pool: 5 #这里看心情
timeout: 5
# You will often want to seperate your databases between dev
# mode and prod mode. Absent a production db, though, defaulting
# to dev is pretty sensible for many developer-users.
production: &production
<<: *pgsql
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
#
# Note also, sqlite3 is totally unsupported by Metasploit now.
test:
<<: *pgsql
database: metasploit_framework_test
username: metasploit_framework_test
password: ___________________________

  最后如重新启动msf就可以了,当然还可以在配置下数据库自动开启

root@kali:~# systemctl start postgresql
root@kali:~# systemctl enable postgresql
root@kali:~# msfconsole       #进入msf看效果
### ### msf > db_status [*] postgresql connected to msf msf > search CVE-2015-0311 Matching Modules ================ Name Disclosure Date Rank Description ---- --------------- ---- ----------- exploit/multi/browser/adobe_flash_uncompress_zlib_uaf 2014-04-28 great Adobe Flash Player ByteArray UncompressViaZlibVariant Use After Free msf >
 

msf自动连接postgresql配置的更多相关文章

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

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

  2. 最新发布树莓派2代Wi-Fi自动连接实战(适合初学者)

    话说天地会珠海分舵在上几天才刚给大家分享了个海外资讯说树莓派2已经发布且Windows10加盟之类的资讯,具体请查看<海外优秀资讯抢先看8 - Windows 10 for Raspberry ...

  3. msf连接PostgreSQL数据库

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

  4. linux环境下搭建osm_web服务器一(Postgresql配置及osm2pgsql原始数据导入):

    Postgresql配置及osm2pgsql原始数据导入 2012年,Ubuntu 12.04LTS发布,又一个长效支持版,我们又该更新OpenStreetMap服务器了,这次,将详细在博客中记录配置 ...

  5. prometheus使用postgresql-adapter连接postgresql

    概述 Prometheus使用postgresql需要使用postgresql-adapter进行数据转换.在安装postgresql-adapter之前需要安装2个扩展:pg_prometheus和 ...

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

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

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

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

  8. hibernate+mysql的连接池配置

    1:连接池的必知概念    首先,我们还是老套的讲讲连接池的基本概念,概念理解清楚了,我们也知道后面是怎么回事了. 以前我们程序连接数据库的时候,每一次连接数据库都要一个连接,用完后再释放.如果频繁的 ...

  9. DBCP连接池配置参数说明

    <!-- 数据源1 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicData ...

随机推荐

  1. 学习笔记(6)- pytext训练会话助手

    https://github.com/facebookresearch/pytext https://pytext.readthedocs.io/en/master/ https://pytext.r ...

  2. 关于hrf图的做法

    要拿matlab 的spm 包功能做 Model specification ,review and estimation specify1st level 第二张图是在建模以后,通过spm中的res ...

  3. 引入CSS的方式、link和@import的区别

    引入CSS的方式有四种:内联方式.嵌入方式.链接方式.导入方式. 内联方式 内联方式指的是直接在 HTML 标签中的 style 属性中添加 CSS. <div style="back ...

  4. 八大排序算法C++代码实现

    八大排序算法 概述 排序有内部排序和外部排序,内部排序是数据记录在内存中进行排序,而外部排序是因排序的数据很大,一次不能容纳全部的排序记录,在排序过程中需要访问外存. 我们这里说说八大排序就是内部排序 ...

  5. List模拟栈

    import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class Main<E ...

  6. 由Nginx反向代理引出的JCaptcha验证码验证失败的问题

    搜索关键字: 1)Windows本地开发正常,部署到Linux远程服务器上JCaptcha验证失败 2)Linux远程服务器上JCpatcha验证失败 3)Nginx反向代理后JCaptcha验证失败 ...

  7. [Write-up]BSides-Vancouver

    关于 下载链接 目标:拿到root用户目录下的flag.txt 全程无图! 信息收集 因为虚拟机网络是设置Host-only,所以是vmnet1这张网卡,IP段为192.168.7.1/24 nmap ...

  8. 【快学springboot】使用springboot发送邮件

    前言 在实际项目中,经常需要用到邮件通知功能.比如,用户通过邮件注册,通过邮件找回密码等:又比如通过邮件发送系统情况,通过邮件发送报表信息等等,实际应用场景很多.这篇文章,就教大家通过springbo ...

  9. 八 SpringMVC文件上传,必须设置表单提交为post

    1 修改Tomcat配置,本地目录映射 那么在server.xml中体现为: 测试一下是否设置成功: 2 引入jia包   3 配置多媒体解析器 3 jsp开启图片上传 4 Controller层设置 ...

  10. 【转】iPhone/IOS使用Fiddler抓包配置

    原文链接:https://blog.csdn.net/weixin_39198406/article/details/81123716 1. 安装 安装Fiddler软件2. 配置2.1 端口 点击 ...