httpx icon indicating copy to clipboard operation
httpx copied to clipboard

Request body missing when using the `-rr` flag

Open seeyarh opened this issue 4 years ago • 0 comments

Looks like the -rr functionality is broken on master. The request headers are included in the POST request but the request body is not included. Below is the output when I use debug to dump the request.

$ ./httpx -rr req.txt -l winrm-test2.txt -json -irr -v -o test.json -d
ebug -unsafe

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/              v1.2.0

                projectdiscovery.io

Use with caution. You are responsible for your actions.
Developers assume no liability and are not responsible for any misuse or damage.
[INF] Dumped HTTP request for https://176.53.94.149:5985/wsman

POST /wsman HTTP/1.1
Connection:close
Host: 0.0.0.0:5985
User-Agent:Mozilla/5.0 (Linux; Android 8.0.0; LG-H873) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36
Accept: */*
Content-Type: application/soap+xml;charset=UTF-8
Wsmanidentify: unauthenticated
Content-Length: 234

The file req.txt looks like

POST /wsman HTTP/1.1
Host: 0.0.0.0:5985
User-Agent: curl/7.68.0
Accept: */*
Content-Type: application/soap+xml;charset=UTF-8
WSMANIDENTIFY: unauthenticated
Content-Length: 234

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsmid="http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"><s:Header/><s:Body><wsmid:Identify/></s:Body></s:Envelope>

Adding the following line after line 152 in runner/runner.go seems to fix the problem.

options.RequestBody = rrBody

seeyarh avatar Mar 11 '22 15:03 seeyarh