Alfred
March 19, 2024
Last updated
March 19, 2024
Last updated
Task 1: Initial Access
First we when we visited the IIS website, we can see here the webpage
Then the second one that we visited is the jenkins login page which is located in port 8080 or http-proxy service
After several tries to login we discovered that the login credentials is default
admin:admin
Then this is the dashboard for the jenkins once you log in as an admin
After navigating to the dashboard now we can access the "project" which is a project that is named as project.
Then we will just click configure which is located in the left side of the page. After that scroll down to the bottom part which is the windows batch command or our payload will be placed...
After we applied and saved our changes to the project we will now click the "Build Now" button to build the project so that our payload will be executed.
We can see here in the console output the reverse shell payload is being processed by the server
And then we got the reverse connection from the server which leads to user bruce
Task 2: Switching Shells
Now we have to switch shell to have a better elevating privilege.
First we have to make a reverse_tcp payload using the msfvenom
Then we need a listener and we will use the meterpreter for that
We will just upload the payload the same as before how we got the reverse shell connection
Just click the build now again
Then payload is now being processed
After we downloaded the malicious exe or the reverse tcp exe. Now we have to get in the box another time using the reverse payload before.
So once again we just apply and save this.
Click the build now
As we get back into the box we can see our newly created malicious exe or the reverse tcp for our meterpreter. We just have to execute it
After we execute the .exe file, now we got the reverse tcp in the meterpreter
First we have to use shell for us to get the normal terminal
Then use the command whoami /priv to view our privilege
After that we will exit from the shell and use the command load incognito
"Incognito allows us to impersonate user tokens. It was first integrated into Metasploit first, then to Meterpreter. In this recipe, we will be covering Incognito and use cases. Tokens are similar to web cookies." - From google
Use the list_tokens -g to view the availabe tokens that we can impersonate
Then just use impersonate_token command and the user that we desire, of course the first user that we will try is administrator
We got the NT authority\system
After that we will get rid of our process in the processes so that we can avoid getting detected
Now view the processes in the box
Just migrate into the services.exe process
When we use the PS command again, now we can't see the shell-name.exe process that we was on before.
Having the highest privilege user in the box will now be able to view the root.txt