









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An overview of buffer overflows, a common memory vulnerability. It explains how buffer overflows occur, their effects, and the methods attackers use to exploit them. Additionally, it discusses defensive measures to prevent buffer overflows, such as canaries, write xor execute, aslr, and safer coding practices.
Typology: Slides
1 / 16
This page cannot be seen from the preview
Don't miss anything!
Raise exception (Java and .NET) Truncate input
Data and code -- von Neumann architecture
SIGSEGV, Access Violation, etc. The program terminates Slightly annoying, but what if it didn’t happen?
Allocated page Potentially visible changes Corruption Controlled corruption Stack smashing
Change the value of variables DisableSecurity = true Clobber pointers (linked lists, trees, …) Alter malloc() data! Change what memory ranges are used/free Use dynamically allocated memory (same location as something previously allocated) as an alias. Useful to overwrite function pointers!
Not a big issue, since the code is usually loaded in the same place for performance Use a “NOP sled” Pad the payload with NOP instructions, or effectively NOP instructions Jump anywhere into the NOP sled to get to the payload
Pad buffers with a random, secret value determined at compile time or runtime Check to see if the secret value is the same before allowing transfer of control If you smash the boundaries of the array on the stack, how do you know what the values are?
Randomize locations for loading of code Requires compiler, linker, and runtime support for position-independent code (PIC) Prevent attackers from being able to jump reliably to function calls or payload in the stack Why? Because regular code is linked in by the runtime linker whereas the payload is not
strcpy strlcpy strncat strlcat scanf fgets on %s gets fgets
Anything with bounds checking – Java, C#, VB.net, Python, Perl, Ruby, PHP, D… …but be careful when calling C/C++/asm libraries