More Fun with Scapy




Hi 

Somedays ago I posted about manipulating data packets with Scapy. That was a simple packet but lets see how we can add more to it like src address and ttl value.
So lets start

1. So lets craft a packet first open terminal start Scapy by typing Scapy.
2. Now craft a simple packet again

>>> packet=IP(dst="192.111.XX.XX")/TCP(dport=80)/"hello world"

This was a simple packet now lets make it more complicated by adding the source IP and Time to Live value(TTL) value.
First we will add the Source IP

>>>packet=IP(src="192.168.XX.XX", dst="192.168.XX.XX")/TCP(dport=80)/"hello world"



here I used a new term src. src refers to the source IP address from which the packet has been sent to the destination IP.
this is very important to add a crafted source IP if you dont to want to reveal the real source IP.



Now lets  make it more complicated by adding TTL value

What TTL means ?
TTL is a timer value included with the packet sent over TCP/IP based networks which tells the recipients how long to whether use hold it and use it before discarding the packet.

You can also determine the OS running on host computer with TTL value like windows OS have the TTL value 128.

Lets craft the packet with TTL value, We will use ICMP(Internet Control Message Protocol ) protocol for this.

>>>packet=IP(src="192.168.XX.XX", dst="192.168.XX.XX", ttl="128")/ICMP()/"hello world"

So you can easily craft data packets using the src and ttl  value.

So in this tutorial we learnt how we can modify our packets. This is very important because if you are not modifying the packet scapy will use the default values to before sending a packet you have to modify it with your own modification


So do you having more fun with Scapy

I will be doing more posts about crafting more complicated packets.

But before We will talk about how you can send the packets.

If you need help feel free to comment.

Regards
Sooraj Shekhar (Team Computer Korner)






Feel Free To Leave A Comment If Our Article has Helped You, Support Us By Making A Small Contribution, Thank You!

0 comments: