Module 4
Initial steps and checks for detecting malware
Last updated on: 16 August 2024
Edit this page on GitHubModule 4
Last updated on: 16 August 2024
Edit this page on GitHubThere is a device of unknown security status and the owner wants to investigate the possibility of infection or previous compromise. Perhaps you have been handed this device physically, or perhaps you will support the client remotely. Use different off-the-shelf or built-in first party scanning tools as well as integrity checks to identify, analyze, and search for Indicators of compromise (IoC) to identify a breach, or a given suspicious malware.
After completing this subtopic, practitioners should be able to do the following:
The least labor-intensive method to detect known malware is to simply use a malware scanner to look at a client’s device’s live system. Note that the quality of antivirus products can vary wildly, but most products catch most known malware. Below are links to some common malware scanners for desktop systems:
🧰 Windows: Microsoft Defender is free and built into Windows. Various commercial AV tools may be used, each with their own pros and cons. Here we will be suggesting MalwareBytes. Consider also AdwCleaner from MalwareBytes for a remover of Adware and Potentially Unwanted Programs1.
🧰 MacOS: We similarly recommend using Malwarebytes. Avast Free Antivirus is also a free option.
🧰 Linux: ClamAV is an open-source antivirus for Linux. It is also available for other platforms
🧰 Android: Various providers such as LookOut provide free or paid Android antivirus and additional mobile security protections. ClamAV is implemented on Android in the Hypatia app via F-Droid.
💡 Compared to desktop operating systems, by design antivirus on Android is more limited in its ability; it can scan all installed apps, but isn’t able to look for possible advanced spyware hiding on the system. Moreover, it may not be able to remove malware it detects.
One of the first steps you can take when looking for malware is installing an antivirus program and letting it run a scan on its system. After the scan is complete, most programs will generate some kind of log that provides additional information about scan results, and we recommend taking a look at it. If antivirus programs catch a potentially suspicious file, they might ‘quarantine’ it, which means that the file will be locked away from the rest of the operating system so that it cannot be accidentally opened or cause further havoc. If you would like to do further analysis on that file, you might need to take it out of quarantine; check out your antivirus program’s documentation on this topic.
It should be noted that modern malware doesn’t always involve malicious files. Instead, it may involve legitimate scripts performing malicious tasks that are made persistent in some way. Antivirus apps will scan for such tasks, thus in the logs it provided, be mindful not to only expect ‘files’.
You should be aware of the limitations of antivirus programs and why they are not a total cure for malware. Different antivirus programs use different detection engines. Some engines will detect some types of viruses and other malware, but no engine is 100% effective.
For this reason, in case you have a sample, you may prefer to upload potentially suspicious files to VirusTotal, which checks the file using a suite of commercially available engines and provides other information that can help you determine whether a file is malicious. Do note that if you upload a file to VirusTotal, it will remain on the website and can be downloaded (and searched for) by anyone with a paid account on the site. As such, if you are dealing with files that contain potentially sensitive information or you don’t want the fact that this file is being analyzed to become publicly known, it’s best to generate a hash of the file2 and search for this on VirusTotal instead. Finally, remember that VirusTotal only uses static engines and its detection can therefore be less effective than that of an antivirus running on a live system. See Subtopic 8 on sample-based Detection for more on this skill. For more on VirusTotal skills, complete the activity in Chapter 7 of the Field Guide to Incident Response for Civil Society and Media.
While modern antivirus engines try to look for malware-like behavior and block executables which meet this criterion, those tests are still relatively rudimentary. Antivirus mostly recognizes malware based on IoCs that were submitted to it; as such, it rarely picks up on new or lesser-known malware.
In addition, adversaries will often test their malware against well-known antivirus programs and modify it so that it isn’t easily detected, for instance by using obfuscation, encoding, compression, and encryption. Some malware will attempt to disable antivirus programs or add itself to an exception list so that it is not scanned. Other malware can trick users into disabling them. For this reason, we recommend installing a new antivirus program on a potentially compromised system and running a scan with that. You can uninstall the program afterwards.
When you do find malware or adware on somebody’s computer, including in cases where it is commodity malware or adware, it is useful to work with the owner of the device to understand how the malware may have been installed on the device (described in Subtopic 10) and then clean up the infection (described in Subtopic 11). Understanding how the malware was installed may point to lack of controls, awareness about risky behavior, or even supply chain issues (e.g., devices shipped pre-installed with potentially unwanted programs) to be discussed and addressed.
All modern operating systems use some form of built-in protection or so-called ‘walled gardens’ (such as app stores or Smart Screen) which restrict users to executable files which the operating system deems safe. By checking to see if these protections have been disabled, removed, or put in an error state, you will gain a valuable triage indication that further compromise may have occurred. If any of those protections are not working, it does not necessarily mean that they were disabled by malware; a user could have turned them off manually in order to run certain software or they could have been targeted by a social engineering attack which convinced them to disable some of those features. If you re-enable those protections, it will likely stop a lot of malware from running or restrict the damage which it can cause to a system.
One thing you can do on all systems is check all web browsers that are installed and see if they have any new extensions which you do not recognize. If they have such extensions, run a web search to see what they do, if they could potentially be malicious, and, if they are potentially malicious, what sort of malware could have installed them.3
For all devices, we would recommend checking out this quick triage checklist.
Check out the Windows Defender Security Center (or Windows Security/Security at a glance), which lets you quickly glance at several Windows security settings, including whether Windows Defender is currently up and running. Do note that Windows Defender’s antivirus features might be automatically disabled if you install a third-party antivirus. This is expected behavior. In either case, a malicious program may have succeeded in adding itself to an exception list (allowlist) instructing the anti-malware tool not to check it. You can verify that there are no unwanted exceptions on Windows Defender using these instructions and other third party anti-malware products may offer the same functionality. The settings panel will let you check the status of several other built-in protections, such as Reputation-based Protection, Core isolation, and Secure boot, among others.
Windows uses Smart App Control (previously called SmartScreen before Window 11, which is now the web-based version of the product integrated in the Edge Browser) as a mechanism to check the reputation of executables before they are run. Check Smart App Control (Win 11) in the Windows Security settings to see in case it has been disabled. Look for Smart Screen settings in earlier versions of Windows.
It’s worth noting that security configurations vary between different versions of iOS and Android. More recent versions of iOS, for example, require profiles to be digitally signed, which should make it harder for adversaries to leverage them. Similarly, many software updates change the way systems deal with permissions or notifications. A good rule of thumb is that successive versions of iOS and Android tend to have stricter security requirements when it comes to automations, apps, and permissions.
Windows Defender
Free with an active Windows licenseAn anti-malware solution made by Microsoft, available to all Windows users for free.
MalwareBytes
Free with premium featuresA popular antivirus scanner often used within civil society.
Avast
Free with premium featuresAnother antivirus scanner with a solid free tier.
Lookout
Multiple pricing tiersA well-known company providing Android security services.
Google Play Protect
FreeQuick documentation on Google Play Protect, an additional and highly recommended security tool for Android.
Identifying compromised devices: an intermediate guide
FreeSome quick signs we can look for when trying to figure out if a device is potentially compromised by malware. Note that these steps are just the start and do not replace scans and deeper analysis.
Windows Security
Free with every Windows installA central point in a Windows operating system where you can check at a glance which security measures have been enabled and which have not.
Protecting against malware in macOS
FreeAn article by Apple outlining some of the security mechanisms present within macOS.
Gatekeeping on macOS
FreeA more in-depth article describing how Gatekeeper, a key macOS security mechanism, functions.
macOS trojan disables gatekeeper to deploy malicious payloads
FreeA case study of how malware managed to disable macOS security mechanisms in order to spread itself on a system.
How to look at your command history list in macOS terminal
FreeA brief guide to browsing through command line history on macOS terminal, which can be useful if you’re trying to figure out what prior commands were typed and if any of them affected security mechanisms.
iOS security checks and mechanisms
Free with macOS and iOS systemsSome security checks you can conduct when doing triage on iOS systems:
iOS security checks and mechanisms
Free with macOS and iOS systemsCheck for app tracking permissions on iOS systems
iOS security checks and mechanisms
Free with macOS and iOS systemsApple’s Safety Check tool
Checking for linked devices on WhatsApp
FreeArticles for:
Checking for linked devices on Signal
FreeArticles for:
Checking for linked devices on Telegram
FreeArticles for:
A Potentially Unwanted Program is something that the user does not want on their system, even if they might have downloaded and run it themselves. It could include programs which mis-advertise their functionality or run many ads. ↩︎
A hash is like a short fingerprint of a file—it can be used to identify a unique file without revealing its contents. You can calculate a hash by using the command line on Windows, macOS, and Linux. ↩︎
Having a malicious extension on your system does not necessarily mean that you have other types of malware as well. An attacker could also use social engineering to convince a user to install malware. ↩︎
If you want to learn more about the spctl command, which is responsible for Gatekeeper, run “man spctl” in the macOS Terminal to see the manual/ documentation page. ↩︎
Congratulations on finishing Module 4!
Mark the checkbox to confirm your completion and continue to the next module.
Marks the current module as completed and saves the progress for the user.
You've completed all modules in this learning path.