The objective of this track is to learn how to inject data dynamically at test time using just-in-time data.
You'll emulate user input that is typically added in a track's challenge manually using a solve
script that will be verified later in a check
script.
In this first challenge, you're going to get a random word from an online resource and then assign that random word to an environment variable that you'll persist in the /root/.bashrc
file. Saving the environment variable to the /root/.bashrc
file will makes its value available later on.
The online resource you'll use to get a random word is an API published by https://wordnik.com. You'll need to register to the site and get an API key in order to have the website provide a random word. You'll add the API to the URL that you'll call using a curl
command. The command you'll use to get the random word is:
SECRET_MESSAGE=$(curl -s 'https://api.wordnik.com/v4/words.json/randomWord?api_key=<YOUR_API_KEY> | jq -r '.word')