daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Dec 16th, 2018 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import telnetlib
  2. import sys
  3. import time
  4.  
  5.  
  6. HOST = sys.argv[1]
  7. USER = sys.argv[2]
  8. PASSWORD = sys.argv[3]
  9.  
  10. telnet = telnetlib.Telnet(HOST)
  11.  
  12. telnet.read_until("login: ")
  13. telnet.write(USER + "\n")
  14.  
  15. telnet.read_until("Password: ")
  16. telnet.write(PASSWORD + "\n")
  17.  
  18. telnet.write("mkdir /tmp -p\n")
  19. telnet.write("cd /tmp\n")
  20. telnet.write("uname -m\n")
  21. time.sleep(1)
  22. arch = telnet.read_very_eager().split('\n')[-2]
  23.  
  24. if arch[0:3] == 'arm':
  25.     telnet.write("wget http://192.168.0.110/ARM/busybox-arm\n")
  26.     telnet.write("wget http://192.168.0.110/ARM/client\n")
  27.     telnet.write("wget http://192.168.0.110/ARM/strace\n")
  28.     telnet.write("wget http://192.168.0.110/ARM/tcpdump\n")
  29.     telnet.write("chmod +x busybox-arm\n")
  30.     telnet.write("chmod +x client\n")
  31.     telnet.write("chmod +x strace\n")
  32.     telnet.write("chmod +x tcpdump\n")
  33.    
  34. else:
  35.     telnet.write("wget http://192.168.0.110/MIPSEB/busybox-mips\n")
  36.     telnet.write("wget http://192.168.0.110/MIPSEB/client\n")
  37.     telnet.write("wget http://192.168.0.110/MIPSEB/strace\n")
  38.     telnet.write("wget http://192.168.0.110/MIPSEB/tcpdump\n")
  39.     telnet.write("wget http://192.168.0.110/MIPSEB/netstat-mips\n")
  40.     telnet.write("wget http://192.168.0.110/MIPSEB/server\n")
  41.     telnet.write("wget http://192.168.0.110/MIPSEB/timeout\n")
  42.     telnet.write("chmod +x busybox-mips\n")
  43.     telnet.write("chmod +x client\n")
  44.     telnet.write("chmod +x strace\n")
  45.     telnet.write("chmod +x tcpdump\n")
  46.     telnet.write("chmod +x netstat-mips\n")
  47.     telnet.write("chmod +x server\n")
  48.     telnet.write("chmod +x timeout\n")
  49.  
  50. telnet.write("exit\n")
  51. print telnet.read_all()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top