3) Basic Static Anylsis
3) Basic Static Anylsis
Packing Files
The file on the left is the original executable with all strings, imports
and other information visible. On the right hand is a packed
executable. All of the packed file’s strings, imports and other
information are compressed and are invisible to most static analysis
tools.
Now let’s try to understand the portable executable file and their
format so that we will have idea what to look for.
- PE Header Summary
We know that the malware needs to use linked libraries & functions
to work properly, so let’s discover that.
Linked Libraries
Static Linking
Runtime Linking
Dynamic Linking
When the program calls the linked library function, that function
executes within the library.
The PE file header stores the information about every library that
will be loaded and every function that will be used by the
program
Common DLLs that are mostly required and can be used to make
certain deductions.
Common DLLs
Functions
Import Functions
Export Functions
DLL implements one or more functions and exports them for use
by an executable that can then import and use them.
Now that we have covered the basics let’s start with the techniques
used to do an effective basic static analysis.
1. Antivirus Scanning
This is the first step that you can carry out to figure out whether the
particular program that you doubt to be malware is actually
malicious or not. Most of the time the software that you want to
check for security reasons might have already been identified by the
major antivirus companies and it will save a hell lot of time for you
trying to figure that out by yourself.
These are not perfect by any means, they carry out the scan using
already known suspicious code (file signatures), as well as
behavior & pattern-matching analysis (heuristics).
2. Hashing
ii) Share it with other analysts to help them identify the malware
iii) Search for that malware online and check if it has been already
identified
3. Finding strings
We know what string is, the strings that we are talking about are a
sequence of characters that are present in the program. So in this
particular technique, we try to fish out the strings that are present in
the program, like a message, something connecting to a URL, or
copies of file that might be present at a specific location, etc.
Not all strings found by Strings are valid strings they can be
string, memory address, CPU instructions or data used by the
program, leaves to the user to filter them out.
Many other tools are available for browsing a PE header. Two of the
most useful tools are PEBrowse Professional and PE Explorer.