Skip to content

Instantly share code, notes, and snippets.

@DhavalKapil
Created April 11, 2018 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DhavalKapil/7f8ade7f7023b6b30ae46f4baa1b1597 to your computer and use it in GitHub Desktop.
Save DhavalKapil/7f8ade7f7023b6b30ae46f4baa1b1597 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int main() {
uintptr_t *p1 = malloc(0);
uintptr_t *p2 = malloc(0);
free(p2);
// UAF
*p2 = (uintptr_t)p2 - 0x10;
uintptr_t *p3 = malloc(0);
fprintf(stderr, "Fastbin loop: %p,%p,%p\n", p3, malloc(0), malloc(0));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment