SlideShare a Scribd company logo
1 of 74
Download to read offline
Practical Malware Analysis
Ch 7: Analyzing Malicious Windows
Programs
Rev. 2-27-17
The Windows API

(Application Programming Interface)
What is the API?
• Governs how programs interact with
Microsoft libraries
• Concepts
– Types and Hungarian Notation
– Handles
– File System Functions
– Special Files
Types and Hungarian Notation
• Windows API has its own names to
represent C data types
– Such as DWORD for 32-bit unsigned integers
and WORD for 16-bit unsigned integers
• Hungarian Notation
– Variables that contain a 32-bit unsigned
integer start with the prefix dw
Common API Types
Type (Prefix) Meaning
WORD (w) 16-bit unsigned value
DWORD (dw) 32-bit unsigned value
Handle (H) A reference to an object
Long Pointer (LP) Points to another type
Handles
• Items opened or created in the OS, like
– Window, process, menu, file, ...
• Handles are like pointers to those objects
– They not pointers, however
• The only thing you can do with a handle
is store it and use it in a later function
call to refer to the same object
Handle Example
• The CreateWindowEx function returns
an HWND, a handle to the window
• To do anything to that window (such as
DestroyWindow), use that handle
File System Functions
• CreateFile, ReadFile, WriteFile
– Normal file input/output
• CreateFileMapping, MapViewOfFile
– Used by malware, loads file into RAM
– Can be used to execute a file without using
the Windows loader
Special Files
• Shared files like servershare
– Or ?servershare
• Disables string parsing, allows longer filenames
• Namespaces
– Special folders in the Windows file system
 Lowest namespace, contains everything
.Device namespace used for direct disk input/output
Witty worm wrote to .PhysicalDisk1 to corrupt the disk
Link Ch 7a
Special Files
• Alternate Data
Streams
– Second stream of
data attached to a
filename
– File.txt:otherfile.txt
The Windows Registry
Registry Purpose
• Store operating system and program
configuration settings
– Desktop background, mouse preferences, etc.
• Malware uses the registry for persistence
– Making malware re-start when the system
reboots
Registry Terms
• Root keys These 5
• Subkey A folder within a folder
• Key A folder; can contain folders or values
• Value entry Two parts: name and data
• Value or Data The data stored in a registry entry
• REGEDIT Tool to view/edit the Registry
Root Keys
Run Key
• HKLMSOFTWAREMicrosoftWindowsCurrentVersion
Run
– Executables that start when a user logs on
Autoruns
• Sysinternals tool
• Lists code that will run automatically when
system starts
– Executables
– DLLs loaded into IE and other programs
– Drivers loaded into Kernel
– It checks 25 to 30 registry locations
– Won't necessarily find all automatically running
code
• Link Ch 7b
Autoruns
Common Registry Functions
• RegOpenKeyEx
– Opens a registry key for editing and querying
• RegSetValueEx
– Adds a new value to the registry & sets its data
• RegGetValue
– Returns the data for a value entry in the Registry
• Note: Documentation will omit the trailing W
(wide) or A (ASCII) character in a call like
RegOpenKeyExW
Ex, A, and W Suffixes
• From Ch 2
.REG Files
.REG Files
.REG Files
Networking APIs
Berkeley Compatible Sockets
• Winsock libraries, primarily in ws2_32.dll
– Almost identical in Windows and Unix
– Berkeley compatible sockets
Server and Client Sides
• Server side
– Maintains an open socket waiting for
connections
– Calls, in order, socket, bind, listen, accept
– Then send and recv as necessary
• Client side
– Connects to a waiting socket
– Calls, in order, socket, connect
– Then send and recv as necessary
Simplified

Server

Program
Realistic code
would call
WSAGetLastError
many times
The WinINet API
• Higher-level API than Winsock
• Functions in Wininet.dll
• Implements Application-layer protocols
like HTTP and FTP
• InternetOpen – connects to Internet
• InternetOpenURL –connects to a URL
• InternetReadFile –reads data from a
downloaded file
Following Running Malware
Transferring Execution
• jmp and call transfer execution to another
part of code, but there are other ways
– DLLs
– Processes
– Threads
– Mutexes
– Services
– Component Object Model (COM)
– Exceptions
DLLs (Dynamic Link Libraries)
• Share code among multiple applications
• DLLs export code that can be used by
other applications
• Static libraries were used before DLLs
– They still exist, but are much less common
– They cannot share memory among running
processes
– Static libraries use more RAM than DLLs
DLL Advantages
• Using DLLs already included in Windows
makes code smaller
• Software companies can also make custom
DLLs
– Distribute DLLs along with EXEs
How Malware Authors Use DLLs
• Store malicious code in DLL
– Sometimes load malicious DLL into another
process
• Using Windows DLLs
– Nearly all malware uses basic Windows DLLS
• Using third-party DLLs
– Use Firefox DLL to connect to a server,
instead of Windows API
Basic DLL Structure
• DLLs are very similar to EXEs
• PE file format
• A single flag indicates that it's a DLL instead of
an EXE
• DLLs have more exports & fewer imports
• DllMain is the main function, not exported, but
specified as the entry point in the PE Header
– Called when a function loads or unloads the library
Processes
• Every program being executed by Windows is
a process
• Each process has its own resources
– Handles, memory
• Each process has one or more threads
• Older malware ran as an independent
process
• Newer malware executes its code as part of
another process
Many Processes Run at Once
Memory Management
• Each process uses resources, like CPU, file
system, and memory
• OS allocates memory to each process
• Two processes accessing the same memory
address actually access different locations
in RAM
– Virtual address space (link Ch 7c)
Creating a New Process
• CreateProcess
– Can create a simple remote shell with one
function call
– STARTUPINFO parameter contains handles for
standard input, standard output, and
standard error streams
• Can be set to a socket, creating a remote shell
Code to Create a Shell
• Loads socket handle, StdError, StdOutput
and StdInput into lpProcessInformation
• CommandLine contains the command line
• It's executed when CreateProcess is called
Threads
• Processes are containers
– Each process contains one or more threads
• Threads are what Windows actually executes
• Threads
– Independent sequences of instructions
– Executed by CPU without waiting for other threads
– Threads within a process share the same memory
space
– Each thread has its own registers and stack
Thread Context
• When a thread is running, it has complete
control of the CPU
• Other threads cannot affect the state of
the CPU
• When a thread changes a register, it does
not affect any other threads
• When the OS switches to another thread, it
saves all CPU values in a structure called
the thread context
Creating a Thread
• CreateThread
– Caller specified a start address, also called a
start function
How Malware Uses Threads
• Use CreateThread to load a malicious DLL
into a process
• Create two threads, for input and output
– Used to communicate with a running
application
Interprocess Coordination with Mutexes
• Mutexes are global objects that
coordinate multiple processes and threads
• In the kernel, they are called mutants
• Mutexes often use hard-coded names
which can be used to identify malware
Functions for Mutexes
• WaitForSingleObject
– Gives a thread access to the mutex
– Any subsequent threads attempting to gain
access to it must wait
• ReleaseMutex
– Called when a thread is done using the mutex
• CreateMutex
• OpenMutex
– Gets a handle to another process's mutex
Making Sure Only One Copy of Malware
is Running
• OpenMutex
checks if
HGL345 exists
• If not, it is
created with
CreateMutex
• test eax, eax

sets Z flag if eax is
zero (link Ch 7d)
Services
• Services run in the background without
user input
SYSTEM Account
• Services often run as SYSTEM which is
even more powerful than the
Administrator
• Services can run automatically when
Windows starts
– An easy way for malware to maintain
persistence
– Persistent malware survives a restart
Service API Functions
• OpenSCManager
– Returns a handle to the Service Control Manager
• CreateService
– Adds a new service to the Service Control
Manager
– Can specify whether the service will start
automatically at boot time
• StartService
– Only used if the service is set to start manually
Svchost.exe
• WIN32_SHARE_PROCESS
– Most common type of service used by
malware
– Stores code for service in a DLL
– Combines several services into a single shared
process named svchost.exe
Svchost.exe in Process Explorer
Other Common Service Types
• WIN32_OWN_PROCESS
– Runs as an EXE in an independent process
• KERNEL_DRIVER
– Used to load code into the Kernel
Service Information in the Registry
• HKLMSystemCurrentControlSetServices
– Start value = 0x03 for "Load on Demand"
– Type = 0x20 for WIN32_SHARE_PROCESS
• Link Ch 7e
SC Command
• Included in Windows
• Gives information about Services
Component Object Model (COM)
• Allows different software components to
share code
• Every thread that uses COM must call
OleInitialize or CoInitializeEx before
calling other COM libraries
GUIDs, CLSIDs, IIDs
• COM objects are accessed via Globally
Unique Identifiers (GUIDs)
• There are several types of GUIDs,
including
– Class Identifiers (CLSIDs)
• in Registry at HKEY_CLASSES_ROOTCLSID
– Interface Identifiers (IIDs)
• in Registry at HKEY_CLASSES_ROOTInterface
• Link Ch 7f
Exceptions
• Exceptions are caused by errors, such as
division by zero or invalid memory access
• When an exception occurs, execution
transfers to the Structured Exception
Handler
fs:0 Stores Exception Location
• FS is one of six Segment Registers
• Link Ch 7g-i
Kernel v. User Mode
Two Privilege Levels
• Ring 0: Kernel
Mode
• Ring 3: User mode
• Rings 1 and 2 are
not used by
Windows
– Link Ch 7j
User Mode
• Nearly all code runs in user mode
– Except OS and hardware drivers, which run in
kernel mode
• User mode cannot access hardware
directly
• Restricted to a subset of CPU instructions
• Can only manipulate hardware through
the Windows API
User Mode Processes
• Each process has its own memory, security
permissions, and resources
• If a user-mode program executes an
invalid instruction and crashes, Windows
can reclaim the resources and terminate
the program
Calling the Kernel
• It's not possible to jump directly from
user mode to the kernel
• SYSENTER, SYSCALL, or INT 0x2E
instructions use lookup tables to locate
predefined functions
Kernel Processes
• All kernel processes share resources and
memory addresses
• Fewer security checks
• If kernel code executes an invalid
instruction, the OS crashes with the Blue
Screen of Death
• Antivirus software and firewalls run in
Kernel mode
Malware in Kernel Mode
• More powerful than user-mode malware
• Auditing doesn't apply to kernel
• Almost all rootkits use kernel code
• Most malware does not use kernel mode
The Native API
The Native API
• Lower-level interface for interacting with
Windows
• Rarely used by non-malicious programs
• Popular among malware writers
• Ntdll.dll
manages
interactions
between user
space and the
kernel
• Ntdll
functions
make up the
Native API
The Native API
• Undocumented
• Intended for internal Windows use
• Can be used by programs
• Native API calls can be more powerful and
stealthier than Windows API calls
Popular Native API Calls in Malware
• NTtQuerySystemInformation
• NTtQueryInformationProcess
• NTtQueryInformationThread
• NTtQueryInformationFile
• NTtQueryInformationKey
– Provide much more information than any
available Win32 calls
Popular Native API Calls in Malware
• NtContinue
– Returns from an exception
– Can be used to transfer execution in
complicated ways
– Used to confuse analysts and make a program
more difficult to debug

More Related Content

What's hot

CNIT 127 Ch 16: Fault Injection and 17: The Art of Fuzzing
CNIT 127 Ch 16: Fault Injection and 17: The Art of FuzzingCNIT 127 Ch 16: Fault Injection and 17: The Art of Fuzzing
CNIT 127 Ch 16: Fault Injection and 17: The Art of FuzzingSam Bowne
 
CNIT 126 Ch 7: Analyzing Malicious Windows Programs
CNIT 126 Ch 7: Analyzing Malicious Windows ProgramsCNIT 126 Ch 7: Analyzing Malicious Windows Programs
CNIT 126 Ch 7: Analyzing Malicious Windows ProgramsSam Bowne
 
CNIT 126 8: Debugging
CNIT 126 8: DebuggingCNIT 126 8: Debugging
CNIT 126 8: DebuggingSam Bowne
 
Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Sam Bowne
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgSam Bowne
 
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs Sam Bowne
 
CNIT 126 13: Data Encoding
CNIT 126 13: Data EncodingCNIT 126 13: Data Encoding
CNIT 126 13: Data EncodingSam Bowne
 
Practical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware BehaviorPractical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware BehaviorSam Bowne
 
Practical Malware Analysis: Ch 9: OllyDbg
Practical Malware Analysis: Ch 9: OllyDbgPractical Malware Analysis: Ch 9: OllyDbg
Practical Malware Analysis: Ch 9: OllyDbgSam Bowne
 
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Sam Bowne
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static TechniquesCNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static TechniquesSam Bowne
 
CNIT 127 Lecture 7: Intro to 64-Bit Assembler
CNIT 127 Lecture 7: Intro to 64-Bit AssemblerCNIT 127 Lecture 7: Intro to 64-Bit Assembler
CNIT 127 Lecture 7: Intro to 64-Bit AssemblerSam Bowne
 
CNIT 126 Ch 11: Malware Behavior
CNIT 126 Ch 11: Malware BehaviorCNIT 126 Ch 11: Malware Behavior
CNIT 126 Ch 11: Malware BehaviorSam Bowne
 
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisCNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisSam Bowne
 
CNIT 127 Ch 4: Introduction to format string bugs
CNIT 127 Ch 4: Introduction to format string bugsCNIT 127 Ch 4: Introduction to format string bugs
CNIT 127 Ch 4: Introduction to format string bugsSam Bowne
 
Practical Malware Analysis: Ch 15: Anti-Disassembly
Practical Malware Analysis: Ch 15: Anti-DisassemblyPractical Malware Analysis: Ch 15: Anti-Disassembly
Practical Malware Analysis: Ch 15: Anti-DisassemblySam Bowne
 
CNIT 126 Ch 9: OllyDbg
CNIT 126 Ch 9: OllyDbgCNIT 126 Ch 9: OllyDbg
CNIT 126 Ch 9: OllyDbgSam Bowne
 
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesPractical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesSam Bowne
 
CNIT 127 14: Protection Mechanisms
CNIT 127 14: Protection MechanismsCNIT 127 14: Protection Mechanisms
CNIT 127 14: Protection MechanismsSam Bowne
 

What's hot (20)

CNIT 127 Ch 16: Fault Injection and 17: The Art of Fuzzing
CNIT 127 Ch 16: Fault Injection and 17: The Art of FuzzingCNIT 127 Ch 16: Fault Injection and 17: The Art of Fuzzing
CNIT 127 Ch 16: Fault Injection and 17: The Art of Fuzzing
 
CNIT 126 Ch 7: Analyzing Malicious Windows Programs
CNIT 126 Ch 7: Analyzing Malicious Windows ProgramsCNIT 126 Ch 7: Analyzing Malicious Windows Programs
CNIT 126 Ch 7: Analyzing Malicious Windows Programs
 
CNIT 126 8: Debugging
CNIT 126 8: DebuggingCNIT 126 8: Debugging
CNIT 126 8: Debugging
 
Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Practical Malware Analysis Ch12
Practical Malware Analysis Ch12
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
 
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
 
CNIT 126 13: Data Encoding
CNIT 126 13: Data EncodingCNIT 126 13: Data Encoding
CNIT 126 13: Data Encoding
 
Practical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware BehaviorPractical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware Behavior
 
Practical Malware Analysis: Ch 9: OllyDbg
Practical Malware Analysis: Ch 9: OllyDbgPractical Malware Analysis: Ch 9: OllyDbg
Practical Malware Analysis: Ch 9: OllyDbg
 
9: OllyDbg
9: OllyDbg9: OllyDbg
9: OllyDbg
 
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static TechniquesCNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
 
CNIT 127 Lecture 7: Intro to 64-Bit Assembler
CNIT 127 Lecture 7: Intro to 64-Bit AssemblerCNIT 127 Lecture 7: Intro to 64-Bit Assembler
CNIT 127 Lecture 7: Intro to 64-Bit Assembler
 
CNIT 126 Ch 11: Malware Behavior
CNIT 126 Ch 11: Malware BehaviorCNIT 126 Ch 11: Malware Behavior
CNIT 126 Ch 11: Malware Behavior
 
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisCNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
 
CNIT 127 Ch 4: Introduction to format string bugs
CNIT 127 Ch 4: Introduction to format string bugsCNIT 127 Ch 4: Introduction to format string bugs
CNIT 127 Ch 4: Introduction to format string bugs
 
Practical Malware Analysis: Ch 15: Anti-Disassembly
Practical Malware Analysis: Ch 15: Anti-DisassemblyPractical Malware Analysis: Ch 15: Anti-Disassembly
Practical Malware Analysis: Ch 15: Anti-Disassembly
 
CNIT 126 Ch 9: OllyDbg
CNIT 126 Ch 9: OllyDbgCNIT 126 Ch 9: OllyDbg
CNIT 126 Ch 9: OllyDbg
 
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesPractical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
 
CNIT 127 14: Protection Mechanisms
CNIT 127 14: Protection MechanismsCNIT 127 14: Protection Mechanisms
CNIT 127 14: Protection Mechanisms
 

Viewers also liked

Ch 10: Hacking Web Servers
Ch 10: Hacking Web ServersCh 10: Hacking Web Servers
Ch 10: Hacking Web ServersSam Bowne
 
CNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro CNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro Sam Bowne
 
Ch 13: Network Protection Systems
Ch 13: Network Protection SystemsCh 13: Network Protection Systems
Ch 13: Network Protection SystemsSam Bowne
 
Ch 6: Enumeration
Ch 6: EnumerationCh 6: Enumeration
Ch 6: EnumerationSam Bowne
 
CNIT 128 5: Mobile malware
CNIT 128 5: Mobile malwareCNIT 128 5: Mobile malware
CNIT 128 5: Mobile malwareSam Bowne
 
CNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 DisassemblyCNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 DisassemblySam Bowne
 
CNIT 127 Ch 2: Stack overflows on Linux
CNIT 127 Ch 2: Stack overflows on LinuxCNIT 127 Ch 2: Stack overflows on Linux
CNIT 127 Ch 2: Stack overflows on LinuxSam Bowne
 
CNIT 123 Ch 1: Ethical Hacking Overview
CNIT 123 Ch 1: Ethical Hacking OverviewCNIT 123 Ch 1: Ethical Hacking Overview
CNIT 123 Ch 1: Ethical Hacking OverviewSam Bowne
 
CNIT 126 6: Recognizing C Code Constructs in Assembly
CNIT 126 6: Recognizing C Code Constructs in Assembly CNIT 126 6: Recognizing C Code Constructs in Assembly
CNIT 126 6: Recognizing C Code Constructs in Assembly Sam Bowne
 
Ch 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts ReviewCh 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts ReviewSam Bowne
 
CISSP Prep: Ch 3. Asset Security
CISSP Prep: Ch 3. Asset SecurityCISSP Prep: Ch 3. Asset Security
CISSP Prep: Ch 3. Asset SecuritySam Bowne
 
Ch 12: Cryptography
Ch 12: CryptographyCh 12: Cryptography
Ch 12: CryptographySam Bowne
 
CNIT 123: Ch 4: Footprinting and Social Engineering
CNIT 123: Ch 4: Footprinting and Social EngineeringCNIT 123: Ch 4: Footprinting and Social Engineering
CNIT 123: Ch 4: Footprinting and Social EngineeringSam Bowne
 
Ch 9: Embedded Operating Systems: The Hidden Threat
Ch 9: Embedded Operating Systems: The Hidden ThreatCh 9: Embedded Operating Systems: The Hidden Threat
Ch 9: Embedded Operating Systems: The Hidden ThreatSam Bowne
 
Ch 7: Programming for Security Professionals
Ch 7: Programming for Security ProfessionalsCh 7: Programming for Security Professionals
Ch 7: Programming for Security ProfessionalsSam Bowne
 
Ch 5: Port Scanning
Ch 5: Port ScanningCh 5: Port Scanning
Ch 5: Port ScanningSam Bowne
 
CNIT 127 Lecture 7: Intro to 64-Bit Assembler (not in book)
CNIT 127 Lecture 7: Intro to 64-Bit Assembler (not in book)CNIT 127 Lecture 7: Intro to 64-Bit Assembler (not in book)
CNIT 127 Lecture 7: Intro to 64-Bit Assembler (not in book)Sam Bowne
 
'Malware Analysis' by PP Singh
'Malware Analysis' by PP Singh'Malware Analysis' by PP Singh
'Malware Analysis' by PP SinghBipin Upadhyay
 
CNIT 123: Ch 13: Network Protection Systems
CNIT 123: Ch 13: Network Protection SystemsCNIT 123: Ch 13: Network Protection Systems
CNIT 123: Ch 13: Network Protection SystemsSam Bowne
 
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden ThreatCNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden ThreatSam Bowne
 

Viewers also liked (20)

Ch 10: Hacking Web Servers
Ch 10: Hacking Web ServersCh 10: Hacking Web Servers
Ch 10: Hacking Web Servers
 
CNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro CNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro
 
Ch 13: Network Protection Systems
Ch 13: Network Protection SystemsCh 13: Network Protection Systems
Ch 13: Network Protection Systems
 
Ch 6: Enumeration
Ch 6: EnumerationCh 6: Enumeration
Ch 6: Enumeration
 
CNIT 128 5: Mobile malware
CNIT 128 5: Mobile malwareCNIT 128 5: Mobile malware
CNIT 128 5: Mobile malware
 
CNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 DisassemblyCNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 Disassembly
 
CNIT 127 Ch 2: Stack overflows on Linux
CNIT 127 Ch 2: Stack overflows on LinuxCNIT 127 Ch 2: Stack overflows on Linux
CNIT 127 Ch 2: Stack overflows on Linux
 
CNIT 123 Ch 1: Ethical Hacking Overview
CNIT 123 Ch 1: Ethical Hacking OverviewCNIT 123 Ch 1: Ethical Hacking Overview
CNIT 123 Ch 1: Ethical Hacking Overview
 
CNIT 126 6: Recognizing C Code Constructs in Assembly
CNIT 126 6: Recognizing C Code Constructs in Assembly CNIT 126 6: Recognizing C Code Constructs in Assembly
CNIT 126 6: Recognizing C Code Constructs in Assembly
 
Ch 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts ReviewCh 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts Review
 
CISSP Prep: Ch 3. Asset Security
CISSP Prep: Ch 3. Asset SecurityCISSP Prep: Ch 3. Asset Security
CISSP Prep: Ch 3. Asset Security
 
Ch 12: Cryptography
Ch 12: CryptographyCh 12: Cryptography
Ch 12: Cryptography
 
CNIT 123: Ch 4: Footprinting and Social Engineering
CNIT 123: Ch 4: Footprinting and Social EngineeringCNIT 123: Ch 4: Footprinting and Social Engineering
CNIT 123: Ch 4: Footprinting and Social Engineering
 
Ch 9: Embedded Operating Systems: The Hidden Threat
Ch 9: Embedded Operating Systems: The Hidden ThreatCh 9: Embedded Operating Systems: The Hidden Threat
Ch 9: Embedded Operating Systems: The Hidden Threat
 
Ch 7: Programming for Security Professionals
Ch 7: Programming for Security ProfessionalsCh 7: Programming for Security Professionals
Ch 7: Programming for Security Professionals
 
Ch 5: Port Scanning
Ch 5: Port ScanningCh 5: Port Scanning
Ch 5: Port Scanning
 
CNIT 127 Lecture 7: Intro to 64-Bit Assembler (not in book)
CNIT 127 Lecture 7: Intro to 64-Bit Assembler (not in book)CNIT 127 Lecture 7: Intro to 64-Bit Assembler (not in book)
CNIT 127 Lecture 7: Intro to 64-Bit Assembler (not in book)
 
'Malware Analysis' by PP Singh
'Malware Analysis' by PP Singh'Malware Analysis' by PP Singh
'Malware Analysis' by PP Singh
 
CNIT 123: Ch 13: Network Protection Systems
CNIT 123: Ch 13: Network Protection SystemsCNIT 123: Ch 13: Network Protection Systems
CNIT 123: Ch 13: Network Protection Systems
 
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden ThreatCNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
 

Similar to CNIT 126 7: Analyzing Malicious Windows Programs

Windows internals
Windows internalsWindows internals
Windows internalsPiyush Jain
 
CNIT 126 11. Malware Behavior
CNIT 126 11. Malware BehaviorCNIT 126 11. Malware Behavior
CNIT 126 11. Malware BehaviorSam Bowne
 
CNIT 152: 12b Windows Registry
CNIT 152: 12b Windows RegistryCNIT 152: 12b Windows Registry
CNIT 152: 12b Windows RegistrySam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)Sam Bowne
 
Ch 6: The Wild World of Windows
Ch 6: The Wild World of WindowsCh 6: The Wild World of Windows
Ch 6: The Wild World of WindowsSam Bowne
 
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)Sam Bowne
 
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)Sam Bowne
 
CNIT 152 12 Investigating Windows Systems (Part 2)
CNIT 152 12 Investigating Windows Systems (Part 2)CNIT 152 12 Investigating Windows Systems (Part 2)
CNIT 152 12 Investigating Windows Systems (Part 2)Sam Bowne
 
CNIT 121: 12 Investigating Windows Systems (Part 3)
CNIT 121: 12 Investigating Windows Systems (Part 3)CNIT 121: 12 Investigating Windows Systems (Part 3)
CNIT 121: 12 Investigating Windows Systems (Part 3)Sam Bowne
 
Concepts of Malicious Windows Programs
Concepts of Malicious Windows ProgramsConcepts of Malicious Windows Programs
Concepts of Malicious Windows ProgramsNatraj G
 
CNIT 152 12. Investigating Windows Systems (Part 3)
CNIT 152 12. Investigating Windows Systems (Part 3)CNIT 152 12. Investigating Windows Systems (Part 3)
CNIT 152 12. Investigating Windows Systems (Part 3)Sam Bowne
 
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"EPAM Systems
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System CallsVandana Salve
 
Linux: Everyting-as-a-service
Linux: Everyting-as-a-serviceLinux: Everyting-as-a-service
Linux: Everyting-as-a-serviceRohit Sansiya
 
Operating System Structure Part-I.pdf
Operating System Structure Part-I.pdfOperating System Structure Part-I.pdf
Operating System Structure Part-I.pdfHarika Pudugosula
 
CNIT 124: Ch 8: Exploitation
CNIT 124: Ch 8: ExploitationCNIT 124: Ch 8: Exploitation
CNIT 124: Ch 8: ExploitationSam Bowne
 

Similar to CNIT 126 7: Analyzing Malicious Windows Programs (20)

Windows internals
Windows internalsWindows internals
Windows internals
 
CNIT 126 11. Malware Behavior
CNIT 126 11. Malware BehaviorCNIT 126 11. Malware Behavior
CNIT 126 11. Malware Behavior
 
CNIT 152: 12b Windows Registry
CNIT 152: 12b Windows RegistryCNIT 152: 12b Windows Registry
CNIT 152: 12b Windows Registry
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
 
Ch 6: The Wild World of Windows
Ch 6: The Wild World of WindowsCh 6: The Wild World of Windows
Ch 6: The Wild World of Windows
 
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
 
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
 
Ch0 1
Ch0 1Ch0 1
Ch0 1
 
CNIT 152 12 Investigating Windows Systems (Part 2)
CNIT 152 12 Investigating Windows Systems (Part 2)CNIT 152 12 Investigating Windows Systems (Part 2)
CNIT 152 12 Investigating Windows Systems (Part 2)
 
CNIT 121: 12 Investigating Windows Systems (Part 3)
CNIT 121: 12 Investigating Windows Systems (Part 3)CNIT 121: 12 Investigating Windows Systems (Part 3)
CNIT 121: 12 Investigating Windows Systems (Part 3)
 
Concepts of Malicious Windows Programs
Concepts of Malicious Windows ProgramsConcepts of Malicious Windows Programs
Concepts of Malicious Windows Programs
 
CNIT 152 12. Investigating Windows Systems (Part 3)
CNIT 152 12. Investigating Windows Systems (Part 3)CNIT 152 12. Investigating Windows Systems (Part 3)
CNIT 152 12. Investigating Windows Systems (Part 3)
 
Unit 4
Unit  4Unit  4
Unit 4
 
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
Linux: Everyting-as-a-service
Linux: Everyting-as-a-serviceLinux: Everyting-as-a-service
Linux: Everyting-as-a-service
 
Operating System Structure Part-I.pdf
Operating System Structure Part-I.pdfOperating System Structure Part-I.pdf
Operating System Structure Part-I.pdf
 
CNIT 124: Ch 8: Exploitation
CNIT 124: Ch 8: ExploitationCNIT 124: Ch 8: Exploitation
CNIT 124: Ch 8: Exploitation
 
Chapter 7A Peter Norton
Chapter 7A Peter NortonChapter 7A Peter Norton
Chapter 7A Peter Norton
 
DLL Injection
DLL InjectionDLL Injection
DLL Injection
 

More from Sam Bowne

3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam Bowne
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)Sam Bowne
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic CurvesSam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-HellmanSam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android ApplicationsSam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3Sam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard ProblemsSam Bowne
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)Sam Bowne
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis MethodologySam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated EncryptionSam Bowne
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)Sam Bowne
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)Sam Bowne
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream CiphersSam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data CollectionSam Bowne
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers Sam Bowne
 

More from Sam Bowne (20)

Cyberwar
CyberwarCyberwar
Cyberwar
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
10 RSA
10 RSA10 RSA
10 RSA
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers
 

Recently uploaded

GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 

Recently uploaded (20)

GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 

CNIT 126 7: Analyzing Malicious Windows Programs

  • 1. Practical Malware Analysis Ch 7: Analyzing Malicious Windows Programs Rev. 2-27-17
  • 2. The Windows API
 (Application Programming Interface)
  • 3. What is the API? • Governs how programs interact with Microsoft libraries • Concepts – Types and Hungarian Notation – Handles – File System Functions – Special Files
  • 4. Types and Hungarian Notation • Windows API has its own names to represent C data types – Such as DWORD for 32-bit unsigned integers and WORD for 16-bit unsigned integers • Hungarian Notation – Variables that contain a 32-bit unsigned integer start with the prefix dw
  • 5. Common API Types Type (Prefix) Meaning WORD (w) 16-bit unsigned value DWORD (dw) 32-bit unsigned value Handle (H) A reference to an object Long Pointer (LP) Points to another type
  • 6. Handles • Items opened or created in the OS, like – Window, process, menu, file, ... • Handles are like pointers to those objects – They not pointers, however • The only thing you can do with a handle is store it and use it in a later function call to refer to the same object
  • 7. Handle Example • The CreateWindowEx function returns an HWND, a handle to the window • To do anything to that window (such as DestroyWindow), use that handle
  • 8. File System Functions • CreateFile, ReadFile, WriteFile – Normal file input/output • CreateFileMapping, MapViewOfFile – Used by malware, loads file into RAM – Can be used to execute a file without using the Windows loader
  • 9. Special Files • Shared files like servershare – Or ?servershare • Disables string parsing, allows longer filenames • Namespaces – Special folders in the Windows file system Lowest namespace, contains everything .Device namespace used for direct disk input/output Witty worm wrote to .PhysicalDisk1 to corrupt the disk Link Ch 7a
  • 10. Special Files • Alternate Data Streams – Second stream of data attached to a filename – File.txt:otherfile.txt
  • 12. Registry Purpose • Store operating system and program configuration settings – Desktop background, mouse preferences, etc. • Malware uses the registry for persistence – Making malware re-start when the system reboots
  • 13. Registry Terms • Root keys These 5 • Subkey A folder within a folder • Key A folder; can contain folders or values • Value entry Two parts: name and data • Value or Data The data stored in a registry entry • REGEDIT Tool to view/edit the Registry
  • 15. Run Key • HKLMSOFTWAREMicrosoftWindowsCurrentVersion Run – Executables that start when a user logs on
  • 16. Autoruns • Sysinternals tool • Lists code that will run automatically when system starts – Executables – DLLs loaded into IE and other programs – Drivers loaded into Kernel – It checks 25 to 30 registry locations – Won't necessarily find all automatically running code • Link Ch 7b
  • 18. Common Registry Functions • RegOpenKeyEx – Opens a registry key for editing and querying • RegSetValueEx – Adds a new value to the registry & sets its data • RegGetValue – Returns the data for a value entry in the Registry • Note: Documentation will omit the trailing W (wide) or A (ASCII) character in a call like RegOpenKeyExW
  • 19. Ex, A, and W Suffixes • From Ch 2
  • 20.
  • 25. Berkeley Compatible Sockets • Winsock libraries, primarily in ws2_32.dll – Almost identical in Windows and Unix – Berkeley compatible sockets
  • 26.
  • 27. Server and Client Sides • Server side – Maintains an open socket waiting for connections – Calls, in order, socket, bind, listen, accept – Then send and recv as necessary • Client side – Connects to a waiting socket – Calls, in order, socket, connect – Then send and recv as necessary
  • 29. The WinINet API • Higher-level API than Winsock • Functions in Wininet.dll • Implements Application-layer protocols like HTTP and FTP • InternetOpen – connects to Internet • InternetOpenURL –connects to a URL • InternetReadFile –reads data from a downloaded file
  • 31. Transferring Execution • jmp and call transfer execution to another part of code, but there are other ways – DLLs – Processes – Threads – Mutexes – Services – Component Object Model (COM) – Exceptions
  • 32. DLLs (Dynamic Link Libraries) • Share code among multiple applications • DLLs export code that can be used by other applications • Static libraries were used before DLLs – They still exist, but are much less common – They cannot share memory among running processes – Static libraries use more RAM than DLLs
  • 33. DLL Advantages • Using DLLs already included in Windows makes code smaller • Software companies can also make custom DLLs – Distribute DLLs along with EXEs
  • 34. How Malware Authors Use DLLs • Store malicious code in DLL – Sometimes load malicious DLL into another process • Using Windows DLLs – Nearly all malware uses basic Windows DLLS • Using third-party DLLs – Use Firefox DLL to connect to a server, instead of Windows API
  • 35. Basic DLL Structure • DLLs are very similar to EXEs • PE file format • A single flag indicates that it's a DLL instead of an EXE • DLLs have more exports & fewer imports • DllMain is the main function, not exported, but specified as the entry point in the PE Header – Called when a function loads or unloads the library
  • 36. Processes • Every program being executed by Windows is a process • Each process has its own resources – Handles, memory • Each process has one or more threads • Older malware ran as an independent process • Newer malware executes its code as part of another process
  • 38. Memory Management • Each process uses resources, like CPU, file system, and memory • OS allocates memory to each process • Two processes accessing the same memory address actually access different locations in RAM – Virtual address space (link Ch 7c)
  • 39. Creating a New Process • CreateProcess – Can create a simple remote shell with one function call – STARTUPINFO parameter contains handles for standard input, standard output, and standard error streams • Can be set to a socket, creating a remote shell
  • 40. Code to Create a Shell • Loads socket handle, StdError, StdOutput and StdInput into lpProcessInformation
  • 41. • CommandLine contains the command line • It's executed when CreateProcess is called
  • 42. Threads • Processes are containers – Each process contains one or more threads • Threads are what Windows actually executes • Threads – Independent sequences of instructions – Executed by CPU without waiting for other threads – Threads within a process share the same memory space – Each thread has its own registers and stack
  • 43. Thread Context • When a thread is running, it has complete control of the CPU • Other threads cannot affect the state of the CPU • When a thread changes a register, it does not affect any other threads • When the OS switches to another thread, it saves all CPU values in a structure called the thread context
  • 44. Creating a Thread • CreateThread – Caller specified a start address, also called a start function
  • 45. How Malware Uses Threads • Use CreateThread to load a malicious DLL into a process • Create two threads, for input and output – Used to communicate with a running application
  • 46. Interprocess Coordination with Mutexes • Mutexes are global objects that coordinate multiple processes and threads • In the kernel, they are called mutants • Mutexes often use hard-coded names which can be used to identify malware
  • 47. Functions for Mutexes • WaitForSingleObject – Gives a thread access to the mutex – Any subsequent threads attempting to gain access to it must wait • ReleaseMutex – Called when a thread is done using the mutex • CreateMutex • OpenMutex – Gets a handle to another process's mutex
  • 48. Making Sure Only One Copy of Malware is Running • OpenMutex checks if HGL345 exists • If not, it is created with CreateMutex • test eax, eax
 sets Z flag if eax is zero (link Ch 7d)
  • 49. Services • Services run in the background without user input
  • 50. SYSTEM Account • Services often run as SYSTEM which is even more powerful than the Administrator • Services can run automatically when Windows starts – An easy way for malware to maintain persistence – Persistent malware survives a restart
  • 51. Service API Functions • OpenSCManager – Returns a handle to the Service Control Manager • CreateService – Adds a new service to the Service Control Manager – Can specify whether the service will start automatically at boot time • StartService – Only used if the service is set to start manually
  • 52. Svchost.exe • WIN32_SHARE_PROCESS – Most common type of service used by malware – Stores code for service in a DLL – Combines several services into a single shared process named svchost.exe
  • 54. Other Common Service Types • WIN32_OWN_PROCESS – Runs as an EXE in an independent process • KERNEL_DRIVER – Used to load code into the Kernel
  • 55. Service Information in the Registry • HKLMSystemCurrentControlSetServices – Start value = 0x03 for "Load on Demand" – Type = 0x20 for WIN32_SHARE_PROCESS • Link Ch 7e
  • 56. SC Command • Included in Windows • Gives information about Services
  • 57. Component Object Model (COM) • Allows different software components to share code • Every thread that uses COM must call OleInitialize or CoInitializeEx before calling other COM libraries
  • 58. GUIDs, CLSIDs, IIDs • COM objects are accessed via Globally Unique Identifiers (GUIDs) • There are several types of GUIDs, including – Class Identifiers (CLSIDs) • in Registry at HKEY_CLASSES_ROOTCLSID – Interface Identifiers (IIDs) • in Registry at HKEY_CLASSES_ROOTInterface • Link Ch 7f
  • 59. Exceptions • Exceptions are caused by errors, such as division by zero or invalid memory access • When an exception occurs, execution transfers to the Structured Exception Handler
  • 60. fs:0 Stores Exception Location • FS is one of six Segment Registers • Link Ch 7g-i
  • 62. Two Privilege Levels • Ring 0: Kernel Mode • Ring 3: User mode • Rings 1 and 2 are not used by Windows – Link Ch 7j
  • 63. User Mode • Nearly all code runs in user mode – Except OS and hardware drivers, which run in kernel mode • User mode cannot access hardware directly • Restricted to a subset of CPU instructions • Can only manipulate hardware through the Windows API
  • 64. User Mode Processes • Each process has its own memory, security permissions, and resources • If a user-mode program executes an invalid instruction and crashes, Windows can reclaim the resources and terminate the program
  • 65. Calling the Kernel • It's not possible to jump directly from user mode to the kernel • SYSENTER, SYSCALL, or INT 0x2E instructions use lookup tables to locate predefined functions
  • 66. Kernel Processes • All kernel processes share resources and memory addresses • Fewer security checks • If kernel code executes an invalid instruction, the OS crashes with the Blue Screen of Death • Antivirus software and firewalls run in Kernel mode
  • 67. Malware in Kernel Mode • More powerful than user-mode malware • Auditing doesn't apply to kernel • Almost all rootkits use kernel code • Most malware does not use kernel mode
  • 69. The Native API • Lower-level interface for interacting with Windows • Rarely used by non-malicious programs • Popular among malware writers
  • 70. • Ntdll.dll manages interactions between user space and the kernel • Ntdll functions make up the Native API
  • 71. The Native API • Undocumented • Intended for internal Windows use • Can be used by programs • Native API calls can be more powerful and stealthier than Windows API calls
  • 72.
  • 73. Popular Native API Calls in Malware • NTtQuerySystemInformation • NTtQueryInformationProcess • NTtQueryInformationThread • NTtQueryInformationFile • NTtQueryInformationKey – Provide much more information than any available Win32 calls
  • 74. Popular Native API Calls in Malware • NtContinue – Returns from an exception – Can be used to transfer execution in complicated ways – Used to confuse analysts and make a program more difficult to debug