HTB Writeups
  • HTB Writeups
  • Boxes: Very Easy
    • Academy
    • Archetype
    • Arctic
    • Base
    • Bike
    • Blue
    • Explosion
    • Included
    • Markup
    • Oopsie
    • Redeemer
    • Responder
    • Shield
    • Unified
    • Vaccine
  • Boxes: Easy
    • Analytics
    • Armageddon
    • Bashed
    • Beep
    • Blocky
    • Bounty Hunter
    • Buff
    • Cap
    • CozyHosting
    • Devel
    • Explore
    • Forest
    • Grandpa
    • Granny
    • Horizontall
    • Jerry
    • Keeper
    • Knife
    • Lame
    • Late
    • Legacy
    • Mirai
    • Netmon
    • Nibbles
    • Optimum
    • Paper
    • Photobomb
    • Precious
    • RedPanda
    • Return
    • Sau
    • ScriptKiddie
    • Sense
    • Servmon
    • Shocker
    • Shoppy
    • Squashed
    • Trick
  • Boxes: Medium
    • Poison
  • Challenges
    • Behind the Scenes
    • Canvas
    • Debugging Interface
    • Digital Cube
    • Easy Phish
    • Find the Easy Pass
    • Forest
    • Infiltration
    • misDIRection
    • Pusheen Loves Graphs
    • Retro
    • Signals
    • The Secret of a Queen
    • Wrong Spooky Season
  • Fortresses
  • Cyber Apocalypse 2023: The Cursed Mission
    • The Cursed Mission
    • Alien Cradle
    • Critical Flight
    • Debug
    • Extraterrestrial Persistence
    • Getting Started
    • Needle in the Haystack
    • Orbital
    • Packet Cyclone
    • Passman
    • Perfect Sync
    • Persistence
    • Plaintext Tleasure
    • Questionnaire
    • Reconfiguration
    • Relic Maps
    • Roten
    • Secret Code
    • Shattered Tablet
    • Small StEps
  • Hack the Boo 2023
    • Hauntmart
    • Spellbrewery
    • Trick or Treat
    • Valhalloween
  • Cyber Apocalypse 2024: Hacker Royale
    • Hacker Royale
    • An Unusual Sighting
    • BoxCutter
    • BunnyPass
    • Character
    • Data Siege
    • Delulu
    • Dynastic
    • Fake Boost
    • Flag Command
    • Game Invitation
    • It has begun
    • KORP Terminal
    • Labyrinth Linguist
    • LockTalk
    • Lucky Faucet
    • Makeshift
    • Maze
    • Packed Away
    • Phreaky
    • Primary Knowledge
    • Pursue the Tracks
    • Rids
    • Russian Roulette
    • Stop Drop and Roll
    • Testimonial
    • TimeKORP
    • Unbreakable
    • Urgent
  • CYBER APOCALYPSE 2025: Tales from Eldoria
    • Tales from Eldoria
    • A New Hire
    • Cave Expedition
    • Echoes in Stone
    • Eldorion
    • Embassy
    • EncryptedScroll
    • HeliosDEX
    • Quack Quack
    • Silent Trap
    • Stealth Invasion
    • Tales for the Brave
    • The Ancient Citadel
    • The Hillside Haven
    • The Stone That Whispers
    • Thorins Amulet
    • ToolPie
    • Traces
    • Trial by Fire
    • Whispers of the Moonbeam
Powered by GitBook
On this page
  1. Cyber Apocalypse 2024: Hacker Royale

Rids

Personal Rating: Hard

PreviousPursue the TracksNextRussian Roulette

Last updated 1 year ago

I did not solve this challenge myself, but another member of my CTF team did.

The device has this written on it: W25Q128

There is a flash memory chip that we need to get the flag out of

We have a Python script that has the purpose of interacting with the chip as it seems

Executing the Python script returns some numbers:

[239, 64, 24]

Searching for the chip and the instructions it accepts, you come across this program, which contains a mapping of raw instructions to human readable ones:

#define W25_CMD_PAGE_PROGRAM		0x02
#define W25_CMD_DATA_READ		0x03
#define W25_CMD_READ_STATUS1		0x05
#define W25_CMD_WRITE_ENABLE		0x06
#define W25_CMD_GET_ID			0x9F
#define W25_ID0_WINBOND			0xEF
#define W25_CMD_GET_SERIAL		0x4B
#define W25_CMD_SECTOR_ERASE_4K		0x20
#define W25_CMD_BLOCK_ERASE_32K		0x52
#define W25_CMD_BLOCK_ERASE_64K		0xD8
#define W25_CMD_CHIP_ERASE		0xC7

There you can see that the script seems to get the Chip ID. We also see that 0x03 seems to read data from the chip, which is what we want. Changing the script accordingly returns something:

[72, 84, 66]

I put this into the “Magic” Decryptor on CyberChef to find out that the numbers are ASCII values, in this case for HTB.

I edited the script again to include not 3, but increasingly more bytes and decrypted the output with cyberchef. This was the result:

jedec_id = exchange([0x03], 49)

print(jedec_id)

[72, 84, 66, 123, 109, 51, 109, 48, 50, 49, 51, 53, 95, 53, 55, 48, 50, 51, 95, 53, 51, 99, 50, 51, 55, 53, 95, 102, 48, 50, 95, 51, 118, 51, 50, 121, 48, 110, 51, 95, 55, 48, 95, 53, 51, 51, 33, 64, 125]

HTB{m3m02135_57023_53c2375_f02_3v32y0n3_70_533!@}

mcuoneclipse/Examples/KDS/tinyK20/tinyK20_LittleFS_W25Q128/Sources/W25Q128.c at master · ErichStyger/mcuoneclipseGitHub
Logo