加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Metasploit控制台连接postgresql数据库问题

发布时间:2020-12-13 17:39:36 所属栏目:百科 来源:网络整理
导读:在BT5R3平台上,针对Metasploit控制台,使用db_connect postgres:toor@127.0.0.1/msfbook连接postgresql报错解决方法: 1.提示端口错误。 BT5R3上默认安装的postgresql监听端口是7337。 解决方法: ①db_connect postgres:toor@127.0.0.1:7337/msfbook ②修

在BT5R3平台上,针对Metasploit控制台,使用db_connect postgres:toor@127.0.0.1/msfbook连接postgresql报错解决方法:

1.提示端口错误。

BT5R3上默认安装的postgresql监听端口是7337。

解决方法:

①db_connect postgres:toor@127.0.0.1:7337/msfbook

②修改/opt/metasploit/postgresql/data/postgres.conf中port = 5432

2.提示密码错误。

本人未找到默认用户postgres的密码,因此采用如下方法破解。

修改/opt/metasploit/postgresql/data/pg_hba.conf

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust

把md5方式修改为trust后,重启postgresq数据库,使用postgres无需密码即可登录。
3.提示ENCODING错误。

使用UTF8编码新建数据库。

createdb msfbook -E UTF8 -T templat0

此时,敲入db_connect postgres@127.0.0.1/msfbook会有一堆创建数据表的语句输出,表明执行无问题。使用db_status检查,提示正常。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读