githubEdit

Shared Object Hijacking

Shared Object Hijacking is a technique where a binary loads a malicious shared object instead of the legitimate one due to misconfigured load paths like RUNPATH.

Steps to Exploit:

image.png

Identify a SUID binary:

Check its linked libraries using ldd:

Look for non-standard paths (e.g., /development) and check if the folder is writable:

Verify the RUNPATH using readelf:

Check for missing function symbols when copying a standard library:

Create a malicious shared object with the missing function (dbquery):

Compile the malicious library:

Execute the vulnerable binary:

Last updated