Exp6 信息蒐集與漏洞掃描
<a name="1"></a>git
目錄
<a name="2"></a>shell
<h1 align="center">基礎問題回答</h1>
<a name="2.1"></a>數據庫
(1)哪些組織負責DNS,IP的管理。瀏覽器
- 全球根服務器均由美國政府受權的ICANN統一管理,負責全球的域名根服務器、DNS和IP地址管理。
- 全球一共有5個地區性註冊機構:ARIN主要負責北美地區業務,RIPE主要負責歐洲地區業務,APNIC主要負責亞太地區業務,LACNIC主要負責拉丁美洲美洲業務,AfriNIC負責非洲地區業務。
<a name="2.2"></a>服務器
(2)什麼是3R信息。網絡
- 3R是三個以R字母開頭的單詞,分別爲:
- 註冊人(Registrant),註冊商(Registrar),官方註冊局(Registry) <a name="2.3"></a>
(3)評價下掃描結果的準確性。oracle
<font face="宋體" size=4>返回目錄</font>ssh
<a name="4"></a>ide
<h1 align="center">實踐過程記錄</h1>
<a name="4.1"></a>工具
(1)各類搜索技巧的應用
①Google Hacking
- 解釋:Google提供了高級搜索功能。GHDB數據庫包含了大量使用Google從事滲透的搜索字符串。其中包含了不少經常使用的模塊,還有咱們以前使用過的各個平臺下的shellcode,也能夠從這裏獲取。
![](http://static.javashuo.com/static/loading.gif)
②搜索網址目錄結構
- 解釋:利用metasploit的dir_scanner輔助模塊,暴力猜解,獲取網站目錄結構。
- 方法:
- msfconsole
- msf > use auxiliary/scanner/http/dir_scanner
- msf auxiliary(scanner/http/dir_scanner) > set THREADS 50
- msf auxiliary(scanner/http/dir_scanner) > set RHOSTS www.baidu.com
- msf auxiliary(scanner/http/dir_scanner) > exploit
我發現了百度網站下的這兩個目錄:
![](http://static.javashuo.com/static/loading.gif)
③檢測特定類型的文件
- 解釋:有些網站會連接通信錄,訂單等敏感的文件,能夠進行鍼對性的查找
- 方法:
- 百度
site:edu.cn filetype:xls
,會出現一堆文件格式爲XLS/Microsoft Excel的網址
- 點擊某個網址,直接提示下載該文件,下載後打開,就能夠得到某些信息了,好比我下載的這個就包含了陝西師範大學2009-2010學年的評優評先信息。
- 若是咱們想在格式搜索的基礎上加關鍵字,能夠用
site:edu.cn filetype:xls 大學
來搜索與大學有關的XLS文件
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
④使用tracert命令進行路由偵查
- 解釋:tracert可用於對通過的路由進行探測
- 方法:輸入命令
tracert www.baidu.com
![](http://static.javashuo.com/static/loading.gif)
<font face="宋體" size=4>返回目錄</font>
<a name="4.2"></a>
(2)DNS IP註冊信息的查詢
①whois查詢
- 解釋:whois用來進行域名註冊信息查詢。
- 方法:在終端輸入
whois gitee.com
可查詢到3R註冊信息,包括註冊人的姓名、組織和城市等信息。
- 注意:進行whois查詢時去掉www等前綴,由於註冊域名時一般會註冊一個上層域名,子域名由自身的域名服務器管理,在whois數據庫中可能查詢不到。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
②nslookup,dig域名查詢
- 解釋:nslookup能夠獲得DNS解析服務器保存的Cache的結果,但並非必定準確的。dig能夠從官方DNS服務器上查詢精確的結果。
- 方法:在終端輸入
nslookup gitee.com
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
除此以外,dig命令還有不少查詢選項,每一個查詢選項被帶前綴(+)的關鍵字標識。例如:
- +[no]search:使用 [不使用] 搜索列表或 resolv.conf 中的域僞指令(若是有的話)定義的搜索列表。缺省狀況不使用搜索列表。
- +[no]trace:切換爲待查詢名稱從根名稱服務器開始的代理路徑跟蹤。缺省狀況不使用跟蹤。一旦啓用跟蹤,dig 使用迭代查詢解析待查詢名稱。它將按照從根服務器的參照,顯示來自每臺使用解析查詢的服務器的應答。
- +[no]identify:當啓用 +short 選項時,顯示 [或不顯示] 提供應答的 IP 地址和端口號。
- +[no]stats:該查詢選項設定顯示統計信息:查詢進行時,應答的大小等等。缺省顯示查詢統計信息。
- ......
嘗試下+trace查詢選項:
- 方法:在終端輸入
dig gitee.com +trace
![](http://static.javashuo.com/static/loading.gif)
③IP2Location 地理位置查詢
- 解釋:www.maxmind.com網站能夠根據IP查詢地理位置。
- 方法:打開網站網頁->能夠利用
ping www.baidu.com
的返回信息查看網站的IP地址->在網站下方輸入IP->點擊前往查看結果
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
- 解釋:IP-ADDRESS這個網站能夠查詢到更詳細的關於某共有IP的信息
- 方法:在下圖的IP地址輸入框中輸入想要查詢的IP,如百度的IP: 61.135.169.121
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
④IP2反域名查詢
- 解釋:shodan搜索引擎能夠進行反域名查詢,能夠搜索到該IP的地理位置、服務佔用端口號,以及提供的服務類型.
- 方法:在上方搜索框輸入IP
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
<font face="宋體" size=4>返回目錄</font>
<a name="4.3"></a>
(3)基本的掃描技術:主機發現、端口掃描、OS及服務版本探測、具體服務的查點
①主機發現
3.1ping
- 解釋:ping命令用發送ICMP報文的方法檢測活躍主機
- 方法:輸入命令
ping www.baidu.com
![](http://static.javashuo.com/static/loading.gif)
3.2metasploit中的ARP掃描器 udp_sweep 模塊
- 解釋:arp_sweep使用ARP請求枚舉本地局域網的活躍主機,即ARP掃描器 udp_sweep 使用UDP數據包探測。
- 方法:
- msfconsole
- msf > use auxiliary/scanner/discovery/arp_sweep //進入arp_sweep 模塊
- msf auxiliary(scanner/discovery/arp_sweep) > show options //查詢模塊參數
- msf auxiliary(scanner/discovery/arp_sweep) > set RHOSTS 10.10.10.0/24 //用set進行hosts主機段設置
- msf auxiliary(scanner/discovery/arp_sweep) > set THREADS 50 //加快掃描速度
- msf auxiliary(scanner/discovery/arp_sweep) > run //執行run進行掃描
![](http://static.javashuo.com/static/loading.gif)
3.3nmap -sn
- 解釋:nmap -sn參數能夠用來探測某網段的活躍主機
- 方法:輸入命令
nmap -sn 192.168.130.0/24
![](http://static.javashuo.com/static/loading.gif)
②端口掃描
3.4nmap -PU
- 解釋:nmap -PU參數是對UDP端口進行探測,與udp_sweep模塊功能相同。
- 方法:輸入命令
nmap -PU 192.168.130.0/24
![](http://static.javashuo.com/static/loading.gif)
③OS及服務版本探測
3.5nmap -O
- 解釋:nmap -O選項讓Nmap對目標的操做系統進行識別,獲取目標機的操做系統和服務版本等信息
- 方法:輸入命令
nmap -O 192.168.199.196
![](http://static.javashuo.com/static/loading.gif)
3.6nmap -sV
- 解釋:nmap -sV查看目標主機的詳細服務信息
- 方法:輸入命令
nmap -sV -Pn 192.168.199.196
,其中-Pn是在掃描以前,不發送ICMP echo請求測試目標
![](http://static.javashuo.com/static/loading.gif)
④具體服務的查點
網絡服務掃描
3.7 Telnet服務掃描
- 解釋:telnet命令用於登陸遠程主機,對遠程主機進行管理。
- 方法:
- msfconsole
- msf > use auxiliary/scanner/telnet/telnet_version //進入telnet模塊
- msf auxiliary(telnet_version) > set RHOSTS 192.168.130.0/24 //掃描192.168.130.0網段
- msf auxiliary(telnet_version) > set THREADS 100 //提升查詢速度
- msf auxiliary(telnet_version) > run
![](http://static.javashuo.com/static/loading.gif)
3.8 SSH服務掃描
- 方法:
- msfconsole
- msf > use auxiliary/scanner/ssh/ssh_version
- msf auxiliary(ssh_version) > show options
- msf auxiliary(ssh_version) > set RHOSTS 192.168.130.0/24
- msf auxiliary(ssh_version) > set THREADS 200
- msf auxiliary(ssh_version) > run
![](http://static.javashuo.com/static/loading.gif)
3.9 Oracle數據庫服務查點
- 方法:
- msfconsole
- msf > use auxiliary/scanner/oracle/tnslsnr_version
- msf auxiliary(scanner/oracle/tnslsnr_version) > show options
- msf auxiliary(scanner/oracle/tnslsnr_version) > set RHOSTS 192.168.130.0/24
- msf auxiliary(scanner/oracle/tnslsnr_version) > set THREADS 200
- msf auxiliary(scanner/oracle/tnslsnr_version) > run
![](http://static.javashuo.com/static/loading.gif)
3.10 口令猜想與嗅探
- 首先從網上社工庫下載破解的字典password.txt
- 再運行以下命令:
- msfconsole
- msf > use auxiliary/scanner/ssh/ssh_login //進入ssh_login模塊
- msf auxiliary(scanner/ssh/ssh_login) > set RHOSTS 192.168.130.0/24 //設置目標IP或IP段
- msf auxiliary(scanner/ssh/ssh_login) > set USERNAME root //設置目標系統的管理員帳號
- msf auxiliary(scanner/ssh/ssh_login) > set PASS_FILE /root/password.txt //設置破解的字典
- msf auxiliary(scanner/ssh/ssh_login) > set THREADS 200 //提升查詢速度
- msf auxiliary(scanner/ssh/ssh_login) > run
<font face="宋體" size=4>返回目錄</font>
<a name="4.4"></a>
(4)漏洞掃描:會掃,會看報告,會查漏洞說明,會修補漏洞
第一步 檢查安裝狀態,開啓VAS
運行openvas-check-setup
錯誤提示1:
![](http://static.javashuo.com/static/loading.gif)
執行openvasmd --migrate
和openvas-check-setup
錯誤提示2:
![](http://static.javashuo.com/static/loading.gif)
執行openvas-manage-certs -a -f
(這個-f參數是根據運行後提示添加的)和openvas-check-setup
錯誤提示3: ![](http://static.javashuo.com/static/loading.gif)
執行openvasmd
和openvas-check-setup
安裝成功: ![](http://static.javashuo.com/static/loading.gif)
使用openvas-start
開啓服務,會自動打開瀏覽器主頁https://127.0.0.1:9392
提示是這樣的:
![](http://static.javashuo.com/static/loading.gif)
點擊「Advanced」->「Add Exception」->"Confirm Sercurity Exception"
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
而後能夠成功訪問網頁,點擊「Login」:
![](http://static.javashuo.com/static/loading.gif)
第二步:新建任務,開始掃描
- 在菜單欄選擇"Scans"->"Tasks"
- 進入後點擊紫色煙花"Task Wizard"新建一個任務嚮導,在欄裏輸入待掃描主機的IP地址"172.20.10.2",並單擊"Start Scans"確認,開始掃描。
![](http://static.javashuo.com/static/loading.gif)
第三步:查看並分析掃描結果
打開該掃描結果的詳細信息,並點擊其中的「Full and fast」:
![](http://static.javashuo.com/static/loading.gif)
點擊進入Buffer overflow查看詳細結果,其中標註了漏洞的危險等級:
![](http://static.javashuo.com/static/loading.gif)
點開一個危險等級較高的漏洞:
![](http://static.javashuo.com/static/loading.gif)
詳細描述以下: ![](http://static.javashuo.com/static/loading.gif)
Summary是該漏洞的描述,意思是該主機運行的3CTFTPSVC TFTP服務器,容易出現緩衝區溢出漏洞。 ![](http://static.javashuo.com/static/loading.gif)
Solution是關於該漏洞的解決方案:該漏洞至少一年內沒有解決方案或修補程序。這個網站可能不會再提供解決方案了。通常解決方案是升級到一個較新的版本,禁用各自的功能,刪除產品或更換產品的另外一個。
<font face="宋體" size=4>返回目錄</font>
<a name="3"></a>
<h1 align="center">實驗總結與體會</h1>
經過本次實驗,我學會了如何利用各類工具對主機、端口、操做系統、網絡服務進行掃描,瞭解瞭如何利用工具進行信息蒐集,此外還掌握了漏洞的掃描和分析的基本方法,收益匪淺。
經過本身動手實踐,實現了惡意代碼攻擊的前期掃描工做,更加貼近實戰流程,爲後序操做奠基了堅實的基礎。
<font face="宋體" size=4>返回目錄</font>