Home / Companies / Ambassador / Blog / Post Details
Content Deep Dive

Code Injection on Linux and macOS with LD_PRELOAD

Blog post from Ambassador

Post Details
Company
Date Published
Author
Itamar Turner-Trauring
Word Count
1,223
Language
English
Hacker News Points
-
Summary

Code injection on Linux and macOS can be achieved using LD_PRELOAD and DYLD_INSERT_LIBRARIES. These mechanisms allow you to override system calls and shared libraries, changing the behavior of a program without modifying its source code. This technique has various uses such as manipulating time, making a process appear as root, or simulating changes in the filesystem's root directory. However, there are limitations and security concerns associated with this approach.