But I just can't seem to get this right.
This is a rather simple HTTP request that uploads a file.
Code: Select all
POST /sql.php HTTP/1.1\r\n
Host: 192.168.0.15\r\n
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
Accept-Language: en-US,en;q=0.5\r\n
Accept-Encoding: gzip, deflate\r\n
Connection: keep-alive\r\n
Content-Type: multipart/form-data; boundary=---------------------------42419928114728521141917828577\r\n\r\n
-----------------------------42419928114728521141917828577\r\n
Content-Disposition: form-data; name="userfile"; filename="payload-small.txt"\r\n
Content-Type: text/plain\r\n\r\n
aaaaaa\n
aaaaaa\r\n
-----------------------------42419928114728521141917828577--\r\n\r\n
If I use a regular form to do it then it works, and I have just about copy/pasted the data now from the original request into my python script.
I get HTTP 200/OK back, but the files do not show up.
The usual trouble is newlines and carriage return, but I think I got it right ....
Any ideas?