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];

    char * secret1 = "This is secret";
    char * secret2 = "This is secret too";

    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?

closed as off-topic by Rory Alsop Dec 14 '16 at 23:59

  • This question does not appear to be about Information security within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.



While I don't know the settings you use to disable, using:


Should disable ASLR on your executable You can easily check it with process explorer / PE-studio and more.

Not the answer you're looking for? Browse other questions tagged or ask your own question.