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.
More info
- Hacking Tools Github
- Pentest Tools Find Subdomains
- Computer Hacker
- Hack Tools For Ubuntu
- New Hack Tools
- Wifi Hacker Tools For Windows
- Hackers Toolbox
- Easy Hack Tools
- Pentest Tools For Windows
- Nsa Hacker Tools
- What Are Hacking Tools
- Pentest Tools Kali Linux
- Pentest Tools Github
- Hackers Toolbox
- Hacker Tools Hardware
- Usb Pentest Tools
- Nsa Hack Tools Download
- Hack Tools
- Hacker Techniques Tools And Incident Handling
- Hacking Tools Online
- Pentest Tools Windows
- Hacker Tools List
- Pentest Tools Tcp Port Scanner
- Hack Tool Apk
- Hack And Tools
- Hacking App
- What Are Hacking Tools
- Bluetooth Hacking Tools Kali
- Pentest Tools Linux
- Hack Tool Apk
- Hack Tool Apk
- Hacking Tools 2019
- Hacking Tools And Software
- Pentest Tools Tcp Port Scanner
- Black Hat Hacker Tools
- Hacker Tools For Pc
- Pentest Tools Subdomain
- Ethical Hacker Tools
- Pentest Tools Subdomain
- Hacking App
- Hacker Tools Free Download
- World No 1 Hacker Software
- Hack Tools Github
- Physical Pentest Tools
- Hacking Apps
- Hackers Toolbox
- Nsa Hack Tools Download
- Pentest Tools
- New Hack Tools
- Pentest Tools Open Source
- Hacks And Tools
- Pentest Tools Website Vulnerability
- Hacking Tools 2020
- Pentest Tools Nmap
- Pentest Tools For Ubuntu
- World No 1 Hacker Software
- Hacking Tools For Beginners
- Install Pentest Tools Ubuntu
- Hack Tools
- Hacker Tools Mac
- Hack Tools Mac
- Hack Tool Apk No Root
- Hacker Tools 2020
- World No 1 Hacker Software
- How To Make Hacking Tools
- Best Pentesting Tools 2018
- Hack Tools 2019
- Hacking Tools Github
- Usb Pentest Tools
- Nsa Hack Tools
- Pentest Tools Alternative
- Hacker Tools Free
- Hacker Tools For Pc
- Pentest Tools For Windows
- Pentest Tools Nmap
- Hack Tool Apk
- Hacking Apps
- Hacking Tools Hardware
- Bluetooth Hacking Tools Kali
- Hacking Tools 2020
- Pentest Tools Alternative
- Hacker Tools For Ios
- Hacking Tools Name
- Hack Tools For Mac
- Hacker Tools Online
- Hacker Tool Kit
- Hacker Tools Hardware
- Hacker Tools Hardware
- Hacking Tools Hardware
- Best Hacking Tools 2019
- World No 1 Hacker Software
- Pentest Tools Subdomain
- Install Pentest Tools Ubuntu
- Pentest Tools List
- Hacking Tools For Games
- Hack Tool Apk
- Pentest Tools Bluekeep
- Hacker Tools 2020
- Hack Apps
- Hackers Toolbox
- Wifi Hacker Tools For Windows
- Hacker Tools Free
- Game Hacking
- Pentest Tools Kali Linux
- Tools For Hacker
- Game Hacking
- Hacker Tools Github
- Pentest Tools Online
- Pentest Reporting Tools
- Pentest Tools Free
- Free Pentest Tools For Windows
- Hacking Tools Pc
- Hacking Tools Free Download
- Pentest Tools Review
- Pentest Tools Open Source
- Hack Tools For Games
- Hacker Techniques Tools And Incident Handling
- Hacking Tools For Windows Free Download
- Pentest Tools Tcp Port Scanner
- Hacker Tools Hardware
- Usb Pentest Tools
- Black Hat Hacker Tools
- Hacking Tools Pc
- Hacking Tools 2020
- Hacking Tools For Windows 7
- Underground Hacker Sites
- Nsa Hacker Tools
- Pentest Tools Subdomain
- How To Install Pentest Tools In Ubuntu
- Hackers Toolbox
- Hacking Tools 2019
- Hak5 Tools
- Hacking Tools For Windows
- Hacking Tools For Mac
- Hacker Search Tools
- Hacker Tools 2019
- Tools Used For Hacking
- Hacking Tools Download
- Hack Tools 2019
- Tools Used For Hacking
- Hacker Tools Online