26.07.2018 Views

hacking-the-art-of-exploitation

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

exist in <strong>the</strong> packet in <strong>the</strong> binary form <strong>of</strong> high- and low-order 16-bit words.<br />

The conversion is fairly simple:<br />

Src IP = 192.168.2.57<br />

SH = 192 · 256 + 168 = 50344<br />

SL = 2 · 256 + 57 = 569<br />

Dst IP = 192.168.2.1<br />

DH = 192 · 256 + 168 = 50344<br />

DL = 2 · 256 + 1 = 513<br />

New IP = 123.45.67.89<br />

NH = 123 · 256 + 45 = 31533<br />

NL = 67 · 256 + 89 = 17241<br />

The checksum will be changed by N H + N L − D H − D L , so this value must<br />

be subtracted from somewhere else in <strong>the</strong> packet. Since <strong>the</strong> source address is<br />

also known and doesn’t matter too much, <strong>the</strong> low-order 16-bit word <strong>of</strong> that<br />

IP address makes a good target:<br />

S'L = SL − (NH + NL − DH − DL)<br />

S'L = 569 − (31533 + 17241 − 50344 − 513)<br />

S'L = 2652<br />

The new source IP address should <strong>the</strong>refore be 192.168.10.92. The<br />

source IP address can be modified in <strong>the</strong> encrypted packet using <strong>the</strong> same<br />

XORing trick, and <strong>the</strong>n <strong>the</strong> checksums should match. When <strong>the</strong> packet is<br />

sent to <strong>the</strong> wireless access point, <strong>the</strong> packet will be decrypted and sent to<br />

123.45.67.89, where <strong>the</strong> attacker can retrieve it.<br />

If <strong>the</strong> attacker happens to have <strong>the</strong> ability to monitor packets on an<br />

entire class B network, <strong>the</strong> source address doesn’t even need to be modified.<br />

Assuming <strong>the</strong> attacker had control over <strong>the</strong> entire 123.45.X.X IP range, <strong>the</strong><br />

low-order 16-bit word <strong>of</strong> <strong>the</strong> IP address could be strategically chosen not to<br />

disturb <strong>the</strong> checksum. If NL = DH + DL − NH, <strong>the</strong> checksum won’t be changed.<br />

Here’s an example:<br />

NL = DH + DL − NH<br />

NL = 50,344 + 513 − 31,533<br />

N'L = 82390<br />

The new destination IP address should be 123.45.75.124.<br />

0x785<br />

Fluhrer, Mantin, and Shamir Attack<br />

The Fluhrer, Mantin, and Shamir (FMS) attack is <strong>the</strong> most commonly<br />

used attack against WEP, popularized by tools such as AirSnort. This attack<br />

Cryptology 439

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!