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 news
- Pentest Tools Find Subdomains
- Pentest Tools Open Source
- Android Hack Tools Github
- Hack Tools Pc
- Hacking Tools Online
- Pentest Tools Url Fuzzer
- Pentest Tools List
- Pentest Tools Port Scanner
- Growth Hacker Tools
- Hack Tool Apk
- Pentest Tools Nmap
- Hacking Tools Usb
- Pentest Tools Android
- Pentest Tools Github
- Hacker Tools Free
- Hack Tool Apk No Root
- Hack Tools For Windows
- Hack Tools Github
- Growth Hacker Tools
- Hacking Tools Usb
- Best Pentesting Tools 2018
- Tools For Hacker
- Pentest Tools Review
- Wifi Hacker Tools For Windows
- Tools For Hacker
- Beginner Hacker Tools
- Pentest Tools Free
- Pentest Reporting Tools
- Hacker Tools For Pc
- Hacking Tools For Kali Linux
- Hacking Tools 2019
- Hacks And Tools
- Hack Tools
- Hacker Tools Apk Download
- Hacking Tools 2019
- Hacking Tools Kit
- Tools For Hacker
- Hack Tools
- Pentest Tools Apk
- Hacking Tools Hardware
- Hack Tools 2019
- Hack Tools Github
- Hacking Tools Github
- Hacking Tools Kit
- Underground Hacker Sites
- World No 1 Hacker Software
- What Are Hacking Tools
- Hacking Tools For Mac
- Computer Hacker
- Hacker Tools Hardware
- What Are Hacking Tools
- What Is Hacking Tools
- Hacking Tools Usb
- Pentest Tools Alternative
- Hack Tools For Ubuntu
- Hack Tools Online
- Hacker Tools Github
- Pentest Tools Website
- Hacking Tools For Beginners
- Hackers Toolbox
- Pentest Tools Apk
- Usb Pentest Tools
- Hacking Tools For Windows Free Download
- Hack Tools Mac