awesome-malware-persistence
awesome-malware-persistence copied to clipboard
A curated list of awesome malware persistence tools and resources.
Awesome Malware Persistence 
A curated list of awesome malware persistence tools and resources.
Malware persistence consists of techniques that adversaries use to keep access to systems across restarts, changed credentials, and other interruptions that could cut off their access. Techniques used for persistence include any access, action, or configuration changes that let them maintain their foothold on systems, such as replacing or hijacking legitimate code or adding startup code.
This is an extract with only links to the tools and resources taken from the main article about malware persistence.
Contents
- Techniques
-
Persistence Removal
- General
- Windows
- Detection Testing
-
Prevention
- macOS
-
Collection
- General
- Linux
- macOS
- Windows
Techniques
Persistence techniques and detection.
- MITRE ATT&CK tactic "TA0003 - Persistence" - MITRE ATT&CK tactic "TA0003 - Persistence".
- Hexacorn's blog - Hexacorn's blog category for persistence category including the series "Beyond good ol' Run key".
- theevilbit's series "Beyond the good ol' LaunchAgents" - List of macOS persistence beyond just the LaunchDaemons or LaunchAgents.
- forensic artifact repository - Forensic artifact repository covers persistence techniques in their artifacts.
-
Sigma rules - Sigma rules which covers persistence techniques. You can even use filters such as
--filter tag=attack.persistence
or specifically for one techniquetag=attack.t1084
. - Autoruns - You can learn which Windows persistence mechanisms are checked by looking at the output of Autoruns on your own client. Categories and the different locations where things were found are seen in the output. A disassembly of Autoruns lists a subset of the entries which are scanned.
- PowerShell implementation of Autoruns - Another way to find Windows persistence locations is to look at the source code of the PowerShell version of Autoruns. Bonus: A history of the covered persistence locations for each Autoruns version is found there too, which is so awesome!
- KnockKnock - A persistence detection tool for macOS to scan for persistence mechanisms on macOS. Specific persistence locations are found in the plugins folder, e.g. LaunchItems or StartupScripts.
- How malware persists on macOS - List of macOS persistence mechanisms.
- Common malware persistence mechanisms - Different persistence mechanisms for different vectors are described.
- Malware persistence techniques - Good summary of multiple persistence mechanisms, ranging from multiple registry keys to more advanced one, like COM hijacking.
- Detecting & Removing an Attacker's WMI Persistence - Blog post about detecting and removing WMI persistence.
- Windows Persistence using WinLogon - Blog post about abusing WinLogon.
- Untangling Kovter's persistence methods - Blog post about Kovter's persistens methos, among others, hiding in registry. Another one is Threat Spotlight: Kovter Malware Fileless Persistence Mechanism.
- Persistence using GlobalFlags in Image File Execution Options – Hidden from Autoruns.exe - Blog post about abusing GlobalFlag for process execution.
- Uncovering a MyKings Variant With Bootloader Persistence via Managed Detection and Response - Blog post about bootloader persistence.
- Various blog posts about COM/CLSID hijacking
- Linux Malware Persistence with Cron - Blog post about linux persistence using cron jobs.
- Hunting for persistence via Microsoft Exchange Server or Outlook - Blog post about Microsoft Exchange server persistence.
- MoonBounce: the dark side of UEFI firmware - An in-depth write up about one particular UEFI bootkit.
Persistence Removal
Tools and commands for persistence mechanisms removal. Beside the tools mentioned below, use standard OS commands to remove the persistence.
General
- Awesome Incident Response - Use the tools and resources for security incident response, aimed to help security analysts and DFIR teams.
Windows
- PowerSponse - PowerSponse includes various commands for cleanup of persistence mechanisms.
- Removing Backdoors – Powershell Empire Edition - Various blog posts handle the removal of WMI implants.
- RegDelNull - Removal of registry keys with null bytes - used e.g. in run keys for evasion.
Detection Testing
Tools for testing detections. Use the techniques described in Persistence Techniques to create these files or add the configuration changes by hand to test your detections.
- Atomic Red Team - Atomic Red Team supports also the MITRE ATT&CK persistence techniques, see e.g. T1044 "File System Permissions Weakness".
- hasherezade persistence demos - Various (also non standard) persistence methods used by malware for testing own detection, among others COM hijacking demo is found in the repo.
Prevention
Tools for preventing malicious persistence.
macOS
- BlockBlock - A tool which provides continual protection by monitoring persistence locations and protects them accordingly. Similar to KnockKnock but for blocking.
Collection
Tools for persistence collection.
General
- Awesome Forensics - Use the tools from this list which includes awesome free (mostly open source) forensic analysis tools and resources. They help collecting the persistence mechanisms at scale, e.g. by using remote forensics tools.
- osquery - Query persistence mechanisms on clients.
- OSSEC - Use rules and logs from the HIDS to detection configuration changes.
Linux
There is no persistence collection tool for Linux. Use some of the tools from #General or standard OS commands for collection. Thanks for contributing links to Linux specific persistence collection tools.
macOS
- KnockKnock - A tool to uncover persistently installed software in order to generically reveal such malware. See GitHub repository too for the source code.
- Dylib Hijack Scanner or DHS - A simple utility that will scan your computer for applications that are either susceptible to dylib hijacking or have been hijacked. See GitHub repository too for the source code.
Windows
- Autoruns - A powerful persistence collection tool on Windows is Autoruns. It collects different categories and persistence information from a live system and in limited ways from offline images. There is a UI and a command line program and the output format can be set to CSV which can then be imported into your log collection system of choice.
- AutorunsToWinEventLog.ps1 - Instead of using CSV output and copy these file to the server, you can use the AutorunsToWinEventLog script to convert the Autoruns output to Windows event logs and rely on standard Windows event log forwarding.
- PowerShell Autoruns - A PowerShell version of Autoruns.
- RegRipper - Extracts various persistence mechanisms from the registry files directly.
- RECmd - Extract various persistence mechanisms, e.g. by using the config file UserClassesASEPs to extract user's CLSID information.
- KAPE - The tool allows collecting various predefined artifactgs using targets and modules, see KapeFiles which include persistence mechanisms, among others there's a collection of LNK files, scheduled task files and scheduled task listing or a WMI repository auditing module.
Contributing
Contributions welcome! Read the contribution guidelines first.