CtrlK
Pentest Notes / Enumeration / Tools
cURL
| Flag | Description | Example |
|---|---|---|
| -o | Stores output; name should be given | -o page.html |
| -O | Stores output; name is the one used by webserver | - |
| -s | Silent; no status showed | - |
| -k | Skip SSL certificate check while using HTTPS | - |
| -I | only response headers | - |
| -i | both response headers and body | - |
| -L | follow redirects | - |
| -A | User agent | -A 'Mozilla/5.0' |
| -u | Username and password for login forms | -u admin:password |
| -H | Headers in the request | -H ‘Authorization: Basic somebase64string’ |
| -X | Method | -X POST GET by default |
| -d | Data to be sent | -d ‘username=admin@password=admin’ |
| -b | Cookie | -b ‘sessionid=somevalue’ |
| -T | Uploads files to server, same as HTTP PUT | -T [filename.txt] [http://target/upload] |
Common headers:
Content-Type:
Cookie:
Authorization:
Authentication:
Instead of adding username and password using -u flag:
curl username:password@{MACHINE_IP]
Cookies:
Cookies can also be mentioned in the header:
Eg: cookie is sessionid=somevalue
curl -b 'sessionid=somevalue' http://MACHINE_IP:port or
curl -H ‘Cookie: sessionid=somevalue’ http://MACHINE_IP:port
Note: In WINDOWS: only double quotes must be used and quotes inside data must be escaped: "
Content types:
json: application/json
form: application/x-www-form-urlencoded