miraip0ts

PENIS_SET_UP_FTP

Oct 11th, 2018
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.25 KB | None | 0 0
  1. import subprocess, sys, urllib, time
  2. ip = urllib.urlopen('http://api.ipify.org').read()
  3.  
  4. def run(cmd):
  5.     subprocess.call(cmd, shell=True)
  6. print("\x1b[0;37m[CC] INSTALLING WEB SERVER DEPENDENCIES")
  7. run("yum install httpd -y &> /dev/null")
  8. run("service httpd start &> /dev/null")
  9. run("yum install xinetd tftp tftp-server -y &> /dev/null")
  10. run("yum install vsftpd -y &> /dev/null")
  11. run("service vsftpd start &> /dev/null")
  12. run('''echo "service tftp
  13. {
  14.     socket_type             = dgram
  15.     protocol                = udp
  16.     wait                    = yes
  17.    user                    = root
  18.    server                  = /usr/sbin/in.tftpd
  19.    server_args             = -s -c /var/lib/tftpboot
  20.    disable                 = no
  21.    per_source              = 11
  22.    cps                     = 100 2
  23.    flags                   = IPv4
  24. }
  25. " > /etc/xinetd.d/tftp''') 
  26. run("service xinetd start &> /dev/null")
  27. run('''echo "listen=YES
  28. local_enable=NO
  29. anonymous_enable=YES
  30. write_enable=NO
  31. anon_root=/var/ftp
  32. anon_max_rate=2048000
  33. xferlog_enable=YES
  34. listen_address='''+ ip +'''
  35. listen_port=21" > /etc/vsftpd/vsftpd-anon.conf''')
  36. run("service vsftpd restart &> /dev/null")
  37. run("service xinetd restart &> /dev/null")
  38. run("ulimit -u99999; ulimit -n99999")
  39. exit()
Advertisement
Add Comment
Please, Sign In to add comment