Search K
Appearance
Appearance
Other ways to support HackTricks:
For further detail about the technique check the original post from: https://blog.xpnsec.com/dirtynib/**. Here is a summary:
NIB files, part of Apple's development ecosystem, are intended for defining UI elements and their interactions in applications. They encompass serialized objects such as windows and buttons, and are loaded at runtime. Despite their ongoing usage, Apple now advocates for Storyboards for more comprehensive UI flow visualization.
It's critical to note that NIB files can be a security risk. They have the potential to execute arbitrary commands, and alterations to NIB files within an app don't hinder Gatekeeper from executing the app, posing a significant threat.
Initial Setup:
NSAppleScript
.source
property via User Defined Runtime Attributes.Code Execution Gadget:
Apple Script
object, specifically triggering the executeAndReturnError:
selector.Testing:
set theDialogText to "PWND"
display dialog theDialogText
Preparation:
/tmp/
).Overwriting NIB File:
Execution:
About
menu item)./tmp
).From macOS Sonoma onwards, modifications inside App bundles are restricted. However, earlier methods involved:
/tmp/
).Note: Recent macOS updates have mitigated this exploit by preventing file modifications within app bundles post Gatekeeper caching, rendering the exploit ineffective.
Other ways to support HackTricks: