|
| 1 | +Name: Windows WPNDatabase - Notifications |
| 2 | +Description: | |
| 3 | + Parse the `wpndatabase.db` file |
| 4 | +
|
| 5 | +Author: Andrew Rathbun |
| 6 | +Email: andrew.d.rathbun@gmail.com |
| 7 | +Reference: https://github.com/EricZimmerman/SQLECmd |
| 8 | + |
| 9 | +SQLiteIdentifyQuery: | |
| 10 | + SELECT count(*) AS `Check` |
| 11 | + FROM sqlite_master |
| 12 | + WHERE type='table' |
| 13 | + AND (name='Notification' OR |
| 14 | + name='HandlerAssets' OR |
| 15 | + name='WNSPushChannel' OR |
| 16 | + name='TransientTable' OR |
| 17 | + name='NotificationData'); |
| 18 | +
|
| 19 | +SQLiteIdentifyValue: 5 |
| 20 | + |
| 21 | +Categories: |
| 22 | + - Windows |
| 23 | + |
| 24 | +FilenameRegex: "wpndatabase.db" |
| 25 | +Globs: |
| 26 | + - C:\Users\*\AppData\Local\Microsoft\Windows\Notifications\wpndatabase.db |
| 27 | + |
| 28 | +Sources: |
| 29 | +- name: Notifications |
| 30 | + VQL: | |
| 31 | + SELECT *, Parent || "" AS Parent, |
| 32 | + timestamp(winfiletime= ArrivalTime) AS ArrivalTime, |
| 33 | + if(condition= ExpirationTime > 0, |
| 34 | + then=timestamp(winfiletime= ExpirationTime), |
| 35 | + else='Expired') AS ExpirationTime, |
| 36 | + format(format="%02x", args=ActivityId) As ActivityId, |
| 37 | + WNSId || "" AS WNSId, |
| 38 | +
|
| 39 | + if(condition= WNSCreatedTime > 0, |
| 40 | + then=timestamp(winfiletime= WNSCreatedTime), |
| 41 | + else='') AS WNSCreatedTime, |
| 42 | +
|
| 43 | + if(condition= WNSExpirationTime > 0, |
| 44 | + then=timestamp(winfiletime= WNSExpirationTime), |
| 45 | + else='') AS WNSExpirationTime, |
| 46 | +
|
| 47 | + upload(accessor="data", |
| 48 | + file=Payload, |
| 49 | + name=format(format="Payload%v.png", args=ID)) AS Payload |
| 50 | +
|
| 51 | + FROM Rows |
| 52 | +
|
| 53 | + SQL: | |
| 54 | + SELECT |
| 55 | + Notification.Id AS ID, |
| 56 | + Notification.'Order' AS 'Order', |
| 57 | + Notification.HandlerId AS HandlerId, |
| 58 | + NotificationHandler.PrimaryId AS Application, |
| 59 | + NotificationHandler.ParentId AS Parent, |
| 60 | + NotificationHandler.HandlerType AS HandlerType, |
| 61 | + Notification.Type AS Type, |
| 62 | + Notification.Payload AS Payload, |
| 63 | + Notification.PayloadType AS PayloadType, |
| 64 | + Notification.Tag AS Tag, |
| 65 | + Notification."Group" AS "Group", |
| 66 | + Notification.ArrivalTime AS ArrivalTime, |
| 67 | + Notification.ExpiryTime AS ExpirationTime, |
| 68 | + NotificationHandler.CreatedTime AS HandlerCreated, |
| 69 | + NotificationHandler.ModifiedTime AS HandlerModified, |
| 70 | + NotificationHandler.WNSId AS WNSId, |
| 71 | + NotificationHandler.WNFEventName AS WNFEventName, |
| 72 | + WNSPushChannel.ChannelId AS ChannelID, |
| 73 | + WNSPushChannel.Uri AS URI, |
| 74 | + WNSPushChannel.CreatedTime AS WNSCreatedTime, |
| 75 | + WNSPushChannel.ExpiryTime AS WNSExpirationTime, |
| 76 | + Notification.ActivityId AS ActivityId |
| 77 | + FROM Notification |
| 78 | + JOIN NotificationHandler ON NotificationHandler.RecordId = Notification.HandlerId |
| 79 | + LEFT JOIN WNSPushChannel ON WNSPushChannel.HandlerId = NotificationHandler.RecordId |
| 80 | + ORDER BY Id DESC |
0 commit comments