The memset overflows the four bytes stack variable and modifies the canary value.
The 64bits canary 0x5429851ebaf95800 can't be predicted, but in specific situations is not re-generated and can be bruteforced or in other situations can be leaked from memory for example using a format string vulnerability or an arbitrary read wihout overflowing the stack.
If the canary doesn't match, the libc function __stack_chck_fail is called and terminates the prorgam with a SIGABORT which generates a coredump, in the case of archlinux managed by systemd and are stored on "/var/lib/systemd/coredump/"
❯❯❯ ./test
*** stack smashing detected ***:
fish: './test' terminated by signal SIGABRT (Abort)
[sudo] password for xxxx:
Decoding file core.test.1000.c611b7caa58a4fa3bcf403e6eac95bb0.1121.1574354610000000
core.test.1000.c611b : decoded 249856 bytes
❯❯❯ sudo gdb /home/xxxx/test core.test.1000.c611b7caa58a4fa3bcf403e6eac95bb0.1121.1574354610000000 -q
We specify the binary and the core file as a gdb parameters. We can see only one LWP (light weight process) or linux thread, so in this case is quicker to check. First of all lets see the back trace, because in this case the execution don't terminate in the segfaulted return.
We can see on frame 5 the address were it would had returned to main if it wouldn't aborted.
Happy Idea: we can use this stack canary aborts to detect stack overflows. In Debian with prevous versions it will be exploitable depending on the compilation flags used.
And note that the canary is located as the last variable in the stack so the previous variables can be overwritten without problems.
Related articles
- Hacking Tools For Windows
- Hacker Tools List
- Hacking Tools Free Download
- Hacking Tools For Mac
- Hack Tools
- Hack Tools Mac
- Hacking Tools Download
- Hacker Tools For Mac
- Ethical Hacker Tools
- Pentest Tools Framework
- Hacker Tools Free
- Hack Tools Github
- Hacking Tools Download
- Hack App
- Hacker Tools 2020
- Hacker Hardware Tools
- Pentest Tools Bluekeep
- Hacker Tools For Pc
- Hack Tools For Mac
- Hacker Techniques Tools And Incident Handling
- Pentest Tools Apk
- Pentest Tools Bluekeep
- How To Hack
- Hacker Tools For Mac
- Hacker Tools Mac
- Hack Tools For Windows
- Pentest Tools Apk
- Hacker Tools Free
- Hacker Tools Free Download
- Hacking Tools Online
- New Hack Tools
- Best Pentesting Tools 2018
- Hacking Tools For Mac
- Hack Rom Tools
- New Hacker Tools
- Android Hack Tools Github
- Hacker Tools Free Download
- Tools For Hacker
- Pentest Tools Alternative
- Pentest Tools Windows
- Hacking App
- Hacking Tools Name
- Hacking Tools For Windows
- Hacker Tools Apk
- Hacker Tools For Mac
- Easy Hack Tools
- Hacking Tools For Games
- Pentest Tools Download
- Hacking Tools Windows 10
- Hack Tools For Ubuntu
- Pentest Box Tools Download
- Hacking Tools Pc
- Hacking Tools For Windows
- Game Hacking
- Hacking Tools Github
- Hacking Tools Github
- Hacker Tools Apk Download
- Hack Tools Github
- Hacking Tools For Pc
- Pentest Tools Android
- Pentest Tools Open Source
- Pentest Tools Framework
- Pentest Tools Url Fuzzer
- Hacker Tools Mac
- World No 1 Hacker Software
- What Are Hacking Tools
- Hacking Tools Windows 10
- Hackers Toolbox
- Install Pentest Tools Ubuntu
- Hack Website Online Tool
- Hacker Tools Hardware
- Hack Tools For Pc
- Hacking Tools Windows 10
- Hack Tools Pc
- Tools Used For Hacking
- Growth Hacker Tools
- Pentest Tools Online
- Pentest Tools Review
- Pentest Tools List
- World No 1 Hacker Software
- Hacker Tools
- Tools For Hacker
- Pentest Tools Online
- Usb Pentest Tools
- Hacking Tools
- Underground Hacker Sites
- Physical Pentest Tools
- Hack Tools
- Nsa Hacker Tools
- Easy Hack Tools
- Nsa Hacker Tools
- Hacker Tools Hardware
- Nsa Hack Tools
- Hacking Tools Online
- Pentest Tools Online
- Hacking Tools For Windows 7
- Hacking Tools For Beginners
- Hack App
- Pentest Tools Linux
- Wifi Hacker Tools For Windows
- Pentest Tools For Ubuntu
- Hacking Tools Download
- Pentest Tools For Android
- Pentest Tools Port Scanner
- Hacking Tools For Pc
- Termux Hacking Tools 2019
- Hacking Tools Pc
- Hack Tool Apk No Root
- Hacking Apps
- Pentest Reporting Tools
- Hacking Tools
- Hacking Tools Kit
- Nsa Hack Tools
- Hacking Tools For Windows Free Download
- Hacker Tools 2020
- Hacking Tools For Games
- Hacker Tools
- Hacker Security Tools
- Hack Tools
- How To Make Hacking Tools
- Best Hacking Tools 2019
- Hacking Tools And Software
- Hacker Tools For Mac
- Hack Tools For Ubuntu
- Pentest Tools Port Scanner
- Pentest Tools Website Vulnerability
- Hack Tools Mac
- Hack Tools For Games
- Ethical Hacker Tools
- Pentest Tools Nmap
- Hacking Tools For Mac
- Pentest Tools Website