1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

packet interceptor

Discussion in 'C' started by transfernly, Mar 2, 2010.

  1. transfernly

    transfernly New Member

    Joined:
    Dec 15, 2009
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    hello all I am looking for a sample C code for packet interceptor....

    Any help is appreciated

    Thank you
     
  2. karthigayan

    karthigayan New Member

    Joined:
    Feb 19, 2010
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    0
    please explain your requirement briefly .
     
  3. transfernly

    transfernly New Member

    Joined:
    Dec 15, 2009
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    receive the packet as such and modify its contents and then forward it..its a part of my research work.....change few field details and den forward it my another code(which acts as a server)....and do let me know if its possible or not

    Thank you
     
  4. karthigayan

    karthigayan New Member

    Joined:
    Feb 19, 2010
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    0
    You can do it . Normally the whole packet will store as a structure .So when you receive a socket you can just change the particular structure member ( part of the packet ) then you can forward it .
     
  5. transfernly

    transfernly New Member

    Joined:
    Dec 15, 2009
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    when i have done simple client server programme of data excahnge i used to receive only the data part(payload)

    but how to get the entire packet assuch...do u have a sample snippet
     
  6. karthigayan

    karthigayan New Member

    Joined:
    Feb 19, 2010
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    0
    I think you are using send and receive functions in you socket program.Instead try with sendto ,recvfrom functions you will get the address and port of the other informations in the packet .

    man recvfrom
    man sendto
     
  7. transfernly

    transfernly New Member

    Joined:
    Dec 15, 2009
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    yeah....u r right am using send and receive functions....i am using visual studio ..am not coding in linux.....i think i get all the individual fields of the packet ...i think i will be able to get only source ip...port etc etc..but i want the packet right from IP header....

    in which structure i receive the details.....and can i send the same packet as such to another server
     

Share This Page