shellphish / how2heap

A repository for learning various heap exploitation techniques.
MIT License
7.2k stars 1.14k forks source link

Adding Features to malloc_playground #175

Closed lafreuxpabo closed 6 months ago

lafreuxpabo commented 6 months ago

By working on binexp, i thought it would be very useful to be able to see all allocated chunks and their pointers. I also implemented a feature allowing user to add some datas to allocated chunks.

Also changed the sscanf to allow arg1 to be a str and not only an intptr. Also added and arg2 for write.

-> write : allow user to write a str to specified chunk -> listp : list all allocated chunk, their address and value -> listpall: print list of chunks, even if some are not allocated -> clearArray: clear array containing allocated chunks and their address (set everything to 0)

Kyle-Kyle commented 6 months ago

Hey. Sorry for the late response. May I ask why you closed the PR?

lafreuxpabo commented 6 months ago

Hey. Sorry for the late response. May I ask why you closed the PR?

Hello, first of all thanks for you response. I closed my pr because after using the features I implemented, i saw that i miss-implemented the listp command. Imagine you have 3 allocated chunks of 0x10 (header included) If you free the chunk 0 using 'free 0', listp will print nothing as the pointerlist[0] is null I wanted to correct it before making a clean PR

I was also hesitating between making it voluntarily unsecure (not checking input_size) to allow everyone to do what they want even if they could crash the program; or make it much more secure

Kyle-Kyle commented 6 months ago

I was also hesitating between making it voluntarily unsecure (not checking input_size) to allow everyone to do what they want even if they could crash the program; or make it much more secure

It is OK to make it insecure because it is meant to be a play ground.

I wanted to correct it before making a clean PR

Feel free to reopen the PR after the correction.

And thank you for your interests on the project!

lafreuxpabo commented 6 months ago

Thanks you, this project helped me a lot to understand the heap and progress in pwn. As it's my first pr for a real project i want to make my best ^^ have a nice day :)

PS: i'll reopen as soon as i corrected the errors