Depix: reversing pixelation
Pixelating text (replacing each block with the average color of the pixels it covers) is not safe redaction: it's a deterministic, position-dependent transform, so it keeps information about the original. Depix exploits that to recover pixelated text. The idea: if you know the algorithm and block size, you can pre-render an alphabet, pixelate it the same way and compare block by block the target image against those candidates until you rebuild each character (a matching attack over a De Bruijn sequence of characters).
The typical scenario is a document (a PDF, a screenshot) where someone "covered" a password by pixelating it. The work is in extracting the exact region and giving it the format the tool expects (PNG in RGB mode):
git clone https://github.com/spipm/Depix && cd Depix
pdfimages -all document.pdf out # extract the images from the PDF
mogrify -format png out-000.ppm # convert to PNG
python3 depix.py -p crop.png \
-s images/searchimages/debruinseq_notepad_Windows10_close.png \
-o result.pngThe crop must be precise (no margins), and the search image (searchimage) must match the font and pixelation of the original; both ship in the Depix repo. The result is the cleartext password, which is then reused (for example, a su root).
Defence. It is simple: never pixelate or blur sensitive information; cover it with a solid box (real redaction) or remove it before sharing the document.
Machines where it's used
- GreenHornHackTheBox