File Infection Techniques: File Resident Viruses
CS 4440/7440 Malware Analysis & Defense Bill Harrison
File Infection Techniques: File Resident Viruses CS 4440/7440 - - PowerPoint PPT Presentation
File Infection Techniques: File Resident Viruses CS 4440/7440 Malware Analysis & Defense Bill Harrison Viruses: Online Resources } Symantec Virus Encyclopedia: http://securityresponse.symantec.com/avcenter/ vinfodb.html } McAfee Virus
CS 4440/7440 Malware Analysis & Defense Bill Harrison
2
3
4
5
} Replace *.exe file with virus *.exe } Overwrite only the beginning of a *.exe that is larger than the virus
} The *.exe has lost its functionality entirely, so the user notices that
} Anti-virus software finds a virus easily right at the beginning of the file
Program Code Virus Code Program Code Program Code Virus Code Replacement Overwriting
6
} It had already replicated to other systems, so it no longer tried to remain stealthy;
7
8
} Anti-virus software must now search the entire file to find it;
} this defeated early anti-virus software
} Control might transfer to the virus during execution of the *.exe, or it might not,
Program Code Program Code Virus Code Random Overwriting
9
} When the virus is about to terminate, it executes the saved instructions
} Application program functionality is preserved (stealth)
} Vienna and Suicide are famous examples of this kind of virus
10
Program Code Program Code Virus Code
Tricky Jump JUMP
11
} Must pass original command-line arguments!
12
} Appending COM file infector (normal COM) } Memory resident: installs itself into high DOS memory, reduces available
} Hooks interrupts 20h and 21h in order to intercept COM file executions } Existed in multiple variants with different messages
13
14
15
Program Code Program Code Virus Code
Tricky Jump JUMP
Cavity 16
Program Code Program Code PE Header Entry Point field (EP) PE Header Entry Point field (EP) Virus Code + decompressor()
17
18
1.
19
20
21
22
Program Code
Call whatzit
Program Code
Call virus
Virus Code PE Header
EP
PE Header
EP
.reloc section 23
24
} What does the virus do with this field? } How does this help the virus?
25
} What does the virus do with this field? } How does this help the virus?
26
} i.e. reloaded at a different load point because the system had to
} Unfortunately, this provides a large cavity for viruses to use and still
27
28
29
Program Code
IAT: whatzit() foo() bar()
Program Code
New IAT: virus() virus() virus()
Virus Code
Saved IAT
PE Header
EP
PE Header
EP
.reloc section
30
31