2 minutes
FDCA Xmas 2024 Day 14 - No Command Here - Part 1
Challenge Description
Danish (original)
FDCA Special Ops har, siden vores første kontakt med Asgård, haft gang i en operation med at kortlægge Jættenettet. I går lykkedes det dem at identificere noget, der ligner en tankeboks fra Loke.
De har fået opsnappet en fil som ser ud til at give adgang. Men da de allerede er fuldt optaget af deres nuværende operationer, håber vi at du kan finde noget interessant i tankeboksen.
English (from chatgpt)
FDCA Special Ops has, since our first contact with Asgård, been conducting an operation to map the Giant Network. Yesterday, they succeeded in identifying something that looks like a thought box from Loki.
They managed to intercept a file that seems to grant access. But since they are already fully occupied with their current operations, we hope you can find something interesting in the thought box.
File
We are also given the following file:
Domain and port
In addition we are given a domain and port: jættenettet.dk:2222
Solution
The file is an openssh private key:
$ file loki.priv
loki.priv: OpenSSH private key
Using it to login over ssh we get a bash shell, but no commands work:
$ ssh -p 2222 -i loki.priv loki@jættenettet.dk
Oh no! Where's my commands?
bash$ ls
-bash: ls: No such file or directory
bash$ cat
-bash: cat: No such file or directory
So we need to find files and read them using builtin constructs, in my case I used for
loops, globbing and having the error messages be the output:
bash$ function ls() {
> for file in $1/*; do
> $file
> done
> }
bash$ function cat() {
> for value in $(< $1); do
> $value
> done
> }
bash$ ls
-bash: /archive: Is a directory
-bash: /bin: Is a directory
-bash: /considerations.md: Permission denied
-bash: /credit.md: Permission denied
-bash: /etc: Is a directory
-bash: /lib: Is a directory
-bash: /lib64: Is a directory
-bash: /vault: Is a directory
bash$ ls vault
-bash: vault/flag.txt: Permission denied
bash$ cat vault/flag.txt
-bash: .: Is a directory
-bash: .: Is a directory
-bash: .: Is a directory
-bash: .: Is a directory
-bash: .: Is a directory
-bash: FDCA{Ba5h_Liter4te_y0u_ar3}: No such file or directory
-bash: .: Is a directory
-bash: .: Is a directory
-bash: .: Is a directory
-bash: .: Is a directory
-bash: .: Is a directory