Skip to main content

Linux command: curl

curl - Transfer a URL

cURL source code on GitHub:

For Windows, head to curl for windows

curl: see url, or Client for URLs

curl --help
curl -O url
curl -o filename url
curl -I url : Get HEADERS

GET request

$ curl https://api.ipify.org
123.20.185.131

Get HEADERS

$ curl -i https://api.ipify.org
HTTP/1.1 200 OK
Server: Cowboy
Connection: keep-alive
Content-Type: text/plain
Vary: Origin
Date: Mon, 16 Dec 2019 10:13:37 GMT
Content-Length: 13
Via: 1.1 vegur

171.250.70.42

-i vs. -I

# curl -i http://10.10.164.134/info
HTTP/1.1 200 OK
Server: nginx/1.14.1
Date: Sat, 01 May 2021 05:21:23 GMT
Content-Type: application/json
Content-Length: 160
Connection: keep-alive
Build Number: 1.3.4-dev
Server Name: Vincent

"The login API needs to be called with the username and password form fields fields.  It has not been fully tested yet so may not be full developed and secure"

# curl -I http://10.10.164.134/info
HTTP/1.1 200 OK
Server: nginx/1.14.1
Date: Sat, 01 May 2021 05:21:34 GMT
Content-Type: application/json
Content-Length: 148
Connection: keep-alive
Build Number: 1.3.6-final
Server Name: Julias

#

POST request

$ curl https://www.hackthebox.eu/api/invite/how/to/generate -X POST
{"success":1,"data":{"data":"Va beqre gb trarengr gur vaivgr pbqr, znxr n CBFG erdhrfg gb \/ncv\/vaivgr\/trarengr","enctype":"ROT13"},"0":200}          

Login form with username and password

curl -X POST -F 'username=bob' -F 'password=d1ff3r3ntP@55w0rd' http://10.10.226.201:8080/login

Grep all email addresses on web page

curl windcorp.thm | grep -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+[a-zA-Z0-9.-]+\b"

References

Daniel Stenberg on LinkedIn.

Popular posts from this blog

DrayTek VigorAP 910C as Universal Repeater

3 steps to extend wi-fi coverage using DrayTek VigorAP 910C Set Operation Mode to Universal Repeater mode VigorAP 910C: Set Operation Mode Configuration to Universal Repeater Connect DrayTek VigorAP 910C to existing Wi-Fi Access Point Connect DrayTek VigorAP 910C to existing Wi-Fi Access Point Set Security Mode & Pass Phrase for DrayTek VigorAP 910C Set Security Mode & Pass Phrase for DrayTek VigorAP 910C Check Online Status

Google Credential Provider for Windows: Notes

Google Credential Provider for Windows® (GCPW) lets users sign in to Windows® devices with the Google Account they use for work. GCPW provides users with a single sign-on experience to Google services and all the security features available with their Google Account.