配置msf连接postgresql数据库

本文详细介绍了BackTrack 5 R3版本中Metasploit升级后常见的Ruby库错误,提供了包括检查PostgreSQL端口、配置数据库参数、启动msf专业版等在内的解决方案,帮助读者解决Metasploit在使用过程中遇到的问题。

  BackTrack 5 R3版本的Metasploit在每次的升级后总会出现奇奇怪怪的错误,主要是Ruby的库出错,网上找了一些解决的办法,但每次更新后又会出错,蛋碎。

  解决方法:

  BackTrack 5中默认自动开启端口7337。

1、查看PostgreSQL端口是否开启:

root@bt:~# netstat -tnpl |grep postgres

 

如果没有开启输入service postgresql start开启:

root@bt:~# service postgresql start

 2、查看msf的配置,里面有数据库用户和密码

root@bt:~# cat /opt/metasploit/config/database.yml

#
# These settings are for the database used by the Metasploit Framework
# unstable tree included in this installer, not the commercial editions.
#
development:
adapter: "postgresql"
database: "msf3dev"
username: "msf3"
password: "4bfedfc2"
port: 7337
host: "localhost"
pool: 256
timeout: 5

production:
adapter: "postgresql"
database: "msf3dev"
username: "msf3"
password: "4bfedfc2"
port: 7337
host: "localhost"
pool: 256
timeout: 5

 

3、开启msf专业版
 

# /opt/metasploit/msfpro

 

4、查看连接状态:

db_status

5、连接数据库:

db_connect用户名:口令@服务器地址:端口/数据库名称
db_connect msf3:4bfedfc2@127.0.0.1:7337/msf3

 

6、使用hosts命令检查数据库是否可以正常使用。

msf > hosts

 

 

7、使用db_disconnect命令可以断开与数据库的链接:

 

转载于:https://www.cnblogs.com/Heta/p/10485690.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值