0

Hello,
I am a beginner in Windows socket programming and I want to know, if there is some way how to create an UDP packet with no source IP address (or with some different on another network) so when it is forwarded to the destination, receiver will not be able to respond.
Thanks.

2
Contributors
2
Replies
4
Views
8 Years
Discussion Span
Last Post by Thew
0

No source address? No -- even a broadcast address is an address. A different source address? Yes. That's packet-spoofing, something that's used to cause trouble (a 'smurf' packetstorm, for instance; google "Smurf Attack"). You can play with that over your own LAN, but *don't* let it out onto the Internet.

0

I have finally found the solution how to do this. It's possible if you use the WinPcap. You can use this to generate signals on your NIC, "to send your own packets". With use of this headers:

/* 4 bytes IP address */
typedef struct ip_address{
    u_char byte1;
    u_char byte2;
    u_char byte3;
    u_char byte4;
}ip_address;

/* IPv4 header */
typedef struct ip_header{
    u_char  ver_ihl;        // Version (4 bits) + Internet header length (4 bits)
    u_char  tos;            // Type of service 
    u_short tlen;           // Total length 
    u_short identification; // Identification
    u_short flags_fo;       // Flags (3 bits) + Fragment offset (13 bits)
    u_char  ttl;            // Time to live
    u_char  proto;          // Protocol
    u_short crc;            // Header checksum
    ip_address  saddr;      // Source address
    ip_address  daddr;      // Destination address
//    u_int   op_pad;         // Option + Padding
}ip_header;

/* UDP header*/
typedef struct udp_header{
    u_short sport;          // Source port
    u_short dport;          // Destination port
    u_short len;            // Datagram length
    u_short crc;            // Checksum
}udp_header;

I can post whole source code how to create an UDP packet and send it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.