# Pointer Redirecting {{#include ../../banners/hacktricks-training.md}} ## String pointers As 'n funksie-oproep 'n adres van 'n string wat in die stapel geleë is, gaan gebruik, is dit moontlik om die buffer oorgang te misbruik om **hierdie adres te oorskryf** en 'n **adres na 'n ander string** binne die binêre te plaas. As 'n **`system`** funksie-oproep byvoorbeeld die **adres van 'n string om 'n opdrag uit te voer** gaan gebruik, kan 'n aanvaller die **adres van 'n ander string in die stapel** plaas, **`export PATH=.:$PATH`** en in die huidige gids 'n **script met die naam van die eerste letter van die nuwe string** skep, aangesien dit deur die binêre uitgevoer sal word. Jy kan 'n **voorbeeld** hiervan vind in: - [https://github.com/florianhofhammer/stack-buffer-overflow-internship/blob/master/ASLR%20Smack%20and%20Laugh%20reference%20-%20Tilo%20Mueller/strptr.c](https://github.com/florianhofhammer/stack-buffer-overflow-internship/blob/master/ASLR%20Smack%20and%20Laugh%20reference%20-%20Tilo%20Mueller/strptr.c) - [https://guyinatuxedo.github.io/04-bof_variable/tw17_justdoit/index.html](https://guyinatuxedo.github.io/04-bof_variable/tw17_justdoit/index.html) - 32bit, verander adres na vlae string in die stapel sodat dit deur `puts` gedruk word ## Function pointers Dieselfde as string pointer, maar van toepassing op funksies; as die **stapel die adres van 'n funksie** bevat wat aangeroep gaan word, is dit moontlik om dit te **verander** (bv. om **`system`** aan te roep). Jy kan 'n voorbeeld vind in: - [https://github.com/florianhofhammer/stack-buffer-overflow-internship/blob/master/ASLR%20Smack%20and%20Laugh%20reference%20-%20Tilo%20Mueller/funcptr.c](https://github.com/florianhofhammer/stack-buffer-overflow-internship/blob/master/ASLR%20Smack%20and%20Laugh%20reference%20-%20Tilo%20Mueller/funcptr.c) ## References - [https://github.com/florianhofhammer/stack-buffer-overflow-internship/blob/master/NOTES.md#pointer-redirecting](https://github.com/florianhofhammer/stack-buffer-overflow-internship/blob/master/NOTES.md#pointer-redirecting) {{#include ../../banners/hacktricks-training.md}}