User Profile

Collapse

Profile Sidebar

Collapse
sanjayrjain
sanjayrjain
Last Activity: Mar 2 '10, 05:16 AM
Joined: Feb 24 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sanjayrjain
    started a topic Capture the UDP packets

    Capture the UDP packets

    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?
    See more | Go to post

  • sanjayrjain
    replied to Read the Packet header Information
    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) ,...
    See more | Go to post
    Last edited by bvdet; Feb 25 '10, 02:12 PM. Reason: Add code tags

    Leave a comment:


  • sanjayrjain
    started a topic Read the Packet header Information

    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.
    See more | Go to post
No activity results to display
Show More
Working...