Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T1005 Test to Copy Apple Notes Databases via AppleScript #3051

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions atomics/T1005/T1005.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,20 @@ atomic_tests:
rm -f $HOME/.art
rm -f $HOME/gta.db
rm -f $HOME/sqlite_dump.sh

- name: Copy Apple Notes database files using AppleScript
description: |
This command will copy Apple Notes database files using AppleScript as seen in Atomic Stealer.
supported_platforms:
- macos
input_arguments:
destination_path:
description: Specify the path to copy the database files into.
type: path
default: /private/tmp
executor:
command: |-
osascript -e 'tell application "Finder"' -e 'set destinationFolderPath to POSIX file "#{destination_path}"' -e 'set notesFolderPath to (path to home folder as text) & "Library:Group Containers:group.com.apple.notes:"' -e 'set notesFolder to folder notesFolderPath' -e 'set notesFiles to {file "NoteStore.sqlite", file "NoteStore.sqlite-shm", file "NoteStore.sqlite-wal"} of notesFolder' -e 'repeat with aFile in notesFiles' -e 'duplicate aFile to folder destinationFolderPath with replacing' -e 'end' -e 'end tell'
cleanup_command: 'rm "#{destination_path}/NoteStore.sqlite*"'
name: sh
elevation_required: false