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