GithubHelp home page GithubHelp logo

kaneschutzman / heavy_pint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 9b/heavy_pint

0.0 2.0 0.0 376 KB

Library used to generate malicious PDF files for testing

Home Page: www.9bplus.com

Shell 0.05% PHP 99.95%

heavy_pint's Introduction

Summary

Using this tool you can create malicious PDF documents using known JavaScript exploits. These files can then be used in research and testing to further improve how PDF analysis is done. Releasing this library also means that it on the radar of tools that may be used by attackers to generate their documents. Knowing this, the security community can be more prepared and spend more time handling this issue rather than avoiding it.

Important Files

drop_invoice.php - uses the forms, lists and other information to produce an invoice packed with exploits
  • details need to be cleaned up
drop_news.php - uses RSS to produce PDF files with current news information packed with exploits
  • pulls several articles on the generation but can be adjusted to fit needs
drop_packed.php - takes in a directory of "good" PDF files and packs them with exploits
  • ran through the command line using ./caller.sh
  • rips through directory for files and trys to pack them
  • deletes files after attempting to pack, but could be adjusted to track progress

Everything Else

Part of the main libraries or used in the creation process. It is messy, but it is best just to leave it alone unless you do plenty of testing.

General Output

  • JavaScript is obfuscated using random variables
  • Version is taken into account so that exploits are not fired if the reader is not vulnerable
  • Files are encrypted using RC4
  • Streams are dorked by adding a corrupt GZIP stream to the JavaScript object
  • Metadata is left blank in versions

Inheritance Chain (from end to start)

FPDF uses inheritance to achieve a full featureset. If you want more features, those features must then be included in the inheritance chain to be taken advantage of. These may not all be used, but by having them in the chain means you can activate them at the highest level of the construction (exploit generation).

  1. PDF_Exploit (pdf_exploit_generator.class.php => Provides exploit packing and building
  2. FPDF_Protection (protection.class.php) => Provides encryption functionality
  3. PDF_Invoice (invoice.class.php) => Provides JavaScript insert hook with dorked streams
  4. concat_pdf (concat.class.php) => Provides the ability to concatenate two different PDF files (used in packing)
  5. FPDI (fpdi.php) => Provides major functionality for generating documents

Using the Library in Existing Projects

Ensure all files are present at the root level and include pdf_exploit_generator.class.php.

Generating the document:

$pdf = new PDF_Exploit( 'P', 'mm', 'A4' );

Setting encryption:

$pdf->SetProtection(array('print'),'');

Adding an exploit (reference the class for methods):

$pdf-><exploit_to_add>(<shellcode>);

Building the object with the exploits:

$pdf->build_exploit();

Output the PDF:

$pdf->Output();

heavy_pint's People

Contributors

9b avatar bsdixoner avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.