Generate a bunch of malicious pdf files with phone-home functionality. Can be used with Burp Collaborator

Overview

malicious-pdf.png

made-with-python

Malicious PDF Generator ☠️

Generate ten different malicious pdf files with phone-home functionality. Can be used with Burp Collaborator.

Used for penetration testing and/or red-teaming etc. I created this tool because i needed a third party tool to generate a bunch of PDF files with various links.

Usage

python3 malicious-pdf.py burp-collaborator-url

Output will be written as: test1.pdf, test2.pdf, test3.pdf etc in the current directory.

Do not use the https:// etc prefix on the url argument.

Purpose

  • Test web pages/services accepting PDF-files
  • Test security products
  • Test PDF readers
  • Test PDF converters

Credits

You might also like...
Merge multiple PDF files into one.

PDF Merger Merge multiple PDF files into one. Usage % python pdf_merger.py -h usage: pdf_merger.py [-h] [-o OUTPUT] [-f [FILES ...]] optional argumen

Python script that split PDF files.

Automatic PDF Splitter This script can create new single-page PDFs files from multipaged PDFs. Requirements Python 3.0+ # Debian distros sudo apt-get

borb is a library for reading, creating and manipulating PDF files in python.
borb is a library for reading, creating and manipulating PDF files in python.

borb is a library for reading, creating and manipulating PDF files in python.

Converting Html files to pdf using python script, pdfkit module and wkhtmltopdf.

Html-to-pdf-pdfkit-wkhtml- This repository has code for converting local html files and online html resources into pdf. It is an python script which u

Program that locks/unlocks pdf files🐍
Program that locks/unlocks pdf files🐍

🐍 📄 PDFtools 📄 🐍 Programa que bloqueia/desbloqueia arquivos pdf Requisitos • Como usar • Capturas de Tela 🚨 Aviso 🚨 Altere os caminhos referente

pikepdf is a Python library for reading and writing PDF files.

A Python library for reading and writing PDF, powered by qpdf

Convert MD files to PDF automatically (with CSS) 📄🚀

MD2PDF Action Convert MD files to PDF automatically (with CSS)! Converts a pattern described set of markdown files and converts them to pdf whilst app

Simple HTML and PDF document generator for Python - with built-in support for popular data analysis and plotting libraries.

Esparto is a simple HTML and PDF document generator for Python. Its primary use is for generating shareable single page reports with content from popular analytics and data science libraries.

Python PDF Parser (Not actively maintained). Check out pdfminer.six.

PDFMiner PDFMiner is a text extraction tool for PDF documents. Warning: As of 2020, PDFMiner is not actively maintained. The code still works, but thi

Comments
  • Broken PDFs

    Broken PDFs

    The generated PDFs have an empty line or comments at the beginning. This leads to errors when opening the pdf files depending on the technology.

    For example, if a program looks for %PDF-1. at the beginning of the PDF file, uploading or opening the file will fail.

    Best Regards

    opened by ystrela 4
  • Python errors

    Python errors

    Hi, I get some error messages while using your program. I use Python3.

    python3 malicious-pdf.py mydomain.com
      File "malicious-pdf.py", line 607
        except IndexError, e:
                         ^
    SyntaxError: invalid syntax
    

    'Fixed' by except IndexError: in line 607 but again:

    python3 malicious-pdf.py mydomain.com
    Creating PDF files..
    Traceback (most recent call last):
      File "malicious-pdf.py", line 613, in <module>
        create_malpdf("test1.pdf", '\\\\' + '\\\\'  + host + '\\\\' )
      File "malicious-pdf.py", line 533, in create_malpdf
        file.write('''
    TypeError: a bytes-like object is required, not 'str'
    

    Can you explain what the cause of these problems is?

    Regards

    opened by gizamichal 2
  • Test4.pdf appears to incorrectly exploit CVE-2019-7089

    Test4.pdf appears to incorrectly exploit CVE-2019-7089

    Looking at the reference blog for Test4.pdf at https://insert-script.blogspot.com/2019/01/adobe-reader-pdf-callback-via-xslt.html it seems the href needs to be a UNC path like \\test.com\whatever.xslt. When running this script with test.com as the parameter the href is \https://test.com\whatever.xslt. This appears to incorrectly exploit CVE-2019-7089.

    opened by alecdhuse 0
Owner
Jonas Lejon
🔒 Cyber Security
Jonas Lejon
PyPDF2 is a pure-python PDF library capable of splitting, merging together, cropping, and transforming the pages of PDF files.

PyPDF2 is a pure-python PDF library capable of splitting, merging together, cropping, and transforming the pages of PDF files. It can also add custom data, viewing options, and passwords to PDF files. It can retrieve text and metadata from PDFs as well as merge entire files together.

Matthew Stamy 5k Jan 4, 2023
Compare-pdf - A Flask driven restful API for comparing two PDF files

COMPARE-PDF A Flask driven restful API for comparing two PDF files. Description

Karthikeyan JC 3 Mar 13, 2022
A bulk pdf generator. This application can generate PDFs in bulk by using just one click.

A bulk html pdf generator. This application can generate PDFs in bulk by using just one click. Screenshots Requirements ?? Your system must have the f

Aman Nirala 3 Apr 23, 2022
Trata PDF para torná-lo compatível com PDF/X e com impressoras em escala de cinza.

tratapdf Trata PDF para torná-lo compatível com PDF/X e com impressoras em escala de cinza. dependências icc-profiles ghostscript visualizador de PDF

null 1 Nov 30, 2021
Convert PDF to AudioBook and Audio Speech to PDF

In this Python project, we will build a GUI-based PDF to Audio and Audio to PDF converter using the Tkinter, OS, path, pyttsx3, SpeechRecognition, PyPDF4, and Pydub libraries and the messagebox module of the Tkinter library.

RISHABH MISHRA 1 Feb 13, 2022
Telegram bot that can do a lot of things related to PDF files.

Telegram PDF Bot A Telegram bot that can: Compress, crop, decrypt, encrypt, merge, preview, rename, rotate, scale and split PDF files Compare text dif

null 130 Dec 26, 2022
A Python tool to generate a static HTML file that represents the internal structure of a PDF file

PDFSyntax A Python tool to generate a static HTML file that represents the internal structure of a PDF file At some point the low-level functions deve

Martin D. 394 Dec 30, 2022
Generate a preview image for a PDF.

PDF ➡️ Preview A simple tool to save me time on Illustrator. Generates a preview image for a PDF file. Useful for sneak peeks to academic publications

David Chuan-En Lin 51 Sep 22, 2022
CLI tool to generate pdf invoices written in python

invoicepy CLI invoice tool, store and print invoices as pdf. save companies and customers for later use. installation pip install invoicepy config co

Adam Wojtczak 9 Aug 1, 2022
pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative markdown file as input

pystitcher pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative input in the form of a mark

Nemo 387 Dec 10, 2022