SlideShare a Scribd company logo
1 of 43
Finding the Weak
Link in Windows
Binaries
Source Conference, Boston – April 18, 2012
Overview

•What?
•Why?
•How?
•Conclusions
What?
What?

   Without debug symbols or source
   code identify Windows binaries
   that do not leverage the
   available defenses
What?
• OS provided defenses
• Compiler provided defenses
• Compiler enabled defenses
• Linker enabled defenses
• Developer enabled defenses
• Developer secure coding practices
What?
• Version of compiler / linker
• Compiler / linker enabled protections
 • ASLR
 • DEP (NX)
 • Stack cookies
 • Safe Structured Exception Handling
• Developer used defensive APIs
 • Heap corruption behavior, DEP policy
 • DLL planting, pointer encoding
What?
• SDL banned APIs
• Dangerous APIs
 • undermining compiler/linker protections
• UAC / Integrity Level - Developer
• .NET security - Developer
 • Unmanaged code
 • Strong names
 • Partially trusted callers
Why?
Why? - Defensive
• A product == many vendors
 • e.g. Adobe Reader 10.0 == [guess?]
• License != source code
• License != private symbols
• SDL assurance…
 • getting the free security features enabled
• End user assurance / threat awareness
 • Understanding where you need EMET
Or put another way
• A vendors SDL is not enough
 • doesn’t always flow upstream
• A vendor who ships doesn’t assure
 • all third party components
• End user organisations taking ownership
 • of risk
 • of mitigations
Why? - Offensive
• Mitigations are expensive / difficult
• Application specific bugs are expensive
• Maximize research ROI
 • if your goal is to exploit
 • … find the weak link
 • … reduce headaches
Or put another way
• IIS 7.5 FTP DoS
• Chris Valasek / Ryan Smith school us
 • ‘Modern Heap Exploitation using the Low
   Fragmentation Heap’
• Achieved EIP
• … still no win … ASLR
• … lets minimize the tears …
• … unless you want to info leak to win …
How?
Version of Compiler / Linker
• Linker version in the PE header


• ‘Rich’ header
 • Microsoft compiler specific
 • documented in 29a virus e-zine in 2004
 • further documented in 2008
 • embeds compiler IDs
 • XOR encoded
Version of Compiler / Linker
Version of Compiler / Linker
• Version mapping exercise undertaken in
  January 2010
• Visual Studio 6 -> Visual Studio 2010 mapped
• Why?
 • Missing compiler protections
 • Weaker compiler protections
Compiler / Linker Protections
• ASLR compatibility – PE header



• Data Execution Prevention – PE header




 • always on for 64bit no matter what
Compiler / Linker Protections
• Stack Cookies – PE Header, Imports and
  Heuristics



 • imports
   • _crt_debugger_hook
 • heuristics – GS function epilogue / prologue
   • allows versioning
   • using FLIRT like signatures
Compiler / Linker Protections
• SafeSEH – PE header (32bit only)
 • SEH == Structured Exception Handling
Compiler / Linker Protections
• Load Configuration Directory size
 • If size of directory entry <> 64 then MS12-001
    • NOT the size field in the LCD!
 • Microsoft Visual C msvcr71.dll == 72
 • Anything built with Microsoft Visual C++ .NET
   2003 RTM
    • suprising amount of stuff
Default Process Heap
• Default process heap executable
 • PE header
Shared Sections
• Shared sections executable & writeable
 • PE header
 • would be mapped across processes
Defensive APIs
• HeapSetInformation
  • HeapEnableTerminationOnCorr
    uption
• SetProcessDEPPolicy
 • PROCESS_DEP_ENABLE
• EncodePointer
SDL Banned APIs
• Microsoft SDL banned APIs
 • parse the Import Address Table
 • 145 or them
 • indication of security awareness
Dangerous APIs
• VirtualAlloc
 • doesn’t benefit from ASLR
 • if mapping pages executable == win
 • we released VirtualAlloc_s.h
• LoadLibrary
 • if DLL planting mitigations aren’t used
DLL / Executable Planting
• Use of LoadLibrary /
  CreateProcess
• But doesn’t use
 • SetDLLDirectory
 • SetDefaultDllDirectories
 • AddDllDirectory
• There is also a registry key
 • more on this later
UAC / Integrity Level
• In the binaries manifest
.NET Security
• Strong name checks
• Allow partially trusted callers
 • AllowPartiallyTrustedCallersA
   ttribute
.NET Security
App Containers
• New for Windows 8
 • a new DLL characteristic
• Manifest
 • detailing capabilities
• … for more information refer to our blog …
Miscellaneous
• Force Integrity



• Company
 • File Version resource section
• Signer
• Signature type
Existing tools….
Existing Tools - LookingGlass
• from Errata Security
 • http://www.erratasec.com/
• .NET Based PE Scanner
 • Scans the file system or running processes
• Limitations in checks
 • No /SafeSEH
 • No /GS
 • No HeapSetInformation /
   SetProcessDEPPolicy
Existing Tools - BinScope
• from Microsoft
  • http://www.microsoft.com/download/en/d
    etails.aspx?id=11910
• Lots of checks
 • some of what I’ve discussed, but not all!
• Some Extra
  • non-GS friendly initialization / coverage
  • ATL version and vulnerable check
• Needs private symbols!
New tool…
Demo Recx SDL Binary Assure
Beyond binaries
• Defense in depth features via the registry
• Needs installer teams buy-in
• or after market adoption
• Image Execution Options
 • MitigationOptions
 • CWDIllegalInDllSearch
 • DisableExceptionChainValidation
But ….
But even with all these…
Bonus Material - ELF
• Similar(ish) tool exists for ELF
  • readelf && a
    shell script (checksec.h
    @ trapkit.de)
• RPATH / RUNPATH
  • contained in a section of an ELF
  • can override library locations
  • path doesn’t exist and
    you can create == win
  • added to checksec.sh
Conclusions….
Conclusions
• Lot of information available in binaries
• Help with assurance / assessment
 • for vendors and / or end organisations
• Help with target identification
 • target lower hanging fruit
 • less SDL aware components
• Without the use of symbols…
Thanks! Questions?




 Research, Develop, Assess, Consult & Educate
  https://www.surveymonkey.com/sourceboston12


  @RecxLtd                       ollie@recx.co.uk

More Related Content

Recently uploaded

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Recently uploaded (20)

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

Featured

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
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

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...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

2012 04-18 --source_boston_-_finding_the_weak_link_in_windows_binaries

  • 1. Finding the Weak Link in Windows Binaries Source Conference, Boston – April 18, 2012
  • 4. What? Without debug symbols or source code identify Windows binaries that do not leverage the available defenses
  • 5. What? • OS provided defenses • Compiler provided defenses • Compiler enabled defenses • Linker enabled defenses • Developer enabled defenses • Developer secure coding practices
  • 6. What? • Version of compiler / linker • Compiler / linker enabled protections • ASLR • DEP (NX) • Stack cookies • Safe Structured Exception Handling • Developer used defensive APIs • Heap corruption behavior, DEP policy • DLL planting, pointer encoding
  • 7. What? • SDL banned APIs • Dangerous APIs • undermining compiler/linker protections • UAC / Integrity Level - Developer • .NET security - Developer • Unmanaged code • Strong names • Partially trusted callers
  • 9. Why? - Defensive • A product == many vendors • e.g. Adobe Reader 10.0 == [guess?] • License != source code • License != private symbols • SDL assurance… • getting the free security features enabled • End user assurance / threat awareness • Understanding where you need EMET
  • 10. Or put another way • A vendors SDL is not enough • doesn’t always flow upstream • A vendor who ships doesn’t assure • all third party components • End user organisations taking ownership • of risk • of mitigations
  • 11. Why? - Offensive • Mitigations are expensive / difficult • Application specific bugs are expensive • Maximize research ROI • if your goal is to exploit • … find the weak link • … reduce headaches
  • 12. Or put another way • IIS 7.5 FTP DoS • Chris Valasek / Ryan Smith school us • ‘Modern Heap Exploitation using the Low Fragmentation Heap’ • Achieved EIP • … still no win … ASLR • … lets minimize the tears … • … unless you want to info leak to win …
  • 13. How?
  • 14. Version of Compiler / Linker • Linker version in the PE header • ‘Rich’ header • Microsoft compiler specific • documented in 29a virus e-zine in 2004 • further documented in 2008 • embeds compiler IDs • XOR encoded
  • 16. Version of Compiler / Linker • Version mapping exercise undertaken in January 2010 • Visual Studio 6 -> Visual Studio 2010 mapped • Why? • Missing compiler protections • Weaker compiler protections
  • 17. Compiler / Linker Protections • ASLR compatibility – PE header • Data Execution Prevention – PE header • always on for 64bit no matter what
  • 18. Compiler / Linker Protections • Stack Cookies – PE Header, Imports and Heuristics • imports • _crt_debugger_hook • heuristics – GS function epilogue / prologue • allows versioning • using FLIRT like signatures
  • 19. Compiler / Linker Protections • SafeSEH – PE header (32bit only) • SEH == Structured Exception Handling
  • 20. Compiler / Linker Protections • Load Configuration Directory size • If size of directory entry <> 64 then MS12-001 • NOT the size field in the LCD! • Microsoft Visual C msvcr71.dll == 72 • Anything built with Microsoft Visual C++ .NET 2003 RTM • suprising amount of stuff
  • 21. Default Process Heap • Default process heap executable • PE header
  • 22. Shared Sections • Shared sections executable & writeable • PE header • would be mapped across processes
  • 23. Defensive APIs • HeapSetInformation • HeapEnableTerminationOnCorr uption • SetProcessDEPPolicy • PROCESS_DEP_ENABLE • EncodePointer
  • 24. SDL Banned APIs • Microsoft SDL banned APIs • parse the Import Address Table • 145 or them • indication of security awareness
  • 25. Dangerous APIs • VirtualAlloc • doesn’t benefit from ASLR • if mapping pages executable == win • we released VirtualAlloc_s.h • LoadLibrary • if DLL planting mitigations aren’t used
  • 26. DLL / Executable Planting • Use of LoadLibrary / CreateProcess • But doesn’t use • SetDLLDirectory • SetDefaultDllDirectories • AddDllDirectory • There is also a registry key • more on this later
  • 27. UAC / Integrity Level • In the binaries manifest
  • 28. .NET Security • Strong name checks • Allow partially trusted callers • AllowPartiallyTrustedCallersA ttribute
  • 30. App Containers • New for Windows 8 • a new DLL characteristic • Manifest • detailing capabilities • … for more information refer to our blog …
  • 31. Miscellaneous • Force Integrity • Company • File Version resource section • Signer • Signature type
  • 33. Existing Tools - LookingGlass • from Errata Security • http://www.erratasec.com/ • .NET Based PE Scanner • Scans the file system or running processes • Limitations in checks • No /SafeSEH • No /GS • No HeapSetInformation / SetProcessDEPPolicy
  • 34. Existing Tools - BinScope • from Microsoft • http://www.microsoft.com/download/en/d etails.aspx?id=11910 • Lots of checks • some of what I’ve discussed, but not all! • Some Extra • non-GS friendly initialization / coverage • ATL version and vulnerable check • Needs private symbols!
  • 36. Demo Recx SDL Binary Assure
  • 37. Beyond binaries • Defense in depth features via the registry • Needs installer teams buy-in • or after market adoption • Image Execution Options • MitigationOptions • CWDIllegalInDllSearch • DisableExceptionChainValidation
  • 39. But even with all these…
  • 40. Bonus Material - ELF • Similar(ish) tool exists for ELF • readelf && a shell script (checksec.h @ trapkit.de) • RPATH / RUNPATH • contained in a section of an ELF • can override library locations • path doesn’t exist and you can create == win • added to checksec.sh
  • 42. Conclusions • Lot of information available in binaries • Help with assurance / assessment • for vendors and / or end organisations • Help with target identification • target lower hanging fruit • less SDL aware components • Without the use of symbols…
  • 43. Thanks! Questions? Research, Develop, Assess, Consult & Educate https://www.surveymonkey.com/sourceboston12 @RecxLtd ollie@recx.co.uk