Security

如何執行 TCP 劫持?

  • June 25, 2009

我正在使用使用 Windows 身份驗證的 ASP.NET 應用程序進行開發。我已將web.config文件設置為拒絕所有未經身份驗證的使用者,並且只允許來自特定角色的使用者。

使用 Fiddler,我可以模糊我的會話 ID,重播請求,並且仍然得到200 OK響應……顯然沒有任何重新談判。

我的印像是基於 NTLM 的身份驗證的憑據與底層 TCP 連接相關聯。首先,這是真的嗎?這是真正的安全威脅嗎?如果是這樣,個人必須採取哪些步驟來劫持這樣的連接才能冒充另一個使用者的身份?

Internet Explorer 可以執行透明 NTLM 身份驗證。我沒有大量使用 Fiddler,我不知道它是否向您展示了對話的那一部分。我的猜測是您的瀏覽器正在透明地對您進行身份驗證,但我不能肯定地說。

您可以嘗試使用 Wireshark 等嗅探瀏覽器/伺服器流量,看看是否發生了這種情況。客戶端和 IIS 之間的 NTLM 身份驗證是在 TCP 連接中的帶內完成的,而不是作為與 TCP 連接啟動相關的某些帶外過程的一部分。如果它在那裡,你會看到它。

您沒有看到 TCP 劫持。您要麼看到透明身份驗證的結果,要麼您的應用程序實際上不需要身份驗證。

To speak directly to TCP hijacking (TCP sequencing, etc): To hijack a TCP connection an attacker must predict the sequence and acknowledgement numbers and forge traffic as a client. Typically this ends up being a blind attack because the replies from the server computer end up going back to the real client. (If you combine TCP sequencing with ARP cache poisoning you can get a two-way hijack going, but that typically limits the attack to an attacker on a machine on the same subnet as the client or server.) TCP sequencing of live connections between clients and servers over the Internet is difficult unless the attacker has compromised a choke point between the client and server.

通過可猜測的初始序列號進行獲取連接以利用對協議的信任的盲目 TCP 排序攻擊(Kevin Mitnick 對 Shimomura 的工作站的攻擊以在其上放置 .rhosts 文件)成為可能,並且與直接劫持有點不同。

SSL、IPSEC 或其他加密隧道協議是阻止 TCP 劫持的朋友。通常,即使您使用非明文質詢/響應系統(如 NTLM、NTLMv2 等)進行身份驗證,TCP 連接仍然容易受到劫持。

引用自:https://serverfault.com/questions/31794