Skip to main content

THM: Advent of Cyber 2023 - Day 05 - A Christmas DOScovery: Tapes of Yule-tide Past

·231 words·2 mins
TryHackMe Reverse-Engineering Magic-Bytes Dos
eplots.io
Author
eplots.io
Systemcoordinator, Dabble in Cybersecurity, Self-hosting Hobbyist.
Table of Contents
Advent of Cyber 2023 - This article is part of a series.
Part 5: This Article
The fifth day of AoC23 contains a Reverse Engineering task.
We are tasked with looking at some backup files.
However, they look corrupted and the tool that can throubleshoot it only runs on DOS.

Learning Objectives
#

  • Experience how to navigate an unfamiliar legacy system.
  • Learn about DOS and its connection to its contemporary, the Windows Command Prompt.
  • Discover the significance of file signatures and magic bytes in data recovery and file system analysis.

Overview
#

List of some common files and magic bytes:

File Format Magic Bytes ASCII
PNG 89 50 4E 47 0D 0A 1A 0A %PNG
GIF 47 49 46 38 GIF8
Windows & DOS executables 4D 5A MZ
Linux ELF executables 7F 45 4C 46 .ELF
MP3 49 44 33 ID3

Otherwise, it was a straightforward day to look at some files and change some magic bytes..

Questions
#

  1. How large (in bytes) is the AC2023.BAK file?

Run the command dir C:\ to find the bytes.

  1. What is the name of the backup program?

Run the command dir C:\TOOLS\BACKUP to find the name.

  1. What should the correct bytes be in the backup’s file signature to restore the backup properly?

41 43, look it up in a Hex to ASCII converter to find the answer.

  1. What is the flag after restoring the backup successfully?

Simply run the backup tool on the AC2023.BAK file after changing it’s magic bytes.

Advent of Cyber 2023 - This article is part of a series.
Part 5: This Article