Quantgnome Leap
Charlie in the hotel has quantum gnome mysteries waiting to be solved. What is the flag that you find?
Quantgnome Leap
Difficulty: ❄ ❄ ❄ ❄ ❄
Charlie in the hotel has quantum gnome mysteries waiting to be solved. What is the flag that you find?
Hints
Quantgnome Leap
If you want to create SSH keys, you would use the ssh-keygen tool. We have a special tool that generates post-quantum cryptographic keys. The suffix is the same as ssh-keygen. It is only the first three letters that change.
Quantgnome Leap
Process information is very useful to determine where an application configuration file is located. I bet there is a secret located in that application directory, you just need the right user to read it!
Quantgnome Leap
User keys are like presents. The keys are kept in a hidden location until they need to be used. Hidden files in Linux always start with a dot. Since everything in Linux is a file, directories that start with a dot are also…hidden!
Quantgnome Leap
When you give a present, you often put a label on it to let someone know that the present is for them. Sometimes you even say who the present is from. The label is always put on the outside of the present so the public knows the present is for a specific person. SSH keys have something similar called a comment. SSH keys sometimes have a comment that can help determine who and where the key can be used.
motd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
+---------------------------------+
| "If we knew the unknown, the |
| unknown wouldn't be unknown." |
| — Quantum Leap (TV series) |
+---------------------------------+
You observed me, the Gnome...
...and I observed you back.
Did you see me? Am I here or not?
Both? Neither?
Am I a figment of your imagination?
Nay, I am the QuantGnome. Welcome to my challenge!
***
Like me, the world of cryptography is full of mysteries and surprises.
In this challenge, you will learn about the latest advancements in
post-quantum cryptography (PQC), and how they can help secure our digital
future against the threats posed by quantum computers.
I am a reminder that the future is uncertain,
but with the right tools and knowledge,
we can navigate the unknowns and emerge stronger.
Take the PQC leap with me!
I have created a *PQC* key generation program on this system.
Find and execute it.
Solution
Following the hint about ssh-keygen, I searched the filesystem for similar tools and discovered the pqc-keygen:
1
2
3
4
5
qgnome@quantgnome_leap:~$ find /* 2>&1 | grep -i keygen
/opt/oqs-ssh/share/man/man1/ssh-keygen.1
/opt/oqs-ssh/bin/ssh-keygen
/usr/local/bin/pqc-keygen
/var/log/keygen.log
I ran the tool to generate the keys and to list the available algorithms, which displayed a mix of Classical, PQC, and Hybrid encryption methods:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
qgnome@quantgnome_leap:~$ pqc-keygen
— Summary -> Total algorithms = 28 | ✔ Keys generated = 28
Next, use -t to display key characteristics.
qgnome@quantgnome_leap:~$ pqc-keygen -t
Algorithm Bits NIST Kind
------------------------------------ ---- ---- ---------
sphincssha2128fsimple 32 1 PQC
sphincssha2256fsimple 64 5 PQC
ed25519 256 0 Classical
ecdsa-nistp256-sphincssha2128fsimple 288 1 Hybrid
ecdsa-nistp521-sphincssha2256fsimple 585 5 Hybrid
falcon512 897 1 PQC
ecdsa-nistp256-falcon512 1153 1 Hybrid
mldsa-44 1312 0 PQC
ecdsa-nistp256-mldsa-44 1568 1 Hybrid
falcon1024 1793 5 PQC
mldsa-65 1952 0 PQC
rsa-2048 2048 0 Classical
ecdsa-nistp521-falcon1024 2314 5 Hybrid
ecdsa-nistp384-mldsa-65 2336 3 Hybrid
mldsa-87 2592 0 PQC
mayo3 2986 3 PQC
rsa-3072 3072 1 Classical
rsa3072-sphincssha2128fsimple 3104 1 Hybrid
ecdsa-nistp521-mldsa-87 3113 5 Hybrid
ecdsa-nistp384-mayo3 3370 3 Hybrid
rsa3072-falcon512 3969 1 Hybrid
rsa-4096 4096 1 Classical
rsa3072-mldsa-44 4384 0 Hybrid
mayo2 4912 1 PQC
ecdsa-nistp256-mayo2 5168 1 Hybrid
mayo5 5554 5 PQC
ecdsa-nistp521-mayo5 6075 5 Hybrid
rsa3072-mayo2 7984 1 Hybrid
------------------------------------ ---- ---- ---------
You can use 'ssh-keygen -l -f <private key>' to see the bit size of a key.
Next step, SSH into pqc-server.com.
qgnome@quantgnome_leap:~$ for i in $(ls -1); do ssh-keygen -l -f $i; done
256 SHA256:jSd9Oh01nfXqc8Qc21YEA3dHf7k1xkgbmnWXDljnLJA (ED25519)
2048 SHA256:4WWhFAxNP8QiW6fIfalp3POEKRSChUEKnYVDw4b6jEI (RSA)
3072 SHA256:m1H5gxhoYmOgrt3TXd4lWUVgBcw9oeEkoJilxcoL0NM (RSA)
4096 SHA256:IBJ3fXWja7+27Qe964IPF9KL0sAOyqQ9ZRwm9t8LN54 (RSA)
1153 SHA256:E4fAnisXN4csmKWgfZDTZgSe4Km0s34iWPyWvYzBa7o (ECDSA_NISTP256_FALCON512)
5168 SHA256:WQYb8qvmhcfUtXdsleIwxetbfemq3WpWAX51QFrTRDw (ECDSA_NISTP256_MAYO2)
1568 SHA256:Hyq4E8yn4OHW53CtklIu4vO42sOFu7UDIRzwjbIXnoU (ECDSA_NISTP256_MLDSA-44)
288 SHA256:wyOR+UiCkUhFVJQYTLnEpuTEYhoS5OoSpL2pnE7TX2g (ECDSA_NISTP256_SPHINCSSHA2128FSIMPLE)
3370 SHA256:tUx783Up7H5iQ9qSgcUGHBOI1TI7VF/ixfNQOrtHlDk (ECDSA_NISTP384_MAYO3)
2336 SHA256:CcxQefcFIU0weFlcSHvzo8oi1qXvaRMv6wj/eI4kcEg (ECDSA_NISTP384_MLDSA-65)
2314 SHA256:RMYzR+vLEyktvicll0HmWYZ/GTKWGy72iY8TdcZYiag (ECDSA_NISTP521_FALCON1024)
6075 SHA256:VSSbch3yp1Bj84gQ5g5A3aYOZzK0hoZ63EE0dwO4wkY (ECDSA_NISTP521_MAYO5)
3113 SHA256:PFxrZ/lp3gs0Z/pVNBROGRvUBndOCEBibTc4bHZmG0s (ECDSA_NISTP521_MLDSA-87)
585 SHA256:vi7od+KH36dDwwLs8Sw88PjoRLje+a30yf9n2lWw9is (ECDSA_NISTP521_SPHINCSSHA2256FSIMPLE)
1793 SHA256:ssWsj9tYNUSMbiD717QLF9ia2cNmZqI9XSXbIlyxuNA (FALCON1024)
897 SHA256:KPpdiqx9QflJJwM6Ugx06QE2vsNruckUdSMkml0ZGtY (FALCON512)
4912 SHA256:ikD6vsBwzutDlu2s44jDQm+z2J+7p7mhjPee29Ga/gM (MAYO2)
2986 SHA256:BqZ0+DqurC5e7sLYjqDznrlICENRgsmGXlac+GIJhxk (MAYO3)
5554 SHA256:DmrK8og+8hyGY0VoMrXB7eAd1JXA4JA3zEte/bocIPc (MAYO5)
1312 SHA256:IXqDFKhctSD3uQdmM22p4RdUusi1IejUTnoCwZMSDLo (MLDSA-44)
1952 SHA256:quXtrrcAfIREealrEGu3M3KDG5ZYVnpCHuwa7BGLYBc (MLDSA-65)
2592 SHA256:rAI0gHRDHCEzYDv9wW2B8KMZmrKMt2SqLQOfkRm2BV4 (MLDSA-87)
3969 SHA256:fwC2Zf7YFJRSqkA/F5U25qGfPN4ml1+1x53Ci0kEezU (RSA3072_FALCON512)
7984 SHA256:cMdXvd0aWpDlPmSFVGcxgySRvU9yuiRGKum54YNjKxs (RSA3072_MAYO2)
4384 SHA256:PRt4x30hQUQB6dyp0HygWjlM4RduYxjE2LWMRKJLixA (RSA3072_MLDSA-44)
3104 SHA256:oFtoDeKBTzpsY7RZNfLdx4F4dt7H89Jx+nTqE6+Zcwk (RSA3072_SPHINCSSHA2128FSIMPLE)
32 SHA256:XtYsyRQHdvR7ilpq17F55oRdHxsYs4wQN61Fb9mMN6k (SPHINCSSHA2128FSIMPLE)
64 SHA256:fzvuGvnBC2Y6Ljn80qL72eRyyqWTUjGFWazEoyBshmk (SPHINCSSHA2256FSIMPLE)
Moving on to the login on pqc-server.com I checked the ~/.ssh directory and found a collection of RSA keys that allowed the first leap:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
qgnome@quantgnome_leap:~$ cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCya6rjv+pf55l/EvEIZW+yhBdrpBrS0rmyysVhdR5Zn2aatLVDhRnNQrH+si6SOaDAOPhOhy037auUveLhEFaQBDQIDqisQ8JoTT/TKhyO97h1IUkl3zmsuw4Kcu1r24L2UJCIVStiJR8vQU8U0Kg5eWuDRev9j+2VMGqF2hmYqssTNbxHNeNbEr1R6/wciSAa3hNwksqE3dYjbr07veKAIcWcsaPMRHmjHrHXdLLwyweXhgzidd3AgzDskub9XdAiXs2B93mFNbQWel+nE2smxUVUY+SLsGXDTXAJu5AqYXrDEJtSuCOCHKXyPX7WCbmAllQo1FB/9K59pI552+K062SvGDCeLEPpcELozU52/awX2yeldNOj7Bn/xXdKpSPHLUrhsj8y/9gVTnS/0q6VLzO8qIwzxdGh7P0OtQqMrSRkTLEHtdOjojTmT70WUpUaVWXf65X8ymY72G49lJjFVAyM6AFBQK/K52f0UTl4XnvkSHwxYNFyk7wGkE07pWU= gnome1
qgnome@quantgnome_leap:~$ ssh gnome1@pqc-server.com
##############################################################################################################################################
Welcome, gnome1 user! You made the first leap!
You authenticated with an RSA key, but that isn't very secure in a post-quantum world. RSA depends on large prime numbers, which a quantum
computer can easily solve with something like Shor's algorithm.
Take a look around and see if you can find a way to login to the gnome2 account.
##############################################################################################################################################
As gnome1, I found an ED25519 key key pointing to gnome2:
1
2
3
4
5
6
7
8
9
10
11
12
13
gnome1@pqc-server:~$ cat .ssh/id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKUOOPy0e1+4EzuM5PYc1/lfsXrR9FFDxTxDztvCi0Ce gnome2
gnome1@pqc-server:~$ ssh gnome2@pqc-server.com
##############################################################################################################################################
Welcome, gnome2 user! You made the second leap!
You authenticated with an ED25519 key, smaller than an RSA key, but still not secure in a post-quantum world due to Shor's
algorithm.
Take a look around and see if you can find a way to login to the gnome3 account.
##############################################################################################################################################
As gnome2, I found a key using the MAYO2 algorithm, pointing to gnome3:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
gnome2@pqc-server:~$ cat .ssh/id_mayo2.pub
ssh-mayo2 AAAACXNzaC1tYXlvMgAAEzCnvbGit3qCT/thcAuQO1oD/cTqLsG9gC2XVHMB76bqVfQhR8u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~$ ssh gnome3@pqc-server.com
##############################################################################################################################################
Welcome, gnome3 user! You made the third leap!
You authenticated with a MAYO post-quantum key.
A post-quantum cryptographic algorithm with promising results for embedded systems. HOWEVER, use MAYO with caution! Wait for a
standardized implementation (if/when that happens).
Take a look around and see if you can find a way to login to the gnome4 account.
##############################################################################################################################################
As gnome3, I found a hybrid key pointing to gnome4:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
gnome3@pqc-server:~$ cat .ssh/id_ecdsa_nistp256_sphincssha2128fsimple.pub
ssh-ecdsa-nistp256-sphincssha2128fsimple AAAAKHNzaC1lY2RzYS1uaXN0cDI1Ni1zcGhpbmNzc2hhMjEyOGZzaW1wbGUAAAAIbmlzdHAyNTYAAABBBL6fN38B6kQNiS0vAvGeGjAJ7Da2YbpBaAXkeeDJ3CJIUZc8PzNWCfzW5qN8z0RnS1/Hia1jRt6dydqeiVHBa9cAAAAgRAPMBt8y/4/YdBEw9OutMv37HJy50gIQfmzUY5d82Bg= gnome4
gnome3@pqc-server:~$ ssh gnome4@pqc-server.com
##############################################################################################################################################
Welcome, gnome4 user! You made the fourth leap!
You authenticated with a post-quantum hybrid key! What does that mean? A blended approach with proven classical cryptography and post-quantum
cryptography.
In this case, you authenticated with a NIST P-256 ECDSA key (a classical elliptic curve) that also uses post-quantum SPHINCS+ (standardized
by NIST in FIPS 205 as SLH-DSA). That makes this key extremely robust. According to NIST, this is a security level 1 key, which means this
key is at least as strong as AES128.
Instead of a single exchange/signature (as with RSA or ED25519), this key produces two (one classical and one post-quantum) that are both
checked together. If one fails, authentication fails. A hybrid approach is a great first step when testing and implementing post-quantum
cryptography, giving organizations 'Quantum Agility'.
Take a look around and see if you can find a way to login to the admin account.
##############################################################################################################################################
Finally, as gnome4, I found a hybrid key using NIST P-521 and ML-DSA-87 (CRYSTALS-Dilithium) pointing to admin:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
gnome4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WI0vdVECN+4JneOcPv2vu+mJpfgQmlHGaVGok80apOJ5fbbh2yKKcdvpBNPd3lB+azdYG/ui8GwG+fOIUfzMPZ0FAWuKzO+KL3FdnzXaYn67dqpa6NMtdqX4NmGQHW28aoGqfe/sum0Q4FTQxXAJ5RAvJ34fttg5kswsFi+XZFRwpOmjl60hLS8Foy60asQG8ZQOFNSlikoD8YuKJvzd5xafUqnoaBLd6SwgoLQFLxETShyAM6ijCVM16ofodA8xbc0kXVSZtbJ49h55/KBgIrHyGgN6eqGufJ0mcF+PnbemKhvK0GRpi4tPuRSgxU3b8YgyCspu00K4YjrcDZcoYY3z1F4VWe0izFEeiMwtN25DQtVk2XzKZvtJJCS5A3v9qEssWj3pvsC9PEq4epLe48ztIDjgujzFHtjTRZVFiHfXWuvhQOPPDMEK8AqpkB4B4oO01UKe31aAxA9trs6xYRty22671Cpk3PoKkowGAjy+vehn5af0fr2MGA52MSytWBQpgXmoxxG7dxqr9zVg== admin
gnome4@pqc-server:~$ ssh admin@pqc-server.com
##############################################################################################################################################
You made the QuantGnome Leap! Your final stop.
You authenticated with another hybrid post-quantum key. What is different about this key? It uses the NIST P-521 elliptic curve (roughly
equivalent to a 15360-bit RSA key) paired with ML-DSA-87. According to NIST, ML-DSA-87 is a security level 5 algorithm, which provides the
highest security level and is meant for the most secure environments. NIST standardized CRYSTALS-Dilithium as ML-DSA in FIPS 204 with three
defined security levels:
- ML-DSA-44: Security Level 2 - At least as strong as SHA256/SHA3-256
- ML-DSA-65: Security Level 3 - At least as strong as AES192
- ML-DSA-87: Security Level 5 - At least as strong as AES256
This is one of the strongest hybrid keys available in post-quantum cryptography. The other extremely strong security level 5
algorithms all use a combination of the NIST P-521 elliptic curve and one of the following PQC algorithms:
- falcon1024: Falcon (FN-DSA) with a 1024 lattice dimensional size
- sphincssha2256fsimple: SLH-DSA (SPHINCS+) using SHA2 256 and fast signature generation (hence the 'f' in the algorithm name)
- mayo5: MAYO-5 is the highest of the four MAYO security levels
This entire build/system is based off of the Linux Foundation's Open Quantum Safe (OQS) initiative. It uses the OQS liboqs library which
provides PQC algorithm support.
You can find out more about the OQS initiative at https://openquantumsafe.org/.
Next Step: You now have access to a directory in the same location as the SSH daemon. Time to look around for your final flag.
##############################################################################################################################################
I searched the file system for the flag:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
admin@quantgnome_leap:~$ find /* 2>&1 | grep -i flag
/opt/oqs-ssh/flag
/opt/oqs-ssh/flag/flag
/proc/sys/kernel/acpi_video_flags
/proc/sys/kernel/sched_domain/cpu0/domain0/flags
/proc/sys/kernel/sched_domain/cpu0/domain1/flags
/proc/sys/kernel/sched_domain/cpu1/domain0/flags
/proc/sys/kernel/sched_domain/cpu1/domain1/flags
/proc/sys/kernel/sched_domain/cpu2/domain0/flags
/proc/sys/kernel/sched_domain/cpu2/domain1/flags
/proc/sys/kernel/sched_domain/cpu3/domain0/flags
/proc/sys/kernel/sched_domain/cpu3/domain1/flags
/proc/sys/kernel/sched_domain/cpu4/domain0/flags
/proc/sys/kernel/sched_domain/cpu4/domain1/flags
/proc/sys/kernel/sched_domain/cpu5/domain0/flags
/proc/sys/kernel/sched_domain/cpu5/domain1/flags
/proc/sys/kernel/sched_domain/cpu6/domain0/flags
/proc/sys/kernel/sched_domain/cpu6/domain1/flags
/proc/sys/kernel/sched_domain/cpu7/domain0/flags
/proc/sys/kernel/sched_domain/cpu7/domain1/flags
/proc/kpageflags
/sys/devices/pnp0/00:05/tty/ttyS2/flags
/sys/devices/pnp0/00:03/tty/ttyS0/flags
/sys/devices/pnp0/00:06/tty/ttyS3/flags
/sys/devices/pnp0/00:04/tty/ttyS1/flags
/sys/devices/virtual/net/eth0/flags
/sys/devices/virtual/net/lo/flags
/sys/module/scsi_mod/parameters/default_dev_flags
/usr/lib/bash/fdflags
admin@quantgnome_leap:~$ cat /opt/oqs-ssh/flag/flag
HHC{L3aping_0v3r_Quantum_Crypt0}
Then I submitted the flag HHC{L3aping_0v3r_Quantum_Crypt0} to complete the challenge.
Dissecting the attack
graph TD
subgraph Discovery [1. Discovery]
A["File System Enumeration
(Find SSH Keys)"]
B["Crypto Analysis
(Identify Key Types: RSA, MAYO2, ML-DSA)"]
end
subgraph Lateral [2. Lateral Movement]
C["Credential Abuse
(SSH Login using Found Keys)"]
D["Privilege Escalation Chain
(gnome1 -> ... -> admin)"]
end
subgraph Action [3. Action on Objectives]
E["Data Exfiltration
(Read Flag File)"]
end
%% Flow Connections
A -->|Found id_rsa| C
C -->|Login as gnome1| A
A -->|Found id_ed25519| C
C -->|Login as gnome2| D
D -->|Repeat for gnome3/4| E
%% Styling
style A fill:#7f1d1d,stroke:#ef4444,stroke-width:2px,color:#fff
style B fill:#9a3412,stroke:#f97316,stroke-width:2px,color:#fff
style C fill:#7f1d1d,stroke:#ef4444,stroke-width:2px,color:#fff
style D fill:#9a3412,stroke:#f97316,stroke-width:2px,color:#fff
style E fill:#7f1d1d,stroke:#ef4444,stroke-width:2px,color:#fff
| Phase | Vulnerability (CWE) | Mitigation |
|---|---|---|
| 1. Access | CWE-312 Cleartext Storage of Sensitive Information (Unencrypted Private Keys) | Data Protection (Encryption At Rest / Passphrases) |
| 2. Lateral | CWE-668 Exposure of Resource to Wrong Sphere (User A holding User B's Key) | Access Control (Principle of Least Privilege) |
| 3. Action | CWE-200 Exposure of Sensitive Information to an Unauthorized Actor (Flag File Readable) | Access Control (Strict File Permissions) |
Fixing the Credential Storage (CWE-312)
Vulnerability: The private keys (e.g., id_rsa, id_mayo2) were stored on the disk without a passphrase. This meant that merely having read access to the file was sufficient to impersonate the user, bypassing the need for knowledge (a password) or biometrics.
Fix: Enforce the use of Passphrases for SSH keys. When a key is generated, it should be encrypted using a strong KDF (Key Derivation Function) like bcrypt or Argon2.
Vulnerable Generation:
1
2
# FLAW: Empty passphrase allows immediate use
ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519
Secure Generation:
1
2
# FIX: Require user interaction to decrypt the key
ssh-keygen -t ed25519 -o -a 100 -f ~/.ssh/id_ed25519
Impact: Even if an attacker steals the private key file, they cannot use it to authenticate without also cracking the passphrase.
Fixing the Access Control (CWE-668)
Vulnerability: The challenge relied on a “daisy chain” configuration where gnome1 had access to gnome2’s private key, gnome2 had gnome3’s key, and so on. This violates the Principle of Least Privilege and Separation of Duties. A compromised lower-privilege account should not inherently possess the credentials for a lateral or upward move.
Fix: Store keys only within the directory of the user who owns them, not the user who needs them. Use Public Key Infrastructure (PKI) correctly: gnome1 should hold their own private key, and gnome2 should simply authorize gnome1’s public key in their authorized_keys file (if access is legitimately required).
Secure Architecture:
- Generate:
gnome1generates a key pair. - Authorize:
gnome2appendsgnome1.pubto~/.ssh/authorized_keys. - Authenticate:
gnome1uses their own key to log in tognome2.
Impact: This prevents the exposure of gnome2’s identity. If gnome1 is compromised, the attacker can access gnome2, but they cannot become gnome2 elsewhere (e.g., to access gnome3) because they never possess gnome2’s private key.
Fixing the Information Exposure (CWE-200)
Vulnerability: The final objective, the flag file located at /opt/oqs-ssh/flag/flag, was readable by the admin user. While gaining admin access effectively compromises the system, sensitive data at rest should still be protected by strict file permissions or encryption to prevent unauthorized reads if the application layer is bypassed.
Fix: Apply Defense in Depth. Ensure that critical files are readable only by the specific process or root user required to access them, and consider encrypting highly sensitive data at rest.
Secure Configuration:
1
2
3
# FIX: Restrict read access solely to root
chown root:root /opt/oqs-ssh/flag/flag
chmod 600 /opt/oqs-ssh/flag/flag
Impact: Ensures that even if an administrative account is compromised, the attacker cannot simply cat the sensitive file without first escalating privileges to root.
Funsies
Inception
Have you ever experienced a TeamViewer inception? I did…and a production server crashed 😁
Teamviewer makes it pretty easy to create an infinite window loop:
byu/revile221 ingeek
