Chapter 7 - Malicious Code
Chapter 7 - Malicious Code
Intruder
Hacker: 4 phases
Malicious Software:
o Malicious Software - Introduction
o Malware Terminology
o Where malware lives
o What to Infect
o Taxonomy of Malicious Software
Modern Malware
Malware analysis
10/10/2024 2
1
11/10/2024
10/10/2024 3
10/10/2024 4
2
11/10/2024
10/10/2024 6
3
11/10/2024
Foot printing/Reconnaissance
Gaining access
Maintaining access
Covering track
10/10/2024 7
4
11/10/2024
10/10/2024 9
5
11/10/2024
12
6
11/10/2024
Autoexec.bat
Config.sys
Init.d
10/10/2024 13
• Executable
• Interpreted file
• Kernel
• Service
• Master Boot Record
10/10/2024 14
7
11/10/2024
Virus
Trojan
Applet
Logic
bombs Replication
Malicious Trap door
Worm
Alone
Zombie
10/10/2024 15
8
11/10/2024
Dormant:
o The virus is idle. It will eventually be activated by some event
Propagation:
o The virus places an identical copy of itself into other programs or into
certain system areas
Triggering:
o The virus is activated to perform the function for which it was
intended (such as a date, the presence of another program or file)
Execution
o The function is performed, which may be harmless
9
11/10/2024
components:
o infection mechanism - enables replication
o trigger - event that makes payload activate
o payload - what it does, malicious or benign
prepended / postpended / embedded
when infected program invoked, executes virus code
then original program code
can block initial infection (difficult)
or propogation (with access controls)
10
11/10/2024
Virus V:
o 1: go to “main” of virus program
o 2: a special flag (infected or not)
Main:
o Find uninfected programs - infect
them
o Do something damaging to the
system
o “Go to“ first line of the host
program - do normal work
11
11/10/2024
Elk Cloner (1982): The first known microcomputer virus that spread “in the wild,”
Brain (1986): The first MS-DOS based virus, which targeted IBM PC systems.
Morris Worm (1988): One of the first worms distributed via the Internet,
CIH or Chernobyl Virus (1998): A destructive virus that rendered machines unbootable.
ILOVEYOU or Love Letter Virus (2000): attacked tens of millions of Windows PCs via email.
Code Red and Code Red II (2001): Worms that exploited a vulnerability in Microsoft’s IIS
Slammer or Sapphire (2003): A worm that caused a DoS .
Blaster Worm or MSBlast (2003): a vulnerability in Windows => amount of network traffic.
Sobig.F (2003): circulated through emails as viral spam,
Mydoom (2004): An extremely rapidly spreading email-based worm.
Sasser and Netsky (2004): caused problems in networks (in Windows systems)
Conficker (2008): A worm that targeted Windows and consuming network resources.
Stuxnet (2010): it was responsible for causing substantial damage to Iran’s nuclear program.
CryptoLocker (2013): A ransomware.
WannaCry (2017): A ransomware infected hundreds of thousands of computers worldwide.
NotPetya (2017): Masqueraded as ransomware, targeted Ukraine but had global effects.
Bad Rabbit (2017): A ransomware attack, believed to be a variant of NotPetya,
10/10/2024 23
• Based on concealment:
• Encrypted • Polymorphic
• Stealth • Meta-polymo
12
11/10/2024
Boot Sector Virus: Infects master boot record / boot record (boot
sector) of a disk and spreads when a system is booted with an
infected disk (original DOS viruses).
10/10/2024 25
Memory-resident Virus:
o Reside in RAM
o is infect running programs
File Infector:
o Infects executable files. .com, .exe, .pif, .sys,…
o They attach their self to executable files as part of their code.
o Runs whenever the host program is executed.
Multipartive:
o This virus infects the entire system and spreads by performing
unauthorized actions on your operating system, folders, and
programs
10/10/2024 26
13
11/10/2024
Macro Virus:
o became very common in mid-1990s
o platform independent, infect documents (Word…)
o easily spread, often a form of Basic
o more recent releases include protection
o recognized by many anti-virus programs
Browser hijacking:
o This is a type of computer virus that attacks the browser and automatically
redirects to other websites.
Web scripting:
o This virus infiltrates the background of popular websites - usually social
media platforms.
o They disguise themselves as normal links, luring users to click on them,
where the virus enters the computer and starts spreading.
14
11/10/2024
Rootkit filters
call and results
15
11/10/2024
10/10/2024 31
16
11/10/2024
Kaspersky
10/10/2024 34
17
11/10/2024
18
11/10/2024
—
Secret entry point into a program
10/10/2024 38
19
11/10/2024
10/10/2024 39
the gift horse left outside the gates of Troy by the Greeks, Trojan
Horses appear to be useful or interesting to an unsuspecting user,
10/10/2024 but are actually harmful. 40
20
11/10/2024
10/10/2024 42
21
11/10/2024
10/10/2024 43
22
11/10/2024
23
11/10/2024
Code Red
o July 2001 exploiting MS IIS bug
o probes random IP address, does DDoS attack
o consumes significant net capacity when active
Code Red II variant includes backdoor
SQL Slammer
o early 2003, attacks MS SQL Server
o compact and very rapid spread
Mydoom
o mass-mailing e-mail worm that appeared in 2004
o installed remote access backdoor in infected systems
24
11/10/2024
25
11/10/2024
10/10/2024 52
26
11/10/2024
Zombies
27
11/10/2024
Botnets: Bots
Handler
Attacker
China Hungary
Bots: Host illegal movies,
music, pornography,
criminal web sites, …
Forward Spam for
financial gain
Zombies
10/10/2024 56
28
11/10/2024
10/10/2024 57
10/10/2024 58
29
11/10/2024
10/10/2024 59
10/10/2024 60
30
11/10/2024
1. Crypto malware. it encrypts things like your files, folders, and hard-drives.
Victims were asked to pay ransom in Bitcoin to retrieve their data.
2. Lockers: is known for infecting your operating system to completely lock you
out of your computer or devices, making it impossible to access any of your files
or applications. Ex, Android-based.
3. Scareware. fake software acts like an antivirus or a cleaning tool, It often
claims to have found issues on your computer, demanding money to resolve the
problems, some types of scareware lock your computer, flood your screen with
annoying alerts and pop-up messages.
4. Doxware. It threatens to publish your stolen information online if you don’t pay
the ransom.
5. RaaS. is a type of malware hosted anonymously by a hacker. These
cybercriminals handle everything from distributing the ransomware and
collecting payments to managing decryptors — software that restores data
access — in exchange for their cut of the ransom.
6. Mac ransomware. Mac operating systems were infiltrated by their first
ransomware in 2016.
Known as KeRanger infected Apple user systems through an app called
Transmission
7. Ransomware on mobile devices
10/10/2024 61
10/10/2024 62
31
11/10/2024
10/10/2024 63
Malware Analysis
o The process of understanding the behavior and purpose of a
suspicious file or URL.
o The output of the analysis aids in the detection and mitigation of the
potential threat.
10/10/2024 64
32
11/10/2024
Static Analysis
o does not require that the code is actually run.
o examines the file for signs of malicious intent.
o can be useful to identify malicious infrastructure, libraries or
packed files.
o Limit: sophisticated malware can include malicious runtime
behavior that can go undetected
Dynamic malware
o analysis executes suspected malicious code in a safe
environment called a sandbox.
o enables security professionals to watch the malware in action
without the risk of letting it infect their system or escape into the
enterprise network.
Hybrid
10/10/2024 Analysis (includes both of the techniques above) 65
10/10/2024 66
33
11/10/2024
Malware Detection
Threat Alerts and Triage (Cảnh báo và thử thách mối đe dọa)
o teams can save time by prioritizing the results of these alerts over other
technologies.
Incident Response
o aids in the efficiency and effectiveness of the effort in analysing root cause
Threat Hunting
o Help threat hunters find similar activity, such as access to a particular
network connection, port or domain.
Malware Research
o to gain an understanding of the latest techniques, exploits and tools used by
adversarie
10/10/2024 67
Intruder
Hacker: 4 phases
Attack: many types
Malicious Software: many types
Malware Analysis
34
11/10/2024
10/10/2024 69
10/10/2024 70
35