-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
2,803 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build/ | ||
nbproject/private/ | ||
release/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- You may freely edit this file. See harness/README in the NetBeans platform --> | ||
<!-- for some information on what you could do (e.g. targets to override). --> | ||
<!-- If you delete this file and reopen the project it will be recreated. --> | ||
<project name="uk.oshawk.UsnCorrelation" default="netbeans" basedir="."> | ||
<description>Builds, tests, and runs the project uk.oshawk.UsnCorrelation.</description> | ||
<import file="nbproject/build-impl.xml"/> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Manifest-Version: 1.0 | ||
AutoUpdate-Show-In-Client: true | ||
OpenIDE-Module: uk.oshawk.UsnCorrelation | ||
OpenIDE-Module-Localizing-Bundle: uk/oshawk/UsnCorrelation/Bundle.properties | ||
OpenIDE-Module-Specification-Version: 0.0.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
*** GENERATED FROM project.xml - DO NOT EDIT *** | ||
*** EDIT ../build.xml INSTEAD *** | ||
--> | ||
<project name="uk.oshawk.UsnCorrelation-impl" basedir=".."> | ||
<fail message="Please build using Ant 1.7.1 or higher."> | ||
<condition> | ||
<not> | ||
<antversion atleast="1.7.1"/> | ||
</not> | ||
</condition> | ||
</fail> | ||
<property file="nbproject/private/platform-private.properties"/> | ||
<property file="nbproject/platform.properties"/> | ||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2"> | ||
<attribute name="name"/> | ||
<attribute name="value"/> | ||
<sequential> | ||
<property name="@{name}" value="${@{value}}"/> | ||
</sequential> | ||
</macrodef> | ||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2"> | ||
<attribute name="property"/> | ||
<attribute name="value"/> | ||
<sequential> | ||
<property name="@{property}" value="@{value}"/> | ||
</sequential> | ||
</macrodef> | ||
<property file="${user.properties.file}"/> | ||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness)."> | ||
<condition> | ||
<not> | ||
<contains string="${cluster.path.evaluated}" substring="platform"/> | ||
</not> | ||
</condition> | ||
</fail> | ||
<import file="${harness.dir}/build.xml"/> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
build.xml.data.CRC32=d9ed0076 | ||
build.xml.script.CRC32=00ff8b45 | ||
build.xml.stylesheet.CRC32=[email protected] | ||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. | ||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. | ||
nbproject/build-impl.xml.data.CRC32=d9ed0076 | ||
nbproject/build-impl.xml.script.CRC32=c0daf4dd | ||
nbproject/build-impl.xml.stylesheet.CRC32=[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cluster.path=\ | ||
${nbplatform.active.dir}/autopsy:\ | ||
${nbplatform.active.dir}/harness:\ | ||
${nbplatform.active.dir}/java:\ | ||
${nbplatform.active.dir}/platform | ||
nbjdk.active=default | ||
nbplatform.active=Autopsy_4.21.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml | ||
javac.source=1.8 | ||
javac.compilerargs=-Xlint -Xlint:-serial | ||
nbm.needs.restart=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://www.netbeans.org/ns/project/1"> | ||
<type>org.netbeans.modules.apisupport.project</type> | ||
<configuration> | ||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3"> | ||
<code-name-base>uk.oshawk.UsnCorrelation</code-name-base> | ||
<standalone/> | ||
<module-dependencies> | ||
<dependency> | ||
<code-name-base>org.openide.awt</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<specification-version>7.75</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.openide.io</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<specification-version>1.56</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.openide.nodes</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<specification-version>7.52</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.openide.util</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<specification-version>9.14</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.openide.util.lookup</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<specification-version>8.40</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.openide.util.ui</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<specification-version>9.15</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.openide.windows</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<specification-version>6.84</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.sleuthkit.autopsy.core</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<release-version>10</release-version> | ||
<specification-version>10.24.37</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
</module-dependencies> | ||
<test-dependencies> | ||
<test-type> | ||
<name>unit</name> | ||
<test-dependency> | ||
<code-name-base>org.netbeans.libs.junit4</code-name-base> | ||
<compile-dependency/> | ||
</test-dependency> | ||
</test-type> | ||
</test-dependencies> | ||
<public-packages/> | ||
</data> | ||
</configuration> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
OpenIDE-Module-Name=UsnCorrelation |
62 changes: 62 additions & 0 deletions
62
src/uk/oshawk/UsnCorrelation/UsnCorrelationContextMenuActionsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package uk.oshawk.UsnCorrelation; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.List; | ||
import javax.swing.Action; | ||
import org.openide.util.Utilities; | ||
import org.openide.util.lookup.ServiceProvider; | ||
import org.sleuthkit.autopsy.corecomponentinterfaces.ContextMenuActionsProvider; | ||
import org.sleuthkit.autopsy.coreutils.Logger; | ||
import org.sleuthkit.datamodel.AbstractFile; | ||
|
||
@ServiceProvider(service = ContextMenuActionsProvider.class) | ||
public class UsnCorrelationContextMenuActionsProvider implements ContextMenuActionsProvider { | ||
// Used to add right-click actions. | ||
|
||
@Override | ||
public List<Action> getActions() { | ||
// Triggered when a file or group of items (generally files) are right-clicked. | ||
// Adds the graphical timeline and CSV export options. | ||
|
||
ArrayList<Action> actionsList = new ArrayList<>(); | ||
|
||
// Extract the files from the selection. | ||
Collection<? extends AbstractFile> selectedFiles = Utilities.actionsGlobalContext().lookupAll(AbstractFile.class); | ||
|
||
// The options only make sense if a single file is selected. | ||
if (selectedFiles.size() != 1) { | ||
return actionsList; | ||
} | ||
|
||
// Conveniant way of getting the single selected file from the list. Will not loop. | ||
for (AbstractFile selectedFile : selectedFiles) { | ||
AbstractFile usn = UsnProcessor.getUsnForFile(selectedFile); | ||
|
||
// The selected file's file system has no $UsnJrnl file. | ||
if (usn == null) { | ||
continue; | ||
} | ||
|
||
UsnFile usnFile = UsnProcessor.INSTANCE.getUsnFile(usn); | ||
|
||
// Only add the child actions if the selected file has child entries. | ||
if (!usnFile.getChildEntries(selectedFile).isEmpty()) { | ||
actionsList.add(new UsnCorrelationTimelineAction(selectedFile, true)); | ||
actionsList.add(new UsnCorrelationExportAction(selectedFile, true)); | ||
} | ||
|
||
// Only add the parent actions if the selected file has parent entries. | ||
if (!usnFile.getParentEntries(selectedFile).isEmpty()) { | ||
actionsList.add(new UsnCorrelationTimelineAction(selectedFile, false)); | ||
actionsList.add(new UsnCorrelationExportAction(selectedFile, false)); | ||
} | ||
|
||
if (UsnUtil.TEST_LOGGING) { | ||
Logger.getLogger("uk.oshawk.UsnCorrelation").info(String.format("[F15] Right click actions added for file (index=%d, sequence_number=%d).", selectedFile.getMetaAddr(), selectedFile.getMetaSeq())); | ||
} | ||
} | ||
|
||
return actionsList; | ||
} | ||
} |
Oops, something went wrong.