#1
(This post was last modified: 27 November, 2020 - 12:07 AM by MeSvAk.)
firstly u bitches needa know about this shit cz ur brain is not functioning ikr ,.....:
Code:
 
[i]Load-Time:[/i] Before a software starts running, it has a load time. It installs its requirements until the program is fully functional (Libraries, Memory Regions)
[i]Function Hooking:[/i] Replacing or editing a function given in the software with a fake function.
See the Functions used by a software;
You can use the trace binarys used by the majority in linux to see the functions used in the software.
BEGINING OF MA DICK 
Now I assume that we open linux and compile the following code:
Quote: 
Code:
#include <stdio.h>
int main()
{
puts("Hello world !"); }
Quote:Compiling : gcc hello.c -o hello
What we’re going to do now is to replace this set function with the fake sets we provided at load time. Thus, the function we wrote will work, not the function written in the program.
Writing the Fake library to hook the function:
For the puts function, the creation of the fake library is as follows:

 
Code:
[code]
#include <stdio.h>
#include <unistd.h>
#include <dlfcn.h>
int puts(const char *message)
{
int (*new_puts)
(const char *message);
new_puts = dlsym(RTLD_NEXT, "puts");
return new_puts("Hijacked!");
}
[/code]
The library is simply
Code:
puts ();
Creates a fake of the function
Code:
 dlsym ();
allows it to replace the original thanks to its function.
Code:
The dlsym();
function takes two arguments. The first of these, the RTLD_NEXT enum, tells the dynamic loader API part to return to the next instance linked with the 2nd argument. The last argument is asking for the name of the sample to be returned to, and this is the puts function, which we will substitute forged.
 
Quote:return new_puts(“Hijacked);
Here,
Code:
puts ();
The function that will replace the function is specified.
Compiling the library and transferring it to LD_PRELOAD ( with some negro search u can pull it out what ld reload uissisissisi  [Image: monkayes.gif] [Image: monkayes.gif] [Image: monkayes.gif] [Image: monkayes.gif] )
Compiling The Library :
Code:
gcc evil_library.c -o evil_library.so -fPIC -shared -ldl -D_GNU_SOURCE
Code:
 
The LD_PRELOAD environment variable can execute the library we provided at the moment the running software starts, so that we can manipulate the software.
In summary, when we assign the .Library path to the LD_PRELOAD environment variable, the library is enclosed in the running file.
Export our library to LD_PRELOAD environment variable with export command
Code:
export LD_PRELOAD="/home/mehmet/evil_library.so"
Code:
 
Now, when our program is run, instead of “Hello world”, “Hijacked!” He will give our message.
 
[Image: KXHd94j.png]

now u got this suck ur dad anus for sucker punch shit 


this link Is good for this kinda shit https://blog.netspi.com/function-hooking...-in-linux/