MetaSploit常用功能之信息蒐集

專業術語:

1、滲透攻擊exploit

2、攻擊負載(payload):攻擊者在目標上執行的一段攻擊代碼,該代碼具有返彈連接,創建用戶,執行其他系統命令的功能。

3、shellcode:目標機器上運行的一段機器指令,成功執行後會返回一個shell。

4、模塊(module):是指MetaSploit框架中所使用的一段軟件代碼組件。

5、監聽器(listener):監聽器是metasploit中用來等待介入網絡連接的組件。

 

一、使用msfconsole即可打開msf命令控制接口

二、輸入help查看幫助菜單

三、常用參數介紹:

1、back返回上一級目錄。

2、connect連接主機連接網絡。

3、edit用來編輯模塊。

4、exit退出。

5、get查看變量。

6、getg查看全局變量。

7、go_pro進入metasploit圖形界面。

8、jobs查看使用了哪些模塊。

9、kill殺死一個工作。

10、load加載一些插件。

11、route用來做跳板,隱藏真實ip。

12、quit管理窗口。

13、save保存活躍數據。

14、search搜索功能,可以搜索漏洞利用模塊等。

15、sessions選擇會話。

16、set 設置選項參數。

17、show options查看模塊需要配置哪些選項。

18、unset就是不設置。

19、use 使用模塊。

四、啓動設置

service postgresql start

service metasploit start

msfconsole

db_status查看數據庫連接情況

workspace -a(-d) test 創建\刪除一個工作臺

workspace test進入工作臺

使用nmap:

db_map -sS ip地址 掃描主機

db_export 1.xml 導出掃描結果

db_import 1.xml導入掃描結果

hosts 查看掃描結果

五、信息蒐集

whois ip

nmap使用:

1、-sS SYN半開掃描

2、-s TTCP半開掃描

3、-Pn 不使用ping方式探測主機 

4、-A 探測服務類型

5、-6 開啓IPV6掃描

6、-O 探測操作系統版本

常用組合:

1、nmap -sS -Pn 192.168.1.1

2、nmap -sS -A192.168.1.1

3、nmap -T4 -A-v 深入式掃描

4、nmap -sS -sU -T4 -A-v 同上,且掃描UDP

5、nmap -p 1-65535 -T4 -A-v 掃描所有TCP端口

6、nmap -T4 -A-v -Pn不使用ping

7、nmap -sn 使用ping

8、nmap -T4 -F 快速掃描

9、nmap -sV-T4 -O -F --version-light 加強版快速掃描

10、nmap -sn --traceroute 快速路由跟蹤掃描

11、nmap -sS -sU -T4 -A-v -PE -PP-PS80,443 -PA3389 -PU40125 -PY -g 53 --script "defalut or (discovery andsafe)"慢速全面掃描

 

MSF與postgresql協同工作

/etc/init.d/postgresql-8.3 start

msf>

db_connect postgres:[email protected]/msf

db_status

導入nmap掃描的結果:

nmap -sS -Pn -A-oX subnet1 192.168.1.0/24 # -oX 掃描結果導出爲Subnet1.xml

db_import Subnet1.xml

db_hosts -c address #查看導入的主機ip

也可以連接mysql,bt5 r1版本的msf支持連接mysql:

db_driver mysql

db_connectroot:[email protected]/msf3 #連接本機mysql的msf3數據庫

mysql默認密碼toor,使用db_connect 連接時會自動創建msf3數據庫

 

高級掃描方法:

use auxiliary/scanner/ip/ipidseq #IPID序列掃描器,與nmap的-sI -O選項類似

show options

set RHOSTS 192.168.1.0/24

set RPORT 8080

set THREADS 50

run

參數可小寫

map連接數據庫掃描:

db_nmap -sS -A192.168.1.1

db-services  查看掃描結果

 

使用portgresql模塊

search postscan

use auxiliary/scanner/postscan/syn

set RHOSTS 192.168.1.1

set THREADS 50

run

 

特定掃描:

smb-version 模塊:掃描網段

use auxiliary/scanner/smb/smb_version

show options

set RHOSTS 192.168.1.1

run

db_hosts -c address,os_flavor

 

掃描sqlserber主機:

use auxiliary/scanner/mssql/mssql_ping

show options 

set rhosts 192.168.1.0/24

set threads 255

run

 

ssh服務器掃描:

use auxiliary/scanner/ssh/ssh_version

set rhosts 192.168.1.0/24

set threads 50

run

 

telnet服務器掃描:

use auxiliary/scanner/telnet/tenet_version

set rhosts 192.168.1.0/24

set threads 50

run

 

ftp主機掃描:

use auxiliary/scanner/ftp/ftp_version

set rhosts 192.168.1.0/24

set threads 255

run

 

掃描ftp匿名登錄:

use auxiliary/scanner/ftp/anonymous

set rhosts 192.168.1.0/24

set threads 255

run

 

掃描局域網內有哪些主機存活

use auxiliary/scanner/discovery/arp_sweep

set rhosts 192.168.1.0/24

set threads 255

run

 

掃描網站目錄:

use auxiliary/scanner/http/dir_scanner

set rhosts 192.168.1.0/24

set threads 255

run

 

掃描SNMP主機:

use auxiliary/scanner/snmp/snmp_login

set rhosts 192.168.1.0/24

set threads 255

run

 

掃描網站中的E-mail地址:

search_email_collector

use auxiliary/gather/search_email_collector

set DOMAIN baidu.com

run

 

嗅探抓包:

use auxiliary/scanner/sniffer/psnuffle

run

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章