recentpopularlog in

kme : pdf   169

« earlier  
Watching a Malware Author Work - Schneier on Security
Per Adobe's PDF Reference:

File identifiers are defined by the optional ID entry in a PDF file’s trailer dic-
tionary (see Section 3.4.4, “File Trailer”; see also implementation note 162 in
Appendix H). The value of this entry is an array of two byte strings. The first byte
string is a permanent identifier based on the contents of the file at the time it was
originally created and does not change when the file is incrementally updated.
The second byte string is a changing identifier based on the file’s contents at the
time it was last updated. When a file is first written, both identifiers are set to the
same value. If both identifiers match when a file reference is resolved, it is very
likely that the correct file has been found. If only the first identifier matches, a
different version of the correct file has been found.
To help ensure the uniqueness of file identifiers, it is recommend that they be
computed by means of a message digest algorithm such as MD5 (described in In-
ternet RFC 1321, The MD5 Message-Digest Algorithm; see the Bibliography), us-
ing the following information (see implementation note 163 in Appendix H):
• The current time
• A string representation of the file’s location, usually a pathname
• The size of the file in bytes
• The values of all entries in the file’s document information dictionary (see
Section 10.2.1, “Document Information Dictionary”)
pdf  security  malware  incrementalupdates 
11 weeks ago by kme
Shoulder Surfing a Malicious PDF Author | Didier Stevens
What's "incremental updates"? Like Track Changes for PDFs? How is that a good thing?
pdf  malware  exploit 
11 weeks ago by kme
Update: Version 0.7.0 | Didier Stevens
<code class="language-bash">
./ -n document.pdf
./ -s objstm document.pdf

# decode stream objects ('-f' = filter)
./ -s objstm -f document.pdf

# force '' to parse the output of above (even though it's
# missing a proper PDF header)
./ -s objstm -f document.pdf | ./ -n -f

# which is (I think?) is roughly the same as
./ -a -O document.pdf
pdf  parser  reversing  reverseengineering  forensic  malware  analysis  commandline  python  video  streamobject  solution 
11 weeks ago by kme
Decompress FlateDecode Objects in PDF
Tips on how to get working in Python 3 here:

<code class="language-python">import re
import zlib

pdf = open("some_doc.pdf", "rb").read()
stream = re.compile(r'.*?FlateDecode.*?stream(.*?)endstream', re.S)

for s in stream.findall(pdf):
s = s.strip('\r\n')
python  pdf  reversing  forensics  objectstream  flatedecode  zlib 
11 weeks ago by kme
How To Create Fillable PDF Forms With LibreOffice Writer - Linux Uprising Blog
LibreOffice Writer can be used to create fillable PDF forms, being a great free, open source alternative to Adobe's Acrobat for this use case. LibreOffice is cross-platform too, so you can use it not only on Windows and macOS, but also on Linux.
pdf  libreoffice  filloutforms  tipsandtricks  howto 
june 2019 by kme
GitHub - jeromerobert/pdfarranger: Small python-gtk application, which helps the user to merge or split pdf documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface
Small python-gtk application, which helps the user to merge or split pdf documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface - jeromerobert/pdfarranger
pdf  gui  pygtk  python  utility  software 
june 2019 by kme
How to code Adobe JavaScript, how to code PDF JavaScript - Adobe Acrobat -

This works in Chrome and Firefox's built-in PDF viewers, too.
pdf  hyperlink  url  anchor  webdevel  dammitbrain  solution 
january 2019 by kme
PDFtk Server Examples
Remove page 13 from in1.pdf to create out1.pdf

pdftk in.pdf cat 1-12 14-end output out1.pdf


pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf
pdf  commandline  essential  reference  solution 
december 2017 by kme
Create a single pdf from multiple text, images or pdf files - Ask Ubuntu
If you're willing to use a terminal, you can do:

convert image1.jpg image2.png text.txt PDFfile.pdf outputFileName.pdf
imageprocessing  jpg  pdf  solution 
september 2016 by kme
http headers - How to force files to open in browser instead of download (pdf)? - Stack Overflow
Content-Type: application/pdf
Content-Disposition: inline; filename="filename.pdf"

Example for Apache (force download instead of inline):
<FilesMatch "\.(?i:pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
apache  contentdisposition  pdf  webmaster  configuration  maybesolution 
february 2016 by kme
ghostscript - How to convert a PDF to grayscale from command line avoiding to be rasterized? - Stack Overflow -
gs \
-sDEVICE=pdfwrite \
-sProcessColorModel=DeviceGray \
-sColorConversionStrategy=Gray \
-dOverrideICC \
-o out.pdf \
-f page-27.pdf
ghostscript  pdf  commandline  conversion  solution 
november 2015 by kme
Firefox exploit found in the wild | Mozilla Security Blog
The vulnerability comes from the interaction of the mechanism that enforces JavaScript context separation (the “same origin policy”) and Firefox’s PDF Viewer. Mozilla products that don’t contain the PDF Viewer, such as Firefox for Android, are not vulnerable. The vulnerability does not enable the execution of arbitrary code but the exploit was able to inject a JavaScript payload into the local file context. This allowed it to search for and upload potentially sensitive local files.

The files it was looking for were surprisingly developer focused for an exploit launched on a general audience news site, though of course we don’t know where else the malicious ad might have been deployed. On Windows the exploit looked for subversion, s3browser, and Filezilla configurations files, .purple and Psi+ account information, and site configuration files from eight different popular FTP clients. On Linux the exploit goes after the usual global configuration files like /etc/passwd, and then in all the user directories it can access it looks for .bash_history, .mysql_history, .pgsql_history, .ssh configuration files and keys, configuration files for remina, Filezilla, and Psi+, text files with “pass” and “access” in the names, and any shell scripts. Mac users are not targeted by this particular exploit but would not be immune should someone create a different payload. [Update: we’ve now seen variants that do have a Mac section, looking for much the same kinds of files as on Linux.]
firefox  exploit  pdf 
november 2015 by kme - zathura
504 Gateway Time-out as of 2019-07-13.
latex  pdf  viewer  linux  opensource 
june 2015 by kme
Ask Slashdot: Best PDF Handling Library? - Slashdot
Because maybe it's not his first project? Fine, let me ask you: how many times did you get burned by totally unmaintainable third-party dependencies, before you vowed "NEVER AGAIN will I get so utterly fucked over?"

Was your fifth project the one where you couldn't ever port to a new architecture or OS, or was it the one where the only company who had the source, went into bankruptcy and it took years for the liquidation to happen and you never really figured out where the assets are? No wait, your fifth project was the one where they just withdrew it from the market for "strategic reasons" and you never found out why and there was no replacement. Ah, then there was the race condition that you knew you could find if only you could read through the code, but the sole developer didn't even know what "race condition" means so he ignored your bug report. And the time the DRM server incorectly said the API key had expired so you didn't get any sales that day. Then there was that time you had the source but weren't allowed to change some parts of it: I loved the comment "by reading this you are violating the License Agreement" followed by the base64 string of dynamically interpreted code. Of course you violated the agreement, and decoded it: finding a bug you weren't allowed to fix. And of course let's not forget the time the developer might have actually hypothetically allowed the code to be maintained or might have even done it himself, but he had lost it, the one and only copy in the entire world, which had been used to compile the code that literally tens of thousands of people were depending on. That one's a classic, almost right up there with the vendor who died, taking all his customers' hopes of maintenance with him to the grave.

Holy crap. I get why the public doesn't know to demand Free Software. Even smart people can be uninformed or lack expertise outside their areas. But developers, really? You have to be LITERALLY STUPID to not see "open source" as at least a major advantage, if not necessarily always the winner. Maybe it's not always a solid requirement, but if you don't always at least start your searches that way and try to get something that at least can be maintained, then yes, you're a moron.

"Oh no, I'm not a moron," you explain, "I just happen to think that some large projects aren't ever going to need maintenance, because surely it's simple enought that a good programmer will get everything right the first time." You're right: you're not a moron; you're an imbecil. Sorry about the mistake.

I've found these tools useful, with an honorable mention to gnupdf. I've never used it personally, but the code looks pretty solid. That said, when I really needed to produce great multilingual PDF I pulled out the PDF spec, gritted my teeth, and generated it directly.

leptonica - turn images into PDF
tesseract - turn images into searchable PDF
qpdf - linearize PDF for random access over HTTP
jhove - basic validation
jhove-pdf-a - validation with better compatibility guarantees
pdftk - command line tool for splicing pages together or apart
ttx/FontTools - tool for modifying custom fonts
reportlab - python library, easy to use but works best with Latin scripts
score5insightful  pdf  opensource  advice  library  devel 
october 2014 by kme
See also:
unix  sysadmin  cheatsheet  pdf  shell  reference 
july 2014 by kme
r - knitr pandoc: "cannot produce pdf output with pdf writer" - Stack Overflow
So the solution is to leave off the "-w <format>" and just give it "-o filename.pdf"
pandoc  latex  pdf  textprocessing  typesettings  solution 
july 2014 by kme
« earlier      
per page:    204080120160

Copy this bookmark:

to read