Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

PDF/ZIP/NES polyglot file generator (PoC||GTFO 0x14-style)

NotificationsYou must be signed in to change notification settings

perfaram/pdf-zip-nes-polyglot

Repository files navigation

Run with (using the included sample files) :

./gen_poly.py --out magic.pdf --in "CAMUS, Albert - The Stranger.pdf" --message monalisa_joconde_ascii.txt --zip hyeronimus_bosch.jpg --header sample.nes

Let's break this up :

  • --out is the path/name of the resulting file – which will be a perfectly valid PDF file
  • --in is your original PDF file
    • in my example :The Stranger, by Camus
  • --message is the plaintext message that should appear when the resulting file will be opened in a hex editor, or directlycat-ed in a terminal
    • in my example : a splendid rendition of the Mona Lisa in ASCII
    • additional feature : a command to directly output this message (andonly this message without any surrounding gibberish) will be added just before the message itself
      • this command looks liketail -c +offset of message in file magic.pdf | head -clength of message
  • --zip is the (list of) file(s) that are to be zipped and appended in the original PDF
    • in my example : a famous painting by Hyeronimus Bosch
    • additional feature : when unzipped, the original PDF will also appear,although it is not duplicated in the resulting file – ain't this magic :)
  • --header is the file that is to be included at the beginning of the file, before the PDF itself
    • in my example : a NES game, for emulators. So that you can also the PDF in an emulator !

Still, with all this stuff appended to and included at the beginning of the PDF, it stays valid and viewable in any standard PDF viewer (such as Adobe Reader, Preview on macOS, etc...)All of this is possible thanks to the fact that the PDF header does not have to be at the beginning of the file, for it to be a valid PDF.

Inspired by PoC||GTFO-0x14, though this would seem very basic to @angea

About

PDF/ZIP/NES polyglot file generator (PoC||GTFO 0x14-style)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp