Difficulty: ❄ ❄ ❄ ❄ ❄
Team up with Bow Ninecandle to send web requests from the command line using Curl, learning how to interact directly with web servers and retrieve information like a pro!
Hints
cURL Manual
From: Bow Ninecandle
The official cURL man page has tons of useful information on how to use cURL.
cURL: Don’t squash
From: Bow Ninecandle
Take a look at cURL’s “–path-as-is” option; it controls a default behavior that you may not expect!
Silver trophy
1 | Welcome to Curling Fun! We will learn some basic curl commands while playing a round of curling. |
1 | 1) Unlike the defined standards of a curling sheet, embedded devices often have web servers on non-standard ports. Use curl to retrieve the web page on host "curlingfun" port 8080. |
1 | 2) Embedded devices often use self-signed certificates, where your browser will not trust the certificate presented. Use curl to retrieve the TLS-protected web page at https://curlingfun:9090/ |
1 | 3) Working with APIs and embedded devices often requires making HTTP POST requests. Use curl to send a request to https://curlingfun:9090/ with the parameter "skip" set to the value "alabaster", declaring Alabaster as the team captain. |
1 | 4) Working with APIs and embedded devices often requires maintaining session state by passing a cookie. Use curl to send a request to https://curlingfun:9090/ with a cookie called "end" with the value "3", indicating we're on the third end of the curling match. |
1 | 5) Working with APIs and embedded devices sometimes requires working with raw HTTP headers. Use curl to view the HTTP headers returned by a request to https://curlingfun:9090/ |
1 | 6) Working with APIs and embedded devices sometimes requires working with custom HTTP headers. Use curl to send a request to https://curlingfun:9090/ with an HTTP header called "Stone" and the value "Granite". |
1 | 7) curl will modify your URL unless you tell it not to. For example, use curl to retrieve the following URL containing special characters: https://curlingfun:9090/../../etc/hacks |
1 | Great work! |
Gold trophy
The instructions to get start on the gold trophy are in the file HARD-MODE.txt:
1 | alabaster@curlingfun:~$ cat HARD-MODE.txt |
1 | alabaster@curlingfun:~$ curl -k https://curlingfun:9090 -d skip=bow -b end=10 -H "Hack:12ft" |
1 | alabaster@curlingfun:~$ curl -k https://curlingfun:9090/../../etc/button --path-as-is |
1 | alabaster@curlingfun:~$ curl -k https://curlingfun:9090/GoodSportsmanship -L |