Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

xvitaly/preload-tricks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

preload-tricks

GCC CI status Clang CI status

About

Example repository for our article. Contains a sample program with superuser privileges checking (using the getuid() function) and a special example of a shim library that can be used to bypass these checks.

Build

mkdir build
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS:BOOL=ON
cmake --build build

Test application (regular run)

cd build
./example-root

Test application (with LD_PRELOAD)

cd build
LD_PRELOAD="./libtricks.so" ./example-root

Unit tests

cd build
ctest --output-on-failure