64-bit Stack-based Buffer Overflow
64-bit Stack-based Buffer Overflow
Useful notes
32-bit Stack-based Buffer Overflow64-bit Stack-based Buffer OverflowVulnerable Code
// code from https://blog.techorganic.com/2015/04/10/64-bit-linux-stack-smashing-tutorial-part-1/
#include <stdio.h>
#include <unistd.h>
int vuln() {
char buf[80];
int r;
r = read(0, buf, 400);
printf("\nRead %d bytes. buf is %s\n", r, buf);
puts("No shell for you :(");
return 0;
}
int main(int argc, char *argv[]) {
printf("Try to exec /bin/sh");
vuln();
return 0;
}Getting Control of RIP

Why is RIP not overflowed?
Finding RIP Offset


RIP is Under Control

Exploitation



References
Last updated