CNIT 123: Project X10: IPv6 with scapy (20 pts.)

What you need

Testing the Windows Machine's IPv6 Connection

On the Windows machine, open the gogo6 client and make sure you are making an authenticated connection, with a Delegated Prefix, as shown below on this page:

On the Windows machine, open a Command Prompt window and enter this command:

ping ipv6.google.com
You should get replies. If you do not, you need to troubleshoot your IPv6 tunnel before you can proceed further with this project.

Finding the Windows Machine's IPv6 Address

Use the IPCONFIG copmmand on the Windows machine to find its IP address in your Delegated Prefix--it should be the Delegated Prefix followed by ::1, as shown below on this page:

Record it--you will need it for the later steps.

Testing IPv6 Connectivity on the Linux Machine

On the Linux machine, open a Terminal window and enter this command:
ping6 -c 4 ipv6.google.com
You should see replies, starting with "64 bytes from...". If you do not, you need to fix the networking before proceeding further.

Starting scapy

On the Linux machine, use this command to start scapy:
sudo scapy

Sending an ICMPv6EchoRequest Packet with scapy

Creating an IPv6 Object

In the Linux machine, in the Terminal window, at the >>> prompt, execute these commands to create an IPv6 packet and examine it:
i = IPv6()

i.display()

As you can see, the version is now 6, as shown below on this page:

In the Linux machine, in the Terminal window, at the >>> prompt, execute these commands to assign the IPv6 destination address, using the address of your Windows machine instead of the address shown below:

i.dst = "2001:5c0:110c:9d00::1"

i.display()

As you can see in the image above on this page, the src address automatically fills in.

Creating an ICMPv6EchoRequest object

In the Linux machine, in the Terminal window, at the >>> prompt, execute these commands to create an ICMPv6EchoRequest packet and examine it:
ic = ICMPv6EchoRequest()

ic.display()

Sending the ICMPv6EchoRequest packet

Use this command to send the packet and look at the reply:
sr1(i/ic)
You should see a response with type=Echo Reply, as shown below on this page.

Use these commands to send a packet with your name in it, and look at the reply:

ic.data = "YOUR NAME"

sr1(i/ic)

You should see a response with your name in it, as shown below on this page.

Saving the Screen Image

Make sure you can see your name in the response packet.

Save a screen image with the filename Proj X10a from Your Name.

Sending a UDP Packet

Preparing the Target

You need to have Nmap installed on your target Windows 7 machine, so that you will have the Ncat listener.

On the target Win 7 machine, in a Command Prompt window, type these commands, pressing Enter after each one:

cd \program files\nmap

ncat -6 -u -l 4444

Open a second Command Prompt window and execute this command:
netstat -an
You should see UDP port 4444 LISTENING, on the IPv6 address [::], as shown below on this page.

Sending a UDP Packet from scapy

In the Linux machine, in the Terminal window, at the >>> prompt, type these commands, and then press the Enter key:
u = UDP()

u.display()

This creates an object named u of type UDP, and displays its properties.

Execute these commands to change the destination port to 4444 and display the properties again:

u.dport = 4444

u.display()

Your UDP packet's properties should look like the image below on this page:

Execute this command to send the packet to the Windows machine:

send(i/u/"YOUR NAME SENT VIA IPv6 UDP\n")
On the Windows target, you should see the message appear, as shown below on this page:

Saving the Screen Image

Make sure you can see your name on the Windows machine.

Save a screen image with the filename Proj X10b from Your Name.

Turning in Your Project

Email the images to cnit.123@gmail.com with a Subject line of Proj X10 from Your Name.


Sources

http://packetstorm.linuxsecurity.com/papers/general/blackmagic.txt

http://www.secdev.org/projects/scapy/

http://ipv6hawaii.org/?p=143

Last modified 5-1-12