glib-2.0.dll
There are executables that allowglib-2.0.dll to be DLL hijacked.Expected Locations
The fileglib-2.0.dll is normally found in the following paths:
%PROGRAMFILES%\VMware\VMware Tools%PROGRAMFILES%\VMware\VMware Workstation%PROGRAMFILES%\VMware\VMware Player
Vulnerable Executables
DLL Sideloading (1 EXE)
By copying (and optionally renaming) any of the following vulnerable applications to a user-writeable folder, alongside a malicious
glib-2.0.dll, arbitrary code can be executed through it.
Detection
Below a sample Sigma rule that will find processes that loadedglib-2.0.dll located in a folder that is not one of the expected locations (see above).
title: Possible DLL Hijacking of glib-2.0.dll
id: 7524131b-7740-48a3-2257-5b9ff8783090
status: experimental
description: Detects possible DLL hijacking of glib-2.0.dll by looking for suspicious image loads, loading this DLL from unexpected locations.
references:
- https://hijacklibs.net/entries/3rd_party/vmware/glib-2.0.html
author: "Wietze Beukema"
date: 2023-04-03
tags:
- attack.defense_evasion
- attack.T1574.001
logsource:
product: windows
category: image_load
detection:
selection:
ImageLoaded: '*\glib-2.0.dll'
filter:
ImageLoaded:
- 'c:\program files\VMware\VMware Tools\\*'
- 'c:\program files (x86)\VMware\VMware Tools\\*'
- 'c:\program files\VMware\VMware Workstation\\*'
- 'c:\program files (x86)\VMware\VMware Workstation\\*'
- 'c:\program files\VMware\VMware Player\\*'
- 'c:\program files (x86)\VMware\VMware Player\\*'
condition: selection and not filter
falsepositives:
- False positives are likely. This rule is more suitable for hunting than for generating detections.title: Possible preparation for glib-2.0.dll DLL Hijacking
id: 7524132b-7740-48a3-2257-5b9ff8783090
status: experimental
description: Detects possible DLL hijacking of glib-2.0.dll by looking for suspicious file writes of this DLL, to unexpected locations.
references:
- https://hijacklibs.net/entries/3rd_party/vmware/glib-2.0.html
author: "Wietze Beukema"
date: 2023-04-03
tags:
- attack.defense_evasion
- attack.T1574.001
logsource:
product: windows
category: file_event
detection:
selection:
TargetFileName: '*\glib-2.0.dll'
filter:
TargetFileName:
- 'c:\program files\VMware\VMware Tools\\*'
- 'c:\program files (x86)\VMware\VMware Tools\\*'
- 'c:\program files\VMware\VMware Workstation\\*'
- 'c:\program files (x86)\VMware\VMware Workstation\\*'
- 'c:\program files\VMware\VMware Player\\*'
- 'c:\program files (x86)\VMware\VMware Player\\*'
condition: selection and not filter
falsepositives:
- False positives are likely. This rule is more suitable for hunting than for generating detections.title: Possibly malicious versions of glib-2.0.dll
id: 7524133b-7740-48a3-2257-5b9ff8783090
status: experimental
description: Detects possible DLL hijacking of glib-2.0.dll by looking for versions not meeting the known signature data.
references:
- https://hijacklibs.net/entries/3rd_party/vmware/glib-2.0.html
author: "Wietze Beukema"
date: 2023-04-03
tags:
- attack.defense_evasion
- attack.T1574.001
logsource:
product: windows
category: image_load
detection:
selection:
ImageLoaded: '*\glib-2.0.dll'
filter:
ImageLoaded:
- Signed: 'true'
- SignatureStatus: 'signed'
- Signature|contains:
- 'C=US, ST=California, L=Palo Alto, O=''VMware, Inc.'', OU=Digital ID Class 3 - Microsoft Software Validation v2, OU=Marketing, CN=''VMware, Inc.'''
condition: selection and not filter
falsepositives:
- False positives are likely. This rule is more suitable for hunting than for generating detections.Note that this rule is also included in the Detection Content Feeds that comprise all DLL Hijacking entries part of HijackLibs.
FAQs
Why should I care about this?
DLL Hijacking enables the execution of malicious code through a signed and/or trusted executable. Defensive measures such as AV and EDR solutions may not pick up on this activity out of the box, and allow-list applications such as AppLocker may not block the execution of the untrusted code. There are numerous examples of threat actors that have been observed to leaverage DLL Hijacking to achieve their objectives. As such, this project wants to encourage you to monitor for unusual activity involvingglib-2.0.dll.
How do I abuse this vulnerability?
As a red teamer, you will have to compile your own version ofglib-2.0.dll. There are various guides on how this can be achieved.