hacktricks/macos-hardening/macos-security-and-privilege-escalation/macos-file-extension-apps.md

5 KiB

Wachunguzi wa Faili za macOS & Mifumo ya URL ya programu

Jifunze AWS hacking kutoka sifuri hadi shujaa na htARTE (Mtaalam wa Timu Nyekundu ya AWS ya HackTricks)!

Njia nyingine za kusaidia HackTricks:

Hifadhidata ya Huduma za Kuzindua

Hii ni hifadhidata ya programu zote zilizosakinishwa kwenye macOS ambayo inaweza kuulizwa ili kupata habari kuhusu kila programu iliyosakinishwa kama vile mifumo ya URL inayoungwa mkono na aina za MIME.

Inawezekana kudondosha hifadhidata hii na:

{% code overflow="wrap" %}

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump

{% endcode %}

Au kutumia zana lsdtrip.

/usr/libexec/lsd ndio ubongo wa database. Inatoa huduma kadhaa za XPC kama vile .lsd.installation, .lsd.open, .lsd.openurl, na zingine. Lakini pia inahitaji baadhi ya entitlements kwa maombi ili kuweza kutumia XPC functionalities zilizofunuliwa, kama vile .launchservices.changedefaulthandler au .launchservices.changeurlschemehandler kubadilisha programu za default kwa mime types au url schemes na zingine.

/System/Library/CoreServices/launchservicesd inadai huduma com.apple.coreservices.launchservicesd na inaweza kuulizwa kupata habari kuhusu programu zinazoendeshwa. Inaweza kuulizwa na zana ya mfumo /usr/bin/lsappinfo au na lsdtrip.

Programu za Kukabiliana na Upanuzi wa Faili & Handlers wa URL scheme

Mstari ufuatao unaweza kuwa na manufaa kwa kupata programu ambazo zinaweza kufungua faili kulingana na upanuzi:

{% code overflow="wrap" %}

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep -E "path:|bindings:|name:"

{% endcode %}

Au tumia kitu kama SwiftDefaultApps:

./swda getSchemes #Get all the available schemes
./swda getApps #Get all the apps declared
./swda getUTIs #Get all the UTIs
./swda getHandler --URL ftp #Get ftp handler

Unaweza pia kuangalia nyongeza zinazoungwa mkono na programu kwa kufanya:

cd /Applications/Safari.app/Contents
grep -A3 CFBundleTypeExtensions Info.plist  | grep string
<string>css</string>
<string>pdf</string>
<string>webarchive</string>
<string>webbookmark</string>
<string>webhistory</string>
<string>webloc</string>
<string>download</string>
<string>safariextz</string>
<string>gif</string>
<string>html</string>
<string>htm</string>
<string>js</string>
<string>jpg</string>
<string>jpeg</string>
<string>jp2</string>
<string>txt</string>
<string>text</string>
<string>png</string>
<string>tiff</string>
<string>tif</string>
<string>url</string>
<string>ico</string>
<string>xhtml</string>
<string>xht</string>
<string>xml</string>
<string>xbl</string>
<string>svg</string>
Jifunze AWS hacking kutoka sifuri hadi shujaa na htARTE (Mtaalam wa Timu Nyekundu ya AWS ya HackTricks)!

Njia nyingine za kusaidia HackTricks: