今天做了一下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. 【PAT甲级】1016 Phone Bills (25 分)(结构体排序)

    题意: 输入24个正整数代表从0到23每个小时通话一分钟花费的美分.输入一个正整数N(<=1000),然后输入N组字符串,每个字符串包含客户的名字和通话的时刻以及打出或者挂断的状态. 按照字典序 ...

  2. SystemVerilog for design 笔记(二)

    转载请标明出处 1. System Verilog文本值和数据类型 1.1. 增强的文本值赋值 相对于verilog,SV在文本值赋值时可以1.无需指定进制    2.赋值可以是逻辑1 用法: reg ...

  3. 怎样把exe程序注册成系统服务

    怎样把exe程序注册成系统服务 最近一段时间我们公司开发一款新的产品,要在服务器上运行一个服务端程序,为了方便我就希望能将这个程序注册成系统服务开机自动启动而不用每次重启系统都要手动启动程序.要实现这 ...

  4. Java程序基本优化

    1.尽量指定类的final修饰符,因为带有final修饰符的类是不可派生的. 2.尽量重用对象. 3.尽量使用局部变量. 4.不要重复初始化变量. 5.在Java+Oracle的应用系统开发中,Jav ...

  5. .NET List<T>Conat vs AddRange

    最大的不同在于AddRange改变了它所调用的列表,而Concat创建了一个新的List.因此它们有不同的用途. Concat也是一种适用于任何IEnumerable的扩展方法,并返回一个IEnume ...

  6. 2018 蓝桥杯省赛 B 组模拟赛

    C. 结果填空:U型数字 最近蒜头君喜欢上了U型数字,所谓U型数字,就是这个数字的每一位先严格单调递减,后严格单调递增.比如 212 就是一个U型数字,但是 333, 98, 567, 3131,就是 ...

  7. Centos7 VNC远程桌面服务安装配置

    1.服务器版本 CentOS Linux release 7.7.1908 (Core) 首先系统安装了GUI界面 # ln -sf /lib/systemd/system/graphical.tar ...

  8. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:在元素获取焦点时显示(如:键盘操作的用户)

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  9. Intend之属性extra

    我们这次想要实现的功能是从A活动跳到B活动时,A活动中有一个输入框和一个按钮,当点击按钮是时会跳到B活动,然后把A活动中的输入框的内容传到B活动中,且在B活动中的TextView中显示 A活动中先添加 ...

  10. 一道综合渗透题引发的updatexml()注入思考

    MYSQL数据库updatexml报错注入UPDATEXML (XML_document, XPath_string, new_value); 第一个参数:XML_document是String格式, ...