Baby
Tools
- ldapsearch
- crackmapexec
- smbpasswd
- evil-winrm
- impacket-secretsdump
Getting User
Nmap
1 | ┌──(kali㉿kali)-[~] |
Foothold
add domain name and the dcs’s to hosts file
1 | echo "10.129.234.71 baby.vl BabyDC.baby.vl" | sudo tee -a /etc/hosts |
using ldapsearch i was able to find this description which shows an initial password
1 | ┌──(kali㉿kali)-[~] |
I tested the credentials to login with Teresa.Bell with crackmapexec but credentials failed
I created a users.txt to try the password on the users I found
1 | ┌──(kali㉿kali)-[~] |
1 | crackmapexec smb 10.129.234.71 -u it_users.txt -p 'BabyStart123!' --continue-on-success |
but it wasn’t successful also
i found more accounts by using grep to view only the dn (Distinguished Name) which shows us the CN (Common Names) of the objects
1 | ┌──(kali㉿kali)-[~] |
I’m going to save the output of CN to allusers.txt, also removing the spaces and replacing them with .
1 | ┌──(kali㉿kali)-[~] |
Going to try smbmapexec again against all the users
I got a hit, the password belongs to Caroline.Robinson
but I have to change the user’s password
1 | ┌──(kali㉿kali)-[~] |
I changed the password to BabyStart321! using smbpasswd
1 | ┌──(kali㉿kali)-[~] |
Now I am able to login using evil-winrm to get the user flag
1 | ┌──(kali㉿kali)-[~] |
Getting Root
Information Gathering
First I checked user privileges
1 | *Evil-WinRM* PS C:\Users\Caroline.Robinson\Desktop> whoami /all |
I see that i’m in this group BUILTIN\Backup Operators and have the following privileges
1 | SeBackupPrivilege Back up files and directories Enabled |
I save sam and lsa secrets using impacket-reg on the target’s machine
1 | ┌──(kali㉿kali)-[~] |
I downloaded them using evil-wirnm
1 | *Evil-WinRM* PS C:\programdata> download sam.save |
next, I dumped the secrets using impacket-secretsdump
1 | ┌──(kali㉿kali)-[~] |
I tried to login to administrator using the administrator hash but failed, then tried it against the users.txt, which also failed
1 | ┌──(kali㉿kali)-[~] |
then I tried the hash of the machine account and it was correct
1 | ┌──(kali㉿kali)-[~] |
Privilege Escalation
now I’ll dump sam and lsa secrets of the machine account using the hash
1 | ┌──(kali㉿kali)-[~] |
I tested the administrator’s hash against all the users and got a hit the administrator account
1 | ┌──(kali㉿kali)-[~] |
logged in using evil-winrm and I am now able to get the root flag
1 | ┌──(kali㉿kali)-[~] |