A simple example of how to manipulate the value of a memory address of another process.
- First off, compile the programs using
gcc.- Spin up the
targetand get itspid- Go into
gdbusing thepidof the targetgdb -p <pid>- In
gdb, find the memory address of the variable:p &secret, and copy it- Finally, run the
injectorwith thepidand the address of the variable:./injector <pid> <address>This'll only work if the variable is not in the stack or in the register, hence why we're placing it outside of the
mainscope.
| Filename | Modified | Size | Type |
|---|---|---|---|
| [Parent Directory] | - | - | - |
| injector.c | 14/02/25 21:5514/02/25 | 1.1 KiB | [Download][Save] |
| target.c | 14/02/25 21:1014/02/25 | 222 B | [Download][Save] |