內網DNS投毒技術劫持會話

 

 

 

 

工具列表:html

tcpdump
Ferret
Hamster
node
closurether

拓撲環境:node

攻擊機:Kali 10.10.10.237web

被攻擊機: win7 10.10.10.232npm

由於只爲了測試,只修改了PC1的DNSjson

0x01  node安裝緩存

wget http://nodejs.org/dist/v0.8.7/node-v0.8.7.tar.gz
tar zxvf node-v0.8.7.tar.gz 
root@192:~/node-v0.8.7# ./configure 
{ "target_defaults": { "cflags": [],
                       "default_configuration": "Release",
                       "defines": [],
                       "include_dirs": [],
                       "libraries": []},
  "variables": { "clang": 0,
                 "gcc_version": 47,
                 "host_arch": "ia32",
                 "node_install_npm": "true",
                 "node_install_waf": "true",
                 "node_prefix": "",
                 "node_shared_openssl": "false",
                 "node_shared_v8": "false",
                 "node_shared_zlib": "false",
                 "node_use_dtrace": "false",
                 "node_use_etw": "false",
                 "node_use_openssl": "true",
                 "target_arch": "ia32",
                 "v8_no_strict_aliasing": 1,
                 "v8_use_snapshot": "true"}}
creating  ./config.gypi
creating  ./config.mk
root@192:~/node-v0.8.7# make install

安裝完後,執行async

npm install -g closurether

 

若是出現錯誤tcp

SSL Error: SELF_SIGNED_CERT_IN_CHAIN工具

symlinking ../lib/node_modules/npm/bin/npm-cli.js -> /usr/local/bin/npm
updating shebang of /usr/local/bin/npm to /usr/local/bin/node
root@192:~/node-v0.8.7# npm install -g closurether
npm http GET https://registry.npmjs.org/closurether
npm http GET https://registry.npmjs.org/closurether
npm http GET https://registry.npmjs.org/closurether
npm ERR! Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN
npm ERR!     at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:440:26)
npm ERR!     at ClientRequest.g (events.js:185:14)
npm ERR!     at ClientRequest.EventEmitter.emit (events.js:88:17)
npm ERR!     at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1455:

找到解決方法是:測試

root@192:~/node-v0.8.7# npm install npm -g --ca=null
npm http GET https://registry.npmjs.org/npm
npm http 200 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/-/npm-1.4.26.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-1.4.26.tgz
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm@1.4.26 /usr/local/lib/node_modules/npm
root@192:~/node-v0.8.7# npm config set ca=""
root@192:~/node-v0.8.7# npm install -g closurether
/usr/local/bin/closurether -> /usr/local/lib/node_modules/closurether/bin/closurether
closurether@0.1.1 /usr/local/lib/node_modules/closurether
├── mkdirp@0.3.5
├── iconv-lite@0.2.11
└── uglify-js@2.3.6 (async@0.2.10, source-map@0.1.39, optimist@0.3.7)

再執行closurether已經正常。

這裏運行是 DNS走的流量經過本機的服務再轉發給訪問者。HTTP是正常的。遇到HTTPS會出現一些錯誤。也沒有找到什麼好的解決方式一塊兒共勉下。

如今配置好了,來測試一下。

修改下本機的DNS 。指向kali,用closurether來處理DNS信息。(修改DNS也能夠在路由上面進行修改。另外也能夠DHCP,自動獲取DNS的話能夠強制獲取到本身設置的DNS。怎麼實現你們能夠本身去測試,這裏就不討論了)

0x02  測試劫持

修改爲功後。能夠看到詳細的DNS信息與訪問信息。

 

 

這裏。咱們固然就用來node來進行JS注入了。

找一個這個文件js

find / -name extern.js

  

 

 加入測試內容

 

alert 彈出

加入後。會在默認的列表裏面自動加入JS,默認是全部的網站都會注入JS。JS是會緩存的。要清理緩存。也能夠new預加載。

想要加入js的url.自要在

 

/usr/local/lib/node_modules/closurether/tool/cache-sniffer

  

這個目錄裏面加入 就能夠了。

這裏的10086.cn僞造地址 具體想假裝成什麼地址,能夠在config.json裏配置。

JS裏面就是咱們修改的文件extern.js

這裏就能夠用js進行投毒。投入flash升級與下載exe識別替換與js得到主機的一些信息。(注意JS死循環)

0x03 實戰劫持

試一試劫持會話

tcpdump 監聽下eth0  生成cap

用ferret處理生成的cap文件 自動在目錄會長成一個hamster.txt.

在啓用hamster 代理

這樣就能夠劫持他們的會話了

這裏看不懂的能夠看看查查中間人攻擊。

劫持會話的kali上面集成了不少。如urlsnarf,Cookie Cadger(這種我以爲太方便)這裏我不演示這幾種了,你們能夠本身測試。

 

urlsnarf 劫持的話也只是處理下頭文件。

本機我訪問下QQ空間。

收到了urlsnarf裏面的信息

 

 咱們經過抓取到的信息。直接就能夠登錄到QQ空間。

在局域網利用信息是很方便的,還有沒有隱私。測試成功的有 QQ空間 QQ郵箱,百度網盤。其餘的HTTP沒有一一測試。我測試的基本都成功。

說的都是常規思路,大牛們求更淫蕩的姿態。

轉載自 :http://www.freebuf.com/articles/web/43157.html

相關文章
相關標籤/搜索