2
Most read
11
Most read
12
Most read
Analysis of malicious PDF
by
Abdul Adil
Open Info.sec Community
Disclaimer: Either me or the organizers are not responsible for any damages or any sort of actions that you made with the provided information.
Who am i?
• Information security enthusiast & Developer.
• Certified in OCJP ,CEH.
• You can reach me at:
Codestudio8.wordpress.com
Linkedin.com/in/abduladil02
Facebook.com/abduladil02
Twitter.com/abduladil02
Abdul.Adil@connectica.in or AbdulAdil02@gmail.com
What your going learn?
• What is a pdf?
• Internals of PDF.
• Strings of pdf.
• Scanning pdf’s with virus total.
• Demo.
• Conclusion.
What is a pdf?
• It stands for Portable Document Format(PDF).
• Extension of portable document format is “.pdf”.
• Is a file format used to present documents in a manner independent
of application software, hardware, and operating systems.
• Developed by Adobe Systems in the year 1991.
• Interactive features like acroforms , rich media…
• Current version of pdf is 1.7 was released in 2011.
First Malware of PDF
• PDF attachments carrying viruses were first discovered in 2001.
• The virus, named OUTLOOK.PDFWorm or Peachy, uses Microsoft
Outlook to send itself as an attachment to an Adobe PDF file.
• It was activated with Adobe Acrobat, but not with Acrobat Reader.
Structure of pdf
Internals of pdf
• Header: this probably the most simple section. It is made of a single line which specifies the PDF language
version eg:1.1.
• Body: which generally contains the most part of the PDF code. This section is made of a list of objects which
describes how the final document will look.
• cross reference table: this table contains all the data required to the PDF management software (e.g. a
reader) in order to access directly any document object without having to read throughout the file to find
this object. Starts with ‘Xref’.
• Trailer: Any PDF software management application always begins to read from the end of the file where this
last section is located. The trailer contains different essential data, which are from the top to the bottom of
the trailer:
a. the number of objects contained in the file (field /Size),
b. the ID of the file root document (field /Root),
c. the offset (in bytes) of the cross reference table (the line just above the %%EOF line).
Xref table structure
14 objects
Object is free
Object is in use
Take a close look before you proceed!
Tools to analyze pdf files
• You can download from http://blog.didierstevens.com/programs/pdf-tools/
• Pdf-parser.py: This tool will parse a PDF document to identify the fundamental elements used in
the analyzed file. It will not render a PDF document.
• Pdfid.py: This tool is not a PDF parser, but it will scan a file to look for certain PDF keywords,
allowing you to identify PDF documents that contain (for example) JavaScript or execute an action
when opened. PDFiD will also handle name obfuscation.
• Other tools:PeePdf.py
• Online tools:
a. Virustotal.com
b. wepawet(http://wepawet.iseclab.org)
c. pdfexaminer(www.malwaretracker.com)
d. jsunpack.jeek.org
e. pdf stream dumper.
Strings in pdf
• obj,endobj,stream,endstream,xref,trailer,startxref,/Page,/Encrypt,/Obj
Stm,/JS,/JavaScript,/AA,/OpenAction,/JBIG2Decode,/RichMedia,/Laun
ch,/XFA.
• Almost every PDF documents will contain the first 7 words (obj
through startxref), and to a lesser extent stream and endstream.
• /Page gives an indication of the number of pages in the PDF
document. Most malicious PDF document have only one page eg.You
won a lottery mail.
• /Encrypt indicates that the PDF document has DRM or needs a
password to be read.
• /ObjStm counts the number of object streams. An object stream is a
stream object that can contain other objects, and can therefore be
used to obfuscate objects (by using different filters).
Strings in pdf
• /JS and /JavaScript indicate that the PDF document contains
JavaScript. Almost all malicious PDF documents that I’ve found in the
wild contain JavaScript (to exploit a JavaScript vulnerability and/or to
execute a heap spray). Of course, you can also find JavaScript in PDF
documents without malicious intend.
• /AA and /OpenAction indicate an automatic action to be performed
when the page/document is viewed. All malicious PDF documents
with JavaScript I’ve seen in the wild had an automatic action to
launch the JavaScript without user interaction.
Demo
• Let’s see a demo
1.Pdf-parser.py
2.pdfid.py
3.Peepdf
4.Metasploit
Just a glance malicious action snippet
Drawbacks in pdfid.py
• Because PDFiD is just a string scanner (supporting name obfuscation),
it will also generate false positives. For example, a simple text file
starting with %PDF-1.1 and containing words from the list will also be
identified as a PDF document.
What you can do?
• Scan pdf files with anti-malware application.
• Scan with online scanners like virustotal.com and malwr.com(cuckoo).
You can’t stop stupidity!!
Analysis of malicious pdf

More Related Content

PPTX
API Security Fundamentals
PDF
FortiGate Firewall HOW-TO - DMZ
PPT
Proxy Server
PDF
Introduction to Web Application Penetration Testing
ODP
19.cobra
PDF
Discover the All new DocuSign Developer Center
PPTX
Building a REST Service in minutes with Spring Boot
PDF
API Security Best Practices and Guidelines
API Security Fundamentals
FortiGate Firewall HOW-TO - DMZ
Proxy Server
Introduction to Web Application Penetration Testing
19.cobra
Discover the All new DocuSign Developer Center
Building a REST Service in minutes with Spring Boot
API Security Best Practices and Guidelines

What's hot (20)

PDF
OAuth 2.0の概要とセキュリティ
PDF
Introduction to API
PPSX
Ids 005 computer viruses
PPTX
Dependency injection presentation
PPTX
Proxy Presentation
PPTX
Soap web service
PDF
Swagger With REST APIs.pptx.pdf
PPTX
API Presentation
PDF
API Security Best Practices & Guidelines
PPTX
Mobile security part 1(Android Apps Pentesting)- Romansh yadav
PDF
Api security-testing
PPTX
Training: MVVM Pattern
PPT
Command Design Pattern
PPTX
What is Swagger?
PPTX
SQL Injections - A Powerpoint Presentation
PDF
Malicious software
PPT
Introduction to the Web API
PPTX
Sql injection
PDF
OWASP Top 10 Vulnerabilities - A5-Broken Access Control; A6-Security Misconfi...
PPTX
REST & RESTful Web Services
OAuth 2.0の概要とセキュリティ
Introduction to API
Ids 005 computer viruses
Dependency injection presentation
Proxy Presentation
Soap web service
Swagger With REST APIs.pptx.pdf
API Presentation
API Security Best Practices & Guidelines
Mobile security part 1(Android Apps Pentesting)- Romansh yadav
Api security-testing
Training: MVVM Pattern
Command Design Pattern
What is Swagger?
SQL Injections - A Powerpoint Presentation
Malicious software
Introduction to the Web API
Sql injection
OWASP Top 10 Vulnerabilities - A5-Broken Access Control; A6-Security Misconfi...
REST & RESTful Web Services
Ad

Viewers also liked (20)

PPTX
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
PPTX
Hunting before a Known Incident
PPTX
Hunting on the Cheap
PPTX
PDF
Heartbleed by-danish amber
PDF
z/OS Communications Server: z/OS Resolver
PPTX
Newsbytes_NULLHYD_Dec
PDF
Nomadic Display Setup Fabri Mural
PPSX
Función BUSCARV
PDF
Investor alert—investment scams exploit immigrant investor program
PDF
World Cup! Young Germany Guest Blogging
DOC
So you want to retire in florida 1997 far
PDF
Xss 101 by-sai-shanthan
PPTX
Uga Webinar Series: building credibility as a young professional
DOC
Buying a business in florida
PPTX
Example problems
PPTX
Example problems Binomial Multiplication
PPT
Null dec 2014
PDF
Security News Bytes
PPTX
UGA Guest Lecture: Social Media 101
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
Hunting before a Known Incident
Hunting on the Cheap
Heartbleed by-danish amber
z/OS Communications Server: z/OS Resolver
Newsbytes_NULLHYD_Dec
Nomadic Display Setup Fabri Mural
Función BUSCARV
Investor alert—investment scams exploit immigrant investor program
World Cup! Young Germany Guest Blogging
So you want to retire in florida 1997 far
Xss 101 by-sai-shanthan
Uga Webinar Series: building credibility as a young professional
Buying a business in florida
Example problems
Example problems Binomial Multiplication
Null dec 2014
Security News Bytes
UGA Guest Lecture: Social Media 101
Ad

Similar to Analysis of malicious pdf (20)

PDF
Convolutional Neural Networks
PDF
José Miguel Esparza - Obfuscation and (non-)detection of malicious PDF files ...
PPTX
Content Type Attack Dark Hole in the Secure Environment by Raman Gupta
PDF
Malicious pdf document detection based on feature extraction and entropy
PPTX
Two-For-One Talk: Malware Analysis for Everyone
PPT
Client Side Exploits Using Pdf
PDF
PDF: myths vs facts
PDF
CheckPDF77
PDF
Hiding Malicious Content in PDF Documents
PDF
Advanced Pdf Tricks
PPT
Client Side Exploits using PDF
PDF
An overview of potential leaks via PDF
PDF
PDF secrets - hiding & revealing secrets in PDF documents
PDF
PDF - Secrets - 140519092839-phpapp01
PDF
Messing with binary formats
PDF
Don't just pdf, Smart PDF
PDF
Keith J. Jones, Ph.D. - Crash Course malware analysis
PDF
Zero day-malware-protection-brief-2607983
DOC
Cutting out Malware
PPT
Convolutional Neural Networks
José Miguel Esparza - Obfuscation and (non-)detection of malicious PDF files ...
Content Type Attack Dark Hole in the Secure Environment by Raman Gupta
Malicious pdf document detection based on feature extraction and entropy
Two-For-One Talk: Malware Analysis for Everyone
Client Side Exploits Using Pdf
PDF: myths vs facts
CheckPDF77
Hiding Malicious Content in PDF Documents
Advanced Pdf Tricks
Client Side Exploits using PDF
An overview of potential leaks via PDF
PDF secrets - hiding & revealing secrets in PDF documents
PDF - Secrets - 140519092839-phpapp01
Messing with binary formats
Don't just pdf, Smart PDF
Keith J. Jones, Ph.D. - Crash Course malware analysis
Zero day-malware-protection-brief-2607983
Cutting out Malware

More from Raghunath G (17)

PPSX
Securitynewsbytes
PPT
Whats app forensic
PPTX
Seh based exploitation
PPSX
Securitynewsbytes april2015-150418153901-conversion-gate01
PDF
Raspberry pi 2
PPTX
Mobile application security 101
PPTX
Security News Bytes
PPTX
Is iso 27001, an answer to security
PDF
Null HYD Playing with shodan null
PDF
Null HYD VRTDOS
PPTX
Metasploit
PDF
Null July - OWTF - Bharadwaj Machiraju
PPTX
Decoy documents
PDF
Spear phishing attacks-by-hari_krishna
PDF
Social engineering by-rakesh-nagekar
PDF
Netcat 101 by-mahesh-beema
PDF
The art of_firewalking-by-sujay
Securitynewsbytes
Whats app forensic
Seh based exploitation
Securitynewsbytes april2015-150418153901-conversion-gate01
Raspberry pi 2
Mobile application security 101
Security News Bytes
Is iso 27001, an answer to security
Null HYD Playing with shodan null
Null HYD VRTDOS
Metasploit
Null July - OWTF - Bharadwaj Machiraju
Decoy documents
Spear phishing attacks-by-hari_krishna
Social engineering by-rakesh-nagekar
Netcat 101 by-mahesh-beema
The art of_firewalking-by-sujay

Recently uploaded (20)

PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
Trump Administration's workforce development strategy
PDF
Uderstanding digital marketing and marketing stratergie for engaging the digi...
PDF
Complications of Minimal Access-Surgery.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
My India Quiz Book_20210205121199924.pdf
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
Empowerment Technology for Senior High School Guide
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
Unit 4 Computer Architecture Multicore Processor.pptx
Trump Administration's workforce development strategy
Uderstanding digital marketing and marketing stratergie for engaging the digi...
Complications of Minimal Access-Surgery.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Share_Module_2_Power_conflict_and_negotiation.pptx
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
202450812 BayCHI UCSC-SV 20250812 v17.pptx
TNA_Presentation-1-Final(SAVE)) (1).pptx
My India Quiz Book_20210205121199924.pdf
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Cambridge-Practice-Tests-for-IELTS-12.docx
Empowerment Technology for Senior High School Guide
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Weekly quiz Compilation Jan -July 25.pdf
Environmental Education MCQ BD2EE - Share Source.pdf

Analysis of malicious pdf

  • 1. Analysis of malicious PDF by Abdul Adil Open Info.sec Community Disclaimer: Either me or the organizers are not responsible for any damages or any sort of actions that you made with the provided information.
  • 2. Who am i? • Information security enthusiast & Developer. • Certified in OCJP ,CEH. • You can reach me at: Codestudio8.wordpress.com Linkedin.com/in/abduladil02 Facebook.com/abduladil02 Twitter.com/abduladil02 [email protected] or [email protected]
  • 3. What your going learn? • What is a pdf? • Internals of PDF. • Strings of pdf. • Scanning pdf’s with virus total. • Demo. • Conclusion.
  • 4. What is a pdf? • It stands for Portable Document Format(PDF). • Extension of portable document format is “.pdf”. • Is a file format used to present documents in a manner independent of application software, hardware, and operating systems. • Developed by Adobe Systems in the year 1991. • Interactive features like acroforms , rich media… • Current version of pdf is 1.7 was released in 2011.
  • 5. First Malware of PDF • PDF attachments carrying viruses were first discovered in 2001. • The virus, named OUTLOOK.PDFWorm or Peachy, uses Microsoft Outlook to send itself as an attachment to an Adobe PDF file. • It was activated with Adobe Acrobat, but not with Acrobat Reader.
  • 7. Internals of pdf • Header: this probably the most simple section. It is made of a single line which specifies the PDF language version eg:1.1. • Body: which generally contains the most part of the PDF code. This section is made of a list of objects which describes how the final document will look. • cross reference table: this table contains all the data required to the PDF management software (e.g. a reader) in order to access directly any document object without having to read throughout the file to find this object. Starts with ‘Xref’. • Trailer: Any PDF software management application always begins to read from the end of the file where this last section is located. The trailer contains different essential data, which are from the top to the bottom of the trailer: a. the number of objects contained in the file (field /Size), b. the ID of the file root document (field /Root), c. the offset (in bytes) of the cross reference table (the line just above the %%EOF line).
  • 8. Xref table structure 14 objects Object is free Object is in use
  • 9. Take a close look before you proceed!
  • 10. Tools to analyze pdf files • You can download from http://blog.didierstevens.com/programs/pdf-tools/ • Pdf-parser.py: This tool will parse a PDF document to identify the fundamental elements used in the analyzed file. It will not render a PDF document. • Pdfid.py: This tool is not a PDF parser, but it will scan a file to look for certain PDF keywords, allowing you to identify PDF documents that contain (for example) JavaScript or execute an action when opened. PDFiD will also handle name obfuscation. • Other tools:PeePdf.py • Online tools: a. Virustotal.com b. wepawet(http://wepawet.iseclab.org) c. pdfexaminer(www.malwaretracker.com) d. jsunpack.jeek.org e. pdf stream dumper.
  • 11. Strings in pdf • obj,endobj,stream,endstream,xref,trailer,startxref,/Page,/Encrypt,/Obj Stm,/JS,/JavaScript,/AA,/OpenAction,/JBIG2Decode,/RichMedia,/Laun ch,/XFA. • Almost every PDF documents will contain the first 7 words (obj through startxref), and to a lesser extent stream and endstream. • /Page gives an indication of the number of pages in the PDF document. Most malicious PDF document have only one page eg.You won a lottery mail. • /Encrypt indicates that the PDF document has DRM or needs a password to be read. • /ObjStm counts the number of object streams. An object stream is a stream object that can contain other objects, and can therefore be used to obfuscate objects (by using different filters).
  • 12. Strings in pdf • /JS and /JavaScript indicate that the PDF document contains JavaScript. Almost all malicious PDF documents that I’ve found in the wild contain JavaScript (to exploit a JavaScript vulnerability and/or to execute a heap spray). Of course, you can also find JavaScript in PDF documents without malicious intend. • /AA and /OpenAction indicate an automatic action to be performed when the page/document is viewed. All malicious PDF documents with JavaScript I’ve seen in the wild had an automatic action to launch the JavaScript without user interaction.
  • 13. Demo • Let’s see a demo 1.Pdf-parser.py 2.pdfid.py 3.Peepdf 4.Metasploit
  • 14. Just a glance malicious action snippet
  • 15. Drawbacks in pdfid.py • Because PDFiD is just a string scanner (supporting name obfuscation), it will also generate false positives. For example, a simple text file starting with %PDF-1.1 and containing words from the list will also be identified as a PDF document.
  • 16. What you can do? • Scan pdf files with anti-malware application. • Scan with online scanners like virustotal.com and malwr.com(cuckoo).
  • 17. You can’t stop stupidity!!