Overpass 2 - Hacked
Tasks:
Forensics - Analyse the PCAP:
- Download and open pcap file in wireshark
- Follow up http stream and answer questions regarding url of shell upload and payload used.
- Follow up tcp stream to get commands used by attacker and answer related questions.
From commands you can see attacker logged in as james user with whenevernoteartinstant
password.
- Attacker then used ssh-backdoor to establish persistence.
- From tcp stream you can see attacker used
cat /etc/shadow,copy the username and password hash from it and crack it using john the ripper and fasttrack wordlist and complete this task.
Research - Analyse the code:
- Go to ssh-backdoor and analyze the code in main.go , it has hardcoded default hash and salt.
- While analyzing PCAP file , following tcp stream we came to know that attacker used
./backdoor -a 6d05358f090eea56a238af02e47d44ee5489d234810ef6240280857ec69712a3e5e370b8a41899d0196ade16c0d54327c5654019292cbfe0b5e98ad1fec71bedto establish backdoor and run it as service in port 2222. - Use the above hash and hardcoded salt from main.go and crack it using hashcat to obtain ssh backdoor password.(sha512 hash with salt mode) - november16
Attack - Get back in! :
- Login as james using ssh on port 2222 with the password obtained above.
cat /home/james/user.txtand submit user flag.- Search for suid binaries using
find / -perm -u=s -type f 2>/dev/null, .suid_bash looks weird from the list. - .suid_bash is bash binary , execute it with -p flag to get root.
cat /root/root.txtand submit root flag !!!
References: