mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-03 07:14:54 -04:00
some memory exploitation snippets
This commit is contained in:
parent
d987311195
commit
ab05e249d4
19 changed files with 2613 additions and 0 deletions
12
Memory_Exploits/C-codes/testing_shellcode3.c
Normal file
12
Memory_Exploits/C-codes/testing_shellcode3.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
#include <stdio.h> //IO header
|
||||
#include <string.h> //Functions on favor of strings
|
||||
#include <stdlib.h> //exit() function
|
||||
char shellcode[] = ""; /* Global array */
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int (*ret)(); /* ret is a func pointer*/
|
||||
ret = (int(*)())shellcode; /* ret points to our shellcode */
|
||||
|
||||
(int)(*ret)(); /* shellcode is type caste as a function */
|
||||
exit(0); /* exit() */
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue