2. Introduction to Shellcode
What the f*ck is shellcode?
How does Shellcode work?
#include <stdio.h>
#include <string.h>
void no_length_check_function(char *input) {
// add a buffer
char buffer[100];
// do not check the length of the input and copy
strcpy(buffer, input);
}
// create the 'entrypoint' for the program that takes argc (argument count) and argv (argument variables) as the arguments
int main(int argc, char *argv[]) {
// pass the first argv (argv[1]) which will be the second argument IE: file.exe ARGUMENT1 to the vulnerable function
no_length_check_function(argv[1]);
// return becuase it's an int
return 0;
}Let's write some shellcode!
Compiling it!
Adding shellcode to your attack
Last updated