Brute Forcing AES-ECB with Emoji [Hackvent 2022 - Day 20] @0xdf
Brute Forcing AES-ECB with Emoji [Hackvent 2022 - Day 20]  @0xdf
Uploaded January 2023 | Updated November 2026, 3 hours ago
The Hackvent day 20 challenge involves sending a message to a server and getting back that message and the flag, encrypted with AES electronic codebook (ECB) mode. Because of how the message and flag are padded seperately, it's not immediately obvious how I could change the position of the flag within a block. Some analysis will show that using multi-byte characters (like emoji) will abuse this, and allow me to set up blocks that contain the amount of the flag I want. I'll start with 1 character, and send in a frame of my own that should match, and see it does. This is a really fun Python programming exercise. I'll use this abuse to brute force the flag, and then show how to make it way faster by putting all possible next characters into the same request.

Hackvent 2022 writeup: Hackvent 2022 writeup: 0xdf.gitlab.io/hackvent2022/hard
AES-ECB: en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_(ECB)

☕ Buy Me A Coffee: buymeacoffee.com/0xdf

#hackvent

[00:00] Introduction
[00:35] Looking at Python source
[01:25] Strategy
[03:45] Starting script with pwntools remote
[05:36] probe function
[07:28] printing results as block
[09:07] Playing with flag block spacing
[11:18] Finding flag length
[13:47] Manually showing last non-pad byte in flag is }
[15:08] Writing a loop to brute force each character
[20:11] Running, realizing some prints are required
[20:44] Running with status prints, breaks after two
[21:15] Need to update check to find correct block
[23:04] Running with correct checks
[23:30] Improving with much faster algorithm
[23:50] New function with multiple character check
[27:35] Running to figure out how to get characters from block match
[29:52] Adding prints to show progress and flag
[30:27] Wrap-up
Brute Forcing AES-ECB with Emoji [Hackvent 2022 - Day 20]PHPs Unsafe parse_url Function [Encoding - HackTheBox]ffuf Auto Calibration DemystifiedWriting a Webshell Joomla Plugin [HackTheBox - DevVortex]Laboratories [AOC2025 Day 7]NeoVault - HackTheSystem CTFPlaying with Jenkins File Read [CVE-2024-23897]Mull It Over [Day 3 - Advent of Code 2024 - Python]Uncheesable [0xff: One Last Address]Hacking PyJWT for Algorithm Confusion Attack [HackTheBox CyberMonday]Day 10: Pipe Maze [AOC2023 Python]Jumpio Adventure [HTB Stack Smash CTF]
0xdf |

Brute Forcing AES-ECB with Emoji [Hackvent 2022 - Day 20]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER