Restricted was a challenge in the misc category. It’s description says the following:
You ’re still trying to collect information for your research on the alien relic. Scientists contained the memories of ancient egyptian mummies into small chips, where they could store and replay them at will. Many of these mummies were part of the battle against the aliens and you suspect their memories may reveal hints to the location of the relic and the underground vessels. You managed to get your hands on one of these chips but after you connected to it, any attempt to access its internal data proved futile. The software containing all these memories seems to be running on a restricted environment which limits your access. Can you find a way to escape the restricted environment ?
There is a file download, lets download the files and open them up. One of the files is a Dockerfile with the following content
|
|
Looks like it sets up some things in a debian container. A user restricted
with as shell /bin/rbash
, this is a shell that is restricted in a few ways for example you are not able to use /
in commands. Hmm ok, so how do we cat the flag?
Well there is a way to bypass this behavior by running the command as a “startup” command in ssh.
The command we need to get the flag is cat /flag*
, lets try running it.
ssh restricted@DOCKERIP -p DOCKERPORT cat /flag*
And that worked, we got the flag!
HTB{r35tr1ct10n5_4r3_p0w3r1355}