ThaySan
  • ๐Ÿ‘‹Bienvenue
    • Avant-propos
  • ๐ŸšฉCTF & Writeups
    • 2025 | EC2
      • Let's Crax
    • 2025 | HackDay
      • ๐Ÿ”‘Cryptographie
        • Drunk Christmas
        • Find Eve 1
        • Well hidden message - Standard Code Encryption
      • ๐Ÿ”ŽForensic
        • Copperwire Extraction
        • Distracted user
        • I believe you can't fly
      • ๐Ÿง Misc
        • Hello Steve
      • ๐Ÿ’พProgrammation
        • Lonely bot
        • Lonely bot #2
        • Lonely bot #3
        • Useless Animals Sorting
        • Who cares about SSI anyway ?
      • โš™๏ธReverse
        • Just dig
        • Rusty_rev
        • The Cogs of Blackmail
      • ๐ŸŽญSteganographie
        • It says a lot when there is no music
        • Mona LSB
        • Well hidden message - Insignificant blue
      • ๐ŸŒWeb
        • Super Website Verificator 3000
        • The analytical engine leak
        • The Watchful Gears: Uncover the Secrets Within
        • Your region's finest
    • 2024 | Efrei - CyberNight
      • ๐Ÿ”‘Cryptographie
        • Clavier spรฉcial
        • Le futur
        • Securechain 30.0
        • Cascade
        • Shared Flag
        • Weird Algorithm
      • ๐ŸงŠMinecraft
        • Introduction
        • Non aux Bouquins Trafiquรฉs
        • Redstone Gold Block
      • ๐Ÿ’พProgrammation
        • Captcha 1.0
        • Intro ร  la prog
        • Captcha 2.0
      • โš™๏ธReverse
        • Reverse the Reverse
        • Find me if you can
        • HuGO Decrypt
        • Kitten eXORcism
        • M30W Vault Tech
        • The Ugandan Labyrinth
      • ๐ŸŽญStรฉganographie
        • Le message
        • bon Le ordre
        • COD FORFLAG
        • Mauvaise note
        • Bruit
        • Un (un ?) drรดle de QR code
        • Randonnรฉe Guillerette ร  Bordeaux
      • ๐Ÿ’ปSystรจme
        • Marche-pied
        • Escabot
        • rรฉgulation des Donnรฉes et des Normes de Sรฉcuritรฉ
      • ๐ŸŒWeb
        • cybernight.zip
        • Mon champion prรฉfรฉrรฉ
        • Co(mpressed)okies
        • Gitty Mistake
        • JWT Kiddo
        • Parseur Farceur
      • L'enquรชte
        • L'enquรชte 2/6
        • L'Enquรชte 1/6
        • Bienvenue, enquรชteur
    • 2024 | Star-Hack
      • ๐Ÿ”‘Cryptographie
        • Cรฉsar, mais pas Cรฉsar
        • Double ennui
        • Langage secret
        • Quadratique Mystรฉrieuse
        • ReSultAt
        • Sup3r S3cr3t
        • Warmup
      • ๐Ÿ”ŽForensic
        • Cache-cache
        • Fichier ZIP protรฉgรฉ par mot de passe
        • HEADER
        • Investigation 1
        • Investigation 2
      • ๐Ÿง Misc
        • B4l4d3 Urb41n3
        • Bruhh, c'est quoi รงa ?
        • Cut13
        • Pika Pika
      • ๐Ÿ˜ˆPwn
        • Pwn0x01
        • Pwn0x02
        • Pwn0x03
      • โš™๏ธReverse
        • Assembly
        • Rev0x00
        • Rev0x01
        • Rev0x02
      • ๐ŸŒWeb
        • Clone Udemy
        • Flask
        • Guess_The_Passcode
        • PHP
        • Tickets
        • Usine de Cookies
    • 2024 | ECW
      • ๐Ÿ”‘Cryptographie
        • Course hipPIN
    • 2024 | CTFREI Intro
      • ๐Ÿ”‘Cryptographie
        • AES Intro
        • Alรฉatoire
        • Game of Luck
        • RSA Intro
        • RSA2
        • RSA3
      • ๐Ÿ”ŽForensic
        • Mais qui est le photographe ?
        • Mais oรน est passรฉ mon flag ?
        • Mรฉmoire 1/4
        • Mรฉmoire 2/4
        • Mรฉmoire 3/4
        • Mรฉmoire 4/4
        • My computer is talking
      • ๐Ÿ“šOSINT
        • Avion โœˆ
        • Geoint
        • Google!
        • Googlint
        • Le pivot
        • Le temps commence maintenant
        • Sacrรฉ dossier
        • Socint
      • ๐Ÿ’พProgrammation
        • Try Me
        • Answer Me
        • Eval Me
        • Time Based
      • ๐Ÿ˜ˆPwn
        • BOF Intro
        • Shop
        • BOF 2
        • BOF win()
      • โš™๏ธReverse
        • CrackMe1
        • CrackMe2
        • CrackMe3
        • Hidden...
        • Something changed?
        • ZZZ
      • ๐ŸŽญStรฉganographie
        • Cybernight รชtre comme
        • Joli paysage
        • Petit poisson
        • StegHide 'n' Seek
        • Un canard pas comme les autres
      • ๐Ÿ’ปSystรจme
        • Bash Jail
        • Bash Jail Revenge
        • BrokenBin
        • GTFO Of Here
        • Pyjail
        • Pyjail Revenge
        • Strange input, right?
      • ๐ŸŒWeb
        • SQLi
        • POST This Money
        • Give me my Flask PIN
        • Access
        • Render
        • RenderV2
        • Touchy
    • 2024 | DefCamp
      • ๐Ÿ”‘Cryptographie
        • conv
        • oracle-srl
        • ctr
      • ๐Ÿ”ŽForensic
        • i-got-a-virus
        • Alternating
        • call-me-pliz
      • ๐Ÿง Misc
        • pyterm
      • ๐Ÿ“ฑMobile
        • mobisec
      • ๐Ÿ“šOSINT
      • ๐Ÿ˜ˆPwn
      • โš™๏ธReverse
      • ๐Ÿ•ต๏ธTraque
      • ๐ŸŒWeb
        • noogle
        • production-bay
    • 2024 | 404CTF
      • ๐Ÿ”‘Cryptographie
        • Bรฉbรฉ nageur
        • Le petit bain
        • Poor Random Number Generator [1/2]
        • Plongeon Rapide Super Artistique
        • J'รฉponge donc j'essuie
        • Poor Random Number Generator [2/2]
        • La Seine
        • J'ai glissรฉ chef !
        • SEA - La face cachรฉe de l'Iceberg
      • ๐Ÿ”ŽForensic
        • Le tir aux logs
        • Darts Bank
        • Vaut mieux sรฉcuriser que guรฉrir
        • De bons croissants au beurre
        • Poids Raw vs. Cours Jette [1/3]
      • ๐Ÿ”ŒHardware
        • Serial killer
        • Le soulevรฉ de GND
        • Comment est votre modulation ? [1/2]
        • Sea side channel [1/4] - Introduction
        • Comment est votre modulation ? [2/2]
        • Sea side channel [2/4] - Reconnaissance
        • Sea side channel [3/4] - Mais oรน sont les triggers ?
      • ๐Ÿค–IA
        • Du poison [1/2]
        • Du poison [2/2]
        • Des portes dรฉrobรฉes
      • ๐Ÿง Misc
        • Discord
        • De la friture sur la ligne
        • Bienvenue
        • Revers(ibl)e Engineering [0/2]
      • ๐Ÿ“šOSINT
        • Lรฉgende
        • Not on my watch
        • Secret Training [1/2]
      • ๐Ÿ˜ˆPwn
        • Pseudoverflow
        • Jean Pile
        • Mordu du 100m
        • Antismash
      • ๐Ÿˆโ€โฌ›Quantique
        • Des trains superposรฉs
        • De l'รฉcoute, pas trรจs discrรจte
        • De la multiplicitรฉ des problรจmes
      • โš™๏ธReverse
        • โญร‰chauffement
        • โญIntronisation du CHAUSSURE
        • โญBugdroid Fight [1/2]
        • โญRevers(ibl)e Engineering [1/2]
        • โญBugdroid Fight [2/2]
        • โญNanocombattants
        • โญRevers(ibl)e Engineering [2/2]
        • Le Tableau Noir
      • ๐ŸŽญStรฉganographie
        • โญL'absence
        • โญRegarder en stรฉrรฉo
        • โญLa Barre Fixe
        • โญLe grand รฉcart
        • โญLa chute
      • ๐ŸŒWeb
        • โญVous รชtes en RETARD
        • โญLe match du siรจcle [1/2]
        • โญExploit mag
        • โญLe match du siรจcle [2/2]
        • โญLE GORFOU 42
        • โญLa boutique officielle
    • 2024 | CTFREI - Bordeaux
      • ๐Ÿ”‘Cryptographie
        • zzz
      • ๐Ÿ“šOSINT
        • Alexis Dumas
        • Back to the bureau
        • Dr Octopus
        • Folie et ambition
        • GeoGuessr
        • Hugo Nelots : prรฉlude
        • La fin ?
        • La fuite Dumas
        • Un rรฉseau suspect
      • ๐Ÿ’พProgrammation
        • Eval me 1
        • Eval me 2
        • Time Based
      • ๐Ÿ’ปSystรจme
        • Broken Binary 1
        • Broken Binary 2
        • GTFO of here
        • Pyjail 1
        • Pyjail 2
        • Pyjail 3
        • Pyjail 4
      • ๐ŸŒWeb
        • Au commencement รฉtait le verb
        • Becadmin
        • PHP Juggler
    • 2024 | HTB - Cyber Apocalypse Challenges
      • ๐Ÿ”—Blockchain
        • Lucky Faucet
        • Recovery
        • Russian Roulette
      • ๐Ÿ”‘Cryptographie
        • Blunt
        • Dynastic
        • Iced TEA
        • Makeshift
        • Primary Knowledge
      • ๐Ÿ”ŽForensic
        • An unusual sighting
        • Data Siege
        • Fake Boost
        • Game Invitation
        • It Has Begun
        • Phreaky
        • Pursue The Tracks
        • Urgent
      • ๐Ÿ”ŒHardware
        • BunnyPass
        • Flash-ing Logs
        • Maze
        • Rids
        • The PROM
      • ๐Ÿง Misc
        • Character
        • Cubicle Riddle
        • Path of Survival
        • Stop Drop and Roll
        • Unbreakable
        • Were Pickle Phreaks
        • Were Pickle Phreaks Revenge
      • ๐Ÿ˜ˆPwn
        • Delulu
        • Pet Companion
        • Tutorial
        • Writing on the Wall
      • โš™๏ธReverse
        • BoxCutter
        • Crushing
        • FollowThePath
        • LootStash
        • MazeOfPower
        • Metagaming
        • PackedAway
        • QuickScan
      • ๐ŸŒWeb
        • Flag Command
        • KORP Terminal
        • Labyrinth Linguist
        • LockTalk
        • Testimonial
        • TimeKORP
    • 2024 | UNbreakable
      • ๐Ÿ”‘Cryptographie
        • start-enc
        • traffic-e
      • ๐Ÿ”ŽForensic
        • easy-hide
        • password-manager-is-a-must
      • ๐Ÿง Misc
        • rfc-meta
      • ๐Ÿ“ฑMobile
        • flagen
        • improper-configuration
      • ๐Ÿ“กNetwork
        • wifi-basic
        • wifiland
      • ๐Ÿ“šOSINT
        • persistent-reccon
        • safe-password
      • ๐Ÿ˜ˆPwn
        • intro-to-assembly
      • โš™๏ธReverse
        • fake-add
      • ๐ŸŽญStรฉganographie
        • secrets-of-winter
      • ๐ŸŒWeb
        • pygment
        • sided-curl
        • you-can-trust-me
    • 2023 | EFREI - CyberNight
      • ๐Ÿ“šOSINT
        • Invest Now !
      • ๐Ÿ˜ˆPwn
        • NSA Call Converter
      • โš™๏ธReverse
        • CryptoVirus
        • WebChaussettes
      • ๐ŸŒWeb
        • DoctoLeak
    • 2023 | Flag4All
      • ๐Ÿ”‘Cryptographie
        • Aes IV
        • Crypt my loop
        • Kentucky fried chicken
        • RSA primes
        • Xor
    • 2022 | EFREI - CyberNight
      • ๐Ÿ”‘Cryptographie
        • Coupรฉ-dรฉcalรฉ
        • ExFILEtration
        • Il s'est baissรฉ ou pas
        • J'ai pas rotรฉ
        • Les allemands !
        • RSA Strong Prime generator
      • ๐Ÿ”ŽForensic
        • Bomberman 1/2
        • Bomberman 2/2
        • Magic
        • Peu importe le chemin
        • Sniff sniff
        • Souvenir
        • Xray
      • ๐Ÿ”ŒHardware
        • Class4
        • Find me 2/3
        • Identify 1/3
        • Yo listen 3/3
      • ๐Ÿง Misc
        • Et je tombe tombe tombe
        • Des yeux partout
        • RiGOLe
        • Roomba tricheur
        • Survey
        • Tinder
      • ๐Ÿ’พProgrammation
        • Repeat
        • Startup
        • Timing
      • โš™๏ธReverse
        • Auth 1
        • Auth2
        • Auth3
        • Cryptoroomba
        • Tenet
      • ๐ŸŽญStรฉganographie
        • 50 shades of stephane legar
        • Chess master
        • Deviens champion sers toi de tout ce que tu as appris
        • Drifting in the bits
        • Pyramide
        • Spirale
      • ๐ŸŒWeb
        • Ah bah c'est du propre
        • Cooking roomba
        • Leaderboard
        • vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Propulsรฉ par GitBook
Sur cette page
  • Challenge
  • Solution

Cet article vous a-t-il รฉtรฉ utile ?

  1. CTF & Writeups
  2. 2025 | HackDay
  3. Reverse

Just dig

PrรฉcรฉdentReverseSuivantRusty_rev

Derniรจre mise ร  jour il y a 3 mois

Cet article vous a-t-il รฉtรฉ utile ?

Flag: HACKDAY{i_LovE_DiGg!N9_1nTo_4sm}

Challenge

Description


Researchers have recently uncovered a mysterious ancient artifact beneath the Cogswell Halls. Its purpose remains unknown, but its potential seems invaluable. Who knows? The secrets it holds could revolutionize modern knowledge. They need an expert eyeโ€”yours! Let's dig in !


sha256: 966a1f6b87a7c29df32838da5afeead32c5141603faba59b4373c98bcd67b5d9

Ce challenge tourne sur un docker et n'est pas disponible

Solution

Pour ce challenge, on commence par dรฉcompiler. Ici, j'utilise Ghidra.

Ensuite, rendez-vous dans la fonction HackDay :

On voit un jump vers c95WsZt4xa. Dans celui-ci, on place une valeur dans EBX, puis on jump ร  nouveau.

Ce qu'on a mis dans EBX, c'est SEFD, avec un peu d'intuition, on s'aperรงoit que c'est le dรฉbut de la base64 de HACKDAY :

En fait, le binaire place dans les registres EAX, EBX, ECX et EDX un bout du flag encodรฉ en base64. On peut ร  la main rรฉcupรฉrer toutes ces valeurs dans le bon ordre, mais on va plutรดt automatiser รงa afin de montrer comment รงa fonctionne.

Ici, j'utilise python avec gdb :

import gdb
import re
from base64 import b64decode

def get_register_value(register: str) -> str:
  s = gdb.execute(f"info register {register}", to_string=True)
  s = re.sub(' +', ' ', s).split(' ')[1]
  return s

def get_address_value(address: str) -> str:
  s = gdb.execute(f"x /w {address}", to_string=True)
  s = bytes.fromhex(s.split('\t')[1][2:]).decode()[::-1] # little endian
  return s

# Charger le binaire
gdb.execute("file ./just-dig-out")

# On break sur le tout premier jump de HackDay (premier screen)
gdb.execute("break *0x565561e4")

# On lance le binaire
gdb.execute(f"run")

# Une fois le breakpoint atteint
# On rรฉcupรจre la valeur des registres
old_registers = [get_register_value(r) for r in ['eax', 'ebx', 'ecx', 'edx']]

# On prend le jmp suivant et on se cale APRES le MOV dans le registre
for i in range(2):
  gdb.execute("ni")

encoded_flag = ''
for _ in range(11):
  # Rรฉcupรจre les nouvelles valeurs des registres
  registers = [get_register_value(r) for r in ['eax', 'ebx', 'ecx', 'edx']]
  
  # Dรฉtecte le registre qui a changรฉ (et rรฉcupรจre l'adresse qu'il contient)
  address = [registers[i] for i in range(len(registers)) if registers[i] != old_registers[i]][0]
  # Rรฉcupรจre la valeur ร  l'adresse
  value = get_address_value(address)
  # Ajoute cetete valeur ร  notre chaรฎne finale
  encoded_flag += value

  # Remplace les anciens registres par les nouveaux
  old_registers = registers
  
  # Prendre le prochain jump 
  for i in range(4):
    gdb.execute("ni")

# Dรฉcode et affiche le flag
print(b64decode(encoded_flag).decode())

gdb.execute("quit")

On lance la commande gdb -q -x just.py, et on admire le travail :

[...]

   0x56556219 <TF3D1xEH5f+0>   mov    eax, 0x565561c1
 โ†’ 0x5655621e <TF3D1xEH5f+5>   inc    DWORD PTR ds:0x56559008
   0x56556224 <TF3D1xEH5f+11>  cmp    DWORD PTR ds:0x56559008, 0xc
   0x5655622b <TF3D1xEH5f+18>  je     0x56556365 <tWq5CYhW7B>
   0x56556231 <qRHxrv9HwO+0>   mov    ebx, 0x5655618d
   0x56556236 <qRHxrv9HwO+5>   inc    DWORD PTR ds:0x56559008
   0x5655623c <qRHxrv9HwO+11>  cmp    DWORD PTR ds:0x56559008, 0x2
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ threads โ”€โ”€โ”€โ”€
[#0] Id 1, Name: "just-dig-out", stopped 0x5655621e in TF3D1xEH5f (), reason: SINGLE STEP
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ trace โ”€โ”€โ”€โ”€
[#0] 0x5655621e โ†’ TF3D1xEH5f()
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
HACKDAY{i_LovE_DiGg!N9_1nTo_4sm}
๐Ÿšฉ
โš™๏ธ
3KB
just-dig.zip
archive