session hijacking

session hijacking
接管現存動態會話的過程
refer to the exploitation of a valid computer session where an attack takes over a session between two computer
用途:The connection can be taken over after authentication
影響範圍: 大部份電腦都存在此弱點,因為使用tcp/ip
很多應用系統採用命令行登錄是不安全的,尤其是telnet、 rsh、rlogin及FTP程式,它們全是黑客攻擊對象。
任何一個黑客在連接了客戶與伺服器之間的網段後,可以用Session Hijacking工具接管會話。
ex:
當一個合法用戶登錄到命令行進行會話時,黑客可以找到此會話並馬上代表用戶接管此會話,重新連接客戶,這樣黑客便完全控制這個登錄,進而黑客成為合法用戶。而真正的用戶會簡單地認為網絡出故障了,從而會斷掉會話。

ps:session and permanent cookies can be generated while visiting different web sites on the internet


spoofing vs hijacking
hijacking:把己存在的session偷過來
spoofing:欺騙對方,常見的攻擊有 arp spoofing

....................................................

three broad phases of session hijacking:
1 tracking the connection
2 desynchronizing the connection
3 injecting the attacker's packet

session hijacking steps
1 place yourself between the victim and the target
2 monitor the flow of packets
3 predict the sequence number
要把另一個人踢掉,讓sequence number亂掉,讓對方收到不是他預期,由於都會要求seq會造成兩邊不對稱,因此容易產生ack storm
4 kill the connection to the victim's machine
5 take over the session
6 start injecting packets to the target server

............................................................................................................................................................

types of session hijacking
active:主動劫持則是將會話當中的某一台主機「踢」下線,然後由攻擊者取代並接管會話
假設原本是a<->b,攻擊者是c,攻擊後變a<->c
passive:被動劫持實際上就是在後台監視雙方會話的數據流,從中獲得敏感數據
假設原本是a<->b,攻擊者是c,攻擊後變 a<->c<->b

session hijacking leves:
network level hijacking
 tcp/ip hijacking
 ip spofing:source routed packets
 rst hijacking
 blind hijacking
 man-in-the-middle:packet sniffer
 udp hijacking
application level hijacking
 obtaining session id's
 sniffing
 brute force
 misdirected trust

........................................................................................................

network level hijacking
implement on the data flow of protocol shared by all web applications
attack on network level sessions provids some critical information to the attacker which is used to attack application level sessions

sequence number prediction
先了解對方sequence number如何送
attacker 用自己的ip連線到server,記錄對方回傳sequence number的範圍,通常是隨機的但不會差太多
接著偽冒另一端ip,且設定不會收到訊息後,開始猜測sequence number是否可行
因此建議使用unpredictable sequence numbers來預防
.....

tcp/ip hijacking
use spoofed packets to take over a connection between a victim and a target machine
ps:attacker和victim需在same network

steps:
1 the victim's connection is sniffed by gaining his/her sequence numbers
2 using the sequence number,the attacker sends a spoofed packet from the victim's system to the pc_b
3 the pc_b responds to the victim,assuming that the packet has arrived from it ,thus incrementing the sequence number
ps:通常會中斷
.....

ip spoofing
使用source routed packets方式,讓packet不管怎麼走,都會經過attacker
ps:在internet通常無效,因為大部份router己關閉此功能
ps:目前還是概念

.....

rst hijacking
a from of tcp/ip hijacking where a reset packet is added
step:
1attacker:
spoofed source address with predicted ack number,並傳送reset packet給victim
2victim:
收到reset packet後connection reset
ps:通常是配合其他攻擊

.....

blind hijacking
不管有沒有看到,或者是對方回應有沒有到我這裡,都沒關係,反正這些東西就送過去
inject the malicious data or commands into the intercepted communicatins in the tcp session even if the source routing is disabled
send the data or comments but has no access to see the response

.....

MITM(man-in-the-middle)
泛指所有以中間人方式介入,並欺騙通訊雙方其中間人為目標之行為
可用以下方法實做
icmp:使用type 5 Redirect Message
arp spoofing
bgp(Border Gateway Protocol)
dns spoofing,用proxy,fake dns,欺騙user連到fake web,再幫user連到真的web

replay attack(重送攻擊)
Session hijack就是其中的一种
藉由重覆送出某些封包來達成攻擊目的的手段
做法:C攔截A送給B的封包,再將此封包原封不動的送給B
當攻擊者複製兩方之間的訊息資料流,並且對其中一方或多方重新執行資料流,受到攻擊的電腦會將資料流當成合法訊息來處理,導致發生一連串負面的影響,例如項目的重複排序。
入侵者使用封包收集軟體於網路通訊時將你加密及簽章的認證封包攔截下來,之後再將它重送謂給認證伺服器即可通過認證而入侵系統
ex:
假設Alice向Bob認證自己。Bob要求她提供密碼作為身份信息。同時,Eve竊聽了兩人的通訊,並記錄了密碼。在Alice和Bob 完成通訊後,Eve聯繫Bob,假裝自己為Alice,當Bob要求密碼時,Eve將Alice的密碼發出,Bob認可和自己通訊的人是Alice。

預防方法有:
採用Challenge-Response的機制,確定 Request訊息與Response訊息是成對的關係
可在傳送的訊息上加入時戳(time stamp)或序號(sequence number),讓Server可檢察封包是否被重送
採用一次通行碼 (One-Time Password)方式防止重送攻擊

.....

udp hijacking
victim執行 udp查詢時,在真正回應回來之前,attacker就送一個假的給victim,假的udp可包含惡意資訊
ex:victim執行dns query時,attacker送一個假的dns response,讓victim去錯誤的地方
the hacker has to send the forged server reply to client udp before the server responds to it

........................................................................................................

application level hijacking
the attacker gains the session id's to get control of the existing session or even create a new unauthorized session

obtaining session id's
session id可以在以下地方發現
http get request
form
cookie

sniffing
intercepted session id

brute force
guess the session ids
attacker can conduct 1000 session id guesses per second using a domestic dsl line

misdirected trust
使用 xxs或html injection將victim重導到另一個惡意網頁取得session id

ps:
參數 secure指出此cookie將只有在安全的HTTPS連結時傳送。

....................................................

session hijacking tools
tty watcher:for solaris
ip watcher:a commercial session hijacking tool
remote tcp session reset utility:可將對方reset
paros http hijacker:MITM proxy,收到對方封包後可修改後在送出
dnshijacker:執行dns spoof
hiksuite
Hunt:It is useful with telnet, ftp, and others to grab traffic between two computers or to hijack sessions
juggernaut: 作者是daemon9

....................................................

countermeasures:
use encryption:兩端加密中間不太容易看到
use a secure protocol:使用ipsec,認證,資料完整性,...等
limit incoming connections
minimize remote access
educate the employees

Session Hijacking防範
對於敏感的會話通訊(如防火牆的遠端管理、PKI或是其他重要部件的管理),選用一個有密碼認證功能的工具把整個會話加密是一個好選擇。
Secure Shell (SSH)就提供這些功能。VPN產品也提供認證及會話加密。黑客沒有在SSH或VPN工具裡所用的鑰匙便無法進行會話攻擊。


2010-03-10 09:49:43發表 0000-00-00 00:00:00修改   

數據分析
程式開發
計算機組織與結構
資料結構與演算法
Database and MySql
manage tool
windows
unix-like
linux service
network
network layer3
network layer2
network WAN
network service
作業系統
數位鑑識
資訊安全解決方案
資訊安全威脅

Cisco security
Cisco network
Cisco layer3
Cisco layer2



  登入      [牛的大腦] | [單字我朋友] Powered by systw.net