SlideShare una empresa de Scribd logo
1 de 15
Anti-Virus Checking on File Upload
Testing and reporting the issue for web applications
Jerome Smith
15 May 2015
Methodology
Process
• Upload file…
• …and then download it!
• While upload may apparently succeed, download may fail (file empty etc.)
• Is the downloaded file the same?
• May be renamed
• Hashing constitutes good evidence
• If download unsupported, you can only speculate if upload produces no errors
Which file?
• Netcat?
• Metasploit payload?
• CryptoLocker?
• EICAR test file
EICAR
What % hit rate do you think this file got on VirusTotal?
• About 10% (6 out of 57)*
• AegisLab, Ikarus, Qihoo-360, SUPERAntiSpyware, TrendMicro and
TrendMicro-HouseCall
• So not a fair file with which to test someone’s AV capability!
* at 13/05/15 (and all other stats)
EICAR
Okay, what about this one?
• 95% (53 out of 56)
EICAR
And this one?
• 0% (0 out of 57)
• Document contains the signature but the raw file does not
EICAR
Now what about this one?
• 86% (49 out of 57)
Here’s the previous one:
• 95% (53 out of 56)
The EICAR Test File
http://www.eicar.org/86-0-Intended-use.html
• “The file is a legitimate DOS program”
• Its contents are printable ASCII but it is executable!
The EICAR Test File
http://www.eicar.org/86-0-Intended-use.html
• “Any anti-virus product that supports the EICAR test file should detect it in
any file providing that the file starts with the following 68 characters, and is
exactly 68 bytes long”
X5O!P%@AP[4PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
• “The first 68 characters is the known string. It may be optionally appended
by any combination of whitespace characters with the total file length not
exceeding 128 characters. The only whitespace characters allowed are the
space character, tab, LF, CR, CTRL-Z. To keep things simple the file uses
only upper case letters, digits and punctuation marks, and does not include
spaces.”
• So that last eicar.txt file ending with a CRLF was still a valid EICAR file
What’s in a name?
• “Any anti-virus product…should detect it in any file …”
• So filename should be irrelevant
• eicar.com renamed to:
• eicar.gif
• eicar.pdf
• a.b
• Same VirusTotal result
• Phew, otherwise of course malware could just be renamed to escape detection
Back to the EICAR Quiz
• The Word document from earlier had no hits
What if we prepend the EICAR signature?
• 46% (26 out of 56)
• “…providing that the file starts with the following 68 characters…”
• Signature instead added as last bytes = 1 out of 57
• Signature instead inserted in the middle(ish) = 1 out of 57
Play your eiCards Right
• These Word files were 12,772 bytes – a lot more than 68
• “…It may be optionally appended by any combination of whitespace
characters with the total file length not exceeding 128 characters…”
• Recall original document with signature prepended
• 46% (26 out of 56)
• Truncated to 112 bytes
• 61% (34 out of 56)
• Size right but characters after signature include non-whitespace
• Whitespace after signature
• 81% (46 out of 57)
• Corrupt whitespace with “test” at offset 0x50
• 75% (43 out of 57)
Signature Context
• Recall when signature added as last bytes to document
• 2% (1 out of 57)
• Shortened to last 112 bytes with whitespace preceding
• 14% (8 out of 57)
• Interrupt whitespace with “test” at offset 0x10
• 5% (3 out of 57)
Other Factors
• Let’s return to the original Word document with no hits
• Let’s PDF it
• No hits
• Recall Word document with EICAR signature prepended
• 46% (26 out of 56)
• PDF file with EICAR signature prepended
• 54% (31 out of 57)
• Similar effect on hit rate when the signature is moved, the file truncated etc.
• PDF from EICARgen (http://blog.didierstevens.com/programs/eicargen/)
• PDF opens a text document containing EICAR – essentially eicar.txt
• Just like ZIP files, this embedded file can be detected – PDF Stream Objects
• 55% (31 out of 56)
So what?
• As always, produce as much evidence as possible
• When speculating, say so!
• Client may be able to fill in the gaps, although ensure the report makes that clear!
• A screenshot of the test file used run through VirusTotal is great evidence
• Ensure the major AV players detect the file
• SHA-256 hash is part of the output: hash downloaded file to be sure
So what?
• In general, the closer a file meets the EICAR spec, the better the hit rate
• More than just a signature
• Location
• File size
• Other bytes
• Beyond this, who knows what logic differences account for different scanners results?
• For testing AV on upload, renaming the original EICAR file is the best approach
• But then file is no longer valid for most formats (PDF, JPG, DOCX etc.)
• If the app is doing file header analysis, file may be rejected
- Possible false negative if interpreted as AV working
- As EICAR signature preference is for the start, what can you do?
• If text files are supported, always use the original EICAR file as a .txt
• Many AVs detect EICAR overzealously with reference to spec
• To meet (misinformed) expectations?
• Is this dangerous behaviour? Could it be exploited?

Más contenido relacionado

Último

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Último (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Anti-Virus Checking on File Upload

  • 1. Anti-Virus Checking on File Upload Testing and reporting the issue for web applications Jerome Smith 15 May 2015
  • 2. Methodology Process • Upload file… • …and then download it! • While upload may apparently succeed, download may fail (file empty etc.) • Is the downloaded file the same? • May be renamed • Hashing constitutes good evidence • If download unsupported, you can only speculate if upload produces no errors Which file? • Netcat? • Metasploit payload? • CryptoLocker? • EICAR test file
  • 3. EICAR What % hit rate do you think this file got on VirusTotal? • About 10% (6 out of 57)* • AegisLab, Ikarus, Qihoo-360, SUPERAntiSpyware, TrendMicro and TrendMicro-HouseCall • So not a fair file with which to test someone’s AV capability! * at 13/05/15 (and all other stats)
  • 4. EICAR Okay, what about this one? • 95% (53 out of 56)
  • 5. EICAR And this one? • 0% (0 out of 57) • Document contains the signature but the raw file does not
  • 6. EICAR Now what about this one? • 86% (49 out of 57) Here’s the previous one: • 95% (53 out of 56)
  • 7. The EICAR Test File http://www.eicar.org/86-0-Intended-use.html • “The file is a legitimate DOS program” • Its contents are printable ASCII but it is executable!
  • 8. The EICAR Test File http://www.eicar.org/86-0-Intended-use.html • “Any anti-virus product that supports the EICAR test file should detect it in any file providing that the file starts with the following 68 characters, and is exactly 68 bytes long” X5O!P%@AP[4PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* • “The first 68 characters is the known string. It may be optionally appended by any combination of whitespace characters with the total file length not exceeding 128 characters. The only whitespace characters allowed are the space character, tab, LF, CR, CTRL-Z. To keep things simple the file uses only upper case letters, digits and punctuation marks, and does not include spaces.” • So that last eicar.txt file ending with a CRLF was still a valid EICAR file
  • 9. What’s in a name? • “Any anti-virus product…should detect it in any file …” • So filename should be irrelevant • eicar.com renamed to: • eicar.gif • eicar.pdf • a.b • Same VirusTotal result • Phew, otherwise of course malware could just be renamed to escape detection
  • 10. Back to the EICAR Quiz • The Word document from earlier had no hits What if we prepend the EICAR signature? • 46% (26 out of 56) • “…providing that the file starts with the following 68 characters…” • Signature instead added as last bytes = 1 out of 57 • Signature instead inserted in the middle(ish) = 1 out of 57
  • 11. Play your eiCards Right • These Word files were 12,772 bytes – a lot more than 68 • “…It may be optionally appended by any combination of whitespace characters with the total file length not exceeding 128 characters…” • Recall original document with signature prepended • 46% (26 out of 56) • Truncated to 112 bytes • 61% (34 out of 56) • Size right but characters after signature include non-whitespace • Whitespace after signature • 81% (46 out of 57) • Corrupt whitespace with “test” at offset 0x50 • 75% (43 out of 57)
  • 12. Signature Context • Recall when signature added as last bytes to document • 2% (1 out of 57) • Shortened to last 112 bytes with whitespace preceding • 14% (8 out of 57) • Interrupt whitespace with “test” at offset 0x10 • 5% (3 out of 57)
  • 13. Other Factors • Let’s return to the original Word document with no hits • Let’s PDF it • No hits • Recall Word document with EICAR signature prepended • 46% (26 out of 56) • PDF file with EICAR signature prepended • 54% (31 out of 57) • Similar effect on hit rate when the signature is moved, the file truncated etc. • PDF from EICARgen (http://blog.didierstevens.com/programs/eicargen/) • PDF opens a text document containing EICAR – essentially eicar.txt • Just like ZIP files, this embedded file can be detected – PDF Stream Objects • 55% (31 out of 56)
  • 14. So what? • As always, produce as much evidence as possible • When speculating, say so! • Client may be able to fill in the gaps, although ensure the report makes that clear! • A screenshot of the test file used run through VirusTotal is great evidence • Ensure the major AV players detect the file • SHA-256 hash is part of the output: hash downloaded file to be sure
  • 15. So what? • In general, the closer a file meets the EICAR spec, the better the hit rate • More than just a signature • Location • File size • Other bytes • Beyond this, who knows what logic differences account for different scanners results? • For testing AV on upload, renaming the original EICAR file is the best approach • But then file is no longer valid for most formats (PDF, JPG, DOCX etc.) • If the app is doing file header analysis, file may be rejected - Possible false negative if interpreted as AV working - As EICAR signature preference is for the start, what can you do? • If text files are supported, always use the original EICAR file as a .txt • Many AVs detect EICAR overzealously with reference to spec • To meet (misinformed) expectations? • Is this dangerous behaviour? Could it be exploited?

Notas del editor

  1. You don’t really want to upload something malicious or which could be construed to be malicious
  2. Hint: the cursor is at the end of the file
  3. Printable ASCII so it can be easily created Executed on XP SP3 though!
  4. http://blog.didierstevens.com/2008/05/19/pdf-stream-objects/
  5. Speculation – i.e. ensure report “client informed…”
  6. Logic differences, e.g. DOCS vs PDF with EICAR at front had different hit rates Dangerous behaviour Could you add EICAR sig to a known malicious file so AV says “EICAR test file, harmless” and a user may run it? Given that sig needs to be at front for effective detection, would it have to run like a COM file, in which case < Windows 7? Of course you could probably change the file in some way so the AV misses it altogether, which is better!