{"componentChunkName":"component---src-templates-red-team-chronicles-js","path":"/library/red-team-chronicles/the-one-where-failed-to-break-in/","result":{"data":{"wordpressWpRedTeamChronicles":{"title":"The one where I failed to break in","content":"\n<p>T’was a Monday morning. A new assessment was about to begin.</p>\n\n\n\n<p>I am no fan of Monday mornings, but assessment mornings are pure adrenaline. I woke up a little early that day to double-check if all the assessment infrastructure was up and running. Tea and <a href=\"http://reddit.com/r/netsec\">r/netsec</a> are my morning rituals before leaving home.</p>\n\n\n\n<p>On my way to the assessment, I had my Amazon Music (yeah, I know, sue me) tuned to System of a Down radio. It helps me get into the zone. I recommend <a href=\"https://www.youtube.com/watch?v=L-iepu3EtyE\">Aerials</a>; there is something weirdly poetic about that song.</p>\n\n\n\n<h3><strong>The goal</strong></h3>\n\n\n\n<p>My goal was straightforward – break into the customer database server without getting caught. I had five days. It was showtime.</p>\n\n\n\n<p>It had been a good year. Red teams live and die by their outcomes. And up until then, I had hit nothing but net. There is comfort in the mindset that there is always a way in.&nbsp; I had no reason to believe today would be any different. I was about to learn otherwise.</p>\n\n\n\n<h3><strong>Getting started</strong></h3>\n\n\n\n<p>Within an hour, I could remotely control a machine within the organization over the Internet. I had a tried and tested payload that had worked well in the prior months against most perimeter detection solutions.</p>\n\n\n\n<p>Excel DDE → Starts CMD → Starts a download lolbin (like bitsadmin) → fetches encrypted payload → load in memory → decrypt payload → execute → Call back.</p>\n\n\n\n<p>I was able to cross the first hurdle with ease.</p>\n\n\n\n<h3><strong>Day 1 &#8211; Chasing the keys to the kingdom</strong></h3>\n\n\n\n<p>I had access to an account that did not have administrative privileges on my machine or, for that matter, anywhere else. I also had no idea where the database server was.</p>\n\n\n\n<p>The obvious strategy was to try and compromise the domain. If I could get the keys to the kingdom, then accessing the database server would only be a matter of time, patience, and persistence.</p>\n\n\n\n<p>Right off the bat, I executed what many of us consider a lucky charm these days – Kerberoasting</p>\n\n\n\n<p>A kerberoastable domain admin meant I had a high likelihood of owning the domain by lunchtime.</p>\n\n\n\n<p>So thanks to <a href=\"https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1\">HarmJ0y’s Powerview script</a>, I had the list of kerberoastable accounts and hashes. Unfortunately, none of them were Domain Admins, Enterprise Admins, or accounts that would allow a possibility to compromise the domain.</p>\n\n\n\n<p>My heart sank when I got the list of domain admins – <em>just one</em>.</p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img src=\"https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/1-RTC.png\" alt=\"\" class=\"wp-image-18695\" srcset=\"https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/1-RTC.png 220w, https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/1-RTC-150x150.png 150w\" sizes=\"(max-width: 220px) 100vw, 220px\" /></figure></div>\n\n\n\n<p>One domain admin is a rarity. The least I had seen before was five. And five is any day better than one (for a red teamer, that is). I ran a quick check of the domain admin properties, and my heart sank further.</p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img src=\"https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/2-RTC.png\" alt=\"\" class=\"wp-image-18696\"/></figure></div>\n\n\n\n<p>Logon restrictions to the domain controllers only! This meant that there was no chance of finding domain admin exposed credentials anywhere else.</p>\n\n\n\n<p>This was going to be more difficult than I thought.</p>\n\n\n\n<p>Of the seven kerberoastable accounts, I only managed to crack one.</p>\n\n\n\n<p>And as far as I could analyze based on its group memberships and properties, it did not appear to have anything of value. In fact, I could not even reach the machine on which the service was supposedly configured.</p>\n\n\n\n<p>I decided to park this route for the time being as it was already past lunchtime on day 1.</p>\n\n\n\n<h4><strong>The quick hit list</strong></h4>\n\n\n\n<p>Candidly writing, I was both annoyed and impressed at how the accounts with the tasty privileges were locked down. So next up was my trusty quick hit list:</p>\n\n\n\n<ol><li>Local privilege escalation</li><li>UAC bypass</li><li>Misconfigured paths and services</li><li>LLMNR using Invoke-Inveigh</li><li>GPP</li><li>SMBv1 checks</li></ol>\n\n\n\n<p>Nothing. Zilch. Zippo. Nada.</p>\n\n\n\n<p>No LLMNR struck me as especially weird. Was I on a sparsely populated subnet? A quick local segment scan showed that Port 135 and 445 were locked down. I could only see the RDP port. And there were about 100 hosts that were live. Maybe I just had to be patient. I decided to keep it running for a while.</p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img src=\"https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/3-RTC.png\" alt=\"\" class=\"wp-image-18697\"/></figure></div>\n\n\n\n<h3><strong>Day 2 to 4 &#8211; Going Hunting</strong></h3>\n\n\n\n<p>It was already day 2, and I had nothing to show for my time there.</p>\n\n\n\n<p>Though it was time to switch gears and try something else, I could not just go waltzing through the network as it could trip a SIEM rule or the EDR, and I certainly did not want to get caught. Normally, I would take the risk, but experience told me that if someone had locked down the network so well, they knew what they were defending against.</p>\n\n\n\n<p>I needed a clear plan of action and have multiple tasks going on at the same time. Here&#8217;s what I decided to do:</p>\n\n\n\n<ol><li>Spend some time understanding the environment. That meant digging deep into Active Directory.</li><li>Find the IP address and hostname of the database server.</li><li>Figure out what credentials were required to log in to the database server.</li><li>Find the credentials to the database server (somehow!).</li><li>BloodHound the network without using BloodHound, so I could find privilege hopping points.</li></ol>\n\n\n\n<p>Lots to do!</p>\n\n\n\n<p>While hunting in Active Directory, I did pick up some interesting targets – Users who could change passwords, modify attributes, create policies, RDP to the server, possible workstation and server administrators, and possible DB administrators.</p>\n\n\n\n<p>I also found computers that could potentially be my target customer database servers, thanks to SPN scanning and hostname keyword searches for “db”, “sql” etc.</p>\n\n\n\n<p>I decided to hunt for these users on the network and see if there was a way to compromise them. I ran user hunting and session enumeration scripts, but I could not enumerate any sessions on the DC.</p>\n\n\n\n<p>NetCease? No way. Just no way. The one thing I had counted on, they took from me.</p>\n\n\n\n<p>File servers were always a good target for session enumeration. Everyone connects there. But it was a NAS device that everyone was mapped to. No session enumeration was possible.</p>\n\n\n\n<p>I felt like I was facing Gandalf.</p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img src=\"https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/4-RTC.png\" alt=\"\" class=\"wp-image-18698\" srcset=\"https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/4-RTC.png 412w, https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/4-RTC-300x146.png 300w\" sizes=\"(max-width: 412px) 100vw, 412px\" /></figure></div>\n\n\n\n<p>Just so you know, if someone kills session enumeration on their network, finding user targets becomes a matter of luck, chance, and brute force. It increases your chances of being detected because you have to expand the footprint of your search.</p>\n\n\n\n<p>I was suffering because I did not have rights.</p>\n\n\n\n<p>You can still enumerate sessions if you are an administrator on the target machine, but I had no admin privileges.</p>\n\n\n\n<p>And to top it off, most of the workstations had blocked WMI and SMB. So even BloodHound would come back empty from workstations.</p>\n\n\n\n<p>I also found that the workstation computers had LAPS attributes! Local administrator password reuse was out of the question now.</p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img src=\"https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/5-RTC.png\" alt=\"\" class=\"wp-image-18699\" srcset=\"https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/5-RTC.png 220w, https://internal-wp.smokescreen.io/wp-content/uploads/2021/01/5-RTC-150x150.png 150w\" sizes=\"(max-width: 220px) 100vw, 220px\" /></figure></div>\n\n\n\n<p>This meant that even if I serendipitously managed to get local admin access on my machine, the local administrator password was useless to me as I couldn’t use it anywhere else!</p>\n\n\n\n<h3><strong>Day 5 &#8211; Expanding the Search</strong></h3>\n\n\n\n<p>Last day of the assessment and I was staring at a bunch of dead ends</p>\n\n\n\n<ul><li>No unconstrained delegation.</li><li>No meaningful credentials from LLMNR</li><li>No ASREPRoasting.</li><li>No scope for AdminSDHolder abuses.</li><li>Of all my DB server targets, four were unreachable. The rest did not have default or common passwords.</li><li>No default passwords on any of the popular targets like Tomcat/JBoss/Jenkins that give you code execution.</li><li>Server Admins had a granular password policy of 15 characters so, I couldn’t guess passwords either.</li><li>Accounts for administrative use and regular use were split.</li><li>SMB was blocked from my network location towards a big chunk of the server zone so, running enumeration against the servers was difficult.</li><li>A bunch of users I wanted to compromise were in the protected users group.</li></ul>\n\n\n\n<p>I did manage to get administrative access to three UAT servers that had “Domain Users” in the administrator&#8217;s group. It seemed like the UAT segment did not have the same rigorous blocks as compared to the production segment.</p>\n\n\n\n<h3><strong>Two truths and a lie</strong></h3>\n\n\n\n<ol><li>At 7:00 pm on day 5, I gave up and called it quits as time was up.</li><li>I went to a bar nearby and had a beer.</li><li>At 5:30 pm on day 5, I got lucky and was able to expand my access to the customer database from the UAT segment by obtaining a backup web.config file that had stored SQL passwords in it.</li></ol>\n\n\n\n<h3><strong>Looking back</strong></h3>\n\n\n\n<p>This story is about all the stuff that was done right.</p>\n\n\n\n<ol><li>Machines were patched for exploits and well-known privilege escalation checks.</li><li>Powerful privileged groups had restricted members and several types of logon restrictions were enforced.</li><li>Fine-grained password policies for key users made password guessing a futile strategy.</li><li>Session enumeration was restricted.</li><li>Administrators to critical servers had additional protections (LSASS Protections, Protect Users Group, etc.), making it very difficult to steal credentials.</li><li>Administrative use and regular use was split, reducing the surface of credential exposure.</li><li>Lateral movement paths were blocked for the user segment. Lateral movement between endpoints was nearly impossible. WMI / SMB were blocked. RDP was too risky an option.</li><li>Critical servers were not accessible from all locations.</li><li>Default passwords for applications did not work.</li></ol>\n\n\n\n<p>Ultimately, I was up against someone who knew how people like me operate. They didn&#8217;t do anything too fancy. They just meticulously removed options from my arsenal. And that&#8217;s half of what Active Defense is all about.&nbsp;<br></p>\n","excerpt":"T’was a Monday morning. A new assessment was about to begin. I am no fan of Monday mornings, but assessment mornings are pure adrenaline. I woke up a little early that day to double-check if all the assessment infrastructure was up and running. Tea and r/netsec are my morning rituals before leaving home. On my […]\n","slug":"the-one-where-failed-to-break-in","date":"2021-01-19T10:16:53.000Z","modified":"2021-01-20T05:10:26.000Z","status":"publish","featured_media":{"id":"7cdf6956-c72a-5317-aa0b-e280bea2fa99","source_url":"https://ss-website-content-prod.s3.ap-south-1.amazonaws.com/wp-content/uploads/2021/01/Smokescreen-Red-Team-Chronicle-3-COVER.png","alt_text":"","large":{"childImageSharp":{"fluid":{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAAAsTAAALEwEAmpwYAAAChUlEQVQozz1SS09aYRC9P8EuDAKatCpGUAF5Pyyvi4BAy0tKVw2SEHmjUgiiaK0gAaQNDbumaRdt0ririy7apPGfnd6ZJl2czL3f982ZOWdG6Pf7iEQiKJVK8Pv9CIfDSKfT2NraQjAYRCwWQzQa5e9arfYfpXIZne4Fhu/eo387wV48iUgqDWE2m/FjrVYLt9sNm80Gp9MJtVoNq9UKo9GIZDLJ/4FAgIvTud3hhNFihUv0I5Z+AU9oD5VmC0K9XodOp8Pc3BxCoRDm5+ehVCqxs7PDRCaTiclUKhUrEEWRiydSKYhSAaPNDpvbA184AjH6HILZbOYHcrkcGo0GGxsbUCgUnEhyHQ4H38lkMhgMBlZBBYqlMhL7aWxub0PxZBmbJjMCsQQEkmexWLC0tMQdZLNZ9szr9bJ06nRxcZE71+v1WFlZYVSqVVjsDonQgEcyORTLq3is1kAgg5vNJqrSg0qlgtPTU5yfn8PlcnF3dE62xONxHtTa2hrbcJDLYVfyrdZ4DadXhPmpC8pVFYTJZAJCr9fD4eEhut0uWq0W1tfXmaTT6aDRaOD4+JglkxKKeentq4McjqRB5IolRKUJa4wmCLQ2w+EQl5eXyGQyvDIUfT4f6G4wGOD6+ppVkMcLCwtMGI5EUa7Vkcq8xLPUPkLxBEKJFARKIIxGI1xdXbE86ojIxuMxdz+dTjmWpd07OTmBx+PBbiCISv0IveEI/fEtWhdvUG21Idzc3IBApCQvn8+zl5RI5O12m20gkC0E2gyb3Y4jyb/PX7/h7sc97n/9xs8/D/8IqRuK5F2hUGAi8ozi2dkZk9GwiJyQkwZSKBbxVsqhDsfTD5h9/IQv3+/wF0MfvmpR3zlCAAAAAElFTkSuQmCC","aspectRatio":1.9047619047619047,"src":"/static/364c7c5604b2461baaf0d11f5b451b68/bc8e0/Smokescreen-Red-Team-Chronicle-3-COVER.png","srcSet":"/static/364c7c5604b2461baaf0d11f5b451b68/8ac63/Smokescreen-Red-Team-Chronicle-3-COVER.png 200w,\n/static/364c7c5604b2461baaf0d11f5b451b68/3891b/Smokescreen-Red-Team-Chronicle-3-COVER.png 400w,\n/static/364c7c5604b2461baaf0d11f5b451b68/bc8e0/Smokescreen-Red-Team-Chronicle-3-COVER.png 800w,\n/static/364c7c5604b2461baaf0d11f5b451b68/6050d/Smokescreen-Red-Team-Chronicle-3-COVER.png 1200w,\n/static/364c7c5604b2461baaf0d11f5b451b68/00405/Smokescreen-Red-Team-Chronicle-3-COVER.png 1600w,\n/static/364c7c5604b2461baaf0d11f5b451b68/1f96e/Smokescreen-Red-Team-Chronicle-3-COVER.png 2400w","srcWebp":"/static/364c7c5604b2461baaf0d11f5b451b68/ccdb5/Smokescreen-Red-Team-Chronicle-3-COVER.webp","srcSetWebp":"/static/364c7c5604b2461baaf0d11f5b451b68/6b183/Smokescreen-Red-Team-Chronicle-3-COVER.webp 200w,\n/static/364c7c5604b2461baaf0d11f5b451b68/fc32b/Smokescreen-Red-Team-Chronicle-3-COVER.webp 400w,\n/static/364c7c5604b2461baaf0d11f5b451b68/ccdb5/Smokescreen-Red-Team-Chronicle-3-COVER.webp 800w,\n/static/364c7c5604b2461baaf0d11f5b451b68/9000d/Smokescreen-Red-Team-Chronicle-3-COVER.webp 1200w,\n/static/364c7c5604b2461baaf0d11f5b451b68/e0075/Smokescreen-Red-Team-Chronicle-3-COVER.webp 1600w,\n/static/364c7c5604b2461baaf0d11f5b451b68/83a9d/Smokescreen-Red-Team-Chronicle-3-COVER.webp 2400w","sizes":"(max-width: 800px) 100vw, 800px"}}}},"author":{"id":"765e8417-7ed6-55b7-95a7-1d561141e760","name":"Sudarshan Pisupati"},"acf":{"subtitle":"An account of what happens when you go up against security teams that anticipate what an adversary will do and actively defend their network."},"yoast_meta":{"yoast_wpseo_twitter_title":"","yoast_wpseo_twitter_description":"","yoast_wpseo_redirect":"","yoast_wpseo_opengraph_title":"","yoast_wpseo_opengraph_description":"","yoast_wpseo_metakeywords":"","yoast_wpseo_metadesc":"An account of a red team assessment where I went up against a security team that anticipated what an adversary would do and actively defended their network.","yoast_wpseo_meta_robots_noindex":"","yoast_wpseo_meta_robots_nofollow":"","yoast_wpseo_meta_robots_adv":"","yoast_wpseo_linkdex":"59","yoast_wpseo_focuskw":"Red team","yoast_wpseo_canonical":""}},"costSectionImage":{"childImageSharp":{"fluid":{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAADUklEQVQ4yzWSW2gcZRzFzzcze02y273OfWdnZ3dmr9mmSUsiaaJtV+0lNppaGmukTcEHgygWtS8iKAUFRSEvggj6JoJPPha1j74IfREUBC+ICIKgD2K7mfn7n10dOAzfzHy/Od/5H4xGDVzb6aPSaeeyhl2ZdepW2qx5Sd3qirK2JKnWCaHb56HZO9DMZ4Rm3YBm3YRq7kuq8aFQjU8yVv3LGct5F4AEuVyBVCofl8rqT6xfpKr+h6Sa/0iaSUK3SJgOgSVbdUrbLgmjRtBtYiihqk9VqvLa/A7HH/aAQinWCyiWCWV+UeYPVIM3WRFsNxQ1L4TjhTPNzkGx1T3g9QFDxwwdJwx7LFT9LooVgt34Gucv98ELBpbfQ4kfVrS7SaMWJq16lPH8SHJakahPJTfaLD8SthvBqEXsOso5XsTRhBOH9dbneHzXgmyYMfRWDEzxH3Nei3LNNhUGC5T1+wTXJ+EGJPFdbgTEQJIdj7IshaEczRTY7H6KK88VIfKVOT7u95wd5erNcC4IorQXUL6/QIeGiyS1eiS8DkN9Uvgu1RoTKXG2GsdS1SOUVULn8Pt45Z00RKHiMnCc4CHkXT+aZRfJoEf5zgLlh0skMxDsMHYn11sTh1LskqGp+Oj/AwdHb+LWN0qc3ygeiKyaYY6zyrd7UX7+MBXmj9CMP5g44wxJZqjitlj+ZOoZBiZjYEXj7PV7WFi+LhFxcw4Vn50ORL2Xc1vhXKcb5oJeWOwNo1SzG8FpRiJWrRGBh8XZRXIM0u2I2zB1pxp/4djaVcSXUlE/Ev9VRqgWZdwmzbTapLADxL2zG7HiqYYwWLodcnYhqgZLG087aP2G1dEmllaBREV9OuF4d9Kdwbey3/0x3Rv+qjSD36WG/2cq6P2d6Q7HuaMrlPK7pDiNScEli4tu2qRw7txhLrv9Mx58dA3nLgGnYpubO6s4e2kDDz22JU5uXBHrp/dw36mXxfIDr8srJ96SV+7fTyyvf5BcXPlYHix+JnXmv1Da/a+yQf9Ooub+kPL7t3Hm4hE8chkozWUFntwD1jeQeXVf4MbbCl58IyleejOD51+bxe71Ap7Y07B1zcGFXR9bV+ex+dQx3ryGje0Rzm2fwekL2+yuibMX8S+BMBcPGVLWLQAAAABJRU5ErkJggg==","aspectRatio":1.528735632183908,"src":"/static/739e365bb81f8bf83185927701d2793f/651c0/cost-image-2x.png","srcSet":"/static/739e365bb81f8bf83185927701d2793f/e223a/cost-image-2x.png 133w,\n/static/739e365bb81f8bf83185927701d2793f/66882/cost-image-2x.png 265w,\n/static/739e365bb81f8bf83185927701d2793f/651c0/cost-image-2x.png 530w,\n/static/739e365bb81f8bf83185927701d2793f/a384c/cost-image-2x.png 795w,\n/static/739e365bb81f8bf83185927701d2793f/c884a/cost-image-2x.png 1056w","srcWebp":"/static/739e365bb81f8bf83185927701d2793f/46494/cost-image-2x.webp","srcSetWebp":"/static/739e365bb81f8bf83185927701d2793f/a5ef1/cost-image-2x.webp 133w,\n/static/739e365bb81f8bf83185927701d2793f/4dc00/cost-image-2x.webp 265w,\n/static/739e365bb81f8bf83185927701d2793f/46494/cost-image-2x.webp 530w,\n/static/739e365bb81f8bf83185927701d2793f/5b747/cost-image-2x.webp 795w,\n/static/739e365bb81f8bf83185927701d2793f/950f5/cost-image-2x.webp 1056w","sizes":"(max-width: 530px) 100vw, 530px"}}}},"pageContext":{"id":"2a4a728d-5ce7-56f2-a24e-97e90239476a"}},"staticQueryHashes":["1478079672"]}