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.

In <strong>the</strong> example above, <strong>the</strong> host 192.168.42.88 is a Windows XP machine<br />

running an openssh server on port 22 via cygwin. The tcpdump output below<br />

shows <strong>the</strong> spo<strong>of</strong>ed SYN packets flooding <strong>the</strong> host from apparently random<br />

IPs. While <strong>the</strong> program is running, legitimate connections cannot be made<br />

to this port.<br />

reader@<strong>hacking</strong>:~/booksrc $ sudo tcpdump -i eth0 -nl -c 15 "host 192.168.42.88"<br />

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br />

listening on eth0, link-type EN10MB (E<strong>the</strong>rnet), capture size 96 bytes<br />

17:08:16.334498 IP 121.213.150.59.4584 > 192.168.42.88.22: S<br />

751659999:751659999(0) win 14609<br />

17:08:16.346907 IP 158.78.184.110.40565 > 192.168.42.88.22: S<br />

139725579:139725579(0) win 64357<br />

17:08:16.358491 IP 53.245.19.50.36638 > 192.168.42.88.22: S<br />

322318966:322318966(0) win 43747<br />

17:08:16.370492 IP 91.109.238.11.4814 > 192.168.42.88.22: S<br />

685911671:685911671(0) win 62957<br />

17:08:16.382492 IP 52.132.214.97.45099 > 192.168.42.88.22: S<br />

71363071:71363071(0) win 30490<br />

17:08:16.394909 IP 120.112.199.34.19452 > 192.168.42.88.22: S<br />

1420507902:1420507902(0) win 53397<br />

17:08:16.406491 IP 60.9.221.120.21573 > 192.168.42.88.22: S<br />

2144342837:2144342837(0) win 10594<br />

17:08:16.418494 IP 137.101.201.0.54665 > 192.168.42.88.22: S<br />

1185734766:1185734766(0) win 57243<br />

17:08:16.430497 IP 188.5.248.61.8409 > 192.168.42.88.22: S<br />

1825734966:1825734966(0) win 43454<br />

17:08:16.442911 IP 44.71.67.65.60484 > 192.168.42.88.22: S<br />

1042470133:1042470133(0) win 7087<br />

17:08:16.454489 IP 218.66.249.126.27982 > 192.168.42.88.22: S<br />

1767717206:1767717206(0) win 50156<br />

17:08:16.466493 IP 131.238.172.7.15390 > 192.168.42.88.22: S<br />

2127701542:2127701542(0) win 23682<br />

17:08:16.478497 IP 130.246.104.88.48221 > 192.168.42.88.22: S<br />

2069757602:2069757602(0) win 4767<br />

17:08:16.490908 IP 140.187.48.68.9179 > 192.168.42.88.22: S<br />

1429854465:1429854465(0) win 2092<br />

17:08:16.502498 IP 33.172.101.123.44358 > 192.168.42.88.22: S<br />

1524034954:1524034954(0) win 26970<br />

15 packets captured<br />

30 packets received by filter<br />

0 packets dropped by kernel<br />

reader@<strong>hacking</strong>:~/booksrc $ ssh -v 192.168.42.88<br />

OpenSSH_4.3p2, OpenSSL 0.9.8c 05 Sep 2006<br />

debug1: Reading configuration data /etc/ssh/ssh_config<br />

debug1: Connecting to 192.168.42.88 [192.168.42.88] port 22.<br />

debug1: connect to address 192.168.42.88 port 22: Connection refused<br />

ssh: connect to host 192.168.42.88 port 22: Connection refused<br />

reader@<strong>hacking</strong>:~/booksrc $<br />

Some operating systems (for example, Linux) use a technique called<br />

syncookies to try to prevent SYN flood attacks. The TCP stack using syncookies<br />

adjusts <strong>the</strong> initial acknowledgment number for <strong>the</strong> responding SYN/ACK<br />

packet using a value based on host details and time (to prevent replay attacks).<br />

Networking 255

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

Saved successfully!

Ooh no, something went wrong!