I have scanned with nmap command and I try different thing.
Enumeration
Rustscan is a very useful tool for scanning all ports. The tool is very fast and can scan all ports within 1 second. I will use it for the entire enumeration process.
I scanned 79 port with finger-user-enum.pl. You can download the file. sammy and sunny may be login to ssh.
Initial foothold
I tried SSH brute force with Hydra, but it took a lot of time, so I decided to use the port number as the password
When I run sudo -l command. I see that can run file without permission.
As I understand, when I run the file I see the output that file run id command.
By the way There is a other user except root and sunny. It is sammy user. I looked bash_history and backup directory is significant.
I found two hashes under the backup directory.
Prilivige Escalation
“I tried to crack the hash of sammy using the john command.
I login ssh with user sammy and when I run sudo -l command, I can use wget command with root permission.
I changed troll file with using wget command and I run troll command with sunny user.
troll file
I create http server on my local machine to send the troll file to target machine.
two services are running on the target machine and I looked the webservice and scanned the directory with gobuster
All endpoints return either 403 or 301 I can’t find more information about website. Let’s go more deep. I have scanned every endpoint until find a valuable info.
I open the binary with ghidra. We see the main function.
There is function that is name exam. I look the exam function.
We see the 2 functions. These are reverse and xor.
Firstly, I look reverse function.
This function gets a list as a param_1 and param_2 and gets a integer value. Integer value provide a limit of for function. I look the t list and get a note for the reversing.
I look the other function. function provides to make a xor between local_38 and t2 list.
I start the target ip and port with nc and encounter console ask some questions. I answer the question.