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
  • RΓ©solution
  • Script de rΓ©solution

Cet article vous a-t-il Γ©tΓ© utile ?

  1. CTF & Writeups
  2. 2024 | HTB - Cyber Apocalypse Challenges
  3. Hardware

The PROM

PrΓ©cΓ©dentRidsSuivantMisc

Dernière mise à jour il y a 1 an

Cet article vous a-t-il Γ©tΓ© utile ?

CatΓ©gorie: Hardware DifficultΓ©: medium Flag: HTB{AT28C16_EEPROM_s3c23t_1d!!!}

Challenge

Description


After entering the door, you navigate through the building, evading guards, and quickly locate the server room in the basement. Despite easy bypassing of security measures and cameras, laser motion sensors pose a challenge. They're controlled by a small 8-bit computer equipped with AT28C16 a well-known EEPROM as its control unit. Can you uncover the EEPROM's secrets?

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

RΓ©solution

On a devant nous une mΓ©moire EEPROM de type AT28C16. Un rapide tour sur la nous permet de voir ses caractΓ©ristiques :

Tous les input pins fonctionnent en 5V sauf le A9 et le OE qui peuvent Γͺtre montΓ© jusqu’à 12V

On lit Γ©galement qu’il existe 32 octets rΓ©servΓ©s Γ  l’identification, c’est ici que se cache le flag

Pour ce faire il faut :

  • Mettre le pin A9 Γ  12V (en HIGH)

  • Et lire l’adresse de 0x7e0 Γ  0x7FF

Pour Γͺtre en mode lecture justement, il faut mettre les pins :

  • CE et OE Γ  LOW

  • WE Γ  HIGH (donc 5V)

Concernant l’adresse, ce sont des les pins de A10 Γ  A0 qui servent Γ  la paramΓ©trer (A10 Γ©tant le haut de l’adresse) :

  • 0x7e0 : 0b11111100000

  • 0x7ff : 0b11111111111


Script de rΓ©solution

from pwnlib.tubes.remote import remote
import re

# On fonction en 5V
LOW = 0
HIGH = 5

def resolve_address(address: int) -> list[int]:
	address = [5 if b == '1' else 0 for b in bin(address)[2:].zfill(10)]
	# Mettre A9 Γ  12V pour la lecture
	address[1] = 12
	return address

def parse_read(data: str) -> str:
	b = re.search(r"Read (.*) at", data)
	if b is None:
		return ""
	return bytes.fromhex(b.group(1)[2:]).decode()

def solve(host: str, port: int) -> None:
	# Connection au challenge
	client = remote(host, port)

	# Fonction pour envoyer des commandes et rΓ©cupΓ©rer la sortie
	def send_commands(commands: list[str]) -> str:
		_output = []
		for command in commands:
			_output.append(client.sendlineafter(b'> ', command.encode()).decode() + f"{command}")
			if "read_byte" in command:
				_output.append(client.recvline().decode())
		return '\n'.join(_output)

	# Envoie des commandes pour Setup les pin CE / OE / WE
	print(send_commands([
		f"set_ce_pin({LOW})",
		f"set_oe_pin({LOW})",
		f"set_we_pin({HIGH})"
	]))

	flag = ""
	for address in range(0x7e0, 0x7ff+1):
	  # Paramètrage de l'adresse à lire puis lecture
		output = send_commands([
			f"set_address_pins({resolve_address(address)})",
			f"read_byte()"
		])
		print(output)
		# Parsing de la sortie pour rΓ©cupΓ©rer l'octer lu
		flag += parse_read(output)
	print(f"Flag: {flag}")

if __name__ == '__main__':
	solve('94.237.53.3', 43523)

      AT28C16 EEPROMs
       _____   _____
      |     \_/     |
A7   [| 1        24 |] VCC
A6   [| 2        23 |] A8
A5   [| 3        22 |] A9
A4   [| 4        21 |] !WE
A3   [| 5        20 |] !OE
A2   [| 6        19 |] A10
A1   [| 7        18 |] !CE
A0   [| 8        17 |] I/O7
I/O0 [| 9        16 |] I/O6
I/O1 [| 10       15 |] I/O5
I/O2 [| 11       14 |] I/O4
GND  [| 12       13 |] I/O3
      |_____________|

> set_ce_pin(0)
help

Usage:
  method_name(argument)

EEPROM COMMANDS:
  set_address_pins(address)  Sets the address pins from A10 to A0 to the specified values.
  set_ce_pin(volts)          Sets the CE (Chip Enable) pin voltage to the specified value.
  set_oe_pin(volts)          Sets the OE (Output Enable) pin voltage to the specified value.
  set_we_pin(volts)          Sets the WE (Write Enable) pin voltage to the specified value.
  set_io_pins(data)          Sets the I/O (Input/Output) pins to the specified data values.
  read_byte()                Reads a byte from the memory at the current address.
  write_byte()               Writes the current data to the memory at the current address.
  help                       Displays this help menu.

Examples: 
  set_ce_pin(3.5)
  set_io_pins([0, 5.1, 3, 0, 0, 3.1, 2, 4.2])

> set_oe_pin(0)
> set_we_pin(5)
> set_address_pins([5, 12, 5, 5, 5, 5, 0, 0, 0, 0, 0])
> read_byte()
> Read 0x48 at address 0x7e0

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 0, 0, 0, 5])
> read_byte()
Read 0x54 at address 0x7e1

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 0, 0, 5, 0])
> read_byte()
Read 0x42 at address 0x7e2

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 0, 0, 5, 5])
> read_byte()
Read 0x7b at address 0x7e3

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 0, 5, 0, 0])
> read_byte()
Read 0x41 at address 0x7e4

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 0, 5, 0, 5])
> read_byte()
Read 0x54 at address 0x7e5

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 0, 5, 5, 0])
> read_byte()
Read 0x32 at address 0x7e6

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 0, 5, 5, 5])
> read_byte()
Read 0x38 at address 0x7e7

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 5, 0, 0, 0])
> read_byte()
Read 0x43 at address 0x7e8

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 5, 0, 0, 5])
> read_byte()
Read 0x31 at address 0x7e9

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 5, 0, 5, 0])
> read_byte()
Read 0x36 at address 0x7ea

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 5, 0, 5, 5])
> read_byte()
Read 0x5f at address 0x7eb

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 5, 5, 0, 0])
> read_byte()
Read 0x45 at address 0x7ec

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 5, 5, 0, 5])
> read_byte()
Read 0x45 at address 0x7ed

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 5, 5, 5, 0])
> read_byte()
Read 0x50 at address 0x7ee

> set_address_pins([5, 12, 5, 5, 5, 5, 0, 5, 5, 5, 5])
> read_byte()
Read 0x52 at address 0x7ef

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 0, 0, 0, 0])
> read_byte()
Read 0x4f at address 0x7f0

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 0, 0, 0, 5])
> read_byte()
Read 0x4d at address 0x7f1

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 0, 0, 5, 0])
> read_byte()
Read 0x5f at address 0x7f2

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 0, 0, 5, 5])
> read_byte()
Read 0x73 at address 0x7f3

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 0, 5, 0, 0])
> read_byte()
Read 0x33 at address 0x7f4

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 0, 5, 0, 5])
> read_byte()
Read 0x63 at address 0x7f5

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 0, 5, 5, 0])
> read_byte()
Read 0x32 at address 0x7f6

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 0, 5, 5, 5])
> read_byte()
Read 0x33 at address 0x7f7

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 5, 0, 0, 0])
> read_byte()
Read 0x74 at address 0x7f8

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 5, 0, 0, 5])
> read_byte()
Read 0x5f at address 0x7f9

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 5, 0, 5, 0])
> read_byte()
Read 0x31 at address 0x7fa

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 5, 0, 5, 5])
> read_byte()
Read 0x64 at address 0x7fb

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 5, 5, 0, 0])
> read_byte()
Read 0x21 at address 0x7fc

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 5, 5, 0, 5])
> read_byte()
Read 0x21 at address 0x7fd

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 5, 5, 5, 0])
> read_byte()
Read 0x21 at address 0x7fe

> set_address_pins([5, 12, 5, 5, 5, 5, 5, 5, 5, 5, 5])
> read_byte()
Read 0x7d at address 0x7ff

Flag: HTB{AT28C16_EEPROM_s3c23t_1d!!!}
🚩
πŸ”Œ
documentation