Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22157

How to set up and compile a binary for format string attacks?

$
0
0

I wanted to practise format strings attack, so i wrote a small program

format.c:

#include <stdio.h>

char input[1024];

int main() {

    fgets(input, sizeof(input), stdin);
    printf(input);

}

I compiled it with gcc-7 format.c -o format -m32 -no-pie.
Now i tried following to see if my supplied string is in memory: python -c 'print "AAAA" + " %x"*50' | ./format

Output:

AAAA 400 f7f995c0 804918a ffffd3e0 0 0 f7de07e1 f7f99000 f7f99000 0 f7de07e1 1 ffffd474 ffffd47c ffffd404 1 0 f7f99000 0 f7ffd000 0 f7f99000 f7f99000 0 f75cc795 b4f44185 0 0 0 1 8049060 0 f7fe9450 f7fe42d0 804c000 1 8049060 0 8049092 8049176 1 ffffd474 80491e0 8049240 f7fe42d0 ffffd46c 1c 1 ffffd5f9 0

I got lots of stack addresses and other addresses, but i dont see my A's in memory. Can someone help me?


Viewing all articles
Browse latest Browse all 22157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>