Skip to content

Commit a616255

Browse files
authored
Updated --attachments output
1 parent 9bf9594 commit a616255

File tree

1 file changed

+45
-16
lines changed

1 file changed

+45
-16
lines changed

msgIntel.js

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
1-
// Script Name: msgIntel.js
2-
// MITRE ATT&CK Technique: T1005 - Data from Local System
3-
// Platform: macOS
1+
/**
2+
* Script Name: msgIntel.js
3+
* Description: Extracts message data from macOS Messages app databases
4+
* MITRE ATT&CK Technique: T1005 - Data from Local System
5+
* Platform: macOS
6+
*
7+
* Author: Daniel Acevedo
8+
* Date: 2024DEC19
9+
* Version: 0.8.0
10+
* License: Apache 2.0
11+
*
12+
* Copyright 2024 Daniel Acevedo
13+
*
14+
* Licensed under the Apache License, Version 2.0 (the "License");
15+
* you may not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing, software
21+
* distributed under the License is distributed on an "AS IS" BASIS,
22+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23+
* See the License for the specific language governing permissions and
24+
* limitations under the License.
25+
*/
426

527
(() => {
628
'use strict';
@@ -374,13 +396,10 @@
374396
m.is_delivered,
375397
m.is_read,
376398
m.is_sent,
377-
m.is_empty,
378-
m.is_delayed,
379-
m.is_auto_reply,
380-
m.is_prepared,
381-
m.is_finished,
382399
m.is_spam,
383-
m.is_kt_verified
400+
m.is_kt_verified,
401+
m.service,
402+
m.version
384403
FROM attachment a
385404
LEFT JOIN message_attachment_join maj ON a.ROWID = maj.attachment_id
386405
LEFT JOIN message m ON maj.message_id = m.ROWID
@@ -414,7 +433,7 @@
414433
attachment: {
415434
guid: att.guid,
416435
created_date: MsgIntelUtils.convertAppleDate(att.created_date),
417-
metadata: {
436+
file_metadata: {
418437
filename: att.filename,
419438
mime_type: att.mime_type,
420439
uti: att.uti,
@@ -426,22 +445,32 @@
426445
is_outgoing: att.is_outgoing,
427446
is_sticker: att.is_sticker,
428447
hide_attachment: att.hide_attachment,
429-
is_commsafety_sensitive: att.is_commsafety_sensitive,
430-
ck_sync_state: att.ck_sync_state
448+
is_commsafety_sensitive: att.is_commsafety_sensitive
431449
},
432450
message: {
433451
guid: att.guid.substring(att.guid.indexOf('_', att.guid.indexOf('_') + 1) + 1),
434-
is_from_me: att.is_from_me,
435-
communication: MsgIntelUtils.mapCommunication(att,
436-
this.handles.byRowId.get(att.handle_id),
437-
this.handles.byId.get(att.destination_caller_id)),
452+
communication: {
453+
channel: {
454+
service: att.service,
455+
version: att.version,
456+
is_from_me: att.is_from_me
457+
},
458+
...MsgIntelUtils.mapCommunication(att,
459+
this.handles.byRowId.get(att.handle_id),
460+
this.handles.byId.get(att.destination_caller_id))
461+
},
438462
state: {
439463
is_delivered: Boolean(att.is_delivered),
440464
is_read: Boolean(att.is_read),
441465
is_sent: Boolean(att.is_sent),
442466
is_spam: Boolean(att.is_spam),
443467
is_kt_verified: Boolean(att.is_kt_verified)
444468
}
469+
},
470+
icloud: {
471+
ck_sync_state: att.ck_sync_state,
472+
ck_record_id: att.ck_record_id,
473+
ck_record_change_tag: att.ck_record_change_tag
445474
}
446475
}
447476
}))

0 commit comments

Comments
 (0)