SlideShare a Scribd company logo
ACROS PUBLIC                                    © ACROS




               Advanced (Persistent)
               Binary Planting
               SOURCE Barcelona 2011




               Mitja Kolsek
               ACROS d.o.o.
               mitja.kolsek@acrossecurity.com
               www.acrossecurity.com
ACROS PUBLIC                Page 2               SOURCE Barcelona 2011




                   BINARY PLANTING
                   QUICK SUMMARY
               (DLL hijacking, DLL preloading,
                  Unsafe library loading...)
ACROS PUBLIC     Page 3              SOURCE Barcelona 2011




                          DLL, EXE


           you

                                bad guy
ACROS PUBLIC                             Page 4                       SOURCE Barcelona 2011



                                                            DLL Search Order


                    LoadLibrary(“SomeLib.dll”)

               1.   The directory from which the application loaded
               2.   C:WindowsSystem32
               3.   C:WindowsSystem
               4.   C:Windows
               5.   Current Working Directory (CWD)
               6.   PATH
ACROS PUBLIC                             Page 5                       SOURCE Barcelona 2011



                                                            EXE Search Order


                    CreateProcess(“SomeApp.exe”)

               1.   The directory from which the application loaded
               2.   Current Working Directory (CWD)
               3.   C:WindowsSystem32
               4.   C:WindowsSystem
               5.   C:Windows
               6.   PATH
ACROS PUBLIC                            Page 6                 SOURCE Barcelona 2011



                                                      EXE Search Order


                    ShellExecute(“SomeApp.exe”)

               1.   Current Working Directory (CWD)
               2.   C:WindowsSystem32
               3.   C:WindowsSystem
               4.   C:Windows
               5.   PATH
ACROS PUBLIC                                  Page 7                             SOURCE Barcelona 2011



                                                                  Our Past Research

      •    Extended scope: Launching EXEs
      •    Improved attack vector: WebDAV
      •    We looked at 200+ leading Windows apps
      •    Found 500+ binary planting bugs (120+ EXE, 400+ DLL)
      •    Guidelines for developers
               http://www.binaryplanting.com/guidelinesDevelopers.htm
      •    Guidelines for administrators
               http://www.binaryplanting.com/guidelinesAdministrators.htm
      •    Free Online Binary Planting Exposure Test
               http://www.binaryplanting.com/test.htm
      •    Advanced binary planting (COM-Servers)
               • Executing code through IE8 on Windows XP – two clicks only
               • Executing code through IE9 on Windows 7 – right click, add to archive
ACROS PUBLIC   Page 8   SOURCE Barcelona 2011
ACROS PUBLIC               Page 9              SOURCE Barcelona 2011




                      PERSISTENCE
                #1 - PERSISTENCE IN SOFTWARE
               #2 – PERSISTENCE ON COMPUTER
ACROS PUBLIC               Page 10       SOURCE Barcelona 2011




               #1 - PERSISTENCE IN SOFTWARE
                    (Everywhere You Look)
ACROS PUBLIC                       Page 11                   SOURCE Barcelona 2011



                             Microsoft (Sysinternals) Process Monitor




               1.   Filter: Path Contains <our-path>
               2.   Launch Application
               3.   Exclude irrelevant entries
               4.   Look for DLL and EXE accesses
               5.   Plant DLL/EXE
               6.   Re-launch Application
               7.   If successful, see call stack
ACROS PUBLIC                            Page 12                   SOURCE Barcelona 2011



                                                   Example: Real Player

                   I used to load
               rio500.dll from CWD.
                  Wait... I still do.




        Publicly reported in February 2010
        by Taeho Kwon and Zhendong Su
        http://www.cs.ucdavis.edu/research/tech-reports/2010/CSE-2010-2.pdf
ACROS PUBLIC   Page 13   SOURCE Barcelona 2011
ACROS PUBLIC        Page 14      SOURCE Barcelona 2011




               False Positives
ACROS PUBLIC   Page 15   SOURCE Barcelona 2011
ACROS PUBLIC         Page 16     SOURCE Barcelona 2011




               Hidden & Remote
ACROS PUBLIC   Page 17   SOURCE Barcelona 2011
ACROS PUBLIC          Page 18       SOURCE Barcelona 2011




               Cleaning The Table
ACROS PUBLIC   Page 19   SOURCE Barcelona 2011
ACROS PUBLIC    Page 20                 SOURCE Barcelona 2011



               Real Player on Windows XP (mpeg)
ACROS PUBLIC   Page 21                    SOURCE Barcelona 2011



                  Real Player on Windows XP (avi)
ACROS PUBLIC                          Page 22            SOURCE Barcelona 2011



                                                  Example: Opera
               I fixed a DLL hijacking
                     bug but what
                   the heck is this
                   “EXE planting”?




        Windows XP: dwmapi.dll (fixed in 10.62)
ACROS PUBLIC   Page 23   SOURCE Barcelona 2011
ACROS PUBLIC                                  Page 24                             SOURCE Barcelona 2011



                                                        Binary Planting Issues Found


               Real Player

               •   WinXP: RealPlay.exe loading planted rapi.dll upon startup
               •   Win7: RealPlay.exe loading planted SHDOCLC.DLL upon startup
               •   RealPlay.exe loading planted rio500.dll upon exit
               •   RealPlay.exe loading planted rio300.dll upon exit
               •   RealShare.exe loading planted pnrs3260.dll upon startup

               Opera

               •   WinXP: Opera.exe loading planted rundll32.exe upon opening a
                   downloaded ZIP
ACROS PUBLIC           Page 25       SOURCE Barcelona 2011




           #2 - PERSISTENCE ON COMPUTER
              (Turning Downloads Folder
                   Into a Minefield)
ACROS PUBLIC                             Page 26                      SOURCE Barcelona 2011



                                                            DLL Search Order


                    LoadLibrary(“SomeLib.dll”)

               1.   The directory from which the application loaded
               2.   C:WindowsSystem32
               3.   C:WindowsSystem
               4.   C:Windows
               5.   Current Working Directory (CWD)
               6.   PATH
ACROS PUBLIC   Page 27   SOURCE Barcelona 2011
ACROS PUBLIC               Page 28            SOURCE Barcelona 2011




               Planting a “Persistent Mine”
                      (cryptbase.dll)
ACROS PUBLIC   Page 29   SOURCE Barcelona 2011
ACROS PUBLIC               Page 30            SOURCE Barcelona 2011




               Planting a “Persistent Mine”
                      (msiexec.exe)
ACROS PUBLIC   Page 31   SOURCE Barcelona 2011
ACROS PUBLIC                                Page 32                           SOURCE Barcelona 2011



                                    Downloads folder “mine field” problem

          Why is it cool?
               Persistent – “download today, exploit months later”
               Installers usually get elevated privileges

          Whose fault is it?
               Installers loading DLLs from their neighborhood is expected behavior
               Browsers keep downloads on disk until manually deleted
               Chrome download dialog is clickjackable
               Chrome trusts EXE files from already visited sites
               InstallShield calls “msiexec.exe” without full path

          How could it be fixed?
               All downloaded executables should have modified names:
                    Cryptbase(0).dll, msiexec(0).exe
ACROS PUBLIC                                   Page 33                           SOURCE Barcelona 2011



                                 Binary Planting: Guidelines For Researchers

         Stay current
               Make sure you’re working with the latest version of the product
               Make sure your O/S is up to date

         Try different O/S versions
               Different DLLs, different drivers, codecs etc.

         Try different data files
               Different formats (file extensions), different content

         Try it from remote
               ShellExecute will issue a security warning when launching from a share

         Locate the culprit
               Check the call stack to find which module is responsible for the bug, then
                 check the module’s details to find the author
ACROS PUBLIC                                   Page 34                  SOURCE Barcelona 2011



                                  Binary Planting: Guidelines For Developers

         Use only absolute paths
               LoadLibrary(“relative.dll”) - FAIL
               CreateProcess(“notepad.exe”) – FAIL
               ShellExecute(“cmd.exe”) - FAIL

         CWD use
               Set CWD to a safe location, quickly
               Call SetDllDirectory(“”)

         Observe file system operations on all supported O/S versions
               Different DLLs, different drivers, codecs etc.

         Maximize code coverage
               Different formats (file extensions), different content
ACROS PUBLIC                                 Page 35                           SOURCE Barcelona 2011



                                                                           Resources

       Tools
               Process Monitor: http://technet.microsoft.com/en us/sysinternals/bb896645
               Symbols: http://msdn.microsoft.com/en-us/windows/hardware/gg463028


       Files
               “Malicious” DLL
                 www.binaryplanting.com/demo/windows_address_book/wab32res.dll
                 www.binaryplanting.com/demo/windows_address_book_64/wab32res.dll
               “Malicious” EXE: C:WindowsSystem32calc.exe (what else?)


       Knowledge
               www.binaryplanting.com
               blog.acrossecurity.com
ACROS PUBLIC               Page 36              SOURCE Barcelona 2011




                Pregunt(e|a)s
                        Mitja Kolsek
                         ACROS d.o.o.
                   www.acrossecurity.com
               mitja.kolsek@acrossecurity.com
                   Twitter: @acrossecurity
Ad

Recommended

Andrew Hay - Chris Nickerson - Building Bridges - Forcing Hackers and Busine...
Andrew Hay - Chris Nickerson - Building Bridges - Forcing Hackers and Busine...
Source Conference
 
Don Bailey - A Million Little Tracking Devices
Don Bailey - A Million Little Tracking Devices
Source Conference
 
Legal/technical strategies addressing data risks as perimeter shifts to Cloud
Legal/technical strategies addressing data risks as perimeter shifts to Cloud
Source Conference
 
From DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and Bobs
Source Conference
 
Wendy Nather - Building a Rube Goldberg Application Security Program
Wendy Nather - Building a Rube Goldberg Application Security Program
Source Conference
 
Dan Guido SOURCE Boston 2011
Dan Guido SOURCE Boston 2011
Source Conference
 
Esage on non-existent 0-days, stable binary exploits and user interaction
Esage on non-existent 0-days, stable binary exploits and user interaction
DefconRussia
 
On non existent 0-days, stable binary exploits and
On non existent 0-days, stable binary exploits and
Alisa Esage Шевченко
 
Dll injection
Dll injection
KarlFrank99
 
1780 1783
1780 1783
Editor IJARCET
 
1780 1783
1780 1783
Editor IJARCET
 
Let's Talk Technical: Malware Evasion and Detection
Let's Talk Technical: Malware Evasion and Detection
James Haughom Jr
 
Bruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
Bruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
Priyanka Aash
 
Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...
Stefano Maccaglia
 
Security Challenges of Antivirus Engines, Products and Systems
Security Challenges of Antivirus Engines, Products and Systems
Antiy Labs
 
Introduction to Malware Analysis
Introduction to Malware Analysis
Andrew McNicol
 
Análisis de ataques APT
Análisis de ataques APT
linenoise
 
Reverse Engineering 101
Reverse Engineering 101
ysurer
 
Dll hijacking
Dll hijacking
antitree
 
Advanced Persistent Threats: Reality or Myth
Advanced Persistent Threats: Reality or Myth
Rahul Mohandas
 
Malware 101 by saurabh chaudhary
Malware 101 by saurabh chaudhary
Saurav Chaudhary
 
Two-For-One Talk: Malware Analysis for Everyone
Two-For-One Talk: Malware Analysis for Everyone
Paul Melson
 
CNIT 127 Ch 6: The Wild World of Windows
CNIT 127 Ch 6: The Wild World of Windows
Sam Bowne
 
Software vulnerability discovery and exploitation during red team assessments
Software vulnerability discovery and exploitation during red team assessments
b0yd
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
Sam Bowne
 
Finfisher- Nguyễn Chấn Việt
Finfisher- Nguyễn Chấn Việt
Security Bootcamp
 
CNIT 126 11. Malware Behavior
CNIT 126 11. Malware Behavior
Sam Bowne
 
exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-bas...
exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-bas...
tutorialsruby
 
Million Browser Botnet
Million Browser Botnet
Source Conference
 
iBanking - a botnet on Android
iBanking - a botnet on Android
Source Conference
 

More Related Content

Similar to Advanced (persistent) binary planting (20)

Dll injection
Dll injection
KarlFrank99
 
1780 1783
1780 1783
Editor IJARCET
 
1780 1783
1780 1783
Editor IJARCET
 
Let's Talk Technical: Malware Evasion and Detection
Let's Talk Technical: Malware Evasion and Detection
James Haughom Jr
 
Bruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
Bruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
Priyanka Aash
 
Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...
Stefano Maccaglia
 
Security Challenges of Antivirus Engines, Products and Systems
Security Challenges of Antivirus Engines, Products and Systems
Antiy Labs
 
Introduction to Malware Analysis
Introduction to Malware Analysis
Andrew McNicol
 
Análisis de ataques APT
Análisis de ataques APT
linenoise
 
Reverse Engineering 101
Reverse Engineering 101
ysurer
 
Dll hijacking
Dll hijacking
antitree
 
Advanced Persistent Threats: Reality or Myth
Advanced Persistent Threats: Reality or Myth
Rahul Mohandas
 
Malware 101 by saurabh chaudhary
Malware 101 by saurabh chaudhary
Saurav Chaudhary
 
Two-For-One Talk: Malware Analysis for Everyone
Two-For-One Talk: Malware Analysis for Everyone
Paul Melson
 
CNIT 127 Ch 6: The Wild World of Windows
CNIT 127 Ch 6: The Wild World of Windows
Sam Bowne
 
Software vulnerability discovery and exploitation during red team assessments
Software vulnerability discovery and exploitation during red team assessments
b0yd
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
Sam Bowne
 
Finfisher- Nguyễn Chấn Việt
Finfisher- Nguyễn Chấn Việt
Security Bootcamp
 
CNIT 126 11. Malware Behavior
CNIT 126 11. Malware Behavior
Sam Bowne
 
exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-bas...
exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-bas...
tutorialsruby
 
Let's Talk Technical: Malware Evasion and Detection
Let's Talk Technical: Malware Evasion and Detection
James Haughom Jr
 
Bruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
Bruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
Priyanka Aash
 
Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...
Stefano Maccaglia
 
Security Challenges of Antivirus Engines, Products and Systems
Security Challenges of Antivirus Engines, Products and Systems
Antiy Labs
 
Introduction to Malware Analysis
Introduction to Malware Analysis
Andrew McNicol
 
Análisis de ataques APT
Análisis de ataques APT
linenoise
 
Reverse Engineering 101
Reverse Engineering 101
ysurer
 
Dll hijacking
Dll hijacking
antitree
 
Advanced Persistent Threats: Reality or Myth
Advanced Persistent Threats: Reality or Myth
Rahul Mohandas
 
Malware 101 by saurabh chaudhary
Malware 101 by saurabh chaudhary
Saurav Chaudhary
 
Two-For-One Talk: Malware Analysis for Everyone
Two-For-One Talk: Malware Analysis for Everyone
Paul Melson
 
CNIT 127 Ch 6: The Wild World of Windows
CNIT 127 Ch 6: The Wild World of Windows
Sam Bowne
 
Software vulnerability discovery and exploitation during red team assessments
Software vulnerability discovery and exploitation during red team assessments
b0yd
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
Sam Bowne
 
Finfisher- Nguyễn Chấn Việt
Finfisher- Nguyễn Chấn Việt
Security Bootcamp
 
CNIT 126 11. Malware Behavior
CNIT 126 11. Malware Behavior
Sam Bowne
 
exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-bas...
exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-bas...
tutorialsruby
 

More from Source Conference (20)

Million Browser Botnet
Million Browser Botnet
Source Conference
 
iBanking - a botnet on Android
iBanking - a botnet on Android
Source Conference
 
I want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUIC
Source Conference
 
Extracting Forensic Information From Zeus Derivatives
Extracting Forensic Information From Zeus Derivatives
Source Conference
 
How to Like Social Media Network Security
How to Like Social Media Network Security
Source Conference
 
Wfuzz para Penetration Testers
Wfuzz para Penetration Testers
Source Conference
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on Rails
Source Conference
 
Securty Testing For RESTful Applications
Securty Testing For RESTful Applications
Source Conference
 
Esteganografia
Esteganografia
Source Conference
 
Men in the Server Meet the Man in the Browser
Men in the Server Meet the Man in the Browser
Source Conference
 
Advanced Data Exfiltration The Way Q Would Have Done It
Advanced Data Exfiltration The Way Q Would Have Done It
Source Conference
 
Adapting To The Age Of Anonymous
Adapting To The Age Of Anonymous
Source Conference
 
Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?
Source Conference
 
Who should the security team hire next?
Who should the security team hire next?
Source Conference
 
The Latest Developments in Computer Crime Law
The Latest Developments in Computer Crime Law
Source Conference
 
JSF Security
JSF Security
Source Conference
 
How To: Find The Right Amount Of Security Spend
How To: Find The Right Amount Of Security Spend
Source Conference
 
Everything you should already know about MS-SQL post-exploitation
Everything you should already know about MS-SQL post-exploitation
Source Conference
 
Keynote
Keynote
Source Conference
 
Reputation Digital Vaccine: Reinventing Internet Blacklists
Reputation Digital Vaccine: Reinventing Internet Blacklists
Source Conference
 
iBanking - a botnet on Android
iBanking - a botnet on Android
Source Conference
 
I want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUIC
Source Conference
 
Extracting Forensic Information From Zeus Derivatives
Extracting Forensic Information From Zeus Derivatives
Source Conference
 
How to Like Social Media Network Security
How to Like Social Media Network Security
Source Conference
 
Wfuzz para Penetration Testers
Wfuzz para Penetration Testers
Source Conference
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on Rails
Source Conference
 
Securty Testing For RESTful Applications
Securty Testing For RESTful Applications
Source Conference
 
Men in the Server Meet the Man in the Browser
Men in the Server Meet the Man in the Browser
Source Conference
 
Advanced Data Exfiltration The Way Q Would Have Done It
Advanced Data Exfiltration The Way Q Would Have Done It
Source Conference
 
Adapting To The Age Of Anonymous
Adapting To The Age Of Anonymous
Source Conference
 
Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?
Source Conference
 
Who should the security team hire next?
Who should the security team hire next?
Source Conference
 
The Latest Developments in Computer Crime Law
The Latest Developments in Computer Crime Law
Source Conference
 
How To: Find The Right Amount Of Security Spend
How To: Find The Right Amount Of Security Spend
Source Conference
 
Everything you should already know about MS-SQL post-exploitation
Everything you should already know about MS-SQL post-exploitation
Source Conference
 
Reputation Digital Vaccine: Reinventing Internet Blacklists
Reputation Digital Vaccine: Reinventing Internet Blacklists
Source Conference
 
Ad

Recently uploaded (20)

Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Ad

Advanced (persistent) binary planting

  • 1. ACROS PUBLIC © ACROS Advanced (Persistent) Binary Planting SOURCE Barcelona 2011 Mitja Kolsek ACROS d.o.o. [email protected] www.acrossecurity.com
  • 2. ACROS PUBLIC Page 2 SOURCE Barcelona 2011 BINARY PLANTING QUICK SUMMARY (DLL hijacking, DLL preloading, Unsafe library loading...)
  • 3. ACROS PUBLIC Page 3 SOURCE Barcelona 2011 DLL, EXE you bad guy
  • 4. ACROS PUBLIC Page 4 SOURCE Barcelona 2011 DLL Search Order LoadLibrary(“SomeLib.dll”) 1. The directory from which the application loaded 2. C:WindowsSystem32 3. C:WindowsSystem 4. C:Windows 5. Current Working Directory (CWD) 6. PATH
  • 5. ACROS PUBLIC Page 5 SOURCE Barcelona 2011 EXE Search Order CreateProcess(“SomeApp.exe”) 1. The directory from which the application loaded 2. Current Working Directory (CWD) 3. C:WindowsSystem32 4. C:WindowsSystem 5. C:Windows 6. PATH
  • 6. ACROS PUBLIC Page 6 SOURCE Barcelona 2011 EXE Search Order ShellExecute(“SomeApp.exe”) 1. Current Working Directory (CWD) 2. C:WindowsSystem32 3. C:WindowsSystem 4. C:Windows 5. PATH
  • 7. ACROS PUBLIC Page 7 SOURCE Barcelona 2011 Our Past Research • Extended scope: Launching EXEs • Improved attack vector: WebDAV • We looked at 200+ leading Windows apps • Found 500+ binary planting bugs (120+ EXE, 400+ DLL) • Guidelines for developers http://www.binaryplanting.com/guidelinesDevelopers.htm • Guidelines for administrators http://www.binaryplanting.com/guidelinesAdministrators.htm • Free Online Binary Planting Exposure Test http://www.binaryplanting.com/test.htm • Advanced binary planting (COM-Servers) • Executing code through IE8 on Windows XP – two clicks only • Executing code through IE9 on Windows 7 – right click, add to archive
  • 8. ACROS PUBLIC Page 8 SOURCE Barcelona 2011
  • 9. ACROS PUBLIC Page 9 SOURCE Barcelona 2011 PERSISTENCE #1 - PERSISTENCE IN SOFTWARE #2 – PERSISTENCE ON COMPUTER
  • 10. ACROS PUBLIC Page 10 SOURCE Barcelona 2011 #1 - PERSISTENCE IN SOFTWARE (Everywhere You Look)
  • 11. ACROS PUBLIC Page 11 SOURCE Barcelona 2011 Microsoft (Sysinternals) Process Monitor 1. Filter: Path Contains <our-path> 2. Launch Application 3. Exclude irrelevant entries 4. Look for DLL and EXE accesses 5. Plant DLL/EXE 6. Re-launch Application 7. If successful, see call stack
  • 12. ACROS PUBLIC Page 12 SOURCE Barcelona 2011 Example: Real Player I used to load rio500.dll from CWD. Wait... I still do. Publicly reported in February 2010 by Taeho Kwon and Zhendong Su http://www.cs.ucdavis.edu/research/tech-reports/2010/CSE-2010-2.pdf
  • 13. ACROS PUBLIC Page 13 SOURCE Barcelona 2011
  • 14. ACROS PUBLIC Page 14 SOURCE Barcelona 2011 False Positives
  • 15. ACROS PUBLIC Page 15 SOURCE Barcelona 2011
  • 16. ACROS PUBLIC Page 16 SOURCE Barcelona 2011 Hidden & Remote
  • 17. ACROS PUBLIC Page 17 SOURCE Barcelona 2011
  • 18. ACROS PUBLIC Page 18 SOURCE Barcelona 2011 Cleaning The Table
  • 19. ACROS PUBLIC Page 19 SOURCE Barcelona 2011
  • 20. ACROS PUBLIC Page 20 SOURCE Barcelona 2011 Real Player on Windows XP (mpeg)
  • 21. ACROS PUBLIC Page 21 SOURCE Barcelona 2011 Real Player on Windows XP (avi)
  • 22. ACROS PUBLIC Page 22 SOURCE Barcelona 2011 Example: Opera I fixed a DLL hijacking bug but what the heck is this “EXE planting”? Windows XP: dwmapi.dll (fixed in 10.62)
  • 23. ACROS PUBLIC Page 23 SOURCE Barcelona 2011
  • 24. ACROS PUBLIC Page 24 SOURCE Barcelona 2011 Binary Planting Issues Found Real Player • WinXP: RealPlay.exe loading planted rapi.dll upon startup • Win7: RealPlay.exe loading planted SHDOCLC.DLL upon startup • RealPlay.exe loading planted rio500.dll upon exit • RealPlay.exe loading planted rio300.dll upon exit • RealShare.exe loading planted pnrs3260.dll upon startup Opera • WinXP: Opera.exe loading planted rundll32.exe upon opening a downloaded ZIP
  • 25. ACROS PUBLIC Page 25 SOURCE Barcelona 2011 #2 - PERSISTENCE ON COMPUTER (Turning Downloads Folder Into a Minefield)
  • 26. ACROS PUBLIC Page 26 SOURCE Barcelona 2011 DLL Search Order LoadLibrary(“SomeLib.dll”) 1. The directory from which the application loaded 2. C:WindowsSystem32 3. C:WindowsSystem 4. C:Windows 5. Current Working Directory (CWD) 6. PATH
  • 27. ACROS PUBLIC Page 27 SOURCE Barcelona 2011
  • 28. ACROS PUBLIC Page 28 SOURCE Barcelona 2011 Planting a “Persistent Mine” (cryptbase.dll)
  • 29. ACROS PUBLIC Page 29 SOURCE Barcelona 2011
  • 30. ACROS PUBLIC Page 30 SOURCE Barcelona 2011 Planting a “Persistent Mine” (msiexec.exe)
  • 31. ACROS PUBLIC Page 31 SOURCE Barcelona 2011
  • 32. ACROS PUBLIC Page 32 SOURCE Barcelona 2011 Downloads folder “mine field” problem Why is it cool? Persistent – “download today, exploit months later” Installers usually get elevated privileges Whose fault is it? Installers loading DLLs from their neighborhood is expected behavior Browsers keep downloads on disk until manually deleted Chrome download dialog is clickjackable Chrome trusts EXE files from already visited sites InstallShield calls “msiexec.exe” without full path How could it be fixed? All downloaded executables should have modified names: Cryptbase(0).dll, msiexec(0).exe
  • 33. ACROS PUBLIC Page 33 SOURCE Barcelona 2011 Binary Planting: Guidelines For Researchers Stay current Make sure you’re working with the latest version of the product Make sure your O/S is up to date Try different O/S versions Different DLLs, different drivers, codecs etc. Try different data files Different formats (file extensions), different content Try it from remote ShellExecute will issue a security warning when launching from a share Locate the culprit Check the call stack to find which module is responsible for the bug, then check the module’s details to find the author
  • 34. ACROS PUBLIC Page 34 SOURCE Barcelona 2011 Binary Planting: Guidelines For Developers Use only absolute paths LoadLibrary(“relative.dll”) - FAIL CreateProcess(“notepad.exe”) – FAIL ShellExecute(“cmd.exe”) - FAIL CWD use Set CWD to a safe location, quickly Call SetDllDirectory(“”) Observe file system operations on all supported O/S versions Different DLLs, different drivers, codecs etc. Maximize code coverage Different formats (file extensions), different content
  • 35. ACROS PUBLIC Page 35 SOURCE Barcelona 2011 Resources Tools Process Monitor: http://technet.microsoft.com/en us/sysinternals/bb896645 Symbols: http://msdn.microsoft.com/en-us/windows/hardware/gg463028 Files “Malicious” DLL www.binaryplanting.com/demo/windows_address_book/wab32res.dll www.binaryplanting.com/demo/windows_address_book_64/wab32res.dll “Malicious” EXE: C:WindowsSystem32calc.exe (what else?) Knowledge www.binaryplanting.com blog.acrossecurity.com
  • 36. ACROS PUBLIC Page 36 SOURCE Barcelona 2011 Pregunt(e|a)s Mitja Kolsek ACROS d.o.o. www.acrossecurity.com [email protected] Twitter: @acrossecurity