 Hello and welcome to this free video where I'm going to show you off my Public tools that I use to create pdf files and later. I will also produce a paying video where I Show you all my private tools to make all kinds of special pdf files Now if you go to my website DDA statements, and you go to my PDF tools you will find my make pdf tools Like you want to make embedded files and script and javascript PDF files and Then you can download my make pdf tools here. I have already downloaded this I have it here in my folder So let's unzip this here Okay, so and I have three programs that I want to show you hello world Embedded and javascript. This is my module that I developed to create PDF files, so it contains classes to create pdf objects So let's start with hello world Here hello world and let's call this hello dot PDF So this created this file hello PDF and As you can expect when you open it you get a pdf with hello world Now if we look at the pdf code, so you have a header the first object which is the root object the catalog object outline object a Pages object that's object three object four represents the page itself With the font here in object six and then in object five We have the text that we want to display here hello world second line third line and drawing a rectangle around it and then We have the crosshift table with an entry for each object and the trailer With an end of file now if we look at the program To generate this It's a rather simple program, so we import my mpdf module and then here We create an object, so we instantiate the class see PDF with the PDF file name So that's a hello PDF that we typed and that is the start of our Creation of a PDF file, so we have this object and then we apply different methods. So this is the method to generate header Then a method to generate Template and the template is one for a typical PDF file where we have only one page This is a comment this I mean this code is commented out And this is the code that we saw for object five Where we have all those Text and then here at the end we create our trailer. So that means that the calculation of the crosshift table and everything is done by my CPDF class you only have to provide it the root object to the reference to the root object the catalogue object so let's delete this one here and work With just a simple hello world line, so let me save this Let's run this again, and now if you open hello you have hello world Now if you want to change this text So let's look first Here at hello PDF Okay, so we have object five here Hello world Now if you would want to change this text here directly In the PDF document you could do this but then This reference here to the start of the crosshift a wisdom will no longer be valid although most adobe reader Versions don't have any problem with this Now what's better to do is that you change it from the program. So let me undo this and Let's change it in the program So here you have the string Strings in the PDF language are surrounded by parenthesis So let's do hello world from Didier here Let me save this Run it like this and Then you can see hello world from didier and If we reload this You can see that this has been changed and correctly calculated So this is simply hello world Let's look at the next example and that is one to create Files with embedded javaxi so PDF documents with embedded javascript. Let me close this so make javascript That PDF And if we don't provide any argument by default A PDF document will be created with the javascript that displays an alert message box So here you have that script now I have to show you this with Adobe reader So I'm going to do this in my virtual machine because I don't want to install adobe reader On my main machine. So here you have the script and when we open this you can see the text Javascript example, but then also here the pop-up hello from PDF javascript So let's look at this The PDF file And here you can see again. We have our header our object one The catalog object which this time also has an open action Which is found in object 7. So let's go down to object 7 Okay, and object 7 is an action object of type javascript and here between parentheses you have the actual javascript that was Included in this PDF document. So that is the default from the program. It displays an up alert like this you can Work with options. You have an option where you provide the javascript on the command line And you can have also an option where you provide the javascript as a file So let me just do one here javascript where I provide one from the command line and let's do an Up alert one plus two like this and call this alert sum dot PDF Okay, so this file has been created Have a look So this is just like the other one and the difference here is in object 7 here where you see This is the string that I provided And if I execute this from adobe reader, okay, now let's Close this and okay alert sum So one plus two equals three. So that is my program to create PDF files with javascript and then the last one Is a program to create PDF files with embedded files So make PDF embedded We are going to embed this zip file into The embedded dot PDF file like this Now if we open this embedded PDF file with ultra edit Here, okay, now you can see it is Actually hex. This is not pure ascii, but let's switch To ascii. So you have the header here Command that indicates that we are dealing with the binary file actually And then here the catalog object, which is the same as we saw in the other except here for these name sections Where we have embedded files you can see here The name of the file we embedded With an object to reference with a reference to object 7 So let's go to object 7 Like this here and so this is a file spec object Referencing object 8 And object 8 here Contains the embedded file in a stream which has been compressed. This is a stream here Okay, and then we have the crosshift table So if I open this embedded file You can actually see the text here and also the embedded file that can be saved Extracted that is and if we look at the program to create this PDF file with embedded files So I have a function to Read binary file there's one here and then I create the PDF file so I instantiized my class PDF object I call the header method. I call the binary method I have also some stego, but I'm not going to talk about this here And here we have an open action if you want the File to be generated automatically, but we are not going to deal with here. So Then we have a method to create an indirect object where you give it The index of the indirect object so object one the version and then the dictionary of this indirect object so the content This is object two That is the outline object three the pages Object four the page itself And then object five the text object six the font object seven the file spec And here object eight This is the one that contains a stream and this is the method stream two, uh, which we can use to create a stream object so we give it An Index that's object eight version zero And this here is The content of the file that we want to embed We provide this Name and value here key value property to add in the dictionary And these are the filters that we want to apply. So by default we are going to Flat and code this file There can be some automatic options if you decide with options with we don't do that and then here We finalize with The crossref and the trailer You can see the different options here from the program, but i'm not going to go into details here Okay, so these are my three programs my three public programs I also have like announced A lot of private tools here in the secret folder you can see all the different Private tools first of all and pdf the module which is much larger because it not only contains here in this private version um A class pdf method, but also methods for obfuscation and fuzzing This here are all programs to create pdf files that Show you my launch exploited i developed A deflate bomb a car embedded file Hello world with fuzzer and with name obfuscation different javascripts with an embedded pe file with shellcode gpec files So that's a pdf file with an image metadata Simple metadata and one with 6ml bomb And then also a flash you can create pdf files containing flash and that is my program here to create one Now these are all programs to create files from scratch But i also have an example how to use my module To create to modify an existing pdf file with an incremental update And so this is here a simple example, but all of these examples here can be Source codes here can be transformed into an incremental update So i hope you found my creation pdf tools here interesting And i hope that you are also looking forward to my video where i show you all my private tools Thank you for following this