Source code for sending packets

xiaoxiao2021-03-06  65

I have a lot of online, recently written the back door, need a tool for a bag, simple, and use others, it is better to write one ... Similarly, since you want to write, you just write all the points. .

Below this is the source code written in the previous day, and the extraction file is not tested. (Generally, I don't test) ..

The help of the code is written very detailed, this is not a description of Luo Wei, simply talking about this role ...

Software provides custom transmission (including all fields that can be modified), and provides five kinds of counterfeit source formats, improve delivery packets, etc., etc. ... Others, Use the code to explain .....

Written bucket, it is inevitable, I hope everyone will give it to ...

//

///

// Packet sender 1.0 //

///

// Date: [2004.4.25] //

// Author: [Zvrop] [zvrop@163.com] //

// Environment: [WinXP Visual C 6.0] //

// Home: [http://www.geedao.com] [http://www.ringz.org] //

// Name: [If you have changed anything, please send it to a copy, thank you] //

///

//

//

// Some header files

//

#include

#include

#include

#include

#include

#include

#include

//

// Several macro definition

//

#define ipver 4 // IP protocol

#define max_timeout 2000 // maximum timeout time

#define max_hostname_lan 1024 // Host name longest

#define max_buff_len 65500 // Send buffer maximum

#define max_port 65500 // port largest

#define max_char 255 // uchar type maximum

#define max_short 65535 // ushort type is the largest

#define max_long 4294967294 // ulong type largest

#define def_port_da 1025 // Default port

#define def_forge_ip 0xfffffffff // Default forged IP

#define def_forge_port 0xfffFFF // Default forgery port

//

// Several packet header structure definition

//

/ / Define IP's head

Typedef struct _iphdr {

Uchar h_verlen; // 4 top length, 4-digit IP version number

Uchar TOS; // 8 service type TOS

Ushort total_len; // 16-bit total length (bytes)

Ushort Ident; // 16 bit identity

Ushort frag_and_flags; // 3 bit flag

Uchar TTL; // 8-bit survival time TTL

Uchar proto; // 8-bit protocol (TCP, UDP or other)

Ushort Checksum; // 16-bit IP header checksum

Ulong sourceip; // 32 bitsource IP address

Ulong destip; // 32 bit IP address

} Ip_header;

/ / Define TCP Pseudo

Typedef struct _psdhdr {

Ulong saddr; // source address

Ulong Daddr; // destination address

Uchar MBZ; // is useless

Uchar PTCL; // Protocol Type

Ushort tcpl; // TCP length

} PSD_HEADER;

/ / Define TCP's head

Typedef struct _tcphdr {

Ushort th_sport; // 16 bond source port

Ushort th_dport; // 16-bit destination port ulong th_seq; // 32-bit serial number

Ulong TH_ACK; // 32 bit confirmation number

Uchar TH_LENRES; // 4 top length / 6 reserved words

Uchar TH_FLAG; // 6 bit flag

Ushort TH_WIN; / / 16-bit window size

USHORT TH_SUM; / / 16-bit checksum

Ushort TH_URP; // 16-bit emergency data offset

} TCP_HEADER;

/ / Define UDP headers

Typedef struct _udphdr {

Ushort uh_sport; // 16 bond source port

Ushort uh_dport; // 16 bit destination port

Ushort uh_len; // 16 bit length

Ushort uh_sum; // 16 bit checksum

} Udp_header;

/ / Define ICMP's head

Typedef struct _icphdr {

Uchar i_type; // 8-bit type

Uchar i_code; // 8-bit code

Ushort i_cksum; // 16-bit checksum

Ushort i_id; // identification number (generally used process number as identification number)

Ushort i_seq; // message serial number

Ulong timestamp; // Timestamp

ICMP_HEADER;

/ / Define the first IGMP header

Typedef struct _igmphdr {

Uchar i_code; // 8-bit code

Uchar i_type; // 8-bit type

Ushort i_nv; // is useless

Ushort i_cksum; // 16-bit checksum

Ulong i_addr; // 32 bit group address

} IGMP_HEADER;

//

// Some packet header structural variables

//

IP_HEADER ip_header = {0}; // IP head structure

PSD_Header PSD_HEADER = {0}; // Pseudo-head structure

TCP_HEADER TCP_HEADER = {0}; // TCP header structure

UDP_HEADER UDP_HEADER = {0}; // UDP head structure

ICMP_HEADER ICMP_HEADER = {0}; // ICMP head structure

IGMP_HEADER IGMP_HEADER = {0}; // IGMP head structure

//

// Several global variables

//

/ / Pointer for temporary pile variables

Ulong * ip_buff = null; // IP buffer

Ushort * port_buff = null; // port buffer

Ushort * ip_chk_buff = NULL; // ip header test and buffer

Ushort * other_chk_buff = null; // Other first tests and buffers

// Send the relevant parameters

Char dest_ip [MAX_HOSTNAME_LAN] = {0}; // destination IP

Short send_data_type = 2; // Send type

Ulong send_degree = 10; // Send number

Ulong send_sdeg = 1; // Top number

Ushort delay_time = 0; // delay time

Socket SockRaw = 0; // Socket handle

Struct SockAddr_in Destaddr = {0}; // Socket Address Structure

Char send_dest_data [max_buff_len] = {0}; // Send message information

Char send_data_file [max_path] = {0}; // data file path

INT sent_data_size = 0; // Send information size

// Variable parameter variables of each message

UCHAR IP_TOSE = 0; // IP service type

Ushort ip_ident = 0; // ip16 bit identifier ushort ip_flag = 0; // ip flag

UCHAR IP_TTLE = 128; // ip TTL value

Ushort TCP_WINS = 16384; // TCP window value

Uchar tcp_flag = 2; // TCP logo

Ulong TCP_SEQ = 1; // 32-bit serial number

Ulong TCP_ACK = 0; // 32 bit confirmation number

Ushort tcp_urp = 0; // TCP emergency data offset

Ushort ICMP_TYPE = 8; // ICMP Type Value

Ushort ICMP_CODE = 0; // ICMP code value

Ushort ICMP_ID = 2; // ICMP Identification number value

Ushort ICMP_SEQ = 1; // ICMP serial number

Ulong ICMP_TIME = 1; // ICMP Timestamp Value

Ushort IGMP_code = 1; // IGMP version value

Ushort IGMP_TYPE = 1; // IGMP type value

Ulong IGMP_ADDR = 100; // IGMP32 bit group address

// Forgery related variables

Ulong ip_forge_deg = 100; // Forged number

Short forge_type = 1; // Forgery mode

CHAR forge_ip_file [max_path] = {0}; // Forgery IP file path

Char forge_ip [MAX_HOSTNAME_LAN] = {0}; // Forgery IP

Ushort forge_port = def_port_da; // Forged port

/ / Temporary variable related to the program

Ushort portt = 0; // Temporary variable, record the port of the destination IP

Ulong iptl = 0; // Temporary variable, record destination IP

INT ErrorCode = 0; // Error Returns Storage Variable

//

// Name of several functions

//

Void usage ();

Ushort Checksum (USHORT * BUFFER, INT Size);

Int setInitializeValue (int Argc, char * argv []);

Int setInitializesock ();

Int getipandportbyline (char * iPL);

Int makeforgedata ();

Int acid ();

// Overload function

Int assmemory (ulong ** a, ulong sa, ushort ** b, ulong sb);

INT Assmemory (ushort ** a, ulong sa, ushort ** b, ulong sb);

//

// master function

//

INT Main (int Argc, char * argv []) {

/ / The parameter is less than 2, exiting

IF (argc <2) {

USAGE ();

Return 0;

}

FPRINTF (stderr, "1. Start analysis of the command line, get parameters, slightly ... / N");

// Analyze the command line and assign the initialization value.

IF (! setInitializeValue (argc, argv))

Return 0;

FPRINTF (stderr, "2. Initializing the network, slightly ... / N");

// Initialize the connection function

IF (! setInitializesock ())

Return 0;

FPRINTF (stderr, "3. Constructing forged packets, slightly, etc. ... / N");

// Construct forgery data

IF (! makeforgedata ())

Return 0;

FPRINTF (stderr, "4. Positive operation, slightly, wait ... / N");

// Calculated papers and if (! Accchecksum ())

Return 0;

// start sending information below

// Fill address structure

MEMSET (& DestadDR, 0, Sizeof (Destaddr));

Destaddr.sin_Family = AF_INET; // Internet Network

Destaddr.sin_port = HTONS (portt);

Destaddr.sin_addr.s_addr = htonl (iptl); // destination IP

/ / Start loop sending message, because the test is calculated, here is some pointers and memory operations

Char sendto_buff [MAX_BUFF_LEN];

Ulong i = 0, J, HL = 0, SZE = SizeOf (Destaddr);

For (j = 0; j

// Recycling IP segment

IF (i> = ip_forge_deg)

i = 0;

/ / Send buffer to empty, you should not

MEMSET (Sendto_Buff, 0, Max_Buff_len);

// Fill variable parameters

IP_HEADER.SOURCEIP = HTONL (IP_BUFF [I]);

IP_HEADER.IDENT = HTONS ((USHORT) ((i IP_IDENT)% MAX_SHORT) 1);

IP_HEADER.CHECKSUM = IP_CHK_BUFF [I];

// Fill the send buffer

Memcpy (sendto_buff, & ip_header, sizeof (ip_header));

/ / Judgment what type of packet, send

Switch (send_data_type) {

Case 1:

// Fill the TCP fake head and TCP head

PSD_Header.saddr = IP_HEADER.SOURCEIP;

TCP_HEADER.TH_SEQ = HTONL ((TCP_SEQ I)% MAX_SHORT) ;;

TCP_HEADER.TH_SPORT = HTONS (port_buff [i]);

// Filling the papers and have been calculated

TCP_HEADER.TH_SUM = Other_chk_buff [i];

// Fill buffer

Memcpy (SENDTO_BUFF SIZEOF (IP_HEADER), & TCP_HEADER, SIZEOF (TCP_HEADER));

Memcpy (Sendto_Buff SizeOf (IP_HEADER) SIZEOF (TCP_HEADER),

Send_dest_data, send_data_size;

// Calculate the length of the message

HL = sizeof (ip_header) sizeof (tcp_header) send_data_size;

Break;

Case 2:

PSD_Header.saddr = IP_HEADER.SOURCEIP;

UDP_HEADER.UH_SPORT = HTONS (port_buff [i]);

UDP_HEADER.UH_SUM = Other_chk_buff [i];

Memcpy (SENDTO_BUFF SIZEOF (IP_HEADER), & UDP_HEADER, SIZEOF (UDP_HEADER));

Memcpy (sendto_buff sizeof (ip_header) sizeof (udp_header),

Send_dest_data, send_data_size;

HL = sizeof (ip_header) sizeof (udp_header) send_data_size; break;

Case 3:

ICMP_HEADER.I_SEQ = HTONS ((iShort) ((ICMP_SEQ I)% Max_Short));

ICMP_HEADER.TIMESTAMP = HTONL ((ICMP_TIME I)% MAX_SHORT);

ICMP_HEADER.I_CKSUM = Other_chk_buff [i];

Memcpy (Sendto_Buff SizeOf (IP_HEADER), & ICMP_HEADER, SIZEOF (ICMP_HEADER));

Memcpy (Sendto_Buff SizeOf (IP_HEADER) SIZEOF (ICMP_HEADER),

Send_dest_data, send_data_size;

HL = SIZEOF (IP_HEADER) SIZEOF (ICMP_HEADER) Send_Data_size;

Break;

Case 4:

IGMP_HEADER.I_CKSUM = Other_chk_buff [i];

Memcpy (SENDTO_BUFF SIZEOF (IP_HEADER), & ICMP_HEADER, SIZEOF (IGMP_HEADER));

Memcpy (sendto_buff sizeof (ip_header) sizeof (igmp_header),

Send_dest_data, send_data_size;

HL = sizeof (ip_header) sizeof (igmp_header) send_data_size;

Break;

} // end of switch

//send

For (Ulong Sn = 0; SN

ErrorCode = Sendto (SockRaw,

Sendto_buff,

HL,

0,

(Struct SockAddr *) & Destaddr,

Sze);

} // End of for

// Print prompt

FPRINTF (stderr, ");

// If an error, print the error message and pause

IF (erroorcode == socket_error) {

FPRINTF (stderr, "/ n data transmission error, error code:% D / N"

"Ctrl C exits, any key to continue to send ... / N", getLastError ());

System ("pause");

}

// Delay for a certain time

Sleep (delay_time);

} // End of for

// Release some memory

IF (ip_buff) free (IP_BUFF);

IF (port_buff) free (port_buff);

IF (ip_chk_buff) free (IP_CHK_BUFF);

IF (other_chk_buff) free (other_chk_buff);

// Close the handle

CloseSocket (SOCKRAW);

WSACLEANUP ();

Return 1;

}

//

// Calculative papers

// Fill message must pay attention to the switching of network bytes and host bytes

//

Int acid () {

/ / Calculate the buffer

CHAR MakeSumbuff [MAX_BUFF_LEN];

// Analyze the IP stream of destination

IF (! getipandportbyline (dest_ip))

Return 0;

// Start setting the variable of the IP header

IP_HEADER.H_VERLEN = (iPver << 4 | sizeof (ip_header) / sizeof (unsigned long); // version number ip_header.tos = (uchar) ip_tose; // service type

// This is also different from the length of a specific message field.

ip_header.total_len = sizeof (ip_header) send_data_size; // 16-bit total length (byte)

// This means that each time is sent once, you need to change

IP_Header.Ident = 0; // 16 bit identity

IP_HEADER.FRAG_AND_FLAGS = IP_FLAG; // 3 bit flag

IP_HEADER.TTL = (uchar) ip_ttle; // 8-bit survival time TTL

// Protocol type needs to be changed

IP_HEADER.PROTO = 0; // protocol type

// Good test and needs to be changed

IP_HEADER.CHECKSUM = 0; // Effection

// Source address needs to be changed

IP_HEADER.SOURCEIP = 0; // 32 bitsource IP address

// This changed the byte order

IP_HEADER.Destip = HTONL (IPTL); // 32 bit IP address

IF (! assmemory (& ip_chk_buff, ip_forge_deg, ip_forge_deg))

Return 0;

Ulong i;

Switch (send_data_type) {

Case 1: // TCP package

/ / The protocol is set to TCP

IP_HEADER.PROTO = IPPROTO_TCP;

/ / Plus the TCP structure, assign the value to the head of IP

IP_HEADER.TOTAL_LEN = HTONS (ip_header.total_len sizeof (tcp_header));

// Source address needs to be changed

PSD_Header.saddr = 0; // Source address

PSD_Header.daddr = IP_HEADER.Destip; // destination address

PSD_Header.mbz = 0;

PSD_Header.ptCl = IP_HEADER.PROTO; / / Directly take the protocol

PSD_Header.tcpl = HTONS (SIZEOF (TCP_HEADER) Send_Data_size);

// Pack TCP header

// Source port number needs to be changed

TCP_HEADER.TH_SPORT = 0; // Source port number

TCP_HEADER.TH_DPORT = HTONS (portt); // destination port number

// SYN serial number to change

TCP_HEADER.TH_SEQ = 0; // SYN serial number

TCP_HEADER.TH_ACK = HTONL (TCP_ACK); // ACK sequence number is 0

TCP_HEADER.TH_LENRES = (SizeOf (TCP_HEADER) / SIZEOF (Unsigned Long) << 4 | 0); // TCP length and reserved bit

TCP_HEADER.TH_FLAG = (uchar) TCP_FLAG; // SYN Sign

TCP_HEADER.TH_WIN = HTONS (TCP_WINS); // Window Size

TCP_HEADER.TH_URP = HTONS (TCP_URP); // Offset

// Good test and needs to be changed

TCP_HEADER.TH_SUM = 0; // Check and

// Calculate IP_forge_deg agency and out

For (i = 0; i

// Fill some variables changed each time, such as source IP, source port, SEQ, etc. IP_HEADER.SOURCEIP = HTONL (IP_BUFF [I]);

IP_HEADER.IDENT = HTONS ((USHORT) ((i IP_IDENT)% MAX_SHORT) 1);

PSD_Header.saddr = IP_HEADER.SOURCEIP;

TCP_HEADER.TH_SPORT = HTONS (port_buff [i]);

TCP_HEADER.TH_SEQ = HTONL ((TCP_SEQ I)% Max_Short);

// The TCP pseudo head and TCP first send it to the calculation of TCP's first functions and

MEMSET (MakeSumbuff, 0, Max_Buff_len);

Memcpy (MakeSumbuff, & PSD_Header, Sizeof (PSD_Header);

Memcpy (MakeSumbuff SizeOf (PSD_Header), & TCP_Header, Sizeof (TCP_HEADER));

Memcpy (MakeSumbuff SizeOf (PSD_Header) Sizeof (TCP_HEADER),

Send_dest_data, send_data_size;

Other_chk_buff [i] = checksum ((Ushort *) MakeSumbuff,

SIZEOF (PSD_HEADER) SIZEOF (TCP_HEADER) Send_Data_size);

/ / Then combine IP header to calculate the IP header

MEMSET (MakeSumbuff, 0, Max_Buff_len);

Memcpy (MakeSumbuff, & IP_Header, SIZEOF (IP_HEADER));

Memcpy (MakeSumbuff SizeOf (IP_HEADER), & TCP_HEADER, SIZEOF (TCP_HEADER));

Memcpy (MakeSumbuff SizeOf (IP_HEADER) SIZEOF (TCP_HEADER),

Send_dest_data, send_data_size;

IP_CHK_BUFF [I] = CHECKSUM ((Ushort *) MakeSumbuff,

SIZEOF (ip_header) SIZEOF (TCP_HEADER) Send_Data_size);

} // End of for

Break;

Case 2: // udp package

IP_HEADER.PROTO = IPPROTO_UDP;

IP_HEADER.TOTAL_LEN = HTONS (ip_header.total_len sizeof (udp_header));

PSD_Header.saddr = 0;

PSD_Header.daddr = IP_Header.destip;

PSD_Header.mbz = 0;

PSD_Header.ptCl = IP_HEADER.PROTO;

PSD_Header.tcpl = HTONS (sizeof (udp_header) send_data_size);

UDP_HEADER.UH_SPORT = 0;

UDP_HEADER.UH_DPORT = HTONS (portt);

UDP_HEADER.UH_LEN = HTONS (SIZEOF (UDP_HEADER) Send_Data_size);

UDP_HEADER.UH_SUM = 0;

For (i = 0; i

IP_HEADER.IDENT = HTONS ((USHORT) ((i IP_IDENT)% MAX_SHORT) 1);

PSD_Header.saddr = IP_HEADER.SOURCEIP;

UDP_HEADER.UH_SPORT = HTONS (port_buff [i]);

MEMSET (MakeSumbuff, 0, Max_Buff_len);

Memcpy (MakeSumbuff, & PSD_Header, Sizeof (PSD_Header);

Memcpy (MakeSumbuff SizeOf (PSD_Header), & UDP_Header, SizeOf (UDP_Header));

Memcpy (MakeSumbuff SizeOf (PSD_Header) Sizeof (UDP_HEADER),

Send_dest_data, send_data_size;

Other_chk_buff [i] = checksum ((Ushort *) MakeSumbuff,

SIZEOF (PSD_HEADER) SIZEOF (UDP_HEADER) Send_Data_size);

MEMSET (MakeSumbuff, 0, Max_Buff_len);

Memcpy (MakeSumbuff, & IP_Header, SIZEOF (IP_HEADER));

Memcpy (MakeSumbuff SizeOf (IP_HEADER), & UDP_HEADER, SIZEOF (UDP_HEADER));

Memcpy (MakeSumbuff SizeOf (IP_HEADER) SIZEOF (UDP_HEADER),

Send_dest_data, send_data_size;

IP_CHK_BUFF [I] = CHECKSUM ((Ushort *) MakeSumbuff,

SIZEOF (ip_header) sizeof (udp_header) send_data_size);

} // End of for

Break;

Case 3: // ICMP package

IP_HEADER.PROTO = ipproto_ICMP;

IP_HEADER.TOTAL_LEN = HTONS (ip_header.total_len sizeof (icmp_header));

ICMP_HEADER.I_TYPE = (UCHAR) ICMP_TYPE;

ICMP_HEADER.I_CODE = (UCHAR) ICMP_CODE;

ICMP_HEADER.I_CKSUM = 0;

ICMP_HEADER.I_ID = HTONS (ICMP_ID);

ICMP_HEADER.I_SEQ = 0;

ICMP_HEADER.TIMESTAMP = 0;

For (i = 0; i

IP_HEADER.SOURCEIP = HTONL (IP_BUFF [I]);

IP_HEADER.IDENT = HTONS ((USHORT) ((i IP_IDENT)% MAX_SHORT) 1);

ICMP_HEADER.I_SEQ = HTONS ((iShort) ((ICMP_SEQ I)% Max_Short));

ICMP_HEADER.TIMESTAMP = HTONL ((ICMP_TIME I)% Max_short); Memcpy (MakeSumbuff, & ICMP_HEADER, SIZEOF (ICMP_HEADER));

Memcpy (MakeSumbuff Sizeof (ICMP_HEADER),

Send_dest_data, send_data_size;

Other_chk_buff [i] = checksum ((Ushort *) MakeSumbuff,

SIZEOF (ICMP_HEADER) Send_Data_size);

Memcpy (MakeSumbuff, & IP_Header, SIZEOF (IP_HEADER));

Memcpy (MakeSumbuff SizeOf (IP_HEADER), & ICMP_Header, Sizeof (ICMP_HEADER));

Memcpy (MakeSumbuff SizeOf (IP_HEADER) SIZEOF (ICMP_HEADER),

Send_dest_data, send_data_size;

IP_CHK_BUFF [I] = CHECKSUM ((Ushort *) MakeSumbuff,

SIZEOF (IP_HEADER) SIZEOF (ICMP_HEADER) Send_Data_size);

}

Break;

Case 4: // igmp package

IP_HEADER.PROTO = ipproto_igmp;

IP_HEADER.TOTAL_LEN = HTONS (ip_header.total_len sizeof (igmp_header));

IGMP_HEADER.I_CODE = (uchar) IGMP_CODE;

IGMP_HEADER.I_TYPE = (UCHAR) IGMP_TYPE;

IGMP_HEADER.I_ADDR = HTONL (IGMP_ADDR);

IGMP_HEADER.I_NV = 0;

For (i = 0; i

IP_HEADER.SOURCEIP = HTONL (IP_BUFF [I]);

IP_HEADER.IDENT = HTONS ((USHORT) ((i IP_IDENT)% MAX_SHORT) 1);

Memcpy (MakeSumbuff, & IgMP_Header, Sizeof (IGMP_HEADER));

Memcpy (MakeSumbuff Sizeof (IGMP_HEADER),

Send_dest_data, send_data_size;

Other_chk_buff [i] = checksum ((Ushort *) MakeSumbuff,

SIZEOF (IGMP_HEADER) Send_Data_size);

Memcpy (MakeSumbuff, & IP_Header, SIZEOF (IP_HEADER));

Memcpy (MakeSumbuff SizeOf (IP_Header), & IGMP_Header, SizeOf (IGMP_HEADER));

Memcpy (MakeSumbuff SizeOf (IP_HEADER) SIZEOF (IGMP_HEADER),

Send_dest_data, send_data_size;

IP_CHK_BUFF [I] = CHECKSUM ((Ushort *) MakeSumbuff,

SIZEOF (ip_header) sizeof (igmp_header) send_data_size);

Break;

DEFAULT:

FPRINTF (stderr, "unknow data type / n");

Return 0;

} // end of switch

Return 1;

}

//

// Construct forgery data

//

Int makeforgedata () {

// Pack forged IP

Switch (forge_type) {

Case 1: // This model

// Get the host name

Char name [MAX_HOSTNAME_LAN];

MEMSET (name, 0, max_hostname_lan);

IF (socket_error == gethostname (name, max_hostname_lan) {

FPRINTF (stderr, "gethostname function failed, error code:% d / n", wsagetlasterror ());

Return 0;

}

// Get the IP through the host name

Struct hostent * phostent;

phostent = NULL;

phostent = gethostByName (Name);

IF (phostent == NULL) {

FPRINTF (stderr, "gethostbyname function failed, error code:% d / n", wsagetlasterror ());

Return 0;

}

// Get the native IP, note that this is the host byte order, and Phost points to the network byte order.

// If you want to add you must first turn to host bytes, then do 1 and other operations, and finally go to the network byte.

/ / Of course, this can be unnecessary here, but in order to be compatible, it is converted.

IPTL = NTOHL ((ULONG) (* (Struct In_ADDR *) phostent-> h_addr) .s_addr);

// The number of counterfeit is set to 1

// Similarly, it is clear for the code.

IP_forge_deg = 1;

// Apply for a buffer, there is only one

// Don't forget to release it later

// In addition, the values ​​of these are different types, pay attention

IF (! assmemory (& ip_buff, ip_forge_deg, & port_buff, ip_forge_deg))

Return 0;

// Fill buffer

Portt = forge_port;

Port_buff [0] = portt;

IP_BUFF [0] = IPTL;

Break;

Case 2: // Specify IP type

/ / Split the command line inside the parameter

// It is worth noting that the value of the IPTL returned here is the host byte, no need to switch again

if (! getipandportbyline (forge_ip))

Return 0;

IP_forge_deg = 1;

IF (! assmemory (& ip_buff, ip_forge_deg, & port_buff, ip_forge_deg))

Return 0;

Port_buff [0] = portt;

IP_BUFF [0] = IPTL;

Break;

Case 3: / / Specify IP increment

if (! getipandportbyline (forge_ip))

Return 0;

// Apply for a buffer, here only n, increment from the initial IP

// The specific number is set to the count

IF (! assmemory (& ip_buff, ip_forge_deg, & port_buff, ip_forge_deg))

Return 0;

/ / All assignment

/ / The value here is all all host bytes, and it is unified backwards.

Ulong i;

For (i = 0; i

IP_BUFF [I] = IPTL;

Port_buff [i] = portt;

IPTL ;

Portt ;

IF (portt> = max_port)

Portt = 1;

} // End of for

Break;

Case 4: // Specify file type

/ / Open the IP file

FILE * IPFP;

IPFP = NULL;

IPFP = fopen (Forge_IP_File, "R");

IF (IPFP == NULL) {

FPRINTF (stderr, "open file /"% s / "error, error code:% d / n", forge_ip_file, getLastError ());

Return 0;

}

Ulong Numread;

IP_forge_deg = 0;

/ / Get the number of IPs in the file

While (1) {

MEMSET (Send_Dest_Data, 0, Max_Buff_len);

Numread = fread (send_dest_data, sizeof (char), max_buff_len, ipfp);

IF (NumRead <= 0)

Break;

Ulong i;

For (i = 0; i

IF (send_dest_data [i] == '/ n')

IP_forge_deg ;

} // end of while

// Error closes the handle, return

// Note Close the handle

IF (ip_forge_deg <= 0) {

FPRINTF (stderr, "gets the number of IP numbers in the file ./n");

Fclose (IPFP);

Return 0;

}

/ / According to the number of applications

IF (! assmemory (ip_forge_deg, & port_buff, ip_forge_deg) {

Fclose (IPFP);

Return 0;

}

/ / Position to the beginning of the file

FSeek (IPFP, 0, seek_set);

Char iptemp [max_hostname_lan];

// Start taking every IP

For (i = 0; i

/ / Clear buffer

MEMSET (iptemp, 0, max_hostname_lan);

// Get IP, it is to get information on a line

FGETS (iptemp, max_hostname_lan, ipfp);

// fgets will get the end / N, remove the last / N

IPTEMP [Strlen (iptemp) - 1] = 0;

// Analyze IP, error assignment

IF (! getipandportbyline (iptemp)) {

// If an error, you assign the default value.

IP_BUFF [I] = DEF_FORGE_IP;

Port_buff [i] = def_forge_port;

} else {// end of ix

// Assign each buffer

IP_BUFF [I] = IPTL;

Port_buff [i] = portt;

} // End of else

} // End of for

// Close the file handle

Fclose (IPFP);

Break;

Case 5: // Random

// Apply for a buffer, there is n

IF (! assmemory (& ip_buff, ip_forge_deg, & port_buff, ip_forge_deg))

Return 0;

// Set random seed

SRAND (NULL);

Char ip [20];

// Fill the random IP and port for (i = 0; i

MEMSET (IP, 0, 20);

Sprintf (IP, "% d.% d.% d.% d" ((()% 255) 1),

(RAND ()% 256), (RAND ()% 256), (RAND ()% 256);

// Replace the buffer after conversion

IP_BUFF [I] = INET_ADDR (IP);

Port_buff [i] = ((RAND ()% max_port) 1);

} // End of for

Break;

DEFAULT:

FPRINTF (stderr, "unknown forged type / N");

Return 0;

} // end of switch

/ / Define a macro

#define max_read_file_buff 1024

// If you specify a file file, start with information

IF (send_data_file == ") {

FILE * SDFP = NULL;

//open a file

SDFP = FOPEN (Send_Data_File, "R");

IF (SDFP == NULL) {

FPRINTF (stderr, "Open file /":% s / "error, error code:% d / n", send_data_file, getLastError ());

Return 0;

}

MEMSET (Send_Dest_Data, 0, Max_Buff_len);

CHAR TEMPBUFF [MAX_READ_FILE_BUFF];

int Tempread;

INT ReadsendDataNum = 0;

While (1) {

// Read the file, if the file ends, exit

// If the content exceeds the maximum buffer, exit

MEMSET (Tempbuff, 0, Max_read_file_buff);

Tempread = FREAD (TempBuff, Sizeof (Char), Max_read_file_buff, sdfp);

IF (Tempread <= 0 || readsendDatanum == max_buff_len)

Break;

IF (ReadsendDataNum Tempread> max_buff_len)

Tempread = max_buff_len - readsenddatanum;

Memcpy (Send_Dest_data ReadsendDataNum, Tempbuff, Tempread);

ReadsendDataNum = Tempread;

} // end of while

Fclose (SDFP);

// If you have not specified the size of the send information, the actual read data size is used.

IF (send_data_size == 0)

Send_data_size = readsenddatanum;

/ / Need to align data

IF (send_data_size% 32! = 0)

Send_data_size = (32 - (Send_Data_size% 32));

} // end of if

Return 1;

}

//

// Entry to initialize the value function

//

INT setInitializeValue (int Argc, char * argv []) {

Int temp;

// Analyze the command line and assign the initial value.

For (INT i = 1; i

IF (argv [i] [0] == '/' || argv [i] [0] == '-' || argv [i] [0] == '//') {// Start analysis Parameters

Switch (argv [i] [1]) {

Case '?':

Case 'h':

Case 'h':

USAGE ();

Break;

Case 'T': // TCP Packet

// send_data_type's value 1 is TCP, 2 is UDP, 3 is ICMP, 4 is IGMP

Send_data_type = 1;

// Prepare parameter length

Temp = Strlen (& Argv [i] [3]);

// Check the length of the IP parameter

IF (Temp <= 0 || Temp> max_hostname_lan) {

FPRINTF (stderr, "destination length error:% s / n", argv [i]);

Return 0;

}

// Accept IP parameters

STRCPY (dest_ip, & argv [i] [3]);

Break;

Case 'u': // UDP packet

Send_data_type = 2;

// Prepare parameter length

Temp = Strlen (& Argv [i] [3]);

IF (Temp <= 0 || Temp> max_hostname_lan) {

FPRINTF (stderr, "destination length error:% s / n", argv [i]);

Return 0;

}

STRCPY (dest_ip, & argv [i] [3]);

Break;

Case 'c': // ICMP Packet

Send_data_type = 3;

// Prepare parameter length

Temp = Strlen (& Argv [i] [3]);

IF (Temp <= 0 || Temp> max_hostname_lan) {

FPRINTF (stderr, "destination length error:% s / n", argv [i]);

Return 0;

}

STRCPY (dest_ip, & argv [i] [3]);

Break;

Case 'g': // IGMP packet

Send_data_type = 4;

// Prepare parameter length

Temp = Strlen (& Argv [i] [3]);

IF (Temp <= 0 || Temp> max_hostname_lan) {

FPRINTF (stderr, "destination length error:% s / n", argv [i]);

Return 0;

}

STRCPY (dest_ip, & argv [i] [3]);

Break;

Case 'n': // Send number

Send_degree = atol (& Argv [i] [3]);

IF (send_degree <= 0) {

FPrintf (stderr, "error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'x': // Each message is sent

Send_sdeg = atol (& Argv [i] [3]);

IF (send_sdeg <= 0) {

FPrintf (stderr, "Error Error Error:% S / N", Argv [I]);

Return 0;

}

Break;

Case 'm': // Delay time

DELAY_TIME = ATOI (& Argv [i] [3]);

IF (delay_time <= 0 || delay_time> = max_port) {fprintf (stderr, "delay parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'd': // Send information

// Prepare parameter length

Temp = Strlen (& Argv [i] [3]);

IF (Temp <= 0 || TEMP> MAX_BUFF_LEN) {

FPRINTF (stderr, "destination length error:% s / n", argv [i]);

Return 0;

}

MEMSET (Send_Dest_Data, 0, Max_Buff_len);

STRCPY (Send_Dest_Data, & Argv [i] [3]);

// Get the size of additional data

Send_data_size = temp;

Break;

Case 'f': // Send information by file designation

// Prepare parameter length

Temp = Strlen (& Argv [i] [3]);

IF (Temp <= 0 || TEMP> max_path) {

FPRINTF (stderr, "file length is exceed:% s / n", argv [i]);

Return 0;

}

MEMSET (send_data_file, 0, max_path);

STRCPY (Send_Data_file, & Argv [I] [3]);

Break;

Case 's': // Send information maximum length

Send_data_size = ATOI (& Argv [i] [3]);

IF (send_data_size <= 0 || send_data_size> = max_buff_len) {

FPRINTF (stderr, "maximum length:% s / n", argv [i]);

Return 0;

}

Break;

// IP packet parameter setting

Case 'I':

Switch (argv [i] [2]) {

Case 's':

IP_tose = (uchar) ATOI (& Argv [i] [4]);

IF (ip_tose <= 0 || ip_tose> = max_char) {

FPRINTF (stderr, "IP TOS parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'I':

IP_IDENT = ATOI (& Argv [i] [4]);

IF (ip_ident <= 0 || ip_ident> = max_short) {

FPRINTF (stderr, "IP Ident Parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'f':

IP_FLAG = ATOI (& Argv [i] [4]);

IF (ip_flag <= 0 || IP_FLAG> = max_short) {

FPRINTF (stderr, "IP Flag parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'T':

IP_TTTLE = (uchar) ATOI (& Argv [i] [4]);

IF (ip_ttle <= 0 | ip_ttle> = max_char) {

FPRINTF (stderr, "IP TTL parameter error:% s / n", argv [i]); return 0;

}

Break;

} // end of switch

Break;

Case 'T':

Switch (argv [i] [2]) {

Case 'W':

TCP_WINS = ATOI (& Argv [i] [4]);

IF (TCP_WINS <= 0 || TCP_WINS> = max_short) {

FPRINTF (stderr, "TCP WINS Parameters error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'f':

TCP_FLAG = ATOI (& Argv [I] [4]);

IF (TCP_FLAG <= 0 || TCP_FLAG> = max_char) {

FPRINTF (stderr, "TCP Flag parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 's':

TCP_SEQ = ATOL (& Argv [i] [4]);

IF (TCP_SEQ <= 0 || TCP_SEQ> = Max_long) {

FPRINTF (stderr, "TCP SEQ parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'a':

TCP_ACK = atol (& Argv [i] [4]);

IF (TCP_ACK <= 0 || TCP_ACK> = Max_long) {

FPRINTF (stderr, "TCP ACK Parameter Error:% S / N", Argv [I]);

Return 0;

}

Break;

Case 'u':

TCP_URP = ATOI (& Argv [i] [4]);

IF (TCP_URP <= 0 || TCP_URP> = max_short) {

FPRINTF (stderr, "TCP URP parameter error:% s / n", argv [i]);

Return 0;

}

Break;

} // end of switch

Break;

Case 'C':

Switch (argv [i] [2]) {

Case 'T':

ICMP_TYPE = ATOI (& Argv [I] [4]);

IF (ICMP_TYPE <= 0 || ICMP_TYPE> = Max_short) {

FPRINTF (stderr, "ICMP TYPE parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'C':

ICMP_CODE = ATOI (& Argv [i] [4]);

IF (ICMP_CODE <= 0 || ICMP_CODE> = Max_short) {

FPRINTF (stderr, "ICMP code parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'I':

ICMP_ID = ATOI (& Argv [i] [4]);

IF (ICMP_ID <= 0 || ICMP_ID> = Max_short) {

FPRINTF (stderr, "ICMP ID parameter error:% s / n", argv [i]);

Return 0;}

Break;

Case 's':

ICMP_SEQ = ATOI (& Argv [i] [4]);

IF (ICMP_SEQ <= 0 || ICMP_SEQ> = Max_short) {

FPRINTF (stderr, "ICMP SEQ parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'M':

ICMP_TIME = ATOL (& Argv [i] [4]);

IF (ICMP_TIME <= 0 || ICMP_TIME> = Max_long) {

FPRINTF (stderr, "ICMP TIM parameter error:% s / n", argv [i]);

Return 0;

}

Break;

} // end of switch

Break;

Case 'g':

Switch (argv [i] [2]) {

Case 'C':

IGMP_CODE = ATOI (& Argv [i] [4]);

IF (IGMP_CODE <= 0 || IGMP_CODE> = max_short) {

FPRINTF (stderr, "IGMP code parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'T':

IGMP_TYPE = ATOI (& Argv [i] [4]);

IF (IGMP_TYPE <= 0 || igmp_type> = max_short) {

FPRINTF (stderr, "IGMP Typee parameter error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'a':

IGMP_ADDR = ATOL (& Argv [i] [4]);

IF (IGMP_ADDR <= 0 || IGMP_ADDR> = Max_long) {

FPRINTF (stderr, "ICMP ID parameter error:% s / n", argv [i]);

Return 0;

}

Break;

} // end of switch

Break;

Case 'L': // Forgery Settings

IP_forge_deg = atoi (& Argv [i] [3]);

IF (ip_forge_deg <= 0) {

FPRINTF (stderr, "forgery error:% s / n", argv [i]);

Return 0;

}

Break;

Case 'f': // Forged mode

Switch (argv [i] [2]) {

Case '1': // Mode 1, native IP, you need to specify a port data

Forge_Type = 1;

Forge_Port = ATOI (& Argv [i] [4]);

IF (Forge_Port <= 0 || forge_port> = max_port) {

Forge_Port = DEF_PORT_DA;

}

Break;

Case '2': // Mode 2, fixed IP settings, you must specify IP and port

Forge_Type = 2;

// Prepare parameter length

Temp = Strlen (& Argv [i] [3]);

IF (Temp <= 0 || Temp> max_hostname_lan) {

FPRINTF (stderr, "forgery IP address error:% s / n", argv [i]);

Return 0;}

STRCPY (Forge_IP, & Argv [I] [4]);

Break;

Case '3': // mode 3, specify IP starts increment

Forge_Type = 3;

// Prepare parameter length

Temp = Strlen (& Argv [i] [3]);

IF (Temp <= 0 || Temp> max_hostname_lan) {

FPRINTF (stderr, "forgery IP address error:% s / n", argv [i]);

Return 0;

}

STRCPY (Forge_IP, & Argv [I] [4]);

Break;

CASE '4': // mode 4, IP is provided by file

Forge_Type = 4;

// Prepare parameter length

Temp = Strlen (& Argv [i] [3]);

IF (Temp <= 0 || TEMP> max_path) {

FPRINTF (stderr, "file information error:% s / n", argv [i]);

Return 0;

}

STRCPY (forge_ip_file, & argv [i] [4]);

Break;

Case '5': // mode 5, random generate IP

Forge_Type = 5;

Break;

} // end of switch

Break;

} // end of switch

} // end of if

} // End of for

IF (dest_ip == "") {

FPRINTF (stderr, "must contain a destination address ./n");

Return 0;

}

Return 1;

}

//

// Analyze IP segment

//

INT GetipandPortbyline (char * iPL) {

//variable

Char ip [MAX_HOSTNAME_LAN] = "";

// Get IP

Char * fgp = strrchr (iPl, ':');

// Judgment if only IP is included

IF (fgp! = null) {

// Copy IP

STRNCPY (IP, IPL, (FGP - IPL));

// error

IF (ip == ") {

FPRINTF (stderr, "IP data error ./n");

Return 0;

}

// copy port

FGP ;

Portt = ATOI (FGP);

// Port Select an error, set the default port

IF (portt <= 0 || portt> = max_port) {

Portt = def_port_da;

}

} else {

// only contain IP, set the default port

STRCPY (IP, IPL);

Portt = def_port_da;

}

// If there is a domain name, it is transformed into IP.

IF (IP [0] <'0' || IP [0]> '9') {

Struct Hostent * Server_Host = NULL;

Server_host = gethostByName (IP);

// error

IF (server_host == null) {

FPRINTF (stderr, "unable to convert IP, error code:% D / N", wsagetlasterror ());

Return 0;

}

// Address transformation to host address, assignment, return

IPTL = NTOHL ((ULONG) (* (struct in_addr *) server_host-> h_addr) .s_addr);

} else {

IPTL = NTOHL (INET_ADDR (IP));

Return 1;

}

//

// Initialize the connection function

//

Int setInitializesock () {

INT TIMEOUT = MAX_TIMEOUT;

INT flag = 1;

// Initialize SOCK_RAW

WSADATA WSADATA = {0};

IF ((ERRORCODE = WSAStartup (Makeword (2, 1), & WSADATA)! = 0) {

FPRINTF (stderr, "WSAStartup function failed, error code:% D / N", wsagetlasterror ());

Return 0;

}

SockRaw = WSASOCKET (AF_INET, SOCK_RAW, IPPROTO_RAW, NULL, 0, WSA_FLAG_OVERLAPPED);

IF (SockRaw == Invalid_socket) {

FPRINTF (stderr, "wsasocket () function failed, error code:% D / N", wsagetlasterror ());

Return 0;

}

/ / Set IP_HDRINCL to fill the IP headers yourself

ErrorCode = setsockopt (SockRaw, Ipproto_IP, IP_HDRINCL, (CHAR *) & flag, sizeof (int));

IF (erroorcode == socket_error) {

FPRINTF (stderr, "setsockopt (ip_hdrincl) function failed, error code:% D / N", wsagetlasterror ());

Return 0;

}

// Set the send timeout

ErrorCode = setsockopt (SockRaw, SOL_Socket, SO_SNDTIMEO, (CHAR *) & Timeout, SizeOf (Timeout));

IF (erroorcode == socket_error) {

FPRINTF (stderr, "setsockopt (so_sndtimeo) function failed, error code:% D / N", wsagetlasterror ());

Return 0;

}

Return 1;

}

//

// Good test and function

//

Ushort Checksum (Ushort * Buffer, Int size) {

Unsigned long cksum = 0;

While (size> 1) {

CKSUM = * Buffer ;

Size - = SizeOf (Ushort);

}

IF (size) {

CKSUM = * (Uchar *) BUFFER;

}

CKSUM = (CKSUM >> 16) (CKSUM & 0xFFF);

CKSUM = (CKSUM >> 16);

Return (Ushort) (~ CKSUM);

}

//

// Assign the memory function 1

//

Int assmemory (ulong ** a, ulong sa, ushort ** b, ulong sb) {

* a = (ulong *) Malloc (sa * sizeof (ulong));

* b = (ushort *) malloc (sb * sizeof (ushort));

IF (* a == null || * b == NULL) {

FPRINTF (stderr, "allocated memory failed ./N");

Return 0;

}

MEMSET (* a, 0, sa * sizeof (ulong)); MEMSET (* B, 0, SB * SIZEOF (Ushort));

Return 1;

}

//

// Assign the memory function 2

//

INT Assmemory (ushort ** a, ulong sa, ushort ** b, ulong sb) {

* a = (ushort *) Malloc (sa * sizeof (ushort));

* b = (ushort *) malloc (sb * sizeof (ushort));

IF (* a == null || * b == NULL) {

FPRINTF (stderr, "allocated memory failed ./N");

Return 0;

}

MEMSET (* a, 0, sa * sizeof (ushort));

MEMSET (* B, 0, SB * SIZEOF (Ushort);

Return 1;

}

//

// Print help

//

Void usage () {

/ / Software copyright information, help information

fprintf (stderr, "=============================================== ==================== / n "

"Packet sender 1.0 (Lecher back door with software) / N"

Date: [2004.25] / N "

"Author: [Zvrop] [zvrop@163.com] / n"

"Environment: [WinXP Visual C 6.0] / N"

"Home: [http://www.geedao.com] [http://www.ringz.org] / n"

"=================================================== ================ / n "

"How to use: / n"

"NetsendData.exe / N"

"/ T-T: [CHR] / - U: [CHR] / - C: [CHR] / - G: [CHR] / N"

"/ T-N: [NUM] / N"

"/ T-x: [NUM] / N"

"/ T-M: [NUM] / N"

"/ T-D: [CHR] / - f: [chr] / n"

"/ T-S: [NUM] / N"

"/ T-IS: [NUM] | -II: [NUM] | -IF: [NUM] | -IT: [NUM] / N"

"/ t-tw: [NUM] | -TF: [NUM] | -TS: [NUM] | -TA: [NUM] | -TU: [NUM] / N" "/ T-CT: [NUM] | -CC: [NUM] | -CI: [NUM] | -CS: [NUM] | -CM: [NUM] / N "

"/ T-GC: [NUM] | -gt: [NUM] | -GA: [NUM] / N"

"/ T-L: [NUM] / N"

"/ T-F1: [NUM] / - F2: [CHR] / - F3: [CHR] / - F4: [CHR] / - F5 / N"

"/ t -? / - h / -h / N"

"=================================================== ================ / n "

"The above /" chr / "identifier indicates that the parameter is a string type, /" NUM / "identifier indicates that the parameter is pure-quantitative type / N"

"/" | / "Identifier identifier This group parameter can be set at the same time, /" // "identifier indicates that the group parameter can only set one, if multiple, the final parameters are accurate. / N "

"=================================================== ================ / n "

Basic parameters: / n "

"-t: [chr] sends TCP packets, followed by a destination location address (IP: , port default:% u) / n"

"-u: [chr] sends UDP packets, followed by a destination location address (IP: ) / N"

"-c: [chr] sends ICMP packets, followed by a destination location address (IP: ) / N"

"-g: [chr] sends IGMP packets, followed by a destination location address (IP: ) / N"

"-n: [NUM] Sends the number of components of the data packet group, and a group of messages can contain any number of messages, the default value:% U, the maximum:% u / N"

"-x: [NUM] The number of packets sent by each group, default:% U, maximum:% u / N"

"-m: [NUM] Each time the delay time is sent, when sending a group of information, the error message is not output, the default value:% u / n"

"-? / - h / -h print help information / N"

"/ n Additional Information Parameters: / N"

"-d: [chr] send the additional data of the message, the maximum length:% U bytes / N"

"-F: [chr] The additional numerical value sent by the message is specified by the file, and the full file name must be given ./n"

"-S: [NUM] Send the maximum length of the packet additional data, when the value is greater than the length of the information you provide, the data is insufficient to supplement /" 0 / ", when the value is not equal to 32 integration, will be Automatic expansion. Default: 0, indicating that you do not add any additional data to the message, usually, the -d and -f parameters will automatically revise this value, but if you set this value, the -d and -f parameters are Will not change this value ./n""/n message field parameters (recommend not to use unless you fully understand the meaning of each field, the number of spatial bytes of the field in the registration, without special instructions This value will be converted by the byte position (host -> network)): / n "

"-Is: [NUM] IP Packet (1): Service Type (TOS) bit parameter field setting, default:% u / n"

"-Ii: [NUM] IP packet (2): Identify bit parameter field setting, default:% u / n"

"-IF: [NUM] IP packet (2): flag bit parameter setting, default value:% u / n"

"-It: [NUM] IP packet (1): TTL bit parameter setting, default value:% u / n"

"-Tw: [NUM] TCP Packet (2): Window size bit parameter setting, default:% u / n"

"-TF: [NUM] TCP Packet (1): Sign bit parameter setting, default:% u / n"

"-TS: [NUM] TCP Packet (4): Sequence List Parameter Setting, Default:% U / N"

"-TA: [NUM] TCP Packet (4): Verify the number of parameter settings, default:% u / n"

"-Tu: [NUM] TCP packet (2): emergency data offset parameter setting, default:% u / n"

"-Ct: [NUM] ICMP Packet (2): Type Bit Parameter Setting, Default:% U / N"

"-CC: [NUM] ICMP Packet (2): Code Bit Parameter Setting, Default:% U / N"

"-CI: [NUM] ICMP Packet (2): Identification number parameter setting, default:% u / n"

"-CS: [NUM] ICMP Packet (2): Sequence Bit Parameter Setting, Default:% U / N"

"-Cm: [NUM] ICMP Packet (4): Timestamp bit parameter setting, default value:% u / n"

"-Gc: [NUM] IGMP packet (2): version bit parameter setting, default value:% u / n"

"-Gt: [NUM] IGMP packet (2): Type bit parameter setting, default:% u / n"

"-Ga: [NUM] IGMP Packet (4): Group address bit parameter setting, default:% u / n"

"/ n forged source parameter setting: / n"

"-l: [NUM] forgery the source number setting, the default value:% U, the value can be used without the number of sending parameters, the system will automatically loop. But set less, the back parameters will not be sent, theory You can set it to% U, but depending on the size of your memory ./N "

"-f1: [num] forgery mode 1, native IP, you need to provide a port parameter, default is:% u, all forged IPs are provided, that is, provide this parameter, set the forged source The number of parameters is already invalid, and the memory is taken up ./N "

"-f2: [chr] forgery mode 2, fixed IP, you need to provide a source location parameter (IP: ), [Representation of the meaning of this machine IP settings] / N"

"-f3: [chr] forgery mode 3, fixed IP increments, need to provide a starting fake position parameter (IP: ), incrementing this parameters, such as what you want to make a categorized source , Set this parameter to 192.168.1.1:12345, then the number of forgery is set to 255, pay attention to both, not, increment IP, the port is incremented ./n

"-f4: [chr] forgery mode 4, from the file acquisition source location parameters, you must provide a local file name, each address in the file occupies a row, the default port is% U, support the domain name format (will also be converted to IP during operation) ), Using IP: format, for example: 192.168.1.2: 12345, www.web.com: 54321./n

"-f5 forgery mode 5, randomly generate IP, port / N"

"=================================================== ================ / n "" [Warning: This software is certain in danger, please use it in full understanding] / n "

"[Author does not have any form of responsibility for any form of software] / N"

"The software serves as a program that is included in the back door of Lecher. In fact, there are many online already online, and it has been very early. I write a few common data formats this time. The way, improve the speed of sending packet, almost provide a modification of all variable parameters, I hope everyone can be convenient, if you feel more trouble, you can write a shell to call, it is very convenient, 俺It's not good at writing the GUI program, ^ _ ^ ~ / n "

,

DEF_PORT_DA,

Send_degree, Max_long,

Send_sdeg, Max_long,

DELAY_TIME,

Max_buff_len,

IP_tose,

IP_IDENT,

IP_FLAG,

IP_TTLE,

TCP_WINS,

TCP_FLAG,

TCP_SEQ,

TCP_ACK,

TCP_URP,

ICMP_TYPE,

ICMP_CODE,

ICMP_ID,

ICMP_SEQ,

ICMP_TIME,

IGMP_CODE,

IGMP_TYPE,

IGMP_ADDR,

IP_forge_deg, max_long,

DEF_PORT_DA

);

}

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

New Post(0)