How can a Callgraph detect malicious code?

113 views Asked by At

In Wikipedia I found out, that a Call Graph can obvisiously detect malicious code. Could someone explain how this exactly works? In Wikipedia only the following is written: "Call graphs can also be used to detect anomalies of program execution or code injection attacks". Thanks very much!

1

There are 1 answers

0
mnistic On

It's about pattern detection.

For example, if you know that the Windows APIs used in one of the patterns for code injection are VirtualAllocEx, WriteProcessMemory and CreateRemoteThread you can bring up the call graph for code under analysis for visual inspection, and look for those API calls and verify that they are being invoked in the correct order for that pattern.

You can then generate call graph signatures for detecting malicious code that might be metamorphic, packed or otherwise mutated and therefore not susceptible to regular signature matching, as it would be far more difficult to mutate call graphs. (see here, for example)