Weak RSA
D3v0o0Nu119/2/20261 min read
#cryptography#htb#easy
Weak RSA
Platform: HackTheBox | Category: Cryptography | Difficulty: Easy | Author: D3v0o0Nu11 | Date: 2026-02-10
Description
Can you decrypt the message and get the flag?
Solution Approach
Core idea: Identify the weakness from source review or fingerprinting first. Iterate with incremental payloads instead of guessing.
Steps
-
First, unzip the
.zipfile given. -
For this solution i used
RsaCtfTool.
./RsaCtfTool.py --publickey ./key.pub --uncipherfile ./flag.enc
- Dunno why we didn't get any output, let's try another way by get the private key first and save it to a file named
key.pri.
GET THE PRIVATE KEY FIRST.
./RsaCtfTool.py --publickey ./key.pub --private
- To get the flag run this payload:
sh read-only • copy allowedopenssl pkeyutl -in flag.enc -out flag.txt -decrypt -inkey key.pri
- Got the flag!
Flag
REDACTED
Lessons Learned
- Identify the weakness from source review or fingerprinting first.
- Iterate with incremental payloads instead of guessing.
- Reuse the same pattern in future engagements.