msf连接PostgreSQL数据库
一、启动PostgreSQL服务
######################################################################
?root@root:~# service postgresql start ###启动PostgreSQL服务
?root@root:~# service postgresql status ###查看状态
?root@root:~# ss -ant ###执行成功后,可以通过ss -ant命令查看端口5432是否在侦听,去验证PostgreSQL服务是否成功开启。
######################################################################
二、msfconsole连接PostgreSQL数据库
######################################################################
连接方式1:
root@root:~# msfdb init ###初始化数据库
root@root:~# msfconsole ###打开msf
msf > db_status ###查看连接状态
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[*] postgresql connected to msf ###连接成功
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
msf > update-rc.d postgresql enable ###设置PostgreSQL服务开机自启
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[*] exec: update-rc.d postgresql enable ###使用命令update-rc.d postgresql enable将PostgreSQL服务添加至开机启动项中
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
######################################################################
注意:
!!!
msf > search ms08-067
[!] Module database cache not built yet, using slow search
? 提示这个信息,其实Metasploit已经连接上数据库,但是没有建立数据库缓存。
!!!
重新构建数据库缓存
? 这时,需要重新构建数据库缓存,在msf提示符下执行以下命令:
msf > db_rebuild_cache
[*] Purging and rebuilding the module cache In the background..
?#######################################################################
参考:https://www.jianshu.com/p/9c82ccb2aaf7
########################################################################
三、msfconsole手动连接PostgreSQL数据库
########################################################################
root@root:~# su postgres ###切换postgres账号
########################################################################
postgres@root:/root$ createuser test -P ###创建test账号,密码为test。
########################################################################
postgres@root:/root$ createdb --owner=test test ###owner参数指定数据库的所有者,赋予数据库的所有者为test,创建数据库为test。
########################################################################
msf > db_connect test:test@localhost/test ###进入msf,连接数据库。
########################################################################
最新文章
- noi往届题目泛做
- VS2013各个版本秘钥
- mysql python image
- Tomcat 内存和线程配置优化
- Hibernate-Criteria用法
- 每日一九度之 题目1042:Coincidence
- nbtstat -a <;IP>; 会显示主机名、所在工作组等信息
- 前后端差异更小了——浅谈ES(ECMAScript)6
- scn转换为十进制
- IOS 性能优化的建议和技巧
- 数据库基础(子查询练习、链接查询(join on 、union)及其练习)
- HTML5: Screen Orientation API
- Java8学习(4)-Stream流
- (七十六)CoreLocation(二)获取经纬度、速度、方向,进行区域监听
- asp.net core系列 59 Ocelot 构建基础项目示例
- css background-image 自适应宽高——转载
- 支持flash in Chrome 2017
- python 语言特性
- 【做题】CF285E. Positions in Permutations——dp+容斥
- python中序列化json模块和pickle模块