curl
curl linux command cheatsheet by Thamizhiniyan C S
Introduction
curl is a tool for transferring data from or to a server using URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.
Syntax
curl [options...]
Important Flags
Flags | Description |
---|---|
| Will display a progress meter for you to know how much the download has progressed.(or use --silent flag for a silent crawl) |
| Saves the file downloaded with the name given following the flag. |
| Saves the file with the name it was saved on the server. |
| This flag can resume your broken download without specifying an offset. |
| Limits the download/upload rate to somewhere near the specified range (Units in 100K,100M,100G) |
| Provides user authentication (Format: -u user:password) |
| Helps in uploading the file to some server(In our case php-reverse-shell) |
| If you have to view the page through a PROXY. You can specify the proxy server with this flag. (-x proxy.server.com -u user:password(Authentication for proxy server)) |
| (Caps i) Queries the header and not the webpage. |
| You can specify user agent to make request to the server |
| Tells curl to follow redirects |
| This flag allows you to specify cookies while making a curl request(Cookie should be in the format "NAME1=VALUE1;NAME2=VALUE2") |
| This flag can be used to POST data to the server(generally used for posting form data). |
| To specify the HTTP method on the URL. (GET,POST,TRACE,OPTIONS) |
Examples
Command | Description |
---|---|
cURL help menu | |
Basic GET request | |
Download file | |
Skip HTTPS (SSL) certificate validation | |
Print full HTTP request/response details | |
Send HEAD request (only prints response headers) | |
Print response headers and response body | |
Set User-Agent header | |
Set HTTP basic authorization credentials | |
Pass HTTP basic authorization credentials in the URL | |
Set request header | |
Pass GET parameters | |
Send POST request with POST data | |
Set request cookies | |
Send POST request with JSON data |
APIs
Command | Description |
---|---|
Read entry | |
jq | |
Create (add) entry | |
Update (modify) entry | |
Delete entry |
Last updated