Monday, December 11, 2023

TRYHACKME’S ADVENT OF CYBER 2023 (Day 6)

 Day 6 - “Memories of Christmas Past”

The primary objectives of this challenge were :

  • How specific languages may not handle memory safely
  • how variables might overflow into adjacent memory and corrupt it
  • Exploit a simple buffer overflow to directly change memory you are not supposed to access


 We needed one coin per character to change our name , and 12 bytes were allocated for the name, but when we tried to enter a name containing 13 bytes the 13th bytes went to the coins memory , so this indicated that there was a buffer overflow error. Then when we tried to purchase the star from the inventory every time we got a different item, but since we knew that the inventory id of star was "d" , if we could overflow the name and change the inventory byte to "d" then we will get our star. So we did this by changing the name to one with 45 characters , 45th being "d" , this way we got our star and set it on the christmas tree.

A buffer overflow occurs when a program writes more data to a block of memory, or buffer, than it was allocated to hold. This can lead to unpredictable behavior and is a common source of security vulnerabilities. Buffer overflows can result in crashes, unauthorized access to sensitive data, and even execution of arbitrary code by attackers.

 Here is the walkthrough of Day 6.

No comments:

Post a Comment

MY EXPERIENCE ON ADVENT OF CYBER 2023

  Tryhackme’s advent of cyber 2023 was a great experience, it was very beginner friendly and they provided well setup labs with a storyline ...