• Stars
    star
    285
  • Rank 145,115 (Top 3 %)
  • Language Batchfile
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Test the accuracy of Endpoint Detection and Response (EDR) software with simple script which executes various ATT&CK/LOLBAS/Invoke-CradleCrafter/Invoke-DOSfuscation payloads

EDR-Testing-Script

This repository contains simple script to test EDR solutions against Mitre ATT&CK/LOLBAS/Invoke-CradleCrafter frameworks. This project is very much in its infancy right now. It is written as a single batch script so it can be easily uploaded and run (as opposed to un-zipped, compiled and installed). The script can run either as a normal user or as Administrator however not giving it high privilages will fail some tests.

Right now this script only works on Windows and should work with most security endpoint solutions.

How To

Run the runtests script and observe alerts coming to your EDR console. Cross-verify these alerts to check if your EDR solution identified them correctly. Most tests will just execute calc.exe but it can be easily modified to try to download and exec i.e. Mimikatz. DO NOT USE THIS SCRIPTS ON PRODUCTION SYSTEMS, INSTEAD DEPLOY THIS IN A VM WITH EDR.

Why

Because it is hard to figure out how accurate EDR's are. Most EDR solutions are sold as silver bullet for security but it is actually difficult to check how many different malicious attacks are correctly identified and contained. MITRE & LOLBAS do pretty good job at mapping common tools and techniques which are being used by attackers out there to pivot, execute code and progress through internal networks and this tool will executes these attacks to helps organizations verify the accuracy of deployed EDR product.

Weaponization

The script executes calc.exe. You can replace this easily with metasploit executable where needed but payloads will need to be modified to reflect this. As payloads are hosted on GitHub, if you really want to test your EDR I would suggest to move them to hosted server somewhere else as GitHub is generally not considered malicious. In theory, serving malicious payload (i.e. metasploit) hosted on external server would be much better way of detecting if EDR triggers or not against specific technique.

Tested On

  • Windows 7 x86
  • Windows 7 x64
  • Windows 10 x64

Coverage

The following techniques are currently covered by this script:

ATT&CK LOLBAS Invoke-CradleCrafter Custom Variants Invoke-DOSfuscation
T1197 msiexec.exe MEMORY\PSWEBSTRING winnt32 bitsadmin regsrv32 BINARY\CMD\1
T1118 diskshadow.exe MEMORY\PSWEBDATA winrs manage-bde.wsf + rundll32 JS BINARY\CMD\2
T1170 esentutl.exe MEMORY\PSWEBOPENREAD waitfor BINARY\CMD\3
T1086 replace.exe MEMORY\NETWEBSTRING .SettingContent-ms file BINARY\PS\1
T1121 SyncAppvPublishingServer MEMORY\NETWEBDATA BINARY\PS\2
T1117 hh.exe MEMORY\NETWEBOPENREAD BINARY\PS\3
T1127 ieexec.exe MEMORY\PSWEBREQUEST ENCODING\1
T1047 Setupapi MEMORY\PSRESTMETHOD ENCODING\2
T1128 Shdocvw MEMORY\NETWEBREQUEST ENCODING\3
T1085 csc.exe MEMORY\PSSENDKEYS PAYLOAD\CONCAT\1
T1130 advpack.dll MEMORY\PSCOMWORD PAYLOAD\CONCAT\2
T1191 Scriptrunner MEMORY\PSCOMEXCEL PAYLOAD\CONCAT\3
T1202 sc MEMORY\PSCOMIE PAYLOAD\REVERSE\1
T1028 Register-cimprovider MEMORY\PSCOMMSXML PAYLOAD\REVERSE\2
T1053 control.exe MEMORY\PSINLINECSHARP PAYLOAD\REVERSE\3
T1216 manage-bde.wsf MEMORY\PSCOMPILEDCSHARP PAYLOAD\FORCODE\1
T1218 AppVLP.exe MEMORY\CERTUTIL PAYLOAD\FORCODE\2
T1033 ScriptRunner.exe DISK\PSWEBFILE PAYLOAD\FORCODE\3
T1140 Pester.bat DISK\PSBITS PAYLOAD\FINCODE\1
T1183 powershellcustomhost.exe DISK\BITSADMIN PAYLOAD\FINCODE\2
T1096 PresentationHost.exe DISK\CERTUTIL PAYLOAD\FINCODE\3
T1055 Command Processor Registry
T1015 gpup.exe
T1138 VBoxDrvInst
InstallHinfSection
Atbroker
msconfig
dnscmd
java.exe
WseClientSvc.exe

Run with Metasploit

If you want to run this script as part of Purple Team exercise then simple MSF module execution will do:

msf > use post/multi/manage/upload_exec
msf post(upload_exec) > set lfile /tmp/runtests.bat
lfile => /tmp/runtests.bat
msf post(upload_exec) > set rfile C:\\Users\\Public\\runtests.bat
rfile => C:\\Users\\Public\\runtests.bat
msf post(upload_exec) > set session 1
session => 1
msf post(upload_exec) > run

Run with Cobalt Strike

Using plugin in Cobalt folder, simply load it and click "EDR TEST > RUN ALL TESTS" against specified target.

Thanks

Everyone working on awesome projects like LOLBAS or Invoke-CradleCrafter

More Repositories

1

BlueTeam.Lab

Blue Team detection lab created with Terraform and Ansible in Azure.
Jinja
135
star
2

RT-CyberShield

Protecting Red Team infrastructure with cyber shield blocking AWS/AZURE/IBM/Digital Ocean/TOR/AV IP/ETC. ranges
Shell
44
star
3

Cloud-Investigate

A preconfigured Windows-based system designed for rapid forensic investigations in both Azure and AWS.
HCL
36
star
4

shadowbroker-smb-scanner

shadowbroker SMB exploit scanner. Scans for ETERNALSYNERGY ETERNALBLUE ETERNALROMANCE ETHERNALCHAMPION
Python
36
star
5

LeakGenerator

Generate your own personal data leak
Python
32
star
6

unix_collector

unix_collector is a Live Response collection script for Incident Response on UNIX-like systems using native binaries. Supports AIX, Android, ESXi, FreeBSD, Linux, macOS, NetBSD, NetScaler, OpenBSD and Solaris systems artifacts.
Shell
29
star
7

GeoIPPlotter

GeoIP plotting script written in Python to help security teams draw visualized reports from IP addresses
Python
20
star
8

OS.LAB

Operating System testbed created with Terraform to test payloads, programs and compatibility on different OS versions. Supports AWS and Azure.
HCL
18
star
9

amphunt

Cisco AMP threat hunting scripts
Python
14
star
10

defcon-23-slides-only

10
star
11

investigatehunt

Cisco Umbrella Investigate threat hunting scripts
Python
8
star
12

wordpress-password-bruteforcer

simple module which will attempt to bruteforce wordpress passwords for either specific username or specific list of users and passwords.
Python
8
star
13

powershell-reverse-shell

Simple Powershell Reverse Shell with handling server in python
Python
8
star
14

WINFINGER

A collection of Windows hashes generated against windows installation ISOs using sigcheck from Sysinternals
8
star
15

Bad-Firewall

Bad IP blocking firewall with ipset, iptables and a dash of bash.
Shell
7
star
16

car-hacking-materials

various references and docs related to car hacking
7
star
17

windows-driver-privesc

Check windows drivers for weak permission which could lead to privilage escalation.
5
star
18

LokiToWinEventLog

A repository containing scripts which allow Loki to log to Windows Event Log.
PowerShell
5
star
19

DNS-Testing-Script

Test the accuracy of DNS monitoring and blocking solution.
PowerShell
5
star
20

RT-OfficeBeaconBox

Simple Office-based beacon that calls back to your server for phishing exercises.
Shell
4
star
21

Yara-Mixer

PowerShell scripts concatenating different Yara rules into one master rule file.
PowerShell
3
star
22

Pe-SieveToWinEventLog

A repository containing scripts which allow pe-sieve to log to Windows Event Log.
PowerShell
3
star
23

local-mysql-bruteforcer

local mysql password bruteforcer
Python
3
star
24

fake-http-auth-generator

Python
3
star
25

amp-policy-kit

Cisco Secure Endpoint policy assessment kit
Python
3
star
26

meraki-hunting

Threat hunting scripts for Cisco Meraki installations
Python
2
star
27

SHARPPENCIL

A PowerShell and C# implementation of LDAP attribute extraction for domain users
PowerShell
2
star
28

Invoke-DomainHasher

A threat hunting tool designed to help in identifying unknown binaries across windows domain.
PowerShell
2
star
29

massJARM

A threaded implemenation of JARM tool
Python
2
star
30

afl-fuzz-packets

AFL-minimized packet samples for fuzzing
2
star
31

universal-process-privesc

This simple script is a basic wrapper around windows API to elevate current process privilage. Handy for developement and common functions in python.
Python
2
star
32

evtxpickup

Windows AD wide windows event collection script for scaled up forensic investigations.
PowerShell
1
star
33

MCuban_Blog

Mark Cuban blog copy (in PDF)
Python
1
star
34

Codeword-Generator-Collection

Codeword generators written in common programming and scripting languages
JavaScript
1
star