Common Attack Pattern Enumeration and Classification
A Community Resource for Identifying and Understanding Attacks
An attacker exploits the execution flow of a call to an external library to point to an attacker supplied library or code base, allowing the attacker to compromise the application or server via the execution of unauthorized code. An application typically makes calls to functions that are a part of libraries external to the application. These libraries may be part of the operating system or they may be third party libraries. If an attacker can redirect an application's attempts to access these libraries to other libraries that the attacker supplies, the attacker will be able to force the targeted application to execute arbitrary code. This is especially dangerous if the targeted application has enhanced privileges. Access can be redirected through a number of techniques, including the use of symbolic links, search path modification, and relative path manipulation.
In this example, the attacker using ELF infection that redirects the Procedure Linkage Table (PLT) of an executable allowing redirection to be resident outside of the infected executable. The algorithm at the entry point code is as follows... • mark the text segment writeable • save the PLT(GOT) entry • replace the PLT(GOT) entry with the address of the new lib call The algorithm in the new library call is as follows... • do the payload of the new lib call • restore the original PLT(GOT) entry • call the lib call • save the PLT(GOT) entry again (if its changed) • replace the PLT(GOT) entry with the address of the new lib call
Skill or Knowledge Level: Low
To modify the entries in the configuration file pointing to malicious libraries
Skill or Knowledge Level: Medium
To force symlink and timing issues for redirecting access to libraries
Skill or Knowledge Level: High
To reverse engineering the libraries and inject malicious code into the libraries
Implementation: Restrict the permission to modify the entries in the configuration file.
Implementation: Check the integrity of the dynamically linked libraries before use them.
Implementation: Use obfuscation and other techniques to prevent reverse engineering the libraries.
[R.159.1] [REF-11] Silvio Cesare. "Share Library Call Redirection Via ELF PLT Infection". Issue 56. Phrack Magazine. 2000. <http://www.phrack.org/issues.html?issue=56&id=7>.
[R.159.2] [REF-8] "OWASP Top 10". Top 10 2007 - Malicious File Execution. 2007. The Open Web Application Security Project (OWASP). <https://www.owasp.org/index.php/Top_10_2007-A3>.
More information is available — Please select a different filter.