GithubHelp home page GithubHelp logo

fo0nikens / pdfxplr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sowdust/pdfxplr

0.0 0.0 0.0 2.61 MB

Extract hidden data from pdf files

License: GNU General Public License v3.0

Python 100.00%

pdfxplr's Introduction

pdfxplr

Extract hidden data from pdf files.

Summary

This script attempts to extract potentially interesting data from pdf files, that might be useful in penetration tests, forensics analysis or OSINT investigations. Besides classic metadata, it searches for elements usually overlooked, including metadata inside embedded images, paths on the operating system, usernames, software components.

Prerequisites

You will need Python 3 with the following libraries:

  • chardet
  • pdfminer.six
  • python-dateutil
  • Pillow

To install them, after cloning the repository, simply run:

pip3 install -r requirements.txt

Configuration

The list of exif metadata that will be extracted is set in utils.py, as well as the list of character encodings that will be tried when all else fails.

Usage

pdfxplr.py v. 0.1 - Find hidden data in pdf
by sowdust

usage: pdfxplr.py [-h] [-m] [-a] [-e] [-l] [-i] [-u] [-s] [-p] [-x] [-v]
                  [--encoding encoding] [--store-images path]
                  PATH

extract interesting data from pdf files.

positional arguments:
  PATH                 path to a file or folder

optional arguments:
  -h, --help           show this help message and exit
  -m, --metadata       show metadata, off by default
  -a, --all            show all, add -m to show also metadata
  -e, --email          list all email addresses
  -l, --links          list all URLs
  -i, --ips            list all IP addresses
  -u, --usernames      list all usernames
  -s, --software       list all software components identified
  -p, --paths          list all content found in image alt fields (ie. system
                       paths)
  -x, --images         extract info from images, use -m to show metadata
  -v, --verbose        verbose mode
  --encoding encoding  input document encoding
  --store-images path  path to store extracted images (optional)

It is possible to test the script using the sample pdf file in the "sample" folder.

Acknowledgments

Thanks to Gianluca Baldi for the help with the old version of this project and to Maurizio Agazzini for having suggested using the images' alt text in pdf files.

The XMP metadata parser is by Matt Swain (http://blog.matt-swain.com/post/25650072381/a-lightweight-xmp-parser-for-extracting-pdf).

Some regexes are from John Gruber (http://daringfireball.net/2010/07/improved_regex_for_matching_urls).

Dumppdf is a slightly modified version from the original tool shipped with pdfminer (https://github.com/pdfminer/pdfminer.six/blob/master/tools/dumppdf.py)

pdfxplr's People

Contributors

sowdust 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.