<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Red-Teaming on Riccardo Ancarani</title><link>https://riccardoancarani.github.io/tags/red-teaming/</link><description>Recent content in Red-Teaming on Riccardo Ancarani</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 14 Sep 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://riccardoancarani.github.io/tags/red-teaming/index.xml" rel="self" type="application/rss+xml"/><item><title>Attacking an EDR - Part 2</title><link>https://riccardoancarani.github.io/2023-09-14-attacking-an-edr-part-2/</link><pubDate>Thu, 14 Sep 2023 00:00:00 +0000</pubDate><guid>https://riccardoancarani.github.io/2023-09-14-attacking-an-edr-part-2/</guid><description>&lt;h1 id="introduction---where-we-left-off"&gt;Introduction - Where we left off&lt;/h1&gt; &lt;p&gt;DISCLAMER: This post was done in collaboration with Devid Lana. You can find his blog here: &lt;a href="https://her0ness.github.io/2023-09-14-Attacking-an-EDR-Part-2/" target="_blank" rel="noopener"&gt;her0ness - Attacking an EDR Part 2&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Continuing from our last research, we pursued the exploration of the attack surface of the EDR solution under our scrutiny, STRANGETRINITY. Last time we focused on identifying exclusions within the EDR’s configuration that allowed us to perform actions that would not be possible otherwise. This time around, our focus will be on the communication channel between the EDR agent and its tenant.&lt;/p&gt;</description></item><item><title>Attacking an EDR - Part 1</title><link>https://riccardoancarani.github.io/2023-08-03-attacking-an-edr-part-1/</link><pubDate>Thu, 03 Aug 2023 00:00:00 +0000</pubDate><guid>https://riccardoancarani.github.io/2023-08-03-attacking-an-edr-part-1/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt; &lt;p&gt;DISCLAMER: This post was done in collaboration with Devid Lana. You can find his blog here: &lt;a href="https://her0ness.github.io" target="_blank" rel="noopener"&gt;https://her0ness.github.io&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This post is the first of what - we hope - will be a long series of articles detailing some common flaws that can be found on modern EDR products. By no means this will be a complete reference, but will hopefully provide some practical tools to analyze these gargantuesque products and attempt to understand their functionalities from a black box perspective.&lt;/p&gt;</description></item><item><title>Mockingjay - What is old is new again</title><link>https://riccardoancarani.github.io/2023-07-31-mockingjay-what-is-old-is-new-again/</link><pubDate>Mon, 31 Jul 2023 00:00:00 +0000</pubDate><guid>https://riccardoancarani.github.io/2023-07-31-mockingjay-what-is-old-is-new-again/</guid><description>&lt;h1 id="mockingjay---what-is-old-is-new-again"&gt;Mockingjay - What is old is new again&lt;/h1&gt; &lt;p&gt;There has been quite a lot of rumor recently around the release of a piece of research that discuss a new (?) process injection technique that evades EDRs (what does that even mean?). For reference, these are the blog post I am referring to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.bleepingcomputer.com/news/security/new-mockingjay-process-injection-technique-evades-edr-detection/" target="_blank" rel="noopener"&gt;New Mockingjay process injection technique evades EDR detection&lt;/a&gt; &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.securityjoes.com/post/process-mockingjay-echoing-rwx-in-userland-to-achieve-code-execution" target="_blank" rel="noopener"&gt;Process Mockingjay: Echoing RWX In Userland To Achieve Code Execution&lt;/a&gt; &lt;/p&gt;</description></item><item><title>Random Notes on Task Scheduler Lateral Movement</title><link>https://riccardoancarani.github.io/2021-01-25-random-notes-on-task-scheduler-lateral-movement/</link><pubDate>Mon, 25 Jan 2021 00:00:00 +0000</pubDate><guid>https://riccardoancarani.github.io/2021-01-25-random-notes-on-task-scheduler-lateral-movement/</guid><description>&lt;!-- MDTOC maxdepth:6 firsth1:1 numbering:0 flatten:0 bullets:1 updateOnSave:1 --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#introduction"&gt;Introduction&lt;/a&gt; 
&lt;ul&gt;
&lt;li&gt;&lt;a href="#file-replacement"&gt;File Replacement&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#task-replacement"&gt;Task Replacement&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#com-handlers"&gt;COM Handlers&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#detection"&gt;Detection&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#evasion"&gt;Evasion&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#references"&gt;References&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;!-- /MDTOC --&gt;
&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt; &lt;p&gt;Reading FireEye&amp;rsquo;s UNC2452 &lt;a href="https://www.fireeye.com/blog/threat-research/2020/12/evasive-attacker-leverages-solarwinds-supply-chain-compromises-with-sunburst-backdoor.html" target="_blank" rel="noopener"&gt;writeup&lt;/a&gt; , I started to think about how to emulate them in purple teaming exercises. Despite the supply-chain bit is still a bit out of my reach, I noticed an interesting lateral movement vector that was used as part of that operation.&lt;/p&gt;
&lt;p&gt;Quoting directly FireEye&amp;rsquo;s post (because I am lazy AF):&lt;/p&gt;</description></item><item><title>Streamlining BloodHound Analytics</title><link>https://riccardoancarani.github.io/2019-12-08-streamlining-bloodhound-analytics/</link><pubDate>Sun, 08 Dec 2019 00:00:00 +0000</pubDate><guid>https://riccardoancarani.github.io/2019-12-08-streamlining-bloodhound-analytics/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt; &lt;p&gt;As a penetration tester, I often rely on BloodHound to assist me in Active Directory engagements.
However, after a few of them it was clear that I was repeating the same actions (hence the same queries) over and over again. I felt that doing this initial process manually was not just time consuming but also introduced the possibility to make mistakes and miss some low-hanging fruits, this is especially true while analysing a considerable number of domains in a restricted amount of time.&lt;/p&gt;</description></item><item><title>Not All Paths are Created Equal</title><link>https://riccardoancarani.github.io/2019-11-08-not-all-paths-are-created-equal/</link><pubDate>Fri, 08 Nov 2019 00:00:00 +0000</pubDate><guid>https://riccardoancarani.github.io/2019-11-08-not-all-paths-are-created-equal/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt; &lt;p&gt;&lt;a href="https://github.com/BloodHoundAD/" target="_blank" rel="noopener"&gt;BloodHound&lt;/a&gt; was a revolution for evaluating Active Directory (AD) security and identifying unintended paths that could lead to the compromise of sensitive groups such as Domain Admins. The community has been using it successfully in many engagements and against highly secure environments.&lt;/p&gt;
&lt;p&gt;For those who&amp;rsquo;ve been living in a cave for the past couple of years, in a nutshell BloodHound is a tool that can be used by both defenders and attackers to identify hidden and unintended relationships between AD principals. It&amp;rsquo;s heavily based on the work published by Microsoft&amp;rsquo;s researchers: &lt;a href="https://www.microsoft.com/en-us/research/publication/heat-ray-combating-identity-snowball-attacks-using-machine-learning-combinatorial-optimization-and-attack-graphs/" target="_blank" rel="noopener"&gt;Heat-ray: Combating Identity Snowball Attacks Using Machine Learning, Combinatorial Optimization and Attack Graphs&lt;/a&gt; . Although BloodHound does not rely on machine learning yet, the data model is pretty similar to the proposed one.&lt;/p&gt;</description></item><item><title>Lateral Movement</title><link>https://riccardoancarani.github.io/2019-10-04-lateral-movement/</link><pubDate>Fri, 04 Oct 2019 00:00:00 +0000</pubDate><guid>https://riccardoancarani.github.io/2019-10-04-lateral-movement/</guid><description>&lt;!-- MDTOC maxdepth:6 firsth1:1 numbering:0 flatten:0 bullets:1 updateOnSave:1 --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#introduction"&gt;Introduction&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#find-where-we-have-access"&gt;Find Where We Have Access&lt;/a&gt; 
&lt;ul&gt;
&lt;li&gt;&lt;a href="#local-group-membership-the-blind-approach"&gt;Local Group Membership - The Blind Approach&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#local-group-membership-group-policy-objects"&gt;Local Group Membership - Group Policy Objects&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#access-to-file-shares"&gt;Access to File Shares&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#access-control-lists"&gt;Access Control Lists&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#mssql-access"&gt;MSSQL Access&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#wmi"&gt;WMI&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#remote-service-creation"&gt;Remote Service Creation&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#remote-desktop-protocol"&gt;Remote Desktop Protocol&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#powershell-remoting"&gt;PowerShell Remoting&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#task-scheduler"&gt;Task Scheduler&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#psexec"&gt;PsExec&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#dcom"&gt;DCOM&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#password-spray"&gt;Password Spray&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#folder-redirection-and-roaming-profiles"&gt;Folder Redirection and Roaming Profiles&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#rdp-hijack"&gt;RDP Hijack&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#pass-the-hash"&gt;Pass-the-Hash&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#overpass-the-hash"&gt;Overpass-the-Hash&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="#pass-the-ticket"&gt;Pass-the-Ticket&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;!-- /MDTOC --&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt; &lt;p&gt;Lateral movement is defined by MITRE as:&lt;/p&gt;</description></item><item><title>Modern C2 Infrastructure with Terraform, DigitalOcean, Covenant and Cloudflare</title><link>https://riccardoancarani.github.io/2019-09-28-modern-c2-infrastructure-with-terraform-digitalocean-covenant-and-cloudflare/</link><pubDate>Sat, 28 Sep 2019 00:00:00 +0000</pubDate><guid>https://riccardoancarani.github.io/2019-09-28-modern-c2-infrastructure-with-terraform-digitalocean-covenant-and-cloudflare/</guid><description>&lt;p&gt;This is going to be a quick walkthrough of how I would set up a Command and Control (C2) infrastructure using the following technologies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Terraform (&lt;a href="https://www.terraform.io/" target="_blank" rel="noopener"&gt;https://www.terraform.io/&lt;/a&gt; )&lt;/li&gt;
&lt;li&gt;DigitalOcean (&lt;a href="https://cloud.digitalocean.com" target="_blank" rel="noopener"&gt;https://cloud.digitalocean.com&lt;/a&gt; )&lt;/li&gt;
&lt;li&gt;Cloudflare (&lt;a href="https://www.cloudflare.com" target="_blank" rel="noopener"&gt;https://www.cloudflare.com&lt;/a&gt; )&lt;/li&gt;
&lt;li&gt;Covenant (&lt;a href="https://github.com/cobbr/Covenant" target="_blank" rel="noopener"&gt;https://github.com/cobbr/Covenant&lt;/a&gt; )&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The aim of this post is mainly practicing building reliable and reusable C2 infrastructures for red team engagements. I won&amp;rsquo;t be covering the installation of the various tools but we&amp;rsquo;ll go straight to the design of the infrastructure. I will also assume some familiarity with terraform, the introduction guide (&lt;a href="https://learn.hashicorp.com/terraform?track=getting-started#getting-started" target="_blank" rel="noopener"&gt;https://learn.hashicorp.com/terraform?track=getting-started#getting-started&lt;/a&gt; ) will be enough for most of the stuff you&amp;rsquo;ll see here.
I decided to use Covenant instead of Cobalt Strike mainly because I don&amp;rsquo;t have enough money for buying a personal license &lt;code&gt;¯\_(ツ)_/¯&lt;/code&gt; but also because they have very similar functionalities and in the next few months it may be possible to use Covenant reliably during operations.&lt;/p&gt;</description></item></channel></rss>