MALWARE: VIRUSES
CMSC 414
FEB 08 2018
MALWARE: VIRUSES CMSC 414 FEB 08 2018 MALWARE Malicious code - - PowerPoint PPT Presentation
MALWARE: VIRUSES CMSC 414 FEB 08 2018 MALWARE Malicious code that is stored on and runs on a victims system How does it get to run? Attacks a user- or network-facing vulnerable service Backdoor: Added by a malicious
FEB 08 2018
Malicious code that is stored on and runs on a victim’s system
clicking/installing
Malicious code that is stored on and runs on a victim’s system
clicking/installing
Potentially from any mode of interaction (automated
Virtually anything, subject only to its permissions
Some delay based on a trigger
Some attach themselves to other pieces of code
The line between these is thin and blurry Some malware uses both styles
executed
immediately executed
possible
possible
user action
Original program
Entry point
Original program
Entry point
Original program
Virus
Entry point
Take over the entry point
memory and runs it
memory and runs it
VIRUSES HAVE RESULTED IN A TECHNICAL ARMS RACE
The key is evasion
VIRUSES HAVE RESULTED IN A TECHNICAL ARMS RACE
The key is evasion Mechanisms for evasive propagation
VIRUSES HAVE RESULTED IN A TECHNICAL ARMS RACE
The key is evasion Mechanisms for evasive propagation Mechanisms for detection and prevention
VIRUSES HAVE RESULTED IN A TECHNICAL ARMS RACE
The key is evasion Mechanisms for evasive propagation Mechanisms for detection and prevention
VIRUSES HAVE RESULTED IN A TECHNICAL ARMS RACE
The key is evasion Mechanisms for evasive propagation Mechanisms for detection and prevention
Want to be able to claim wide coverage for a long time Want to be able to claim the ability to detect many viruses
Increase chances by attaching malicious code to something a user is likely to run
antivirus market
competition
Um.. thanks?
Original program
Entry point
Original program
Virus
Entry point
“Appending”
Original program
Entry point
Original program
Virus
Entry point
“Appending”
Original program
Entry point jmp jmp
“Surrounding”
Original program
Entry point
Original program
Virus
Entry point
“Appending”
Original program
Entry point
etc.
Original program
Entry point jmp jmp
“Surrounding”
Overwrite uncommonly used parts of the program
Original program
Entry point
Original program
Virus
Entry point
“Appending”
Original program
Entry point
etc.
Original program
Entry point jmp jmp
Confuse scanners “Surrounding”
Overwrite uncommonly used parts of the program
Mechanize code changes: Goal: every time you inject your code, it looks different
Key Encrypt Plaintext Ciphertext Decrypt Plaintext Key
Symmetric key: both keys are the same Asymmetric key: different keys Important property: the ciphertext is nondeterministic i.e., “Encrypt” has a different output each time but decrypting always returns the plaintext
Key Encrypt Plaintext Decrypt Plaintext Key
Symmetric key: both keys are the same Asymmetric key: different keys Important property: the ciphertext is nondeterministic i.e., “Encrypt” has a different output each time but decrypting always returns the plaintext
Ciphertext Ciphertext
Virus
Original program
Entry point
Take over the entry point
Virus
Virus
Original program
Entry point
Take over the entry point
Virus
Encrypted virus code
Key Decrypter
Original program
Entry point
Take over the entry point
Virus
Encrypted virus code
Key Decrypter
Original program
Entry point
Take over the entry point
Key Decrypter
jmp
Virus code
Encrypted virus code
Key Decrypter Key Decrypter
jmp
Virus code
Encrypted virus code
Key Decrypter Key Decrypter
jmp
Virus code
Encryptor
Encrypted virus code
Key Decrypter Key Decrypter
jmp
Virus code
Encryptor Key 2
Encrypted virus code
Decrypter
Encryption will yield a different output upon each invocation
Now you are the antivirus writer: how do you detect?
code to see if it decrypts.
which do something similar (decompression)?
Now you are the antivirus writer: how do you detect?
code to see if it decrypts.
which do something similar (decompression)?
Now you are the antivirus writer: how do you detect? Now you are the virus writer again: how do you evade?
Now you are the virus writer again: how do you evade?
decrypters
Now you are the virus writer again: how do you evade?
different version of the code
different version of the code
never run it)
When can AV software successfully scan?
When can AV software successfully scan?
behavior
safe environment, like gdb or a virtual machine)
signature
see if it matches the signature
proper behavioral signature)
environment, e.g., gdb) and act differently
proper behavioral signature)
environment, e.g., gdb) and act differently
Attackers have the upper hand: AV systems hand out signatures, thus serving as an oracle
Crypting service
Attackers have an informational advantage
code
Crypting service
Attackers have an informational advantage
code
Crypting service
AV AV AV AV AV AV Many different vendors Attackers have an informational advantage
code
Crypting service
AV AV AV AV AV AV Many different vendors code Attackers have an informational advantage
code
Crypting service
AV AV AV AV AV AV Many different vendors detected code Attackers have an informational advantage
code
Crypting service
AV AV AV AV AV AV Many different vendors Iteratively obfuscate the code (encrypt + jmp + …) detected code Attackers have an informational advantage
code
Crypting service
AV AV AV AV AV AV Many different vendors Iteratively obfuscate the code (encrypt + jmp + …) Attackers have an informational advantage
code
Crypting service
AV AV AV AV AV AV Many different vendors Iteratively obfuscate the code (encrypt + jmp + …) CoDe Attackers have an informational advantage
code
Crypting service
AV AV AV AV AV AV Many different vendors Iteratively obfuscate the code (encrypt + jmp + …) CoDe clear Attackers have an informational advantage
code
Crypting service
AV AV AV AV AV AV Many different vendors Iteratively obfuscate the code (encrypt + jmp + …) Until the obfuscated code is “fully undetectable” CoDe clear Attackers have an informational advantage
code
Crypting service
AV AV AV AV AV AV Many different vendors “FUD” code Iteratively obfuscate the code (encrypt + jmp + …) Until the obfuscated code is “fully undetectable” CoDe clear Attackers have an informational advantage
code
Crypting service
AV AV AV AV AV AV Many different vendors “FUD” code Iteratively obfuscate the code (encrypt + jmp + …)
2013: Web-based crypting services One charged $20 to “remain undetected for more than 7 days”
Until the obfuscated code is “fully undetectable” CoDe clear Attackers have an informational advantage
easy to miscount viruses
https://www.av-test.org/en/statistics/malware/
An often overlooked question