杏吧传媒

Search
searchclose icon

The Methods Behind a 杏吧传媒 Managed Antivirus Investigation

Glitch effectGlitch effectGlitch effect
Glitch banner

At 杏吧传媒, we love to thread and share our investigative approaches to our interesting findings internally so other teams can see what we鈥檙e up to and learn a thing or two.听

In this blog, we鈥檒l go on a short journey of how we dissected a vague Managed Antivirus alert, and along the way, offer some ideas and methods for security analysts everywhere. We鈥檝e got a good balance of 杏吧传媒-specific approaches and methods that anyone can deploy for any machine. (Insert cheesy image of a team high-five here.)

Defender Says Whaaaaaaaaat?

杏吧传媒 has long stood on the Soapbox of Justice to advocate for everyone ingesting the alerts from their AV of choice. (Are you picturing us standing atop a building with a cape flapping in the wind yet??)听

Now, whilst antivirus (AV) doesn鈥檛 sound super le3t, we swear by a good AV, and that often AV contains all the secrets to illuminate an adversary鈥檚 activities; you just have to roll up your sleeves and query the alert data.听

At 杏吧传媒, we roll out Managed AV, and through that, Defender gives us a nudge every now and again to say, 鈥渟omething is going down here.鈥 Now don鈥檛 sleep on MAV; it catches the big bad ugly ones as much as it catches adware. The trick we鈥檝e found for MAV鈥攐r any security product, truth be told鈥攊s to prune. Be selective in the alerts that are made salient.听

The 杏吧传媒 approach drastically prunes detection noise so that only the finest of threat signals end up in front of 杏吧传媒 SOC analysts, and, subsequently, the partner. A tradeoff of delivering this low-noise security efficacy is that it requires some upfront time and effort investment to hammer out detections and prune back the false positives / lackluster alerts from generating needless noise.听

Anyway, let's get off that soapbox and get into some threat data. 馃懣馃挭

The Possibilities of an Alert

This morning the queue advised bright and early that a machine received a threat signal which Defender had neutralized and taxonomized as 鈥榬emoteexec鈥.

An examination of the alert鈥檚 details gives SOME information, but it doesn鈥檛 really reveal the nature of the threat, just the form (an .exe). Instantly, a threat analyst鈥檚 mind adopts the lens of investigative theory to ascertain what the data is telling us as well as the hidden threads waiting to be pulled on.

For example, this MAV alert states the offending account was 鈥淪YSTEM,鈥 but there will be a user underneath this. Where do we need to go to find out?听

Furthermore, randomly named executables in C:\windows are a staple for lateral movement or remote beacons - seemingly corroborated by Defender鈥檚 cataloged name for this threat as RemoteExec. But, to be frank, we鈥檝e seen just as strange alerts , and whilst SOC analysts love reporting threats, we don鈥檛 love reporting false positives.听

TL;DR: human context is the differentiator 杏吧传媒 brings to the community.听

Sure, 杏吧传媒 EDR combined with an automation or two catches some real gnarly stuff, but it鈥檚 the human operator that makes a whole world of difference. Inundating a partner with endless noisy reports that are vague or vainly technical is a pet peeve of mine. As a ThreatOps Manager, I obsess over making sure that along with the tech used in detecting malice, a threat analyst is also investigating the validity of said detection and then curates a simple, concise report which conveys actionable details and data.听

Pivoting from the Alert

Tell you what we鈥檒l do; let鈥檚 put the EDR telemetry aside and instead share methods and techniques agnostic to 杏吧传媒鈥 stack as that鈥檚 gonna be more useful for folk who don鈥檛 work at 杏吧传媒 (yet 馃槈). And by the way, 杏吧传媒-agnostic approaches to solving security intrusions, so we鈥檙e not just showing off for the blog!

After receiving an alert like this, our first moves will be to collect some choice default forensic telemetry on a Windows machine:听

  • The (奥贰痴罢齿蝉)听
  • Prefetch and PowerShell history听
  • Nothing ended up being relevant in here, but we were looking for evidence that any of those EXEs in the MAV alert executed, as well as other suspicious executables in the time window and for evidence of any PowerShell the adversary may have run听

If you鈥檙e interested in knowing a bit more about these artifacts, do we have a webinar for YOU!

杏吧传媒 already has dedicated 鈥榗anned鈥 tasks that make life easier for us when it comes to collecting these in one click.

We鈥檒l focus on the Windows Event logs, as those yielded the most relevant data. Sure, some security vendors get a lil nervous when it鈥檚 time to leverage Event logs for security analysis, but at 杏吧传媒, . 馃槣

We can use , which essentially allows us to quickly 鈥榞rep鈥 through the WEVTXs. Chainsaw does have a summary 鈥榟unt鈥 mode, but don鈥檛 rely on just this feature alone. Instead, Chainsaw鈥檚 is an advanced and surgical way to deploy the tool. Moreover, if you鈥檙e looking to slice quicker through WEVTXs with specific queries, will be a treat - .

We can start by running Chainsaw in 鈥榟unt鈥 mode, which offers us a -based summary of what鈥檚 going on in this data. But there are some limitations with this method.听

  • The major one is not every result will be malicious. A discerning analyst can sift through the noise, but it鈥檚 still not always clear what is ultimately legitimate.听
  • Also, sigma rules aren鈥檛 going to be perfect, and not all malicious data or relevant data will be included in the hunt mode. An analyst who relies on the hunt summary data is probably missing out on the remaining 80% of the threat data from the intrusion.听

Nonetheless, Chainsaw鈥檚 hunt mode rips through the Windows Defender WEVTX. Here, we鈥檙e given some more context on the Defender alerts we saw in the 杏吧传媒 dashboard. Now we can copy/paste the name of the executable and prepare to detonate Chainsaw in search mode.

Ask Specific Questions

Running chainsaw search ./ -s "KAUpyFdi" -i will essentially 鈥榞rep鈥 through our collected WEVTXs, and when that string appears in one of the event entries, the entire XML is printed for us.听

One of the XML results was incredibly interesting.

Here, we corroborated our earlier thoughts when we saw the MAV alert and wondered if this was some kind of service install. is a signpost for a service install.听

In addition to the service install info, we also get greater clarity on the whole SYSTEM account thing. We get a User SID鈥攁 unique string assigned to a user account on a Windows machine.听

But we have some outstanding thoughts:

  • What is the corresponding user name for this SID?
  • Was the executable Defender detected, attempting a service install, some kind of beacon or lateral movement relic?

Tracking Down Lateral Movement

Now, we need a username and to see if there is any Event ID evidence of a machine that this user account moved across from.

But, to be clear, 4624 data and timestamps have to be closely correlated if we want to claim evidence of lateral movement. If there is a log in 30 minutes prior to the service install, that is a tenuous link to lateral movement. What we are looking for is a 4624 as close to the service install as possible. Maybe even essentially simultaneously.

We can use Chainsaw again, searching a timestamp incredibly close to the earlier identified service install (EventID 7045), and filtering by 4624 successful authentication.听

听chainsaw search ./ -s "2022-12-30T13:54:37" -e 4624 -s "S-1-5-21-746137067-1390067357-682003330-500" -i

We get results back that corroborate things we already knew but offer some really insightful new findings:

  • Our timestamp for the 4624 authentication is essentially the same for 7045 service install. Compounded with the Logon Type, this is indicative of lateral movement
  • We have leapfrogged from understanding the offending account as SYSTEM, then just having the SID, and now finally we have an account name: Administrator
  • We do not get a workstation (host/machine) name, but we do get an internal IPv4

Cool, so our hypothesis based on the evidence so far suggests:

  • Someone controlling the Administrator account deployed some kind of lateral movement from 192.168.0.15 to the machine.
  • This lateral movement led to an attempted service install that Defender neutralized.

Reviewing the 杏吧传媒 agents installed in this network, none report having that private IPv4.

This means one of the following:

  • This organization uses dynamic IP allocation, and therefore what was 192.168.0.15 has now changed 鉃★笍 possible, but unlikely
  • We do not have an agent on the machine with the internal IPv4 192.168.0.15 鉃★笍 most likely.

So, does that mean 192.168.0.15 is the adversary鈥檚 machine?

What Was the Defender Alert?

So now our minds are really ticking. Let's review our findings.听

A LOT of offensive security tools use this lateral movement for all kinds of moves鈥攚e鈥檙e talking Impacket, Cobalt Strike, Havoc鈥all the cool kids. We鈥檙e seeing weird, sus activity indicative of the above malice with a privileged account (Administrator) who is acting from a machine we do not have an agent on (192.168.0.15).

But equally, we lack a lot of evidence to make some claim here. We can鈥檛 rule that this is malicious. We鈥檝e leveraged a constellation of different artifacts, but we鈥檙e not really able to make an authoritative claim that this is evil or adversarial.

We can examine the offending file(s) that Defender neutralized. We can retrieve the files that Defender quarantined and subject them to malware analysis. Rapid malware analysis with Thor details that this binary was associated with remcom.

  • You can think of like psexec (kinda sorta)

This is not the smoking gun that it otherwise could have been.

  • It COULD be malicious: remcom is used in multiple Impacket toolkits, for example [, ]

But it also could be completely legitimate, as we have binaries / services associated with lateral movement.

The Importance of Reporting听

So where do we go from here?

The evidence can be counted up and interpreted as malicious lateral movement, neutralized by Defender and unraveled by the 杏吧传媒 Security Operations Center (SOC)鈥 but equally, the evidence could be contextualized by the partner as legitimate and therefore not a security threat.听

Earlier, we briefly alluded to investigation theory. Regardless of the exact theory, we subscribe to the belief as cybersecurity investigators that we all require guiding cognitive concepts for exactly these situations. These theories are all based around letting the evidence speak rather than allowing the analyst to impose their hypothesis as the truth.听

Two key figures leading the conversation here are and . The aim of such guiding principles is to set oneself parameters and processes of investigation methods and analysis with an aim to provide better rigor and reliability and overcome limitations of bias or assumption.听

Now, we don鈥檛 need to start drawing tables and graphs and do anything too wild to adhere to such a guiding principle. For our case, we need to remember our ultimate objective: summarizing and advising our partners. Our incident report doesn't need competing hypotheses or addendums about our investigators鈥 bias. We just need solid technical summaries of what we have observed and further actionable recommendations based on those observations.

In this case, we wrote a report for our partner based on our findings and then annotated it for this blog.

The annotations are for sure a bit 鈥楶epe Silvia', so don鈥檛 engage with the madness too much. You don鈥檛 have to read it all anyway, as we have some of the guidelines and takeaways we had in mind when writing for your reading pleasure below:

  • Be accurate where it makes sense for the partner to take action on their side, like timestamps, user accounts, hostnames, and IP addresses).
  • Do not be needlessly technically accurate where the partner cannot take action or it doesn鈥檛 make sense (for example, it is probably not necessary for me to go into detail in the report of what remcom is, how it works and what it鈥檚 similar to).
  • Offer actionable recommendations for the partner where it contextually makes sense. Notice that I don鈥檛 ask the partner for a whole shopping list of things, but still ask for responses appropriate for the context.
  • Find the 192.168.0.15 machine and install a 杏吧传媒 Agent on it or identify it as unknown; if they feel sus about the activity, prioritize their backups; temporarily disable the specific account in this report so the adversary cannot control it.听
  • Speak with and through the evidence. Notice that this report opens most sentences with phrases like 鈥渆vidence suggests.鈥 This is no accident. Also notice that when we don鈥檛 know something, we don鈥檛 claim it (for example, we do not call the lateral movement malicious).
  • These seem like just arbitrary semantic gymnastics, but we assure you that an authoritatively concise, well-evidenced report that is free of assumption hits different.
  • A reader is likely to take the threat seriously because they are taking YOU seriously. You are conveying yourself, your analysis, your findings and the consequential recommendations as reputable and knowledgeable.

And That鈥檚 All We鈥檝e Got for You

This investigation took longer to write up than it took to deploy and analyze. 馃槀 But it felt appropriate when a number of techniques, tools and tips were leveraged in this investigation that we perhaps take for granted as reflexive.

Now nothing we do here at 杏吧传媒 requires a PhD in hackology. We just have clever, dedicated, hard-working people across all the teams. And in the infosec community, we have an incredible collection of people, tools, and docs that can teach you to conduct security investigations with the same lethality, tenacity and accuracy that 杏吧传媒 strives for.听

Lacking in most people鈥攐ften鈥攊s confidence. We see it again and again, in and out of 杏吧传媒. Personnel have the capability but lack confidence in their execution and method.听

To be transparent, a crisis of confidence could have crept up so many times during this investigation:

  • What if we are wrong about this being malicious lateral movement?
  • What if we are wrong and the service successfully installed, Defender didn鈥檛 stop it, and the partner is currently compromised?!
  • What if we are totally wrong and this is all an obvious false positive and we look stoooopid?!

Those thoughts cross our minds for sure.

We would argue that the normal analyst doubts themselves 40% of the time and trusts their sauce 60% of the time. At this stage in the game, we at 杏吧传媒 trust our sauce 95% and doubt ourselves 5%. Not because we鈥檙e infallible, but because we trust that we will keep leveraging the constellation of telemetry and keep trying investigative approaches until we can find some evidence to latch onto and a thread to pull on.听

As Senior ThreatOps Analyst said not too long ago:
鈥淚f you don鈥檛 have a good process, your results won鈥檛 likely be good; if you have a good process, your results will likely be good.鈥 馃く

We hope this blog encourages your team to try new techniques or corroborates that your current techniques and processes are good.听

You have to trust your own sauce, my friends. If you鈥檙e curious about the ingredients that make up 杏吧传媒鈥 sauce, check out our Tradecraft Tuesday webinars.

Categories
Share

Sign Up for 杏吧传媒 Updates

Get insider access to 杏吧传媒 tradecraft, killer events, and the freshest blog updates.

By submitting this form, you accept our Terms of Service & Privacy Policy
Oops! Something went wrong while submitting the form.
杏吧传媒 at work