这是一篇来自美国的关于Lab 1 – TCP Attacks – Concepts(实验1-TCP攻击-概念)的网络安全代写
Lab 1 Overview
- Task 1: SYN Flood Attacks
- Test telnet during a SYN Flood, with SYN Flood protections ON and OFF
- There are two SYN Flood protection methods:
- SYN Cookies
- Reserve TCP Connections for “proven destinations”
- Task 2: TCP RST Attack
- Guess the correct SEQ/ACK Number to perform a RST Attack
- 5% bonus for fully automating the attack
- Task 3: TCP Session Hijacking
- Guess the correct SEQ/ACK, 5% for automating the attack
- Task 4:
- Reverse shell. Same as Task 3, but add a reverse shell exploit
SYN flood defense: SYN cookies (1)
- When SYN segment arrives, host B calculates function (hash) based on:
- Apache example: Source and destination IP addresses and port numbers, and a secret number
- Host B uses resulting “cookie” for its initial seq # (ISN) in SYNACK
- Host B does not allocate anything to half-open connection:
- Does not remember A’s ISN
- Does not remember cookie
SYN flood defense: SYN cookies (2)
If SYN is legitimate
Host A returns ACK
Host B computes same function, verifies function = ACK # in ACK segment
Host B creates socket for connection
Legit connection established without the need for half-open connections
If SYN-flood attack with spoofed IP address
No ACK comes back to B for connection.
No problem: B is not waiting for an ACK
TCP RST Attack
- Attacker can break the TCP connection by sending a TCP RST
- Must match the SEQ and ACK Numbers
Session hijacking
- Take control of one side of a TCP connection
- Marriage of sniffing and spoofing
Session hijacking: The details
- Attacker is on segment where traffic passes from Alice to Bob
- Attacker sniffs packets
- Sees TCP packets between Bob and Alice and their sequence numbers
- Attacker jumps in, sending TCP packets to Bob; source IP address = Alice’s IP address
- Bob now obeys commands sent by attacker, thinking they were sent by Alice
- Principal defense: encryption w/ auth protocol
- Attacker does not have keys to encrypt and insert meaningful traffic
实验 1 概述
任务 1:SYN 洪水攻击
在 SYN Flood 期间测试 telnet,同时打开和关闭 SYN Flood 保护
有两种SYN Flood保护方法:
同步饼干
为“经过验证的目的地”保留 TCP 连接
任务 2:TCP RST 攻击
猜测正确的 SEQ/ACK 编号以执行 RST 攻击
完全自动化攻击可获得 5% 的奖励
任务 3:TCP 会话劫持
猜测正确的 SEQ/ACK,5% 用于自动化攻击
任务 4:
反壳。 与任务 3 相同,但添加了一个反向 shell 漏洞
SYN泛洪防御:SYN cookies(一)
当 SYN 段到达时,主机 B 计算函数(哈希)基于:
Apache 示例:源和目标 IP 地址和端口号,以及一个秘密号码
主机 B 在 SYNACK 中使用生成的“cookie”作为其初始序列号 (ISN)
主机 B 不分配任何东西给半开连接:
不记得 A 的 ISN
不记得饼干
SYN泛洪防御:SYN cookies(二)
如果 SYN 合法
主机A返回ACK
主机 B 计算相同的函数,在 ACK 段中验证 function = ACK #
主机 B 创建用于连接的套接字
无需半开连接即可建立合法连接
如果使用欺骗性 IP 地址进行 SYN 泛洪攻击
没有 ACK 返回 B 进行连接。
没问题:B 没有在等待 ACK
TCP RST 攻击
攻击者可以通过发送 TCP RST 来中断 TCP 连接
必须匹配 SEQ 和 ACK 编号
会话劫持
控制 TCP 连接的一侧
嗅探和欺骗的联姻
会话劫持:细节
攻击者位于流量从 Alice 传递到 Bob 的网段
攻击者嗅探数据包
查看 Bob 和 Alice 之间的 TCP 数据包及其序列号
攻击者跳入,向 Bob 发送 TCP 数据包; 源 IP 地址 = Alice 的 IP 地址
Bob 现在服从攻击者发送的命令,认为它们是由 Alice 发送的
主要防御:使用授权协议进行加密
攻击者没有密钥来加密和插入有意义的流量