SlideShare uma empresa 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?

Mais conteúdo relacionado

Último

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Último (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Destaque

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
 

Destaque (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 do 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!