I'm experimenting a bit with formatstring attacks with a little program (all vulnerabilities intended):
#include <stdio.h>
int main(int argc, char *argv[]) {
char string[100];
gets(string);
char * secret1 = "This is secret";
char * secret2 = "This is secret too";
printf(string);
return 0;
}
Also I deactivated ASLR and DEP in the Visual Studio 2015 linker settings and then built it, but when I run it and try to exploit by passing %s%s%s
I just get random gibberish as if ASLR was activated. Also the program crashes when I supply more than three %s
's.
Has anyone an idea what could be wrong? Do I need to turn ASLR off globally?