Msf 下连接数据库及安装
postgresql 图形化管理工具
启动 postgresql
root@kali:~# service postgresql start
Starting PostgreSQL 9.1 database server: main.
root@kali:~#
启动 metasploit
root@kali:~# service metasploit start
Configuring Metasploit...
Creating metasploit database user 'msf3'...
Creating metasploit database 'msf3'...
insserv: warning: current start runlevel(s) (empty) of script `metasploit' overrides LSB
defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `metasploit' overrides
LSB defaults (0 1 6).
Starting Metasploit rpc server: prosvc.
Starting Metasploit web server: thin.
Starting Metasploit worker: worker.
root@kali:~#
添加 postgresql 开机启动
root@kali:~# update-rc.d postgresql enable
update-rc.d: using dependency based boot sequencing
root@kali:~#
添加 metasploit 开机启动
root@kali:~# update-rc.d metasploit enable
update-rc.d: using dependency based boot sequencing
root@kali:~#
确保 PostgreSQL 启动监听 5432 端口
root@kali:~# netstat -tnpl|grep postgres
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
3739/postgres
tcp6 0 0 ::1:5432 :::* LISTEN
3739/postgres
root@kali:~#
查看连接 postgres 帐号密码
nano /opt/metasploit/apps/pro/ui/config/database.yml
development:
adapter: "postgresql"
database: "msf3"
username: "msf3"
password: "KIneFXI4X17UP5v90qzbt40Tjdai7e3p"
port: 5432
host: "localhost"
pool: 256
timeout: 5
production:
adapter: "postgresql"
database: "msf3"
username: "msf3"
password: "KIneFXI4X17UP5v90qzbt40Tjdai7e3p"
port: 5432
host: "localhost"
打开 MSF 控制台 (注:请耐心等待)
root@kali:~# msfconsole
[*] Starting the Metasploit Framework console...|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%% %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%
%% %% %%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%
%%
http://metasploit.pro %%%%%%%%%%%%%%%%%%%%%%%%%
%% %% %%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%
%% %%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%%%%% %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%
%
%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%
%%%% %% %%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% %%% %%%%%
%%%% %% %% % %% %% %%%%% % %%%% %% %%%%
%% %%
%%%% %% %% % %%% %%%% %%%% %% %%%% %%%% %% %% %% %%% %
% %%% %%%%%
%%%% %%%%%% %% %%%%%% %%%% %%% %%%% %% %% %%% %%%
%% %% %%%%%
%%%%%%%%%%%% %%%% %%%%% %% %% % %% %%%% %%%% %
%% %%% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% %%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
Taking notes in notepad? Have Metasploit Pro track & report
your progress and findings -- learn more on http://rapid7.com/metasploit
=[ metasploit v4.10.1-2014111001 [core:4.10.1.pre.2014111001 api:1.0.0]]
+ -- --=[ 1366 exploits - 755 auxiliary - 219 post ]
+ -- --=[ 340 payloads - 37 encoders - 8 nops ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]
msf >
连接数据库
msf > db_connect msf3:KIneFXI4X17UP5v90qzbt40Tjdai7e3p@localhost/msf3
[*] Rebuilding the module cache in the background...
msf >
查看数据库连接状态
msf > db_status
[*] postgresql connected to msf3 连接成功
msf >
MSF 中自带的 NMAP 调用
msf > db_connect msf3:KIneFXI4X17UP5v90qzbt40Tjdai7e3p@localhost/msf3
[*] Rebuilding the module cache in the background...
msf >
msf > db_nmap -sS -Pn -A -v -O 10.172.17.100
msf > services 查看扫描结果
Services
========
host port proto name state info
---- ---- ----- ---- ----- ----
10.172.17.100 135 tcp msrpc open Microsoft Windows RPC
10.172.17.100 139 tcp netbios-ssn open
10.172.17.100 445 tcp netbios-ssn open
10.172.17.100 902 tcp vmware-auth open VMware Authentication Daemon
1.10 Uses VNC, SOAP
10.172.17.100 912 tcp vmware-auth open VMware Authentication Daemon
1.0 Uses VNC, SOAP
10.172.17.100 49152 tcp msrpc open Microsoft Windows RPC
10.172.17.100 49153 tcp msrpc open Microsoft Windows RPC
10.172.17.100 49154 tcp msrpc open Microsoft Windows RPC
10.172.17.100 49156 tcp msrpc open Microsoft Windows RPC
10.172.17.100 49157 tcp msrpc open Microsoft Windows RPC
10.172.17.100 49159 tcp msrpc open Microsoft Windows RPC
msf >
安装 postgresql 图形化管理工具
root@kali:~# apt-get install pgadmin3
postgresql 图形化管理工具启动
如图:
启动后界面
如图:
添加服务器
如图:
添加成功
如图:
至此 postgresql 就可以用图形化管理了!!
至此本教程全部结束!!
如有问题请及时联系本人以下为联系方式:
QQ:847604969
QQ 群:378395218