Skip to content

Commit c3d9083

Browse files
committed
function hooking start
1 parent 07153c8 commit c3d9083

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

content/posts/tuxedos.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,19 @@ All this is neat and all but how do things like the `ps` command get all of the
4141
* <https://www.akamai.com/blog/security-research/the-definitive-guide-to-linux-process-injection>
4242
* <https://stackoverflow.com/questions/1401359/understanding-linux-proc-pid-maps-or-proc-self-maps>
4343
* <https://unix.stackexchange.com/questions/262177/how-does-the-ps-command-work>
44+
45+
# Function Hooking
46+
47+
## Background and important
48+
49+
In Linux you can redirect, intercept and alter function calls at run time for an app like setting a fixed number instead of a random one when calling rand from libc. Bellow is a digram from infosecwriteups.com on how function hooking works.
50+
![diagram](https://miro.medium.com/v2/resize:fit:640/format:webp/1*iBk3WT2bqoHKaPcL0CsAkg.png)
51+
(source of image is in sources)
52+
53+
## Methods
54+
55+
* `LD_PRELOAD` environment variable: this variable is loading libraries before executing a program.
56+
57+
## Sources
58+
59+
* <https://infosecwriteups.com/a-gentle-introduction-to-function-hooking-using-ld-preload-1714124a6eb9>

0 commit comments

Comments
 (0)