Broadcast struct in C. Change ip SOURCE addres.

This is a discussion on Broadcast struct in C. Change ip SOURCE addres. within the C Programming forums, part of the General Programming Boards category; hi to everybody. I've just registered to post here. I hope you to understand me. I need to do the ...

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    4

    Broadcast struct in C. Change ip SOURCE addres.

    hi to everybody. I've just registered to post here. I hope you to understand me.

    I need to do the next.
    I'm doing for my final degree project some sniffer in C running in openwrt firmware. I've already done every but I have one thing left I don't know how to start with.
    I've the next private net: http://img443.imageshack.us/img443/999/sinttulo2de.png
    What my sniffer does is to sniff all packets running through my router, and when one of these packets goes to any of my connected PCs, if that PC is asleep, it wakes it up. As if it were an automatic wake on lan.
    So, I've a problem. Supposing PC3 sends a packet to PC4, the arp table from the switch knows where is PC4, and will guide that packet to the PC4 gateway. If this happens, my sniffer will never see that packet, because the sniffer is running in the proccessor in the router, and can only see the packets which go through it.
    I need to do the next. When PC4 fells asleep and my sniffer detects it (already done that), the sniffers has to send a fake broadcast with the IP address source fro PC4, to cheat the switch and make it think PC4 is now connect in the gateway which goes to the router. So, the next packet which will be sent from PC3 to PC4 will go to the router instead to PC4, and my sniffer will see it.

    To sum up, I need to send a broadcast packet with the IP source addres field modified, and I don't know how to do it.

    Sorry for my english!!

  2. #2
    Registered User
    Join Date
    Dec 2012
    Posts
    4
    any idea? does anybody now how to create a broadcast packet from a raw socket with that configuratioN?

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    I don't think anybody is going to post sample code for ARP spoofing on Cboard.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  4. #4
    Registered User
    Join Date
    Dec 2012
    Posts
    4
    why not? I don't understand. I swear is for a degree proyect where I have to guide some frames through some gateways. Is it because a "hack" stuff?

  5. #5
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    I don't doubt you have legitimate reasons for doing it, but two things. First, it is just plain old against Cboard policy to discuss things like that. There are plenty of places online you can find this stuff using Google. Second, being able to redirect packets is a very integral part of any traffic monitor, I would have thought you'd have the details on how to do that down cold before even undertaking such a thing.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  6. #6
    Registered User
    Join Date
    Dec 2012
    Posts
    4
    I understand what you say. I'll ask in some other place. thank you anyway.

    hahah I wish it would be like that, but I was just told to do such a thing without any information. My first page to visit was google, where I can't find anything. Anyway, thank you very much. I'll be round here to ask some other problems If any.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Endian change & Byte Array -> Struct
    By bramaen in forum C Programming
    Replies: 3
    Last Post: 02-05-2010, 11:55 AM
  2. Change char array in struct
    By Rob4226 in forum C Programming
    Replies: 1
    Last Post: 10-20-2009, 03:52 PM
  3. Broadcast on the right interface in C#
    By mdoland in forum C# Programming
    Replies: 1
    Last Post: 02-08-2008, 06:04 PM
  4. change struct
    By WolfBend in forum C Programming
    Replies: 2
    Last Post: 05-12-2007, 11:03 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21