CURL

Curl is a command line based tool that can use various protocols for transferring data from a server to a client. It is popularly used as a command line browser to access a website. Some of the popular protocols supported by CURL are,

DICT FTP(S) Gopher HTTP(S) IMAP Kerberos LDAP MQTT POP3 RTSP RTMP SCP SMTP SMB

This is a popular tool for hacking since it can be liberally used in manipulating HTTP requests. This is particularly useful in cases of testing APIs as the requests can be modified to the detail to exploit a server's API.

HTTP

A webserver/website can be accessed using curl by using the following command,

curl http://www.google.com/

Additional parameters can be included in the curl command to achieve the following,

sX - HTTP Method (GET,POST,PUT,HEAD) can be indicated with this option
cookie - A cookie header can be included using this option
H - An additional header can be included using this option
d - HTTP body/payload can be included using this option

Here is an example command using the above commands,

curl -sX POST http://example.com/api/v1/admin/settings --cookie "PHPSESSID=vgvgl6uod6rs8218132ntc0bmb" -H "Content-Type: application/json" -d@message.json

Last updated