5

A normal HTTP request may look something like this:

GET / HTTP/1.1
Host: example.com

I would like to change the first line of this request, with a custom one, e.g.:

FOOBAR NOT REALLY HTTP
Host: example.com

Is it possible to do this using curl or this there another tool, capable of doing this?

8

You can do this by using tool netcat(also called as nc).

Just from command line, do the following steps to send the modified request.

$ nc <ip-address-of-webserver> 80
  FOOBAR NOT REALLY HTTP
  Host: example.com
1

curl is only able to speak a couple of well defined protocols. What you are trying to do is no valid http nor any valid other protocol.

If you really want to do it this way you can simply send your text for example using netcat.

1

There are 2 options: telnet example.com 80 and nc example.com 80

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.