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
  • Remplissage de la table
  • Passage en mode automatique
  • Déchiffrement

Cet article vous a-t-il été utile ?

  1. CTF & Writeups
  2. 2024 | 404CTF
  3. Stéganographie

La chute

404CTF{CONTRE_LES_CHUTES_CHERCHEZ_LES_DRAPEAUX}

PrécédentLe grand écartSuivantWeb

Dernière mise à jour il y a 11 mois

Cet article vous a-t-il été utile ?

Catégorie: Stegano Difficulté: medium Flag: -

Challenge

Description


Et l'athlète s'élance, sa performance est jusqu'à présent sans fautes ! Mais, que vient-il de se passer ? Il est tombé ! J'espère qu'il n'est pas gravement blessé, car rien n'est encore joué. D'ailleurs, il essaie de nous dire quelque chose !

Mais qu'est-ce qu'il a bien pu vouloir dire ?

Solution

Un simple coup d'œil permet de faire l'hypothèse d'un chiffrement par substitution. On peut le confirmer par une analyse statistique

with open('charabia.txt', 'r', encoding='utf-8') as f:
    data = f.read().strip()

stats = {c: data.count(c) for c in set(data)}
stats = sorted(stats.items(), key=lambda x: x[1], reverse=True)
for stat in stats:
    print(stat)

# ('л', 109) ('^', 77)  ('[', 64)  ('╩', 47)
# ('#', 41)  ('&', 38)  ('λ', 35)  ('6', 33)
# ('|', 28)  ('𝚑', 26)  ('!', 26)  ('$', 23)
# ('༽', 19)  ('⃝', 17)   ('/', 16)  ('ஏ', 16)
# (':', 14)  ('я', 8)   ('é', 7)   ('Ψ', 6)
# ('ж', 6)   ('Ξ', 5)   ('%', 5)   ('ц', 5)
# ('⃥', 5)   ('▙', 5)   ('Ω', 4)   ('Σ', 4)
# ('в', 4)   ('à', 3)   ('?', 3)   ('è', 2)
# ('E', 2)   ('4', 2)   ('0', 1)   ('î', 1)
# ('-', 1)   ('{', 1)   ('}', 1)

Il y a 39 caractères différents avec une répartition non uniforme, ce qui va dans le sens de notre hypothèse. On va donc dresser une table de correspondances entre les caractères chiffrés et clairs.


Remplissage de la table

Première chose importante : aucun espace dans le texte, on peut donc supposer qu'il a été remplacé par л puisque c'est le plus présent.

Nouvel ajout à la table des correspondances

Chiffré
Correspondance

л


Ensuite, on trouve dans le texte 404[$λΣ{, on peut supposer que c'est le début du flag. Problème, il y a 4 caractères entre 404 et {, or le format du flag est 404CTF{.

Il faut cependant voir que le bigramme (terme technique pour se la péter voulant dire "groupe de deux caractères") [$ se retrouve à plusieurs endroits et surtout que le $ n'existe pas sans être précédé de [. On peut en déduire que le C correspond à ce bigramme.

Nouveaux ajouts à la table des correspondances

Chiffré
Correspondance

[$

C

λ

T

Σ

F

On va utiliser ces premiers changements pour deviner la suite, pour ça on sort notre meilleur script Python.

with open('charabia.txt', 'r', encoding='utf-8') as f:
    data = f.read()

# On remplace le bigramme en amont pour simplifier
data = data.replace('[$', 'C')

charmap = {
    'л': ' ',
    'λ': 'T',
    'Σ': 'F',
}

data = ''.join([charmap.get(c, c) for c in data])
print(data)

Dans notre nouveau texte, on peut croiser C^TT^ et T^T^, je pense que c'est assez clair, ça correspond aux mots CETTE et TETE

Nouvel ajout à la table des correspondances

Chiffré
Correspondance

^

E

On met à jour le script et on relance


Passage en mode automatique

Problème : on ne peut pas lui passer le texte avec ces caractères, donc on va refaire un petit script pour changer les caractères pas encore déchiffrés en caractères lisibles par l'outil.

import string

with open('charabia.txt', 'r', encoding='utf-8') as f:
    data = f.read()

# On remplace le bigramme en amont pour simplifier
data = data.replace('[$', 'C')

charmap = {
    'л': ' ',
    'λ': 'T',
    'Σ': 'F',
}

data = ''.join([charmap.get(c, c) for c in data])
print(data)

# Liste des caractères dans le texte
keys = ''
for c in data:
    if c not in keys:
        keys += c 

# Caractère à ne pas modifié puisqu'on en est sûr
conserve = '404{} CTFE'

j = 0
for i, key in enumerate(keys):
    if key not in charmap:
        # On remplace par une lettre qui n'est pas déjà utilisée
        while string.ascii_letters[j] in conserve:
            j += 1
        charmap[key] = string.ascii_letters[j]
    j += 1

print(''.join([charmap.get(c, c) if c not in conserve else c for c in data]))

# ab defg haifhjTbl mng Cpbq rfqst rb ab ub gfhg mng vwbggj bT rb dnhg Tqxg vhbat wb yzqnmbnf mwnCj gefg CbTTb mefTqb uAn mbquhg yzAnueqThq un CpfTbB CAbgT yzAnhwwbfqg jTqnaDb G ifbw mehaT fa ghumwb yzqnmbnf mbfT Fnhqb mnggbq fab ghTfnThea yzb Tqxg yznaDbqbfgb G mnqFnhTbubaT vjahabB DqnCb G Cb yzqnmbnft TefT uea Ceqmg dn vhbat nweqg ifAndnaT uea Ceqmg aAnwwnhT mng vhbaB rb defg qbCeuunayzb yzeaC dhdbubaT yzb defg mqeCfqbq yzbg mnaabnfE yznag wb Cng ef defg Fbqhbl yzb wn DsuangThifb bT ifb defg Teuvbqhbl gfq wn TbTb m mnq CeaTqbt CAbgT dqnhubaT fa jTqnaDb yzqnmbnf d 404CTF{CeaTqbMwbgMCpfTbgMCpbqCpblMwbgMyzqnmbnfE}B unhg yzfCefmt mefqqnhgOrb qbCeuubaCbq uea jmqbfdb gAhw defg mwnPT sQ

On obtient

NE VOUS INQUIHTEZ PAS CFER JURYT JE NE ME SUIS PAS BLESSH ET JE VAIS TRXS BIENT LE GDRAPEAU PLACH SOUS CETTE POUTRE MNA PERMIS GDNAMORTIR MA CFUTEE CNEST GDNAILLEURS HTRANVE S QUEL POINT UN SIMPLE GDRAPEAU PEUT UAIRE PASSER UNE SITUATION GDE TRXS GDANVEREUSE S PARUAITEMENT BHNINEE VRACE S CE GDRAPEAUT TOUT MON CORPS VA BIENT ALORS QUNAVANT MON CORPS NNALLAIT PAS BIENE JE VOUS RECOMMANGDE GDONC VIVEMENT GDE VOUS PROCURER GDES PANNEAUO GDANS LE CAS OU VOUS UERIEZ GDE LA VYMNASTIQUE ET QUE VOUS TOMBERIEZ SUR LA TETE P PAR CONTRET CNEST VRAIMENT UN HTRANVE GDRAPEAU V 404CTU{CONTREPLESPCFUTESPCFERCFEZPLESPGDRAPEAUO}E MAIS GDUCOUPT POURRAISWJE RECOMMENCER MON HPREUVE SNIL VOUS PLAFT YR

On a maintenant une très bonne base, il suffit de faire les corrections à la main. Il ne faut cependant pas oublier que des bigrammes peuvent être utilisés comme pour le C

Notamment, on voit GDANVEREUSE et GDRAPEAUT, on devine que V -> G, T -> X et GD -> D


Déchiffrement

Pour une question de simplicité, je continuerai avec le texte de base, mais en m'appuyant évidemment sur ce que DCode m'annonce.

On arrive avec le script final

import string

with open('charabia.txt', 'r', encoding='utf-8') as f:
    data = f.read().strip()

# On remplace le bigramme en amont pour simplifier
data = data.replace('[$', 'C')
data = data.replace('/ஏ', 'D')

charmap = {
    'л': ' ',
    'λ': 'T',
    'Σ': 'F',
    data[0]: 'N',
    data[1]: 'E',
    data[3]: 'V',
    data[4]: 'O',
    data[5]: 'U',
    data[6]: 'S',
    data[8]: 'I',
    data[10]: 'Q',
    data[13]: 'É',
    data[16]: 'Z',
    data[18]: 'P',
    data[19]: 'A',
    data[23]: 'H',
    data[25]: 'R',
    data[27]: 'J',
    data[30]: 'Y',
    data[31]: '.',
    data[39]: 'M',
    data[51]: 'B',
    data[52]: 'L',
    'я': '\'',
    'в': '.',
    'Ξ': 'G',
    'ц': '_',
    'Y': '?',
}

data = ''.join([charmap.get(c, c) for c in data])
print(data)

# NE VOUS INQUIÉTEZ PAS CHER JURY. JE NE ME SUIS PAS BLESSÉ ET JE VAIS TRèS BIEN. LE DRAPEAU PLACÉ SOUS CETTE POUTRE M'A PERMIS D'AMORTIR MA CHUTE. C'EST D'AILLEURS ÉTRANGE à QUEL POINT UN SIMPLE DRAPEAU PEUT FAIRE PASSER UNE SITUATION DE TRèS DANGEREUSE à PARFAITEMENT BÉNINE. GRACE à CE DRAPEAU. TOUT MON CORPS VA BIEN. ALORS QU'AVANT MON CORPS N'ALLAIT PAS BIEN. JE VOUS RECOMMANDE DONC VIVEMENT DE VOUS PROCURER DES PANNEAUE DANS LE CAS OU VOUS FERIEZ DE LA GYMNASTIQUE ET QUE VOUS TOMBERIEZ SUR LA TETE P PAR CONTRE. C'EST VRAIMENT UN ÉTRANGE DRAPEAU V 404CTF{CONTRE_LES_CHUTES_CHERCHEZ_LES_DRAPEAUE}. MAIS DUCOUP. POURRAIS-JE RECOMMENCER MON ÉPREUVE S'IL VOUS PLAîT Y

Il y a quelques erreurs encore, mais le drapeau est visible et avec une correction ça donne : 404CTF{CONTRE_LES_CHUTES_CHERCHEZ_LES_DRAPEAUX}

Rien d'autre ne saute aux yeux, du moins pour ma part, donc on sort notre second outil : . Il permet de faire une analyse de fréquence couplée à d'autres méthodes comme l'utilisation d'indice de coïncidence.

🚩
🎭
⭐
DCode
646B
la_chute.zip
archive