Query: detection rule: Detects Commandlet names and arguments from the Nishang exploitation framework
Matching passage: Sigma rule: Detects Commandlet names and arguments from the Nishang exploitation framework. Logsource: windows / ps_script. Rule: title: Malicious Nishang PowerShell Commandlets id: f772cee9-b7c2-4cb2-8f07-49870adc02e0 status: test description: Detects Commandlet names and arguments from the Nishang exploitation framework references: - https://github.com/samratashok/nishang author: Alec Costello date: 2019-05-16 modified: 2023-01-16 tags: - attack.execution - attack.t1059.001 logsource: product: windows category: ps_script definition: 'Requirements: Script Block Logging must be enabled' detection: selection: ScriptBlockText|contains: - Add-ConstrainedDelegationBackdoor - Copy-VSS - Create-MultipleSessions - DataToEncode - DNS_TXT_Pwnage - Do-Exfiltration-Dns - Download_Execute - Download-Execute-PS - DownloadAndExtractFromRemoteRegistry - DumpCerts - DumpCreds - DumpHashes - Enable-DuplicateToken - Enable-Duplication - Execute-Command-MSSQL - Execute-DNSTXT-Code - Execute-OnTime - ExetoText - exfill - ExfilOption - FakeDC - FireBuster - FireListener - 'Get-Information ' - Get-PassHints - Get-Web-Credentials - Get-WebCredentials - Get-WLAN-Keys - HTTP-Backdoor - Invoke-AmsiBypass - Invoke-BruteForce - Invoke-CredentialsPhish - Invoke-Decode - Invoke-Encode - Invoke-Interceptor - Invoke-JSRatRegsvr - Invoke-JSRatRundll - Invoke-MimikatzWDigestDowngrade - Invoke-NetworkRelay - Invoke-PowerShellIcmp - Invoke-PowerShellUdp - Invoke-Prasadhak - Invoke-PSGcat - Invoke-PsGcatAgent - Invoke-SessionGopher - Invoke-SSIDExfil - LoggedKeys - Nishang - NotAllNameSpaces - Out-CHM - OUT-DNSTXT - Out-HTA - Out-RundllCommand - Out-SCF - Out-SCT - Out-Shortcut - Out-WebQuery - Out-Word - Parse_Keys - Password-List - Powerpreter - Remove-Persistence - Remove-PoshRat - Remove-Update - Run-EXEonRemote - Set-DCShadowPermissions - Set-RemotePSRemoting - Set-RemoteWMI - Shellcode32 - Shellcode64 - StringtoBase64 - TexttoExe condition: selection falsepositives: - Unknown level: high
Near-miss passage: Sigma rule: Detects when an attacker modifies values of the Disk Cleanup Handler in the registry to achieve persistence. The disk cl. Logsource: windows / registry_add. Rule: title: Potential Persistence Via Disk Cleanup Handler - Registry id: d4f4e0be-cf12-439f-9e25-4e2cdcf7df5a status: test description: 'Detects when an attacker modifies values of the Disk Cleanup Handler in the registry to achieve persistence. The disk cleanup manager is part of the operating system. It displays the dialog box […] The user has the option of enabling or disabling individual handlers by selecting or clearing their check box in the disk cleanup manager''s UI. Although Windows comes with a number of disk cleanup handlers, they aren''t designed to handle files produced by other applications. Instead, the disk cleanup manager is designed to be flexible and extensible by enabling any developer to implement and register their own disk cleanup handler. Any developer can extend the available disk cleanup services by implementing and registering a disk cleanup handler. ' references: - https://persistence-info.github.io/Data/diskcleanuphandler.html - https://www.hexacorn.com/blog/2018/09/02/beyond-good-ol-run-key-part-86/ author: Nasreddine Bencherchali (Nextron Systems) date: 2022-07-21 modified: 2023-02-07 tags: - attack.persistence logsource: product: windows category: registry_add detection: selection: EventType: CreateKey TargetObject|contains: \SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\ filter_main_default_keys: TargetObject|endswith: - \Active Setup Temp Folders - \BranchCache - \Content Indexer Cleaner - \D3D Shader Cache - \Delivery Optimization Files - \Device Driver Packages - \Diagnostic Data Viewer database files - \Downloaded Program Files - \DownloadsFolder - \Feedback Hub Archive log files - \Internet Cache Files - \Language Pack - \Microsoft Office Temp Files - \Offline Pages Files - \Old ChkDsk Files - \Previous Installations - \Recycle Bin - \RetailDemo Offline Content - \Setup Log Files - \System error memory dump files - \System error minidump files - \Temporary Files - \Temporary Setup Files - \Temporary Sync Files - \Thumbnail Cache - \Update Cleanup - \Upgrade Discarded Files - \User file versions - \Windows Defender - \Windows Error Reporting Files - \Windows ESD installation files - \Windows Upgrade Log Files condition: selection and not 1 of filter_main_* falsepositives: - Legitimate new entry added by windows level: medium