Files
blue-team-tools/rules/windows/powershell/powershell_script/powershell_accessing_win_api.yml
T

72 lines
2.1 KiB
YAML
Raw Normal View History

2020-10-06 19:57:57 +03:00
title: Accessing WinAPI in PowerShell
id: 03d83090-8cba-44a0-b02f-0b756a050306
status: experimental
description: Detecting use WinAPI Functions in PowerShell
2020-10-07 14:47:29 +03:00
author: Nikita Nazarov, oscd.community
2020-10-06 19:57:57 +03:00
date: 2020/10/06
2021-10-16 08:18:49 +02:00
modified: 2021/10/16
2020-10-06 19:57:57 +03:00
references:
- https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse
tags:
- attack.execution
- attack.t1059.001
- attack.t1106
logsource:
product: windows
2021-10-16 08:18:49 +02:00
category: ps_script
2021-08-21 09:50:59 +02:00
definition: Script block logging must be enabled
2020-10-06 19:57:57 +03:00
detection:
selection:
2021-08-04 14:49:50 +02:00
ScriptBlockText|contains:
2020-10-06 19:57:57 +03:00
- 'WaitForSingleObject'
- 'QueueUserApc'
- 'RtlCreateUserThread'
- 'OpenProcess'
- 'VirtualAlloc'
- 'VirtualFree'
- 'WriteProcessMemory'
- 'CreateUserThread'
- 'CloseHandle'
2020-10-06 19:57:57 +03:00
- 'GetDelegateForFunctionPointer'
- 'CreateThread'
- 'memcpy'
- 'LoadLibrary'
- 'GetModuleHandle'
- 'GetProcAddress'
2020-10-06 19:57:57 +03:00
- 'VirtualProtect'
- 'FreeLibrary'
- 'ReadProcessMemory'
- 'CreateRemoteThread'
- 'AdjustTokenPrivileges'
- 'WriteByte'
- 'WriteInt32'
- 'OpenThreadToken'
- 'PtrToString'
- 'FreeHGlobal'
- 'ZeroFreeGlobalAllocUnicode'
- 'OpenProcessToken'
- 'GetTokenInformation'
- 'SetThreadToken'
- 'ImpersonateLoggedOnUser'
- 'RevertToSelf'
- 'GetLogonSessionData'
- 'CreateProcessWithToken'
- 'DuplicateTokenEx'
2020-10-06 19:57:57 +03:00
- 'OpenWindowStation'
- 'OpenDesktop'
- 'MiniDumpWriteDump'
2020-10-06 19:57:57 +03:00
- 'AddSecurityPackage'
- 'EnumerateSecurityPackages'
- 'GetProcessHandle'
- 'DangerousGetHandle'
- 'kernel32'
2020-10-06 19:57:57 +03:00
- 'Advapi32'
- 'msvcrt'
2020-10-06 19:57:57 +03:00
- 'ntdll'
- 'user32'
- 'secur32'
2020-10-06 19:57:57 +03:00
condition: selection
falsepositives:
2021-09-30 16:38:39 +02:00
- Carbon PowerShell Module (https://github.com/webmd-health-services/Carbon)
2020-10-06 19:57:57 +03:00
level: high