Double-Free Exploit
Analysis
Variables
char fakemetadata[0x10] = "\x30\0\0\0\0\0\0\0"; // so we can ignore the "wrong size" error
char admin[0x10] = "Nuh-huh\0";
// List of users to keep track of
char *users[15];
int userCount = 0;main_loop()
void main_loop() {
while(1) {
printf(">> ");
char input[2];
read(0, input, sizeof(input));
int choice = atoi(input);
switch (choice)
{
case 1:
createUser();
break;
case 2:
deleteUser();
break;
case 3:
complete_level();
default:
break;
}
}
}createUser()
deleteUser()
complete_level()
Exploitation
Setup
Finding the Double-Free
delete(0) #1

delete(1)

delete(0) #2

Writing to the Fastbin Freelist


Getting the Arbitrary Write
Final Exploit
32-bit
Last updated
Was this helpful?