<?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 Warren Butterworth on Medium]]></title>
        <description><![CDATA[Stories by Warren Butterworth on Medium]]></description>
        <link>https://medium.com/@warrenbutterworth?source=rss-e4005639dc56------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ElOp9aPYOKVSGcwcSfarOw.png</url>
            <title>Stories by Warren Butterworth on Medium</title>
            <link>https://medium.com/@warrenbutterworth?source=rss-e4005639dc56------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 23:10:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@warrenbutterworth/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[Finding Initial Access on a real life Penetration Test]]></title>
            <link>https://medium.com/@warrenbutterworth/finding-initial-access-on-a-real-life-penetration-test-86ed5503ae48?source=rss-e4005639dc56------2</link>
            <guid isPermaLink="false">https://medium.com/p/86ed5503ae48</guid>
            <category><![CDATA[red-teaming]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Warren Butterworth]]></dc:creator>
            <pubDate>Thu, 23 Mar 2023 16:53:32 GMT</pubDate>
            <atom:updated>2023-03-23T16:53:32.399Z</atom:updated>
            <content:encoded><![CDATA[<p>On a recent internal Penetration Test I was faced with the above scenario and had to work a little harder for Domain Admin. So finding initial access. What do we need to do.. as a rule we will need one of 2 things:</p><p>a) Something vulnerable<br>b) Credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*6_Tk2ST3JGz1ErL_O-__6A.png" /></figure><p>Putting Red team tactics to one side (so that means no phishing etc) one of the above is often our only route to gaining intital access. Basically we need to steal , sniff or crack some credentials or we find something vulnerable (a juicy CVE will do nicely) to enable us to get a beacon/session on our initial target.</p><p>Often the first thing that comes to mind is responder/mitm6 or some sort of MITM attack to steal creds and relay/crack them. This is often a great step and usually finds some weak passwords, but in this case the client had been tested multiple times including by ourselves and had worked hard to push a new password policy. Even with an AWS hashcat instance these credentials were tough to crack.</p><p>Relaying credentials also didnt produce any joy. So we are only left with finding something vulnerable.</p><p>Enter Vcenter. A version of Vcenter was found that was vulnerable to <br><a href="https://nvd.nist.gov/vuln/detail/CVE-2021-22005">CVE-2021–22005</a> which exploits a file upload in VMware vCenter Server’s analytics/telemetry (CEIP) service to write a system crontab and execute shell commands as the root user. Great we can get a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*ASkZYWQuS9prbYDJl-S8bw.png" /><figcaption>CVE-2021–22005 Root Shell</figcaption></figure><p>Gaining access to vCenter as root we can retrieve the data.mdb file which contains certificates which are stored in cleartext and can be used to sign any SAML authentication request for any user including the builtin Administrator. Gaining a root shell allows us to download this file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*eXFe9LP8VroSIvloe4xWFQ.png" /><figcaption>Data.mdb file</figcaption></figure><p>With this file there is a tool created by horizon3ai found <a href="https://github.com/horizon3ai/vcenter_saml_login">here </a>that allows us to create a cookie for the vCenter ui.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*laxiIv__0xyGRCDY8VX04w.png" /><figcaption>Cookie Created</figcaption></figure><p>With this cookie injected into a browser session on the vCenter /ui url we are authenticated onto the vsphere gui administrator.</p><p>Once on Vsphere I looked at 2 different scenarios. <br>1.) Dump vmdks and mount the locally, grab SYSTEM,SAM,SECURITY and dump hashes.<br>2.) Open all vm’s to see if any gave me some sort of access</p><p>I started with download dumps. This has to be done on VM backups or VMs that have been stopped. Fortunately there was a few available but the download size was often quite large.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*93YqZ1pyX31jYt53aTNnDg.png" /><figcaption>Downloading vmdks</figcaption></figure><p>The process involved downloading the vmdk file, using <a href="https://manpages.ubuntu.com/manpages/bionic/man8/kpartx.8.html">kpartx </a>to create device maps from the VMDK partition tables, mount the partition, copy the SAM, SECURITY and SYSTEM files and then run secretsdump on them. This for me gave me access to some RID 500 accounts hashes and Domain Cached Credentials (DCC) (Pretty slow to crack these!) The RID 500s didnt have any access on the rest of the domain but it was a useful exercise. You can find a great writeup on this <a href="https://drmarmar.com/vmdk-credentials">here</a>.</p><p>Next I opened every single VM to see if any didn’t need passwords to login. To my suprise I found one VM that dumped me straight on the desktop with no password prompt. After an initial look around Sophos was found to be running so I wanted to get something running quickly. I set up Responder and ntlmrelay. Using the VM I navigated to my Kali VM, captured and relayed the hash. This was a privileged account so succesfully dumped creds from 2 x Management Servers. Quite a lot of hashes were in here including LSA secrets in cleartext for an account that was configured to start a service. This account was a domain admin.</p><p>Always wanting to go the extra mile as I love getting a CobaltStrike Beacon I wmiexec’d to the Domain Controller. Again Sophos was running. Before dumping any file on disk I ran <a href="https://github.com/matterpreter/OffensiveCSharp/blob/master/HookDetector/Program.cs">Hook Detector</a> to see what Windows APIs were being hooked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*G3yoIVk7TOqW1FFP8lDEHg.png" /><figcaption>Windows APIS hooked</figcaption></figure><p>Seems there are a few Windows APIs hooked but a few that are not including NTQueueApcThread. Utilising a little C# I created a process inject executable that downloaded a bin file and injected a payload (my CS Beacon) into memory. After hosting the bin file, uploading and running the exe I was presented with a High integrity beacon for CobaltStrike. From here a DCSYNC of the krbtgt NTLM/AES hash gave me domain dominance.</p><p>I hope you find this writeup helpful.</p><p>Feel free to connect on <a href="https://www.linkedin.com/in/warrenbutterworth/">linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86ed5503ae48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bloodhound: A Pentester’s best friend]]></title>
            <link>https://medium.com/@warrenbutterworth/bloodhound-a-pentesters-best-friend-d8467aa6c50?source=rss-e4005639dc56------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8467aa6c50</guid>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Warren Butterworth]]></dc:creator>
            <pubDate>Wed, 22 Jun 2022 12:22:51 GMT</pubDate>
            <atom:updated>2022-07-04T08:37:06.969Z</atom:updated>
            <content:encoded><![CDATA[<p>Anyone in the Infosec community has heard of bloodhound. Its a tool used to enumerate Active Directory and is my go to on an Internal Engagements. Bloodhound uses graph theory and was created by some of the amazing guys over at SpectorOps.</p><p>I have used bloodhound a fair bit but I am by no means an expert, but I thought I’d put together this post of a few things which have helped me and might help other Infosec professionals.</p><h4>Loop collection method</h4><p>While this is in the docs I feel it might be something thats overlooked. Members of groups, group policy, users etc are areas within active directory that dont generally update on a regular basis throughout the day. <br>User sessions however is something that changes often as users login and out of workstations/servers throught the day. This can be a great technique to understand where a domain admin has been. All you need to do is run the collection method session for a period of time. Sharphound will continue to run dumping session data as it goes. This can them be imported into bloodhound.</p><pre>--CollectionMethod Session --Loop --Loopduration 02:00:00</pre><p>To see the percenatge of Session data you all ready have within bloodhound run the below query in neo4j console.</p><pre>MATCH (u1:User)<br>WITH COUNT(u1) AS totalusers<br>MATCH (c:Computer)-[r:HasSession]-&gt;(u2:User)<br>RETURN 100 * COUNT(DISTINCT(u2)) / totalusers AS userPercentage</pre><h4>Password Spray</h4><p>Once you have a set of valid credentials you can then use sharphound to gather all Active directory information including users/groups. I like to find domain users group and select total amount of users and dump to a json file.</p><figure><img alt="Bloodhound save data as json file" src="https://cdn-images-1.medium.com/max/764/1*PINsz4fery4nfn974Dqa-w.png" /></figure><p>With a little grepping you can extract all user accounts from this file and use them to password spray with weak passwords. If you have 3000 users how many have Password1 or Summer2022 set as their password?</p><pre>cat users.json | cut -d &#39;:&#39; -f 2 | sed &#39;s|[&quot;,\t]||g&#39; | sort -u | tee -a users</pre><h4>AD CS &amp; Custom Queries</h4><p>If youv’e been living under a rock and havent heard about AD CS abuse then this <a href="https://www.specterops.io/assets/resources/Certified_Pre-Owned.pdf">whitepaper </a>by Will &amp; Lee from SpecterOps (again!) is a must read. However if you use a tool by Oliver Lyak called <a href="https://github.com/ly4k/Certipy">Certipy </a>you can enumerate Active Directory Certificate Services (AD CS).</p><figure><img alt="Bloodhound ADCS" src="https://cdn-images-1.medium.com/max/459/1*RLWXWLeKTLm3dUeBezci7Q.png" /></figure><p>This tool queries AD and dumps a json file which can be loaded into Bloodhound on top of sharphounds previous data. (Certipy does a lot more but in this scenario we are just worried about the bloodhound data). After uploading you will need to add the custom queries to neo4j. Once added you can run queries on the data looking for all AD CS vulnerabilities. Reference the above whitpaper for abuse scenarios.</p><figure><img alt="AD CS Under custom Queries" src="https://cdn-images-1.medium.com/max/442/1*vXZmCaWGcJpZUBjgwIlsoA.png" /></figure><h4>More Custom Queries</h4><p>Over time you find queries which help you and start modifying queries to you need. For example within bloodhound there is a query to show out of date operating system and I often look at this on an engagement. The issue with this command is that these workstations/servers could be disabled but an administrator hasn’t tidied up Active Directory. So you get the old data not cleaned up in your sharphound dump. Adding the enabled to the below query helps with this.</p><pre>MATCH (H:Computer) WHERE H.operatingsystem =~ &#39;(?i).*(2000|2003|2008|xp|vista|7|me).*&#39; AND H.enabled = true RETURN H</pre><p>Another quick tip: By default bloodhound marks a few high profile targets on initial graphing: Administrator etc. On one engagement I had 35 Domain admins across the whole estate (yeah 35!) so these were all targets for my enagagement. Now to mark them you right click and set as High value target. “35 x right click x Set as High Value Target” was gonna be way to long for me to do. Enter the below raw query.</p><pre>MATCH p=(n:Group)&lt;-[:MemberOf*1..]-(m) WHERE n.objectid =~ &quot;(?i)S-1-5-.*-512&quot; SET m.highvalue = true RETURN m</pre><p>These are small tweaks to previous queries but they save me time. I have many queries like this that really help. There are many blogs and repositories out there created by others in the industry that have these and many more to many to list here. But what I’m trying to say is tweak them, build your own, make them do what you need them to do.</p><h4>Non Domain Joined</h4><p>Again this is all in the docs, but often your first entry on an internal engagement will be a brute forced password via spraying or a cracked password from responder. While not an officially supported collection method dumping sharphound data from a non domain joined machine can aid in enumerating the domain. NOTE: Amend DNS server to be the IP address of the domain controller within your target network. You can spawn a command shell or powershell as the breached user using runas.</p><pre>runas /netonly /user:DOMAIN\user.name powershell.exe</pre><p>I use a similar technique for powersploit also:</p><pre>$cred = Get-Credential</pre><p>This then allows you to supply the credential on the powersploit commands as below:</p><pre>-Credential $cred</pre><h4>Final thoughts</h4><p>None of this is new and there are lots of blogs detailing some of the above in more detail. The bloodhound docs are a must read. I just wanted to share a few tips that have helped me and that I find useful on every test.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8467aa6c50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[XXE to SSRF to Windows Administrator Hashes]]></title>
            <link>https://medium.com/@warrenbutterworth/oob-xxe-to-ssrf-to-windows-administrator-hashes-1f8ccd910624?source=rss-e4005639dc56------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f8ccd910624</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[xxe]]></category>
            <category><![CDATA[ssrf]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Warren Butterworth]]></dc:creator>
            <pubDate>Thu, 27 Aug 2020 20:54:10 GMT</pubDate>
            <atom:updated>2020-08-28T10:48:25.542Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o6ZtqINioC4DdUkLu%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o6ZtqINioC4DdUkLu%2Fgiphy-downsized.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3o6ZtqINioC4DdUkLu%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/f1419c1f549d27a807b5620fd6745cd0/href">https://medium.com/media/f1419c1f549d27a807b5620fd6745cd0/href</a></iframe><p><strong>Disclaimer: Details are Generic and no client information is present in this post.</strong></p><p>For Clarity from Portswigger.net:</p><blockquote>XML external entity injection (also known as XXE) is a web security vulnerability that allows an attacker to interfere with an application’s processing of XML data. It often allows an attacker to view files on the application server filesystem, and to interact with any back-end or external systems that the application itself can access.</blockquote><blockquote>Server-side request forgery (also known as SSRF) is a web security vulnerability that allows an attacker to induce the server-side application to make HTTP requests to an arbitrary domain of the attacker’s choosing.</blockquote><p>On a recent Pen test I was tasked with testing a bespoke Windows application that connected to a REST API. The Application was used by sales team members to create quotes and manage clients. As these people were often on the road and sometimes had no access to the internet all day the data was stored locally by the application and then once connected to the internet it would sync local data with cloud data.</p><p>Initially I spent time using the application and capturing requests sent to and from the server. As most of the data was stored locally most of these requests were very similar. Push new data to server / Check data / pull specific requests for items that had not been previously downloaded i.e catalogues and that was about it. 3–4 requests in burp all very similar.</p><p>I noticed when amending a Customers details in the application and then saving it would update the local copy but a POST request would also get sent with updated info. I grabbed this request and sent to repeater and started playing around. Straight away I thought “I’m gonna try XXE..” So this is where I started. First attempt and Burp collaborator had results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Lpm57wcXJMuBzJIwIMqFQ.png" /><figcaption>Burp Collaborator gets a hit</figcaption></figure><p>Amazing. Now its time to see what juicy info I can ex-filtrate…</p><p>So I created a malicious DTD file on my VPS and set this up to read files from the server using the below syntax. As this was a windows server first call was C:/windows/win.ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*LG_lHEy12Qm4jvUDRNLULA.png" /><figcaption>Hosted Malicious.dtd</figcaption></figure><p>Boom…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*_JNQmYhrq-8h0pdD8JNkAA.png" /><figcaption>win.ini received</figcaption></figure><p>Next hour or so was spent plugging in potential files to ex-filtrate. Most of these were not hitting or would send back an access is denied response or some characters would break the HTTP syntax.</p><p>I thought I’d try a few more things and see what I could learn. I tried internal port scanning but I couldnt get results, then itried to see if the FTP protocol would connect out. So I fired up responder and waited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*OKl7XDLSH-pVSIC9a1P1vw.png" /></figure><p>Well that worked…</p><p>So what about the SMB protocol. After reading the following <a href="https://techblog.mediaservice.net/2018/02/from-xml-external-entity-to-ntlm-domain-hashes/">blog </a>I was hopeful. Maybe I could capture a NetNtlm Hash?? But this wasn’t to be. <br>SMB protocol was obviously blocked for outbound connections.</p><p>I could confirm the presence of internal SMB shares….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*csSu3hj1c04ypGTPyK5ARw.png" /></figure><p>Hmmm… So what next….. Well so far I could ex-filtrate some local files, confirm internal shares, connect outbound using FTP and HTTP but I needed something a bit better than “I managed to get a hold of the win.ini file” I wanted something a little more jaw dropping than that.</p><p>I went back to file extraction and started to look at files that you would generally look for during privilege escalation.</p><p>First up was Unattended.xml.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*9P11Ot8MfSkp-2wFP6e4ug.png" /></figure><p>HTTP Syntax was getting broken. So I started looking for sysprep.inf and sysprep.xml which are used to deploy image-based installations.</p><p>First try I managed to get sysprep.inf. After URL decoding this I was presented with an encrypted Administrator hash….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*owJbnAFlpnrji2AwLRPodA.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fccosx2jCejdew%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fccosx2jCejdew%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fccosx2jCejdew%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="194" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a2eca7ea1362ea8850576eaa8ffacc8/href">https://medium.com/media/7a2eca7ea1362ea8850576eaa8ffacc8/href</a></iframe><p>Right this was good but I wanted to keep looking. So I needed a comprehensive list of all the locations of interesting windows files and I came across this <a href="https://github.com/soffensive/windowsblindread/blob/master/windows-files.txt">list </a>by <strong>soffensive </strong>on Github. I started trying all similar locations for sysprep.xml. Finally by using the below payload hosted on my VPS I was rewarded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*pPfqW335z9FLk6ZP_uW_eA.png" /></figure><p>However this time the file included the base64 encoded username/password for Administrator. After a quick decode I had plaintext password:username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AyMj-EthTtTvALVohyAkgg.png" /></figure><p>NOW I had something with more impact than win.ini to put in the final report.</p><p>This is my first post so be gentle. But I always like to think sharing is caring!</p><p>I will try and put more posts together but in the meantime you can always follow me on <a href="https://twitter.com/w88ugs">Twitter</a>. I’d like to shout out these blogs that helped me a long the way.</p><ul><li><a href="https://blog.zsec.uk/blind-xxe-learning/">Hunting in the Dark - Blind XXE</a></li><li><a href="https://github.com/soffensive/windowsblindread/blob/master/windows-files.txt">soffensive/windowsblindread</a></li><li><a href="https://techblog.mediaservice.net/2018/02/from-xml-external-entity-to-ntlm-domain-hashes/">From XML External Entity to NTLM Domain Hashes</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f8ccd910624" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>