Skip to content

Commit 9db161c

Browse files
Merge pull request #292 from ION28/develop
Merge Develop to Master for Alpha Release #4.3
2 parents ec7e09f + 06a2328 commit 9db161c

File tree

124 files changed

+2561
-315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+2561
-315
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
cd vcpkg
3535
.\bootstrap-vcpkg.bat
3636
.\vcpkg.exe install yara:${{ matrix.buildarch }}-windows-static
37+
.\vcpkg.exe install libzip:${{ matrix.buildarch }}-windows-static
3738
.\vcpkg.exe integrate install
3839
cd ..
3940
@@ -49,6 +50,14 @@ jobs:
4950
run: powershell set-executionpolicy Unrestricted
5051
shell: powershell
5152

53+
- name: Run Atomic Red Team Prep Script
54+
run: testing\run-atomic-prep.ps1
55+
shell: powershell
56+
57+
- name: Run Atomic Red Team Tests
58+
run: testing\run-atomic-tests.ps1
59+
shell: powershell
60+
5261
- name: Run BLUESPAWN Hunt
5362
run: artifacts\${{ matrix.buildarch }}\${{ matrix.buildtype }}\BLUESPAWN-client.exe --hunt -l Normal --log=xml --reaction=log
5463
shell: cmd
@@ -57,11 +66,20 @@ jobs:
5766
run: Get-ChildItem "bluespawn*.xml" | Rename-Item -NewName BLUESPAWNHuntResults.xml
5867
shell: powershell
5968

69+
- name: TESTS - Check BLUESPAWN Hunt Results against Atomic Red Team Results
70+
run: testing\run-hunt-results-comparison.ps1
71+
shell: powershell
72+
6073
- uses: actions/upload-artifact@master
6174
with:
6275
name: BLUESPAWN-client-${{ matrix.buildarch }}-${{ matrix.buildtype }}
6376
path: artifacts\${{ matrix.buildarch }}\${{ matrix.buildtype }}\BLUESPAWN-client.exe
6477

78+
- uses: actions/upload-artifact@master
79+
with:
80+
name: AtomicTestsResults-${{ matrix.buildarch }}-${{ matrix.buildtype }}.csv
81+
path: AtomicTestsResults.csv
82+
6583
- uses: actions/upload-artifact@master
6684
with:
6785
name: BLUESPAWNHuntResults-${{ matrix.buildarch }}-${{ matrix.buildtype }}.xml

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ packages/
55
vcpkg/
66
BLUESPAWN-client/external/
77
BLUESPAWN-client/resources/severe
8+
BLUESPAWN-client/resources/severe2
89
BLUESPAWN-client/resources/indicators
9-
BLUESPAWN-client/resources/BLUESPAWN-client.aps
1010
*.user
1111
*.filters
1212
*.cache
1313
*.bak
1414
*.lib
15+
*.aps

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919
[submodule "vcpkg"]
2020
path = vcpkg
2121
url = https://github.com/Microsoft/vcpkg.git
22+
[submodule "BLUESPAWN-client/external/signature-base"]
23+
path = BLUESPAWN-client/external/signature-base
24+
url = https://github.com/Neo23x0/signature-base

BLUESPAWN-client/BLUESPAWN-client.vcxproj

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
<ClInclude Include="headers\hunt\HuntRegister.h" />
2727
<ClInclude Include="headers\hunt\hunts\HuntT1004.h" />
2828
<ClInclude Include="headers\hunt\hunts\HuntT1015.h" />
29+
<ClInclude Include="headers\hunt\hunts\HuntT1035.h" />
2930
<ClInclude Include="headers\hunt\hunts\HuntT1037.h" />
3031
<ClInclude Include="headers\hunt\hunts\HuntT1050.h" />
32+
<ClInclude Include="headers\hunt\hunts\HuntT1053.h" />
3133
<ClInclude Include="headers\hunt\hunts\HuntT1055.h" />
3234
<ClInclude Include="headers\hunt\hunts\HuntT1060.h" />
3335
<ClInclude Include="headers\hunt\hunts\HuntT1099.h" />
@@ -39,8 +41,10 @@
3941
<ClInclude Include="headers\hunt\hunts\HuntT1138.h" />
4042
<ClInclude Include="headers\hunt\hunts\HuntT1182.h" />
4143
<ClInclude Include="headers\hunt\hunts\HuntT1183.h" />
42-
<ClInclude Include="headers\hunt\reaction\RemoveValue.h" />
43-
<ClInclude Include="headers\hunt\reaction\SuspendProcess.h" />
44+
<ClInclude Include="headers\mitigation\mitigations\MitigateV71769.h" />
45+
<ClInclude Include="headers\reaction\CarveMemory.h" />
46+
<ClInclude Include="headers\reaction\RemoveValue.h" />
47+
<ClInclude Include="headers\reaction\SuspendProcess.h" />
4448
<ClInclude Include="headers\hunt\RegistryHunt.h" />
4549
<ClInclude Include="headers\hunt\Scope.h" />
4650
<ClInclude Include="headers\mitigation\Mitigation.h" />
@@ -58,6 +62,7 @@
5862
<ClInclude Include="headers\mitigation\mitigations\MitigateV3340.h" />
5963
<ClInclude Include="headers\mitigation\mitigations\MitigateV3344.h" />
6064
<ClInclude Include="headers\mitigation\mitigations\MitigateV3379.h" />
65+
<ClInclude Include="headers\mitigation\mitigations\MitigateV3479.h" />
6166
<ClInclude Include="headers\mitigation\mitigations\MitigateV63597.h" />
6267
<ClInclude Include="headers\mitigation\mitigations\MitigateV63687.h" />
6368
<ClInclude Include="headers\mitigation\mitigations\MitigateV63753.h" />
@@ -66,6 +71,7 @@
6671
<ClInclude Include="headers\mitigation\mitigations\MitigateV63829.h" />
6772
<ClInclude Include="headers\mitigation\mitigations\MitigateV72753.h" />
6873
<ClInclude Include="headers\mitigation\mitigations\MitigateV73519.h" />
74+
<ClInclude Include="headers\mitigation\mitigations\MitigateV73585.h" />
6975
<ClInclude Include="headers\monitor\ETW_Wrapper.h">
7076
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
7177
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
@@ -135,9 +141,10 @@
135141
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
136142
</ClInclude>
137143
<ClInclude Include="headers\util\processes\Analyzer.h" />
138-
<ClInclude Include="headers\hunt\reaction\Detections.h" />
139-
<ClInclude Include="headers\hunt\reaction\Log.h" />
140-
<ClInclude Include="headers\hunt\reaction\Reaction.h" />
144+
<ClInclude Include="headers\reaction\Detections.h" />
145+
<ClInclude Include="headers\reaction\Log.h" />
146+
<ClInclude Include="headers\reaction\Reaction.h" />
147+
<ClInclude Include="headers\util\processes\PERemover.h" />
141148
<ClInclude Include="headers\util\processes\ProcessChecker.h" />
142149
<ClInclude Include="headers\util\processes\ProcessUtils.h" />
143150
</ItemGroup>
@@ -147,8 +154,10 @@
147154
<ClCompile Include="src\hunt\HuntRegister.cpp" />
148155
<ClCompile Include="src\hunt\hunts\HuntT1004.cpp" />
149156
<ClCompile Include="src\hunt\hunts\HuntT1015.cpp" />
157+
<ClCompile Include="src\hunt\hunts\HuntT1035.cpp" />
150158
<ClCompile Include="src\hunt\hunts\HuntT1037.cpp" />
151159
<ClCompile Include="src\hunt\hunts\HuntT1050.cpp" />
160+
<ClCompile Include="src\hunt\hunts\HuntT1053.cpp" />
152161
<ClCompile Include="src\hunt\hunts\HuntT1055.cpp" />
153162
<ClCompile Include="src\hunt\hunts\HuntT1060.cpp" />
154163
<ClCompile Include="src\hunt\hunts\HuntT1099.cpp" />
@@ -160,8 +169,10 @@
160169
<ClCompile Include="src\hunt\hunts\HuntT1138.cpp" />
161170
<ClCompile Include="src\hunt\hunts\HuntT1182.cpp" />
162171
<ClCompile Include="src\hunt\hunts\HuntT1183.cpp" />
163-
<ClCompile Include="src\hunt\reaction\RemoveValue.cpp" />
164-
<ClCompile Include="src\hunt\reaction\SuspendProcess.cpp" />
172+
<ClCompile Include="src\mitigation\mitigations\MitigateV71769.cpp" />
173+
<ClCompile Include="src\reaction\CarveMemory.cpp" />
174+
<ClCompile Include="src\reaction\RemoveValue.cpp" />
175+
<ClCompile Include="src\reaction\SuspendProcess.cpp" />
165176
<ClCompile Include="src\hunt\RegistryHunt.cpp" />
166177
<ClCompile Include="src\hunt\Scope.cpp" />
167178
<ClCompile Include="src\mitigation\Mitigation.cpp" />
@@ -179,6 +190,7 @@
179190
<ClCompile Include="src\mitigation\mitigations\MitigateV3340.cpp" />
180191
<ClCompile Include="src\mitigation\mitigations\MitigateV3344.cpp" />
181192
<ClCompile Include="src\mitigation\mitigations\MitigateV3379.cpp" />
193+
<ClCompile Include="src\mitigation\mitigations\MitigateV3479.cpp" />
182194
<ClCompile Include="src\mitigation\mitigations\MitigateV63597.cpp" />
183195
<ClCompile Include="src\mitigation\mitigations\MitigateV63687.cpp" />
184196
<ClCompile Include="src\mitigation\mitigations\MitigateV63753.cpp" />
@@ -187,6 +199,7 @@
187199
<ClCompile Include="src\mitigation\mitigations\MitigateV63829.cpp" />
188200
<ClCompile Include="src\mitigation\mitigations\MitigateV72753.cpp" />
189201
<ClCompile Include="src\mitigation\mitigations\MitigateV73519.cpp" />
202+
<ClCompile Include="src\mitigation\mitigations\MitigateV73585.cpp" />
190203
<ClCompile Include="src\monitor\etw\ETW_Wrapper.cpp">
191204
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
192205
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
@@ -252,8 +265,9 @@
252265
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
253266
</ClCompile>
254267
<ClCompile Include="src\util\processes\Analyzer.cpp" />
255-
<ClCompile Include="src\hunt\reaction\ReactLog.cpp" />
256-
<ClCompile Include="src\hunt\reaction\Reaction.cpp" />
268+
<ClCompile Include="src\reaction\ReactLog.cpp" />
269+
<ClCompile Include="src\reaction\Reaction.cpp" />
270+
<ClCompile Include="src\util\processes\PERemover.cpp" />
257271
<ClCompile Include="src\util\processes\ProcessUtils.cpp" />
258272
<ClInclude Include="resources\resource.h" />
259273
</ItemGroup>
@@ -271,13 +285,14 @@
271285
<ItemGroup>
272286
<None Include="resources\indicators" />
273287
<None Include="resources\severe" />
288+
<None Include="resources\severe2" />
274289
</ItemGroup>
275290
<ItemDefinitionGroup>
276291
<BuildLog>
277292
<Path>$(SolutionDir)build\$(PlatformTarget)\$(Configuration)\$(MSBuildProjectName).log</Path>
278293
</BuildLog>
279294
<ClCompile>
280-
<AdditionalIncludeDirectories>$(SolutionDir)BLUESPAWN-client\external\pe-sieve\include;$(SolutionDir)BLUESPAWN-client\external\cxxopts\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
295+
<AdditionalIncludeDirectories>$(SolutionDir)BLUESPAWN-client\external\pe-sieve\libpeconv\libpeconv\include;$(SolutionDir)BLUESPAWN-client\external\pe-sieve\;$(SolutionDir)BLUESPAWN-client\external\pe-sieve\include;$(SolutionDir)BLUESPAWN-client\external\cxxopts\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
281296
<RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MultiThreaded</RuntimeLibrary>
282297
<RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MultiThreaded</RuntimeLibrary>
283298
<RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MultiThreadedDebug</RuntimeLibrary>
Submodule signature-base added at be0caf4

BLUESPAWN-client/headers/hunt/Hunt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "Scope.h"
88
#include "HuntInfo.h"
99

10-
#include "hunt/reaction/Reaction.h"
10+
#include "reaction/Reaction.h"
1111
#include "monitor/Event.h"
1212

1313
class HuntRegister;

BLUESPAWN-client/headers/hunt/HuntRegister.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ class HuntRegister {
2626
public:
2727
HuntRegister(const IOBase& oIo);
2828

29-
void RunHunts(DWORD dwTactics, DWORD dwDataSource, DWORD dwAffectedThings, const Scope& scope, Aggressiveness aggressiveness, const Reaction& reaction);
29+
void RunHunts(DWORD dwTactics, DWORD dwDataSource, DWORD dwAffectedThings, const Scope& scope, Aggressiveness aggressiveness, const Reaction& reaction, vector<string> vExcludedHunts, vector<string> vIncludedHunts);
3030
void RunHunt(Hunt& hunt, const Scope& scope, Aggressiveness aggressiveness, const Reaction& reaction);
3131

32+
bool HuntRegister::HuntShouldRun(Hunt& hunt, vector<string> vExcludedHunts, vector<string> vIncludedHunts);
3233
void SetupMonitoring(Aggressiveness aggressiveness, const Reaction& reaction);
3334
void RegisterHunt(std::shared_ptr<Hunt> hunt);
3435
};

BLUESPAWN-client/headers/hunt/hunts/HuntT1004.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include "../Hunt.h"
3-
#include "hunt/reaction/Reaction.h"
4-
#include "hunt/reaction/Log.h"
3+
#include "reaction/Reaction.h"
4+
#include "reaction/Log.h"
55

66
namespace Hunts {
77

BLUESPAWN-client/headers/hunt/hunts/HuntT1015.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#pragma once
22
#include "../Hunt.h"
33

4-
#include "hunt/reaction/Reaction.h"
5-
#include "hunt/reaction/Log.h"
4+
#include "reaction/Reaction.h"
5+
#include "reaction/Log.h"
66

77
namespace Hunts {
88

99
/**
1010
* HuntT1015 looks for Windows Accessibility Features to be messed with in some way
1111
*
12-
* @scans Cursory checks for any Debugger keys + binaries are signed
13-
* @scans Normal Scan not supported.
12+
* @scans Cursory checks for any Debugger keys and if they are signed
13+
* @scans Normal checks for any Debugger keys, checks if signed, scans with YARA
1414
* @scans Intensive Scan not supported.
1515
*/
1616
class HuntT1015 : public Hunt {
@@ -21,7 +21,7 @@ namespace Hunts {
2121
std::wstring wsIFEOWow64 = L"SOFTWARE\\Wow6432Node\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\";
2222

2323
int HuntT1015::EvaluateRegistry(Reaction& reaction);
24-
int HuntT1015::EvaluateFiles(Reaction& reaction);
24+
int HuntT1015::EvaluateFiles(Reaction& reaction, bool bScanYara);
2525
public:
2626
HuntT1015();
2727

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#pragma once
2+
#include <Windows.h>
3+
4+
#include <vector>
5+
6+
#include "../Hunt.h"
7+
#include "reaction/Reaction.h"
8+
#include "reaction/Log.h"
9+
10+
namespace Hunts {
11+
12+
/**
13+
* HuntT1035 examines the system for malicious services
14+
*
15+
* @scans Cursory scans the services that are installed and their binaries
16+
* @scans Normal Scan not supported.
17+
* @scans Intensive Scan not supported.
18+
*/
19+
class HuntT1035 : public Hunt {
20+
private:
21+
std::vector<std::wstring> vSuspicious = { L"cmd.exe", L"powershell.exe", L"cscript.exe", L"wscript.exe", L"net.exe", L"net1.exe" };
22+
int EvaluateService(Registry::RegistryKey key, Reaction reaction);
23+
24+
public:
25+
HuntT1035();
26+
27+
virtual int ScanNormal(const Scope& scope, Reaction reaction);
28+
virtual std::vector<std::shared_ptr<Event>> GetMonitoringEvents() override;
29+
};
30+
}

0 commit comments

Comments
 (0)