====== File Formats ====== There are an endless number of file formats in existence and more being created all the time. Techniques and structures of how these files work and can be abused are detailed here. ===== PDF ===== Incredibly common, and absurdly complex with an incredibly number of abilities. Anatomy of a PDF * [[https://speakerdeck.com/ange/lets-write-a-pdf-file|Basics of writing a PDF by hand]] * [[https://speakerdeck.com/ange/an-overview-of-pdf-potential-leaks?slide=8|Potential issues with PDFs]] * [[https://github.com/gendx/pdf-cheat-sheets/blob/master/pdf-graphics.png|PDF Graphics Cheat Sheet]] * [[http://amccormack.net/2012-01-22-anatomy-of-a-pdf-document.html|More on PDF anatomy]] * [[https://www.thesecurityblogger.com/distributing-malware-inside-adobe-pdf-documents/|An example of PDF exploitation]] ===== ELF ===== The Executable Linkable Format, commonly used for binary executables, compiled objects, shared libraries, and core dumps. Primarily used on Unix and derived systems. Anatomy of a Linux ELF Exeuctable * [[http://refspecs.linuxbase.org/elf/elf.pdf|Official ELF format specification]] * [[http://www.skyfree.org/linux/references/ELF_Format.pdf|ELF format reference]] * [[http://www.sco.com/developers/gabi/2000-07-17/ch4.eheader.html|ELF header reference]] ===== Portable Executable (PE) ===== The Portable Executable (PE) format is a file format for executables, object code, DLLs, FON Font files, and others used in 32-bit and 64-bit versions of Windows operating systems. The PE format is a data structure that encapsulates the information necessary for the Windows OS loader to manage the wrapped executable code. Portable executables are also the standard for [[https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface|EFI environment executables]] Anatomy of a Windows PE * [[https://docs.microsoft.com/en-us/windows/win32/debug/pe-format|PE Format specification]] ===== JPEG ===== JPEG is a standard for lossy compressed digital images, and is arguably one of the most common file types most people will ever see. * [[https://www.ccoderun.ca/programming/2017-01-31_jpeg/|Anatomy of a JPEG]]