Hi ,
I'm using python 2.3 version which is a default version present in linux 4.4.
I have few queries w.r.t python:
1) How can capture the UDP packet and read the TTL value from it?
usually i did manually using tcpdump tool. But now i want to automate it using a python script. Is it possible to achieve this ? If yes , how?
User Profile
Collapse
-
Capture the UDP packets
-
I'm getting using socket library.
Something like this:
[code=python]
sock = socket.socket(s ocket.AF_INET, socket.SOCK_DGR AM, socket.IPPROTO_ UDP)
sock.setsockopt (socket.SOL_SOC KET, socket.SO_REUSE ADDR, 1)
sock.bind(('', rec_port))
print "Connected to Destination Host named:", rec_hostname
# Set some more multicast options
mreq = struct.pack('4s l', socket.inet_ato n(rec_hostname) ,... -
Read the Packet header Information
Hi,
How can i read the packet header information like Source address , destination address, TTL value from a UDP Packet in python.
No activity results to display
Show More
Leave a comment: