MARE Unit-1 QA
MARE Unit-1 QA
Objectives:
• To understand the type of malware and its functionality.
• Determine how the system was infected by malware and define if it was a targeted attack or a
phishing attack.
• How malware communicates with attacker.
• Future detection of malware and generating signatures.
Malware indicators are characteristics or patterns that may suggest the presence of malware (malicious
software) on a computer system or network. These indicators help cybersecurity professionals and
systems detect and identify potential threats. Here are common malware indicators:
given malware sample and extracting as much information from it. The information that is extracted helps
to understand the functionality and scope of malware, how the system was infected and how to defend
Static analysis involves examining the malware without actually executing it. Analysts dissect the code
and structure of the malware to gain insights into its inner workings. Techniques used in static analysis
include:
Code Review: Manually examining the source code of the malware to identify suspicious or malicious
functions, APIs, and behaviors.
Disassembling and Decompiling: Transforming the binary code into human-readable assembly
language (disassembling) or higher-level programming language (decompiling) to better understand the
code's functionality.
Strings Analysis: Extracting and analyzing strings present in the malware, which might reveal indicators
of compromise (IOCs), such as command-and-control (C2) server URLs or encryption keys.
Signature-based Detection: Creating signatures or patterns based on known malware characteristics to
detect and block similar malware in the future.
2. Dynamic Analysis:
Dynamic analysis involves executing the malware in a controlled environment, such as a virtual
machine (VM), and observing its behavior during runtime. Techniques used in dynamic analysis include:
Sandboxing: Running the malware in an isolated and controlled environment to monitor its actions, such
as file modifications, network communication, and process creation.
Behavioral Analysis: Observing and documenting the actions and interactions of the malware with the host
system and other processes to understand its capabilities and intentions.
API Hooking: Intercepting and monitoring the application programming interfaces (APIs) used by the
malware to gain insight into its actions and interactions with the operating system.
Network Traffic Analysis: Capturing and analyzing the network communications initiated by the malware
to identify communication protocols, C2 servers, and data exfiltration attempts.
3. Memory Analysis:
Memory analysis focuses on examining the malware's activities and artifacts present in the system's
memory. This is particularly useful for detecting and analyzing fileless malware or malware that operates
primarily in-memory. Techniques used in memory analysis include:
Memory Dumping: Extracting the contents of the system's memory for offline analysis to identify hidden
or encrypted payloads and other memory-resident artifacts.
Process Injection Analysis: Identifying and analyzing code injection techniques used by malware to
hide its presence or escalate privileges.
Malicious Code Hunting: Searching for telltale signs of malicious code and suspicious data structures
within the memory of a compromised system.
4. Hybrid Analysis:
Hybrid analysis combines aspects of static and dynamic analysis to gain a more comprehensive
understanding of the malware. This approach provides a broader view of the malware's behavior,
capabilities, and evasion techniques.
5. Reverse Engineering:
Reverse engineering involves deconstructing the malware to understand its logic and functionality
fully. It is a crucial process in understanding advanced or previously unknown malware. Analysts may
use various tools and techniques, such as disassemblers, debuggers, and other specialized software to
reverse engineer the malware code.
6. Automated Analysis:
Automated analysis relies on security tools and systems to quickly analyze large volumes of malware
samples. These tools can execute malware in a sandboxed environment, generate reports, and extract IOCs
automatically.
By employing a combination of these malware analysis techniques, cyber security experts can better
understand the threat posed by malware, devise appropriate countermeasures, and develop better informed
incident response strategies.
4.Explain in detail about reverse engineering and resources for reverse engineering malware.
What Is Reverse Engineering Malware?
Reverse engineering malware is the process of analyzing malware to understand its functionality and
purpose. This process can determine how to remove the malware from a system or create defenses against
it.
Reverse engineering malware is challenging, as malware is often designed to be difficult to analyze.
Typically, a malware reverse engineering program would be necessary to become proficient at it. Threat
actors may use obfuscation techniques, encryption, and other tricks to make the programs more complex.
In addition, malware authors may change the code frequently to make it harder to reverse engineer.
However, simply understanding how malware works isn’t enough to protect against it. To be truly effective,
security researchers need to be able to not only understand how malware works but also predict how it will
evolve.
Security researchers must have a strong understanding of assembly language and computer architecture to
reverse engineer malware. Assembly language is the lowest level of programming language, and it’s used
to write programs that are very close to the hardware. This makes it ideal for writing malware, as it gives
the attacker much control over what the code does.
Computer architecture is the study of how computers are designed and how they work. By understanding
computer architecture, security researchers can better understand how malware works and how it can be
used to attack systems.
Behavioral Analysis:
1. Focus: Behavioral analysis concentrates on observing and documenting the actions and interactions of
malware with the target system during runtime.
2. Execution Environment: The malware is executed in a controlled environment, such as a sandbox or
virtual machine, to observe its behavior without affecting the host system.
3. Observations: Analysts look for various activities performed by the malware, such as file modifications,
network communications, registry changes, process creations, and attempts to escalate privileges.
4. Advantages:
• Provides a real-world perspective of how the malware behaves on an actual system.
• Useful for identifying new and unknown malware that may not have specific signatures.
• Helps reveal evasive behavior, such as self-destruct mechanisms and anti-analysis techniques.
5. Limitations:
• Cannot provide insights into the internal code structure and logic of the malware.
• May miss certain aspects of malware behavior that require deep analysis of the code.
Code Analysis:
1. Focus: Code analysis involves examining the malware's binary code, assembly language, or source code
to understand its internal structure, logic, and functionality.
2. Execution Environment: Code analysis is typically conducted in a static environment without executing
the malware. The analysis focuses on studying the code's attributes without running it on a live system.
3. Observations: Analysts review the assembly language or decompiled code to identify instructions,
functions, data structures, and potential vulnerabilities.
4. Advantages:
• Provides a deep understanding of the malware's logic and functionality.
• Helps identify specific techniques used by the malware, such as encryption, packing, or code injection.
• Useful for generating detection signatures and understanding the full extent of the malware's capabilities.
5. Limitations:
• Cannot capture dynamic behaviors of the malware that may occur during runtime.
• May miss evasive techniques that are only observable in a live execution environment.
It’s important to note that a malware analysis lab must be designed and managed with security in mind.
Access to the lab should be restricted, and all tools and systems used in the lab should be kept up-to-date
and regularly reviewed to ensure that they are secure.
Threats are one of the most challenging areas in the field of Information security and the lack of qualified
personnel makes it even harder for companies to keep their information and assets secure and cater to such
a situation without incurring much loss. Malware analysis is the process of determining the origin, potential
impact, and functionality of the given malware sample such as virus, trojan horse, etc. In this article, we are
not going to discuss the whereabouts of Malware or Malware Analysis. Rather we will see How can you
effectively set up a lab for Malware Analysis. As one plan can not fit the need of all the organizations, we
need to take into mind a few alternatives and decide the best according to your organization’s needs.
Fileless malware doesn’t install anything initially, instead, it makes changes to files that are native to the
operating system, such as PowerShell or WMI. Because the operating system recognizes the edited files
as legitimate, a fileless attack is not caught by antivirus software — and because these attacks are stealthy,
they are up to ten times more successful than traditional malware attacks.
3. Spyware
Spyware collects information about user’s activities without their knowledge or consent. This can include
passwords, pins, payment information and unstructured messages.
The use of spyware is not limited to the desktop browser: it can also operate in a critical app or on a mobile
phone.
Even if the data stolen is not critical, the effects of spyware often ripple throughout the organization as
performance is degraded and productivity eroded.
Spyware Example:
DarkHotel, which targeted business and government leaders using hotel WIFI, used several types of
malware in order to gain access to the systems belonging to specific powerful people. Once that access
was gained, the attackers installed keyloggers to capture their targets passwords and other sensitive
information.
4. Adware
Adware tracks a user’s surfing activity to determine which ads to serve them. Although adware is similar
to spyware, it does not install any software on a user’s computer, nor does it capture keystrokes.
The danger in adware is the erosion of a user’s privacy — the data captured by adware is collated with data
captured, overtly or covertly, about the user’s activity elsewhere on the internet and used to create a profile
of that person which includes who their friends are, what they’ve purchased, where they’ve travelled, and
more. That information can be shared or sold to advertisers without the user’s consent.
Adware Example:
Adware called Fireball infected 250 million computers and devices in 2017, hijacking browsers to change
default search engines and track web activity. However, the malware had the potential to become more than
a mere nuisance. Three-quarters of it was able to run code remotely and download malicious files.
5. Trojan
A Trojan disguises itself as desirable code or software. Once downloaded by unsuspecting users, the
Trojan can take control of victims’ systems for malicious purposes. Trojans may hide in games, apps, or
even software patches, or they may be embedded in attachments included in phishing emails.
Trojan Example:
Emotet is a sophisticated banking trojan that has been around since 2014. It is hard to fight Emotet because
it evades signature-based detection, is persistent, and includes spreader modules that help it propagate. The
trojan is so widespread that it is the subject of a US Department of Homeland Security alert, which notes
that Emotet has cost state, local, tribal and territorial governments up to $1 million per incident to remediate.
TrickBot malware is a type of banking Trojan released in 2016 that has since evolved into a modular,
multi-phase malware capable of a wide variety of illicit operations.
6. Worms
Worms target vulnerabilities in operating systems to install themselves into networks. They may gain
access in several ways: through backdoors built into software, through unintentional software
vulnerabilities, or through flash drives. Once in place, worms can be used by malicious actors to launch
DDoS attacks, steal sensitive data, or conduct ransomware attacks.
Worm Example:
Stuxnet was probably developed by the US and Israeli intelligence forces with the intent of setting back
Iran’s nuclear program. It was introduced into Iran’s environment through a flash drive.
Because the environment was air-gapped, its creators never thought Stuxnet would escape its target’s
network — but it did. Once in the wild, Stuxnet spread aggressively but did little damage, since its only
function was to interfere with industrial controllers that managed the uranium enrichment process.
7. Virus
A virus is a piece of code that inserts itself into an application and executes when the app is run. Once
inside a network, a virus may be used to steal sensitive data, launch DDoS attacks or conduct ransomware
attacks.
8. Rootkits
A rootkit is software that gives malicious actors remote control of a victim’s computer with full
administrative privileges. Rootkits can be injected into applications, kernels, hypervisors, or firmware. They
spread through phishing, malicious attachments, malicious downloads, and compromised shared drives.
Rootkits can also be used to conceal other malware, such as keyloggers. Rootkit
Example:
Zacinlo infects systems when users download a fake VPN app. Once installed, Zacinlo conducts a security
sweep for competing malware and tries to remove it. Then it opens invisible browsers and interacts with
content like a human would — by scrolling, highlighting and clicking. This activity is meant to fool
behavioural analysis software. Zacinlo’s payload occurs when the malware clicks on ads in the invisible
browsers. This advertising click fraud provides malicious actors with a cut of the commission.
9. Keyloggers
A keylogger is a type of spyware that monitors user activity. Keyloggers have legitimate uses; businesses
can use them to monitor employee activity and families may use them to keep track of children’s online
behaviors.
However, when installed for malicious purposes, keyloggers can be used to steal password data, banking
information and other sensitive information. Keyloggers can be inserted into a system through phishing,
social engineering or malicious downloads. Keylogger Example:
keylogger called Olympic Vision has been used to target US, Middle Eastern and Asian businessmen
for business email compromise (BEC) attacks. Olympic Vision uses spear-phishing and social
engineering techniques to infect its targets’ systems in order to steal sensitive data and spy on business
transactions. The keylogger is not sophisticated, but it’s available on the black market for $25 so it’s highly
accessible to malicious actors.
10. Bots/Botnets
A bot is a software application that performs automated tasks on command. They’re used for legitimate
purposes, such as indexing search engines, but when used for malicious purposes, they take the form of
self-propagating malware that can connect back to a central server.
Usually, bots are used in large numbers to create a botnet, which is a network of bots used to launch broad
remotely-controlled floods of attacks, such as DDoS attacks. Botnets can become quite expansive. For
example, the Mirai IoT botnet ranged from 800,000 to 2.5M computers.
Botnet Example:
Echobot is a variant of the well-known Mirai. Echobot attacks a wide range of IoT devices, exploiting
over 50 different vulnerabilities, but it also includes exploits for Oracle WebLogic Server and VMWare’s
SD-Wan networking software. In addition, the malware looks for unpatched legacy systems. Echobot could
be used by malicious actors to launch DDoS attacks, interrupt supply chains, steal sensitive supply chain
information and conduct corporate sabotage.
ClamAV is an open-source antivirus engine designed primarily for detecting malicious software, including
viruses, malware, and other threats. It operates on various platforms including Unix, Linux, macOS, and
Windows. Originally developed by Tomasz Kojm in 2001, ClamAV has become a widely used tool for both
individual users and enterprises seeking to protect their systems from malicious software.
ClamAV works by scanning files and directories on a system for signatures and patterns that match known
malware. These signatures are essentially fingerprints or unique identifiers of specific malware strains. When
ClamAV encounters a file, it compares its content against a database of these signatures. If a match is found,
it signals the presence of malware, allowing the user to take appropriate action, such as quarantining or deleting
the infected file.
In addition to signature-based detection, ClamAV also incorporates heuristic analysis techniques to identify
potentially suspicious behavior or code patterns. This enables it to detect previously unknown or "zero-day"
threats that haven't yet been added to its signature database.
In the context of malware analysis, ClamAV can be utilized as one component of a broader toolkit. Analysts
may use it to quickly scan suspicious files or directories for known malware, providing a baseline assessment
of potential threats. However, it's important to note that ClamAV, like any antivirus solution, may not catch all
types of malware, especially newly emerging or custom-built threats. Therefore, it's often used in conjunction
with other malware analysis tools and techniques, such as sandboxing, static and dynamic analysis, and
behavioral analysis, to comprehensively assess and understand the nature of the malware
Scanning Archives: It examines files within compressed archives (e.g., ZIP, RAR, 7Zip) to detect hidden
malware.
Executable File Parsing: ClamAV analyzes Windows PE files (32/64-bit) and other executable formats.
Support for Special Files: It handles diverse formats like Microsoft Office documents, SymbianOS packages,
and more.
Malware Prevention: ClamAV helps prevent malware from spreading via e-mails or other file transfers¹.
10.Explain some basic ClamAV commands and their usage. Explain different types of
signatures.
1. Install ClamAV:
• If you haven't already installed ClamAV, you can do so using your package manager. For
example, on Ubuntu or Debian-based systems, you can install ClamAV using the following
command: arduinoCopy code sudo apt-get install clamav
• Follow the prompts to complete the installation.
2. Update Virus Definitions:
• Before scanning for malware, it's essential to ensure that your virus definitions are up to date.
Update the virus database using the freshclam command: Copy code sudo freshclam
• This command updates the virus signatures to the latest available version.
3. Perform a Scan:
• Once the virus database is updated, you can perform a scan on a specific file, directory, or the
entire system. For example, to scan a specific directory (replace /path/to/directory with the actual
directory path): bashCopy code clamscan /path/to/directory
• ClamAV will scan the specified directory for malware and display the results.
4. View Scan Report:
• After the scan completes, ClamAV will generate a report showing the scan results,
including any detected malware. You can view the report directly in the terminal. If you want to
save the report to a file, you can redirect the output to a text file. For example:
bashCopy code
clamscan /path/to/directory > scan_report.txt
• This command will save the scan report to a file named scan_report.txt in the current
directory.
5. Scan Options:
ClamAV provides various options to customize the scanning process. You can
specify additional options such as recursively scanning subdirectories, ignoring specific file
types, or outputting only infected files. Refer to the ClamAV documentation or use the
clamscan --help command to view available options.
6. Schedule Regular Scans:
• To ensure ongoing protection against malware, you can schedule regular scans using cron or
another scheduling tool. For example, you can create a cron job to run ClamAV scans daily or
weekly and email the results to the system administrator for review.
That's it! You've completed a basic demonstration of ClamAV commands and usage. Remember to
regularly update virus definitions and perform scans to maintain a secure system.
Types of Signatures:
MD5 Signatures: These signatures are based on the MD5 hash values of known malware files. MD5
signatures are effective for identifying exact matches of known malware samples.
SHA-1 and SHA-256 Signatures: Similar to MD5 signatures, SHA-1 and SHA-256 signatures are based on
cryptographic hash functions and are used to uniquely identify malware samples.
YARA Signatures: ClamAV also supports YARA rules, which are more flexible and expressive than
traditional signatures. YARA rules allow users to define complex patterns and conditions for identifying
malware based on various attributes such as file properties, strings, and byte sequences.