Sleuth Kit Java Bindings (JNI)  4.11.0
Java bindings for using The Sleuth Kit
TimelineEventType.java
Go to the documentation of this file.
1 /*
2  * Sleuth Kit Data Model
3  *
4  * Copyright 2018-2021 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.datamodel;
20 
21 import com.google.common.annotations.Beta;
22 import com.google.common.base.MoreObjects;
23 import com.google.common.collect.ImmutableSortedSet;
24 import java.util.Arrays;
25 import java.util.Comparator;
26 import java.util.List;
27 import java.util.Optional;
28 import java.util.SortedSet;
32 import static org.sleuthkit.datamodel.BundleProvider.getBundle;
39 import static org.sleuthkit.datamodel.TimelineEventArtifactTypeImpl.getAttributeSafe;
40 
54 @Beta
55 public interface TimelineEventType extends Comparable<TimelineEventType> {
56 
62  String getDisplayName();
63 
69  long getTypeID();
70 
77 
83  SortedSet<? extends TimelineEventType> getChildren();
84 
93  Optional<? extends TimelineEventType> getChild(String displayName);
94 
101 
109  TimelineEventType parentType = getParent();
110  return parentType.equals(ROOT_EVENT_TYPE)
111  ? this
112  : parentType.getCategory();
113  }
114 
120  default SortedSet<? extends TimelineEventType> getSiblings() {
121  return this.equals(ROOT_EVENT_TYPE)
122  ? ImmutableSortedSet.of(ROOT_EVENT_TYPE)
123  : this.getParent().getChildren();
124  }
125 
126  @Override
127  default int compareTo(TimelineEventType otherType) {
128  return Comparator.comparing(TimelineEventType::getDisplayName).compare(this, otherType);
129  }
130 
134  public enum HierarchyLevel {
135 
139  ROOT(getBundle().getString("EventTypeHierarchyLevel.root")),
145  CATEGORY(getBundle().getString("EventTypeHierarchyLevel.category")),
151  EVENT(getBundle().getString("EventTypeHierarchyLevel.event"));
152 
153  private final String displayName;
154 
161  public String getDisplayName() {
162  return displayName;
163  }
164 
171  private HierarchyLevel(String displayName) {
172  this.displayName = displayName;
173  }
174 
175  }
176 
181  TimelineEventType ROOT_EVENT_TYPE = new TimelineEventTypeImpl(0,
182  getBundle().getString("RootEventType.eventTypes.name"), // NON-NLS
183  HierarchyLevel.ROOT, null) {
184 
185  @Override
186  public SortedSet< TimelineEventType> getChildren() {
187  ImmutableSortedSet.Builder<TimelineEventType> builder = ImmutableSortedSet.orderedBy(new Comparator<TimelineEventType>() {
188  @Override
189  public int compare(TimelineEventType o1, TimelineEventType o2) {
190  return ((Long) o1.getTypeID()).compareTo(o2.getTypeID());
191  }
192  });
193 
194  builder.add(FILE_SYSTEM, WEB_ACTIVITY, MISC_TYPES);
195  return builder.build();
196  }
197  };
198 
199  TimelineEventType FILE_SYSTEM = new TimelineEventTypeImpl(1,
200  getBundle().getString("BaseTypes.fileSystem.name"),// NON-NLS
201  HierarchyLevel.CATEGORY, ROOT_EVENT_TYPE) {
202  @Override
203  public SortedSet< TimelineEventType> getChildren() {
204  return ImmutableSortedSet.of(FILE_MODIFIED, FILE_ACCESSED,
206  }
207  };
208 
209  TimelineEventType WEB_ACTIVITY = new TimelineEventTypeImpl(2,
210  getBundle().getString("BaseTypes.webActivity.name"), // NON-NLS
211  HierarchyLevel.CATEGORY, ROOT_EVENT_TYPE) {
212  @Override
213  public SortedSet< TimelineEventType> getChildren() {
214  return ImmutableSortedSet.of(WEB_DOWNLOADS, WEB_COOKIE,
220  }
221  };
222 
223  // The MISC_TYPE events are sorted alphebetically by their display name instead of their
224  // "natural order" which is by their event ID.
225  TimelineEventType MISC_TYPES = new TimelineEventTypeImpl(3,
226  getBundle().getString("BaseTypes.miscTypes.name"), // NON-NLS
227  HierarchyLevel.CATEGORY, ROOT_EVENT_TYPE) {
228  @Override
229  public SortedSet<TimelineEventType> getChildren() {
230  return ImmutableSortedSet.of(CALL_LOG, CALL_LOG_END, DEVICES_ATTACHED, EMAIL, EMAIL_RCVD,
240 
241  }
242  };
243 
244  TimelineEventType FILE_MODIFIED = new FilePathEventType(4,
245  getBundle().getString("FileSystemTypes.fileModified.name"), // NON-NLS
246  HierarchyLevel.EVENT, FILE_SYSTEM);
247 
248  TimelineEventType FILE_ACCESSED = new FilePathEventType(5,
249  getBundle().getString("FileSystemTypes.fileAccessed.name"), // NON-NLS
250  HierarchyLevel.EVENT, FILE_SYSTEM);
251 
252  TimelineEventType FILE_CREATED = new FilePathEventType(6,
253  getBundle().getString("FileSystemTypes.fileCreated.name"), // NON-NLS
254  HierarchyLevel.EVENT, FILE_SYSTEM);
255 
256  TimelineEventType FILE_CHANGED = new FilePathEventType(7,
257  getBundle().getString("FileSystemTypes.fileChanged.name"), // NON-NLS
258  HierarchyLevel.EVENT, FILE_SYSTEM);
259 
260  TimelineEventType WEB_DOWNLOADS = new URLArtifactEventType(8,
261  getBundle().getString("WebTypes.webDownloads.name"), // NON-NLS
262  WEB_ACTIVITY,
263  new BlackboardArtifact.Type(TSK_WEB_DOWNLOAD),
264  new Type(TSK_DATETIME_ACCESSED),
265  new Type(TSK_URL));
266 
267  TimelineEventType WEB_COOKIE = new URLArtifactEventType(9,
268  getBundle().getString("WebTypes.webCookies.name"),// NON-NLS
269  WEB_ACTIVITY,
270  new BlackboardArtifact.Type(TSK_WEB_COOKIE),
271  new Type(TSK_DATETIME_CREATED),
272  new Type(TSK_URL));
273 
274  TimelineEventType WEB_BOOKMARK = new URLArtifactEventType(10,
275  getBundle().getString("WebTypes.webBookmarks.name"), // NON-NLS
276  WEB_ACTIVITY,
277  new BlackboardArtifact.Type(TSK_WEB_BOOKMARK),
278  new Type(TSK_DATETIME_CREATED),
279  new Type(TSK_URL));
280 
281  TimelineEventType WEB_HISTORY = new URLArtifactEventType(11,
282  getBundle().getString("WebTypes.webHistory.name"), // NON-NLS
283  WEB_ACTIVITY,
284  new BlackboardArtifact.Type(TSK_WEB_HISTORY),
285  new Type(TSK_DATETIME_ACCESSED),
286  new Type(TSK_URL));
287 
288  TimelineEventType WEB_SEARCH = new URLArtifactEventType(12,
289  getBundle().getString("WebTypes.webSearch.name"), // NON-NLS
290  WEB_ACTIVITY,
291  new BlackboardArtifact.Type(TSK_WEB_SEARCH_QUERY),
292  new Type(TSK_DATETIME_ACCESSED),
293  new Type(TSK_DOMAIN));
294 
295  TimelineEventType MESSAGE = new TimelineEventArtifactTypeImpl(13,
296  getBundle().getString("MiscTypes.message.name"),// NON-NLS
297  MISC_TYPES,
298  new BlackboardArtifact.Type(TSK_MESSAGE),
299  new Type(TSK_DATETIME),
300  new TimelineEventArtifactTypeImpl.AttributeExtractor(new Type(TSK_MESSAGE_TYPE)),
301  artf -> {
302  final BlackboardAttribute dir = getAttributeSafe(artf, new Type(TSK_DIRECTION));
303  final BlackboardAttribute readStatus = getAttributeSafe(artf, new Type(TSK_READ_STATUS));
304  final BlackboardAttribute name = getAttributeSafe(artf, new Type(TSK_NAME));
305  final BlackboardAttribute subject = getAttributeSafe(artf, new Type(TSK_SUBJECT));
306  BlackboardAttribute phoneNumber = getAttributeSafe(artf, new Type(TSK_PHONE_NUMBER));
307  // Make our best effort to find a valid phoneNumber for the description
308  if (phoneNumber == null) {
309  phoneNumber = getAttributeSafe(artf, new Type(TSK_PHONE_NUMBER_TO));
310  }
311 
312  if (phoneNumber == null) {
313  phoneNumber = getAttributeSafe(artf, new Type(TSK_PHONE_NUMBER_FROM));
314  }
315 
316  List<String> asList = Arrays.asList(
317  stringValueOf(dir),
318  stringValueOf(readStatus),
319  name == null && phoneNumber == null ? "" : toFrom(dir),
320  name != null || phoneNumber != null ? stringValueOf(MoreObjects.firstNonNull(name, phoneNumber)) : "",
321  stringValueOf(subject)
322  );
323  return String.join(" ", asList);
324  },
325  new AttributeExtractor(new Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT)));
326 
327  TimelineEventType GPS_ROUTE = new TimelineEventArtifactTypeImpl(14,
328  getBundle().getString("MiscTypes.GPSRoutes.name"), // NON-NLS
329  MISC_TYPES,
330  new BlackboardArtifact.Type(TSK_GPS_ROUTE),
331  new Type(TSK_DATETIME),
332  new AttributeExtractor(new Type(TSK_PROG_NAME)),
333  new AttributeExtractor(new Type(TSK_LOCATION)),
334  artf -> {
335  final BlackboardAttribute latStart = getAttributeSafe(artf, new Type(TSK_GEO_LATITUDE_START));
336  final BlackboardAttribute longStart = getAttributeSafe(artf, new Type(TSK_GEO_LONGITUDE_START));
337  final BlackboardAttribute latEnd = getAttributeSafe(artf, new Type(TSK_GEO_LATITUDE_END));
338  final BlackboardAttribute longEnd = getAttributeSafe(artf, new Type(TSK_GEO_LONGITUDE_END));
339  return String.format("From latitude: %1$s longitude: %2$s To latitude: %3$s longitude: %4$s", stringValueOf(latStart), stringValueOf(longStart), stringValueOf(latEnd), stringValueOf(longEnd)); // NON-NLS
340  });
341 
342  @SuppressWarnings("deprecation")
343  TimelineEventType GPS_TRACKPOINT = new TimelineEventArtifactTypeImpl(15,
344  getBundle().getString("MiscTypes.GPSTrackpoint.name"), // NON-NLS
345  MISC_TYPES,
346  new BlackboardArtifact.Type(TSK_GPS_TRACKPOINT),
347  new Type(TSK_DATETIME),
348  new AttributeExtractor(new Type(TSK_PROG_NAME)),
349  artf -> {
350  final BlackboardAttribute longitude = getAttributeSafe(artf, new Type(TSK_GEO_LONGITUDE));
351  final BlackboardAttribute latitude = getAttributeSafe(artf, new Type(TSK_GEO_LATITUDE));
352  return "Latitude: " + stringValueOf(latitude) + " Longitude: " + stringValueOf(longitude); // NON-NLS
353  },
354  new EmptyExtractor());
355 
356  TimelineEventType CALL_LOG = new TimelineEventArtifactTypeImpl(16,
357  getBundle().getString("MiscTypes.Calls.name"), // NON-NLS
358  MISC_TYPES,
359  new BlackboardArtifact.Type(TSK_CALLLOG),
360  new Type(TSK_DATETIME_START),
361  new AttributeExtractor(new Type(TSK_NAME)),
362  artf -> {
363  BlackboardAttribute phoneNumber = getAttributeSafe(artf, new Type(TSK_PHONE_NUMBER));
364  if (phoneNumber == null) {
365  phoneNumber = getAttributeSafe(artf, new Type(TSK_PHONE_NUMBER_TO));
366  }
367  if (phoneNumber == null) {
368  phoneNumber = getAttributeSafe(artf, new Type(TSK_PHONE_NUMBER_FROM));
369  }
370 
371  return "Phone Number: " + stringValueOf(phoneNumber);
372  },
373  new AttributeExtractor(new Type(TSK_DIRECTION)));
374 
375  TimelineEventType EMAIL = new TimelineEventArtifactTypeImpl(17,
376  getBundle().getString("MiscTypes.Email.name"), // NON-NLS
377  MISC_TYPES,
378  new BlackboardArtifact.Type(TSK_EMAIL_MSG),
379  new Type(TSK_DATETIME_SENT),
380  artf -> {
381  String emailFrom = stringValueOf(getAttributeSafe(artf, new Type(TSK_EMAIL_FROM)));
382  if (emailFrom.length() > TimelineEventArtifactTypeImpl.EMAIL_TO_FROM_LENGTH_MAX) {
383  emailFrom = emailFrom.substring(0, TimelineEventArtifactTypeImpl.EMAIL_TO_FROM_LENGTH_MAX);
384  }
385  String emailTo = stringValueOf(getAttributeSafe(artf, new Type(TSK_EMAIL_TO)));
386  if (emailTo.length() > TimelineEventArtifactTypeImpl.EMAIL_TO_FROM_LENGTH_MAX) {
387  emailTo = emailTo.substring(0, TimelineEventArtifactTypeImpl.EMAIL_TO_FROM_LENGTH_MAX);
388  }
389  return "Sent from: " + emailFrom + "Sent to: " + emailTo; // NON-NLS
390  },
391  new AttributeExtractor(new Type(TSK_SUBJECT)),
392  artf -> {
393  final BlackboardAttribute msgAttribute = getAttributeSafe(artf, new Type(TSK_EMAIL_CONTENT_PLAIN));
394  String msg = stringValueOf(msgAttribute);
395  if (msg.length() > TimelineEventArtifactTypeImpl.EMAIL_FULL_DESCRIPTION_LENGTH_MAX) {
396  msg = msg.substring(0, TimelineEventArtifactTypeImpl.EMAIL_FULL_DESCRIPTION_LENGTH_MAX);
397  }
398  return msg;
399  });
400 
401  TimelineEventType RECENT_DOCUMENTS = new FilePathArtifactEventType(18,
402  getBundle().getString("MiscTypes.recentDocuments.name"), // NON-NLS
403  MISC_TYPES,
404  new BlackboardArtifact.Type(TSK_RECENT_OBJECT),
405  new Type(TSK_DATETIME_ACCESSED),
406  new Type(TSK_PATH));
407 
408  TimelineEventType INSTALLED_PROGRAM = new TimelineEventArtifactTypeImpl(19,
409  getBundle().getString("MiscTypes.installedPrograms.name"), // NON-NLS
410  MISC_TYPES,
411  new BlackboardArtifact.Type(TSK_INSTALLED_PROG),
412  new Type(TSK_DATETIME),
413  new AttributeExtractor(new Type(TSK_PROG_NAME)),
414  new EmptyExtractor(),
415  new EmptyExtractor());
416 
417  TimelineEventType EXIF = new TimelineEventArtifactTypeImpl(20,
418  getBundle().getString("MiscTypes.exif.name"), // NON-NLS
419  MISC_TYPES,
420  new BlackboardArtifact.Type(TSK_METADATA_EXIF),
421  new Type(TSK_DATETIME_CREATED),
422  new AttributeExtractor(new Type(TSK_DEVICE_MAKE)),
423  new AttributeExtractor(new Type(TSK_DEVICE_MODEL)),
424  artf -> artf.getSleuthkitCase().getAbstractFileById(artf.getObjectID()).getName()
425  );
426 
427  TimelineEventType DEVICES_ATTACHED = new TimelineEventArtifactTypeImpl(21,
428  getBundle().getString("MiscTypes.devicesAttached.name"), // NON-NLS
429  MISC_TYPES,
430  new BlackboardArtifact.Type(TSK_DEVICE_ATTACHED),
431  new Type(TSK_DATETIME),
432  new AttributeExtractor(new Type(TSK_DEVICE_MAKE)),
433  new AttributeExtractor(new Type(TSK_DEVICE_MODEL)),
434  new AttributeExtractor(new Type(TSK_DEVICE_ID)));
435 
436  // TimelineEventType with id 22 has been deprecated. Trying to reuse 22
437  // may cause backwards combatibility issues and is not recommened. If 22
438  // is reused create upgrade code to reassign event 22 to MISC_TYPE id = 3.
440 
441  // Event for any artifact event with an artifact type for which we don't have
442  // a hard-corded event type. In other words, we recognize the artifact type
443  // as a standard artifact type, but we have not updated the Timeline code
444  // to have a corresponding inner TimelineEventType
445  TimelineEventType STANDARD_ARTIFACT_CATCH_ALL = new TimelineEventArtifactTypeSingleDescription(23,
446  getBundle().getString("CustomTypes.other.name"), //NON-NLS
447  MISC_TYPES,
448  new BlackboardArtifact.Type(TSK_TL_EVENT),
449  new BlackboardAttribute.Type(TSK_DATETIME),
450  new BlackboardAttribute.Type(TSK_DESCRIPTION));
451 
452  //new misc types
453  TimelineEventType LOG_ENTRY = new TimelineEventArtifactTypeSingleDescription(24,
454  getBundle().getString("MiscTypes.LogEntry.name"), //NON-NLS
455  MISC_TYPES,
456  new BlackboardArtifact.Type(TSK_TL_EVENT),
457  new BlackboardAttribute.Type(TSK_DATETIME),
458  new BlackboardAttribute.Type(TSK_DESCRIPTION));
459 
460  TimelineEventType REGISTRY = new TimelineEventArtifactTypeSingleDescription(25,
461  getBundle().getString("MiscTypes.Registry.name"), //NON-NLS
462  MISC_TYPES,
463  new BlackboardArtifact.Type(TSK_TL_EVENT),
464  new BlackboardAttribute.Type(TSK_DATETIME),
465  new BlackboardAttribute.Type(TSK_DESCRIPTION));
466 
467  // Event for any artifact event with a custom artifact type (e.g. shell bag
468  // artifact)
469 
470  TimelineEventType CUSTOM_ARTIFACT_CATCH_ALL = new TimelineEventArtifactTypeSingleDescription(26,
471  getBundle().getString("CustomTypes.customArtifact.name"),//NON-NLS
472  MISC_TYPES,
473  new BlackboardArtifact.Type(TSK_TL_EVENT),
474  new BlackboardAttribute.Type(TSK_DATETIME),
475  new BlackboardAttribute.Type(TSK_DESCRIPTION));
476 
477  TimelineEventType WEB_FORM_AUTOFILL = new TimelineEventArtifactTypeImpl(27,
478  getBundle().getString("WebTypes.webFormAutoFill.name"),//NON-NLS
479  WEB_ACTIVITY,
480  new BlackboardArtifact.Type(TSK_WEB_FORM_AUTOFILL),
481  new Type(TSK_DATETIME_CREATED),
482  artf -> {
483  final BlackboardAttribute name = getAttributeSafe(artf, new Type(TSK_NAME));
484  final BlackboardAttribute value = getAttributeSafe(artf, new Type(TSK_VALUE));
485  final BlackboardAttribute count = getAttributeSafe(artf, new Type(TSK_COUNT));
486  return stringValueOf(name) + ":" + stringValueOf(value); // NON-NLS
487  }, new EmptyExtractor(), new EmptyExtractor());
488 
489  TimelineEventType WEB_FORM_ADDRESSES = new URLArtifactEventType(28,
490  getBundle().getString("WebTypes.webFormAddress.name"),//NON-NLS
491  WEB_ACTIVITY,
492  new BlackboardArtifact.Type(TSK_WEB_FORM_ADDRESS),
493  new Type(TSK_DATETIME_ACCESSED),
494  new Type(TSK_EMAIL));
495 
496  TimelineEventType GPS_BOOKMARK = new TimelineEventArtifactTypeImpl(29,
497  getBundle().getString("MiscTypes.GPSBookmark.name"), // NON-NLS
498  MISC_TYPES,
499  new BlackboardArtifact.Type(TSK_GPS_BOOKMARK),
500  new Type(TSK_DATETIME),
501  new AttributeExtractor(new Type(TSK_NAME)),
502  artf -> {
503  final BlackboardAttribute longitude = getAttributeSafe(artf, new Type(TSK_GEO_LONGITUDE));
504  final BlackboardAttribute latitude = getAttributeSafe(artf, new Type(TSK_GEO_LATITUDE));
505  return "Latitude: " + stringValueOf(latitude) + " Longitude: " + stringValueOf(longitude); // NON-NLS
506  },
507  new EmptyExtractor());
508 
509  TimelineEventType GPS_LAST_KNOWN_LOCATION = new TimelineEventArtifactTypeImpl(30,
510  getBundle().getString("MiscTypes.GPSLastknown.name"), // NON-NLS
511  MISC_TYPES,
512  new BlackboardArtifact.Type(TSK_GPS_LAST_KNOWN_LOCATION),
513  new Type(TSK_DATETIME),
514  new AttributeExtractor(new Type(TSK_NAME)),
515  artf -> {
516  final BlackboardAttribute longitude = getAttributeSafe(artf, new Type(TSK_GEO_LONGITUDE));
517  final BlackboardAttribute latitude = getAttributeSafe(artf, new Type(TSK_GEO_LATITUDE));
518  return "Latitude: " + stringValueOf(latitude) + " Longitude: " + stringValueOf(longitude); // NON-NLS
519  },
520  new EmptyExtractor());
521 
522  TimelineEventType GPS_SEARCH = new TimelineEventArtifactTypeImpl(31,
523  getBundle().getString("MiscTypes.GPSearch.name"), // NON-NLS
524  MISC_TYPES,
525  new BlackboardArtifact.Type(TSK_GPS_SEARCH),
526  new Type(TSK_DATETIME),
527  new AttributeExtractor(new Type(TSK_NAME)),
528  artf -> {
529  final BlackboardAttribute longitude = getAttributeSafe(artf, new Type(TSK_GEO_LONGITUDE));
530  final BlackboardAttribute latitude = getAttributeSafe(artf, new Type(TSK_GEO_LATITUDE));
531  return "Latitude: " + stringValueOf(latitude) + " Longitude: " + stringValueOf(longitude); // NON-NLS
532  },
533  new EmptyExtractor());
534 
535  TimelineEventType GPS_TRACK = new GPSTrackArtifactEventType(32,
536  getBundle().getString("MiscTypes.GPSTrack.name"), // NON-NLS
537  MISC_TYPES,
538  new BlackboardArtifact.Type(TSK_GPS_TRACK),
539  new Type(TSK_NAME));
540 
541  TimelineEventType METADATA_LAST_PRINTED = new TimelineEventArtifactTypeImpl(33,
542  getBundle().getString("MiscTypes.metadataLastPrinted.name"),// NON-NLS
543  MISC_TYPES,
544  new BlackboardArtifact.Type(TSK_METADATA),
545  new BlackboardAttribute.Type(TSK_LAST_PRINTED_DATETIME),
546  artf -> {
547  return getBundle().getString("MiscTypes.metadataLastPrinted.name");
548  },
549  new EmptyExtractor(),
550  new EmptyExtractor());
551 
552  TimelineEventType METADATA_LAST_SAVED = new TimelineEventArtifactTypeImpl(34,
553  getBundle().getString("MiscTypes.metadataLastSaved.name"),// NON-NLS
554  MISC_TYPES,
555  new BlackboardArtifact.Type(TSK_METADATA),
556  new BlackboardAttribute.Type(TSK_DATETIME_MODIFIED),
557  artf -> {
558  return getBundle().getString("MiscTypes.metadataLastSaved.name");
559  },
560  new EmptyExtractor(),
561  new EmptyExtractor());
562 
563  TimelineEventType METADATA_CREATED = new TimelineEventArtifactTypeImpl(35,
564  getBundle().getString("MiscTypes.metadataCreated.name"),// NON-NLS
565  MISC_TYPES,
566  new BlackboardArtifact.Type(TSK_METADATA),
567  new BlackboardAttribute.Type(TSK_DATETIME_CREATED),
568  artf -> {
569  return getBundle().getString("MiscTypes.metadataCreated.name");
570  },
571  new EmptyExtractor(),
572  new EmptyExtractor());
573 
574  TimelineEventType PROGRAM_EXECUTION = new TimelineEventArtifactTypeImpl(36,
575  getBundle().getString("MiscTypes.programexecuted.name"),// NON-NLS
576  MISC_TYPES,
577  new BlackboardArtifact.Type(TSK_PROG_RUN),
578  new Type(TSK_DATETIME),
579  new AttributeExtractor(new Type(TSK_PROG_NAME)),
580  artf -> {
581  String userName = stringValueOf(getAttributeSafe(artf, new Type(TSK_USER_NAME)));
582  if (userName != null) {
583  return userName;
584  }
585  return "";
586  },
587  new AttributeExtractor(new Type(TSK_COMMENT)));
588 
589  TimelineEventType WEB_FORM_AUTOFILL_ACCESSED = new TimelineEventArtifactTypeImpl(37,
590  getBundle().getString("WebTypes.webFormAutofillAccessed.name"),
591  WEB_ACTIVITY,
592  new BlackboardArtifact.Type(TSK_WEB_FORM_AUTOFILL),
593  new Type(TSK_DATETIME_ACCESSED),
594  artf -> {
595  final BlackboardAttribute name = getAttributeSafe(artf, new Type(TSK_NAME));
596  final BlackboardAttribute value = getAttributeSafe(artf, new Type(TSK_VALUE));
597  final BlackboardAttribute count = getAttributeSafe(artf, new Type(TSK_COUNT));
598  return stringValueOf(name) + ":" + stringValueOf(value) + " Access count: " + stringValueOf(count); // NON-NLS
599  }, new EmptyExtractor(), new EmptyExtractor());
600 
601  TimelineEventType CALL_LOG_END = new TimelineEventArtifactTypeImpl(38,
602  getBundle().getString("MiscTypes.CallsEnd.name"), // NON-NLS
603  MISC_TYPES,
604  new BlackboardArtifact.Type(TSK_CALLLOG),
605  new Type(TSK_DATETIME_END),
606  new AttributeExtractor(new Type(TSK_NAME)),
607  artf -> {
608  BlackboardAttribute phoneNumber = getAttributeSafe(artf, new Type(TSK_PHONE_NUMBER));
609  if (phoneNumber == null) {
610  phoneNumber = getAttributeSafe(artf, new Type(TSK_PHONE_NUMBER_TO));
611  }
612  if (phoneNumber == null) {
613  phoneNumber = getAttributeSafe(artf, new Type(TSK_PHONE_NUMBER_FROM));
614  }
615 
616  return "Phone number: " + stringValueOf(phoneNumber);
617  },
618  new AttributeExtractor(new Type(TSK_DIRECTION)));
619 
620  TimelineEventType EMAIL_RCVD = new TimelineEventArtifactTypeImpl(39,
621  getBundle().getString("MiscTypes.EmailRcvd.name"), // NON-NLS
622  MISC_TYPES,
623  new BlackboardArtifact.Type(TSK_EMAIL_MSG),
624  new Type(TSK_DATETIME_RCVD),
625  artf -> {
626  String emailFrom = stringValueOf(getAttributeSafe(artf, new Type(TSK_EMAIL_FROM)));
627  if (emailFrom.length() > TimelineEventArtifactTypeImpl.EMAIL_TO_FROM_LENGTH_MAX) {
628  emailFrom = emailFrom.substring(0, TimelineEventArtifactTypeImpl.EMAIL_TO_FROM_LENGTH_MAX);
629  }
630  String emailTo = stringValueOf(getAttributeSafe(artf, new Type(TSK_EMAIL_TO)));
631  if (emailTo.length() > TimelineEventArtifactTypeImpl.EMAIL_TO_FROM_LENGTH_MAX) {
632  emailTo = emailTo.substring(0, TimelineEventArtifactTypeImpl.EMAIL_TO_FROM_LENGTH_MAX);
633  }
634  return "Message from: " + emailFrom + " To: " + emailTo; // NON-NLS
635  },
636  new AttributeExtractor(new Type(TSK_SUBJECT)),
637  artf -> {
638  final BlackboardAttribute msgAttribute = getAttributeSafe(artf, new Type(TSK_EMAIL_CONTENT_PLAIN));
639  String msg = stringValueOf(msgAttribute);
640  if (msg.length() > TimelineEventArtifactTypeImpl.EMAIL_FULL_DESCRIPTION_LENGTH_MAX) {
641  msg = msg.substring(0, TimelineEventArtifactTypeImpl.EMAIL_FULL_DESCRIPTION_LENGTH_MAX);
642  }
643  return msg;
644  });
645 
646  TimelineEventType WEB_FORM_ADDRESSES_MODIFIED = new URLArtifactEventType(40,
647  getBundle().getString("WebTypes.webFormAddressModified.name"),//NON-NLS
648  WEB_ACTIVITY,
649  new BlackboardArtifact.Type(TSK_WEB_FORM_ADDRESS),
650  new Type(TSK_DATETIME_MODIFIED),
651  new Type(TSK_EMAIL));
652 
653  TimelineEventType WEB_COOKIE_ACCESSED = new URLArtifactEventType(41,
654  getBundle().getString("WebTypes.webCookiesAccessed.name"),// NON-NLS
655  WEB_ACTIVITY,
656  new BlackboardArtifact.Type(TSK_WEB_COOKIE),
657  new Type(TSK_DATETIME_ACCESSED),
658  new Type(TSK_URL));
659 
660  TimelineEventType WEB_COOKIE_END = new URLArtifactEventType(42,
661  getBundle().getString("WebTypes.webCookiesEnd.name"),// NON-NLS
662  WEB_ACTIVITY,
663  new BlackboardArtifact.Type(TSK_WEB_COOKIE),
664  new Type(TSK_DATETIME_END),
665  new Type(TSK_URL));
666 
667  TimelineEventType BACKUP_EVENT_START = new TimelineEventArtifactTypeImpl(43,
668  getBundle().getString("TimelineEventType.BackupEventStart.txt"),// NON-NLS
669  MISC_TYPES,
670  new BlackboardArtifact.Type(TSK_BACKUP_EVENT),
671  new BlackboardAttribute.Type(TSK_DATETIME_START),
672  artf -> {
673  return getBundle().getString("TimelineEventType.BackupEvent.description.start");
674  },
675  new EmptyExtractor(),
676  new EmptyExtractor());
677 
678  TimelineEventType BACKUP_EVENT_END = new TimelineEventArtifactTypeImpl(44,
679  getBundle().getString("TimelineEventType.BackupEventEnd.txt"),// NON-NLS
680  MISC_TYPES,
681  new BlackboardArtifact.Type(TSK_BACKUP_EVENT),
682  new BlackboardAttribute.Type(TSK_DATETIME_END),
683  artf -> {
684  return getBundle().getString("TimelineEventType.BackupEvent.description.end");
685  },
686  new EmptyExtractor(),
687  new EmptyExtractor());
688 
689  TimelineEventType BLUETOOTH_PAIRING = new TimelineEventArtifactTypeSingleDescription(45,
690  getBundle().getString("TimelineEventType.BluetoothPairing.txt"),//NON-NLS
691  MISC_TYPES,
692  new BlackboardArtifact.Type(TSK_BLUETOOTH_PAIRING),
693  new BlackboardAttribute.Type(TSK_DATETIME),
694  new BlackboardAttribute.Type(TSK_DEVICE_NAME));
695 
696  TimelineEventType CALENDAR_ENTRY_START = new TimelineEventArtifactTypeSingleDescription(46,
697  getBundle().getString("TimelineEventType.CalendarEntryStart.txt"),//NON-NLS
698  MISC_TYPES,
699  new BlackboardArtifact.Type(TSK_CALENDAR_ENTRY),
700  new BlackboardAttribute.Type(TSK_DATETIME_START),
701  new BlackboardAttribute.Type(TSK_DESCRIPTION));
702 
703  TimelineEventType CALENDAR_ENTRY_END = new TimelineEventArtifactTypeSingleDescription(47,
704  getBundle().getString("TimelineEventType.CalendarEntryEnd.txt"),//NON-NLS
705  MISC_TYPES,
706  new BlackboardArtifact.Type(TSK_CALENDAR_ENTRY),
707  new BlackboardAttribute.Type(TSK_DATETIME_END),
708  new BlackboardAttribute.Type(TSK_DESCRIPTION));
709 
710  TimelineEventType PROGRAM_DELETED = new TimelineEventArtifactTypeSingleDescription(48,
711  getBundle().getString("TimelineEventType.DeletedProgram.txt"),//NON-NLS
712  MISC_TYPES,
713  new BlackboardArtifact.Type(TSK_DELETED_PROG),
714  new BlackboardAttribute.Type(TSK_DATETIME),
715  new BlackboardAttribute.Type(TSK_PROG_NAME));
716 
717  TimelineEventType OS_INFO = new TimelineEventArtifactTypeSingleDescription(49,
718  getBundle().getString("TimelineEventType.OSInfo.txt"),//NON-NLS
719  MISC_TYPES,
720  new BlackboardArtifact.Type(TSK_OS_INFO),
721  new BlackboardAttribute.Type(TSK_DATETIME),
722  new BlackboardAttribute.Type(TSK_PROG_NAME));
723 
724  TimelineEventType PROGRAM_NOTIFICATION = new TimelineEventArtifactTypeSingleDescription(50,
725  getBundle().getString("TimelineEventType.ProgramNotification.txt"),//NON-NLS
726  MISC_TYPES,
727  new BlackboardArtifact.Type(TSK_PROG_NOTIFICATIONS),
728  new BlackboardAttribute.Type(TSK_DATETIME),
729  new BlackboardAttribute.Type(TSK_PROG_NAME));
730 
731  TimelineEventType SCREEN_SHOT = new TimelineEventArtifactTypeSingleDescription(51,
732  getBundle().getString("TimelineEventType.ScreenShot.txt"),//NON-NLS
733  MISC_TYPES,
734  new BlackboardArtifact.Type(TSK_SCREEN_SHOTS),
735  new BlackboardAttribute.Type(TSK_DATETIME),
736  new BlackboardAttribute.Type(TSK_PROG_NAME));
737 
738  TimelineEventType SERVICE_ACCOUNT = new TimelineEventArtifactTypeImpl(52,
739  getBundle().getString("TimelineEventType.ServiceAccount.txt"),// NON-NLS
740  MISC_TYPES,
741  new BlackboardArtifact.Type(TSK_SERVICE_ACCOUNT),
742  new BlackboardAttribute.Type(TSK_DATETIME_CREATED),
743  artf -> {
744  String progName = stringValueOf(getAttributeSafe(artf, new Type(TSK_PROG_NAME)));
745  String userId = stringValueOf(getAttributeSafe(artf, new Type(TSK_USER_ID)));
746  return String.format("Program Name: %s User ID: %s", progName, userId);
747  },
748  new EmptyExtractor(),
749  new EmptyExtractor());
750 
751  TimelineEventType USER_DEVICE_EVENT_START = new TimelineEventArtifactTypeImpl(53,
752  getBundle().getString("TimelineEventType.UserDeviceEventStart.txt"),// NON-NLS
753  MISC_TYPES,
754  new BlackboardArtifact.Type(TSK_USER_DEVICE_EVENT),
755  new BlackboardAttribute.Type(TSK_DATETIME_START),
756  artf -> {
757  String progName = stringValueOf(getAttributeSafe(artf, new Type(TSK_PROG_NAME)));
758  String activityType = stringValueOf(getAttributeSafe(artf, new Type(TSK_ACTIVITY_TYPE)));
759  String connectionType = stringValueOf(getAttributeSafe(artf, new Type(TSK_VALUE)));
760  return String.format("Program Name: %s Activity Type: %s Connection Type: %s", progName, activityType, connectionType);
761  },
762  new EmptyExtractor(),
763  new EmptyExtractor());
764 
765  TimelineEventType USER_DEVICE_EVENT_END = new TimelineEventArtifactTypeImpl(54,
766  getBundle().getString("TimelineEventType.UserDeviceEventEnd.txt"),// NON-NLS
767  MISC_TYPES,
768  new BlackboardArtifact.Type(TSK_USER_DEVICE_EVENT),
769  new BlackboardAttribute.Type(TSK_DATETIME_END),
770  artf -> {
771  String progName = stringValueOf(getAttributeSafe(artf, new Type(TSK_PROG_NAME)));
772  String activityType = stringValueOf(getAttributeSafe(artf, new Type(TSK_ACTIVITY_TYPE)));
773  String connectionType = stringValueOf(getAttributeSafe(artf, new Type(TSK_VALUE)));
774  return String.format("Program Name: %s Activity Type: %s Connection Type: %s", progName, activityType, connectionType);
775  },
776  new EmptyExtractor(),
777  new EmptyExtractor());
778 
779  TimelineEventType WEB_CACHE = new URLArtifactEventType(55,
780  getBundle().getString("TimelineEventType.WebCache.text"),// NON-NLS
781  WEB_ACTIVITY,
782  new BlackboardArtifact.Type(TSK_WEB_CACHE),
783  new Type(TSK_DATETIME_CREATED),
784  new Type(TSK_URL));
785 
786  TimelineEventType WIFI_NETWORK = new TimelineEventArtifactTypeSingleDescription(56,
787  getBundle().getString("TimelineEventType.WIFINetwork.txt"),//NON-NLS
788  MISC_TYPES,
789  new BlackboardArtifact.Type(TSK_WIFI_NETWORK),
790  new BlackboardAttribute.Type(TSK_DATETIME),
791  new BlackboardAttribute.Type(TSK_SSID));
792 
793  TimelineEventType WEB_HISTORY_CREATED = new URLArtifactEventType(57,
794  getBundle().getString("WebTypes.webHistoryCreated.name"),// NON-NLS
795  WEB_ACTIVITY,
796  new BlackboardArtifact.Type(TSK_WEB_HISTORY),
797  new Type(TSK_DATETIME_CREATED),
798  new Type(TSK_URL));
799 
800  TimelineEventType BLUETOOTH_ADAPTER = new TimelineEventArtifactTypeSingleDescription(58,
801  getBundle().getString("TimelineEventType.BluetoothAdapter.txt"),//NON-NLS
802  MISC_TYPES,
803  new BlackboardArtifact.Type(TSK_BLUETOOTH_ADAPTER),
804  new BlackboardAttribute.Type(TSK_DATETIME),
805  new BlackboardAttribute.Type(TSK_NAME));
806 
807  TimelineEventType BLUETOOTH_PAIRING_ACCESSED = new TimelineEventArtifactTypeSingleDescription(59,
808  getBundle().getString("TimelineEventType.BluetoothPairingLastConnection.txt"),//NON-NLS
809  MISC_TYPES,
810  new BlackboardArtifact.Type(TSK_BLUETOOTH_PAIRING),
811  new BlackboardAttribute.Type(TSK_DATETIME_ACCESSED),
812  new BlackboardAttribute.Type(TSK_DEVICE_NAME));
813 
814  //User manually created events, created with the "Add Event" button in the
815  // timeline UI.
816  TimelineEventType USER_CREATED = new TimelineEventArtifactTypeSingleDescription(60,
817  getBundle().getString("CustomTypes.userCreated.name"),//NON-NLS
818  MISC_TYPES,
819  new BlackboardArtifact.Type(TSK_TL_EVENT),
820  new BlackboardAttribute.Type(TSK_DATETIME),
821  new BlackboardAttribute.Type(TSK_DESCRIPTION));
822 
823  static SortedSet<? extends TimelineEventType> getCategoryTypes() {
824  return ROOT_EVENT_TYPE.getChildren();
825  }
826 
827  static SortedSet<? extends TimelineEventType> getFileSystemTypes() {
828  return FILE_SYSTEM.getChildren();
829  }
830 
831  static SortedSet<? extends TimelineEventType> getWebActivityTypes() {
832  return WEB_ACTIVITY.getChildren();
833  }
834 
835  static SortedSet<? extends TimelineEventType> getMiscTypes() {
836  return MISC_TYPES.getChildren();
837  }
838 
839  static String stringValueOf(BlackboardAttribute attr) {
840  return Optional.ofNullable(attr)
842  .orElse("");
843  }
844 
845  static String toFrom(BlackboardAttribute dir) {
846  if (dir == null) {
847  return "";
848  } else {
849  switch (dir.getDisplayString()) {
850  case "Incoming": // NON-NLS
851  return "from"; // NON-NLS
852  case "Outgoing": // NON-NLS
853  return "to"; // NON-NLS
854  default:
855  return " "; // NON-NLS
856 
857  }
858  }
859  }
860 }
default int compareTo(TimelineEventType otherType)
static String stringValueOf(BlackboardAttribute attr)
SortedSet<?extends TimelineEventType > getChildren()
default SortedSet<?extends TimelineEventType > getSiblings()
static String toFrom(BlackboardAttribute dir)
TimelineEventType.HierarchyLevel getTypeHierarchyLevel()
Optional<?extends TimelineEventType > getChild(String displayName)
static SortedSet<?extends TimelineEventType > getWebActivityTypes()
static SortedSet<?extends TimelineEventType > getMiscTypes()
static SortedSet<?extends TimelineEventType > getFileSystemTypes()
static SortedSet<?extends TimelineEventType > getCategoryTypes()

Copyright © 2011-2021 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.