Last active
July 3, 2017 21:29
-
-
Save cedriczirtacic/9448eee876a0dad59b6f8f764b9d757f to your computer and use it in GitHub Desktop.
getting canaries https://medium.com/@cedriczirtacic/peque%C3%B1o-texto-canarios-en-el-stack-3ce23f6c033b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(gdb) disas main | |
Dump of assembler code for function main: | |
0x00000000004005ab <+0>: sub $0x18,%rsp | |
0x00000000004005af <+4>: mov %fs:0x28,%rax | |
0x00000000004005b8 <+13>: mov %rax,0x8(%rsp) | |
0x00000000004005bd <+18>: xor %eax,%eax | |
0x00000000004005bf <+20>: callq 0x400566 <get_canary> | |
0x00000000004005c4 <+25>: mov (%rax),%rsi | |
0x00000000004005c7 <+28>: mov $0x400688,%edi | |
0x00000000004005cc <+33>: mov $0x0,%eax | |
0x00000000004005d1 <+38>: callq 0x400460 <printf@plt> | |
0x00000000004005d6 <+43>: mov 0x8(%rsp),%rdx | |
0x00000000004005db <+48>: xor %fs:0x28,%rdx | |
0x00000000004005e4 <+57>: jne 0x4005eb <main+64> | |
0x00000000004005e6 <+59>: add $0x18,%rsp | |
0x00000000004005ea <+63>: retq | |
0x00000000004005eb <+64>: callq 0x400450 <__stack_chk_fail@plt> | |
End of assembler dump. | |
(gdb) b *main+13 | |
Breakpoint 1 at 0x4005b8 | |
(gdb) r | |
Starting program: /tmp/main | |
Breakpoint 1, 0x00000000004005b8 in main () | |
(gdb) print/x $rax | |
$1 = 0x1ff274c196d54d00 | |
(gdb) q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment