Merge branch 'master' of github.com:sleuthkit/autopsy

This commit is contained in:
Brian Carrier 2012-06-05 18:12:51 -04:00
commit 36cafdec01
25 changed files with 264 additions and 220 deletions

View File

@ -6,6 +6,9 @@
</Component> </Component>
</NonVisualComponents> </NonVisualComponents>
<Properties> <Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[559, 328]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[588, 308]"/> <Dimension value="[588, 308]"/>
</Property> </Property>
@ -28,14 +31,6 @@
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="noProcessUnallocSpace" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="imgPathLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="imgPathTextField" min="-2" pref="389" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="imgPathBrowserButton" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="imgTypeLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="imgTypeLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace min="10" pref="10" max="10" attributes="0"/> <EmptySpace min="10" pref="10" max="10" attributes="0"/>
@ -49,16 +44,30 @@
<Component id="imgInfoLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="imgInfoLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="optionsLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="10" pref="10" max="10" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="noFatOrphansCheckbox" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="noProcessUnallocSpace" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Group type="102" attributes="1"> <Group type="102" alignment="0" attributes="1">
<Component id="timeZoneLabel" min="-2" max="-2" attributes="0"/> <Component id="timeZoneLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
<Component id="timeZoneComboBox" min="-2" pref="253" max="-2" attributes="0"/> <Component id="timeZoneComboBox" min="-2" pref="253" max="-2" attributes="0"/>
</Group> </Group>
<Component id="noFatOrphansCheckbox" alignment="0" min="-2" max="-2" attributes="0"/> <Group type="102" alignment="0" attributes="0">
<Component id="imgPathLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="imgPathTextField" min="-2" pref="389" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="imgPathBrowserButton" min="-2" max="-2" attributes="0"/>
</Group>
</Group> </Group>
</Group> </Group>
<EmptySpace pref="39" max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -83,21 +92,16 @@
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="multipleSelectLabel" min="-2" max="-2" attributes="0"/> <Component id="multipleSelectLabel" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0"> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="102" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
<EmptySpace type="unrelated" max="-2" attributes="0"/> <Component id="timeZoneLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0"> <Component id="timeZoneComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="timeZoneLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="timeZoneComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="28" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="noProcessUnallocSpace" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
</Group>
</Group> </Group>
<EmptySpace max="32767" attributes="0"/>
<Component id="optionsLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="noProcessUnallocSpace" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
<Component id="noFatOrphansCheckbox" min="-2" max="-2" attributes="0"/> <Component id="noFatOrphansCheckbox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
@ -251,5 +255,12 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="noProcessUnallocSpaceActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="noProcessUnallocSpaceActionPerformed"/>
</Events> </Events>
</Component> </Component>
<Component class="javax.swing.JLabel" name="optionsLabel1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="AddImageVisualPanel1.optionsLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -222,7 +222,9 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
jLabel2 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel();
noFatOrphansCheckbox = new javax.swing.JCheckBox(); noFatOrphansCheckbox = new javax.swing.JCheckBox();
noProcessUnallocSpace = new javax.swing.JCheckBox(); noProcessUnallocSpace = new javax.swing.JCheckBox();
optionsLabel1 = new javax.swing.JLabel();
setMinimumSize(new java.awt.Dimension(559, 328));
setPreferredSize(new java.awt.Dimension(588, 308)); setPreferredSize(new java.awt.Dimension(588, 308));
org.openide.awt.Mnemonics.setLocalizedText(rawSingle, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.rawSingle.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(rawSingle, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.rawSingle.text")); // NOI18N
@ -286,6 +288,8 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
} }
}); });
org.openide.awt.Mnemonics.setLocalizedText(optionsLabel1, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.optionsLabel1.text")); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
@ -293,13 +297,6 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(noProcessUnallocSpace)
.addGroup(layout.createSequentialGroup()
.addComponent(imgPathLabel)
.addGap(18, 18, 18)
.addComponent(imgPathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(imgPathBrowserButton))
.addComponent(imgTypeLabel) .addComponent(imgTypeLabel)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addGap(10, 10, 10) .addGap(10, 10, 10)
@ -311,13 +308,24 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
.addComponent(imgInfoLabel) .addComponent(imgInfoLabel)
.addComponent(jLabel1) .addComponent(jLabel1)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(optionsLabel1)
.addGroup(layout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(noFatOrphansCheckbox)
.addComponent(noProcessUnallocSpace)))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(timeZoneLabel) .addComponent(timeZoneLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(noFatOrphansCheckbox, javax.swing.GroupLayout.Alignment.LEADING))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addContainerGap(39, Short.MAX_VALUE)) .addComponent(imgPathLabel)
.addGap(18, 18, 18)
.addComponent(imgPathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(imgPathBrowserButton))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -339,17 +347,15 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
.addComponent(imgPathBrowserButton)) .addComponent(imgPathBrowserButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(multipleSelectLabel) .addComponent(multipleSelectLabel)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(timeZoneLabel)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(timeZoneLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(optionsLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createSequentialGroup() .addComponent(noProcessUnallocSpace)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGap(3, 3, 3)
.addComponent(noProcessUnallocSpace)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
.addComponent(noFatOrphansCheckbox) .addComponent(noFatOrphansCheckbox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
@ -484,6 +490,7 @@ private void noProcessUnallocSpaceActionPerformed(java.awt.event.ActionEvent evt
private javax.swing.JLabel multipleSelectLabel; private javax.swing.JLabel multipleSelectLabel;
private javax.swing.JCheckBox noFatOrphansCheckbox; private javax.swing.JCheckBox noFatOrphansCheckbox;
private javax.swing.JCheckBox noProcessUnallocSpace; private javax.swing.JCheckBox noProcessUnallocSpace;
private javax.swing.JLabel optionsLabel1;
private static javax.swing.JRadioButton rawSingle; private static javax.swing.JRadioButton rawSingle;
private javax.swing.JRadioButton rawSplit; private javax.swing.JRadioButton rawSplit;
private javax.swing.JComboBox timeZoneComboBox; private javax.swing.JComboBox timeZoneComboBox;

View File

@ -125,5 +125,6 @@ NewCaseVisualPanel2.caseNumberLabel.text=Case Number:
NewCaseVisualPanel2.examinerTextField.text= NewCaseVisualPanel2.examinerTextField.text=
NewCaseVisualPanel2.optionalLabel.text=Optional: Set Case Number and Examiner NewCaseVisualPanel2.optionalLabel.text=Optional: Set Case Number and Examiner
AddImageVisualPanel1.noFatOrphansCheckbox.toolTipText= AddImageVisualPanel1.noFatOrphansCheckbox.toolTipText=
AddImageVisualPanel1.noFatOrphansCheckbox.text=Disable in-depth file recovery of FAT file systems (faster results, but may miss deleted files) AddImageVisualPanel1.noFatOrphansCheckbox.text=Ignore orphan files in FAT file systems
AddImageVisualPanel1.noProcessUnallocSpace.text=Disable recovery of unallocated space AddImageVisualPanel1.noProcessUnallocSpace.text=Ignore unallocated space
AddImageVisualPanel1.optionsLabel1.text=Options to produce results faster (although some data will not be searched):

View File

@ -24,14 +24,13 @@
<Component id="jScrollPane1" alignment="1" pref="274" max="32767" attributes="1"/> <Component id="jScrollPane1" alignment="1" pref="274" max="32767" attributes="1"/>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0"> <EmptySpace pref="159" max="32767" attributes="0"/>
<EmptySpace min="10" pref="10" max="10" attributes="0"/> </Group>
<Component id="nsrlNameLabel" min="-2" max="-2" attributes="0"/> <Group type="102" alignment="0" attributes="0">
</Group> <EmptySpace min="-2" pref="53" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="nsrlNameLabel" min="-2" max="-2" attributes="0"/>
</Group> <EmptySpace pref="110" max="32767" attributes="0"/>
<EmptySpace pref="143" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -39,9 +38,9 @@
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="nsrlNameLabel" min="-2" max="-2" attributes="0"/> <Component id="nsrlNameLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/> <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="106" max="32767" attributes="0"/> <Component id="jScrollPane1" pref="106" max="32767" attributes="0"/>

View File

@ -112,12 +112,12 @@ public class HashDbSimplePanel extends javax.swing.JPanel {
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2)
.addGroup(layout.createSequentialGroup() .addContainerGap(159, Short.MAX_VALUE))
.addGap(10, 10, 10) .addGroup(layout.createSequentialGroup()
.addComponent(nsrlNameLabel)) .addGap(53, 53, 53)
.addComponent(jLabel2)) .addComponent(nsrlNameLabel)
.addContainerGap(143, Short.MAX_VALUE)) .addContainerGap(110, Short.MAX_VALUE))
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -160,7 +160,8 @@ public class HashDbSimplePanel extends javax.swing.JPanel {
@Override @Override
public int getRowCount() { public int getRowCount() {
return xmlHandle.getKnownBadSets().size(); int size = xmlHandle.getKnownBadSets().size();
return size == 0 ? 1 : size;
} }
@Override @Override
@ -170,11 +171,19 @@ public class HashDbSimplePanel extends javax.swing.JPanel {
@Override @Override
public Object getValueAt(int rowIndex, int columnIndex) { public Object getValueAt(int rowIndex, int columnIndex) {
HashDb db = xmlHandle.getKnownBadSets().get(rowIndex); if (xmlHandle.getKnownBadSets().isEmpty()) {
if(columnIndex == 0) { if (columnIndex == 0) {
return db.getUseForIngest(); return "";
} else {
return "No notable databases set.";
}
} else { } else {
return db.getName(); HashDb db = xmlHandle.getKnownBadSets().get(rowIndex);
if (columnIndex == 0) {
return db.getUseForIngest();
} else {
return db.getName();
}
} }
} }

View File

@ -3,6 +3,6 @@ build.xml.script.CRC32=87b97b04
build.xml.stylesheet.CRC32=a56c6a5b@1.46.2 build.xml.stylesheet.CRC32=a56c6a5b@1.46.2
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # 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. # 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=d7ecf067 nbproject/build-impl.xml.data.CRC32=ab518119
nbproject/build-impl.xml.script.CRC32=fe1f48d2 nbproject/build-impl.xml.script.CRC32=fe1f48d2
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.2 nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.2

View File

@ -43,13 +43,13 @@
<Group type="102" attributes="0"> <Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="hitLabel" min="-2" max="-2" attributes="0"/> <Component id="hitLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="hitCountLabel" min="-2" max="-2" attributes="0"/> <Component id="hitCountLabel" min="-2" pref="26" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="hitOfLabel" min="-2" max="-2" attributes="0"/> <Component id="hitOfLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="hitTotalLabel" min="-2" max="-2" attributes="0"/> <Component id="hitTotalLabel" min="-2" pref="34" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="hitButtonsLabel" min="-2" max="-2" attributes="0"/> <Component id="hitButtonsLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="hitPreviousButton" min="-2" pref="23" max="-2" attributes="0"/> <Component id="hitPreviousButton" min="-2" pref="23" max="-2" attributes="0"/>

View File

@ -225,13 +225,13 @@ class ExtractedContentPanel extends javax.swing.JPanel {
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addComponent(hitLabel) .addComponent(hitLabel)
.addGap(18, 18, 18) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(hitCountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(hitCountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(hitOfLabel) .addComponent(hitOfLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(hitTotalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(hitTotalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(26, 26, 26) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(hitButtonsLabel) .addComponent(hitButtonsLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(hitPreviousButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(hitPreviousButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)

View File

@ -321,14 +321,10 @@ class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
q.setQuery(sb.toString()); q.setQuery(sb.toString());
} else { } else {
//use default field, simplifies query //use default field, simplifies query
//quote only if user supplies quotes //always force grouping/quotes
q.setQuery(highlightQuery); q.setQuery(KeywordSearchUtil.quoteQuery(highlightQuery));
} }
//if (isRegex)
// q.setQuery(highLightField + ":" + highlightQuery);
//else q.setQuery(highlightQuery); //use default field, simplifies query
final long contentId = content.getId(); final long contentId = content.getId();
String contentIdStr = Long.toString(contentId); String contentIdStr = Long.toString(contentId);

View File

@ -78,7 +78,7 @@ public final class KeywordSearchIngestService implements IngestServiceAbstractFi
private volatile boolean finalSearcherDone = false; private volatile boolean finalSearcherDone = false;
private final String hashDBServiceName = "Hash Lookup"; private final String hashDBServiceName = "Hash Lookup";
private SleuthkitCase caseHandle = null; private SleuthkitCase caseHandle = null;
private boolean skipKnown = false; private boolean skipKnown = true;
boolean initialized = false; boolean initialized = false;
public enum IngestStatus { public enum IngestStatus {

View File

@ -48,6 +48,12 @@ public interface KeywordSearchQuery {
*/ */
public void setFilter(KeywordQueryFilter filter); public void setFilter(KeywordQueryFilter filter);
/**
* Set an optional field to narrow down the search
* @param field field to set on the query
*/
public void setField(String field);
/** /**
* escape the query string and use the escaped string in the query * escape the query string and use the escaped string in the query

View File

@ -59,6 +59,24 @@ public class KeywordSearchUtil {
return dirName; return dirName;
} }
/**
* Return a quoted version of the query if the original query is not quoted
* @param query the query to check if it is quoted
* @return quoted query
*/
public static String quoteQuery(String query) {
//ensure a single pair of quotes around the query
final int length = query.length();
if (length > 1 && query.charAt(0) == '"'
&& query.charAt(length - 1) == '"') {
return query;
}
StringBuilder sb = new StringBuilder();
sb.append("\"").append(query).append("\"");
return sb.toString();
}
/** /**
* Perform standard escaping / encoding into UTF-8 before sending over net * Perform standard escaping / encoding into UTF-8 before sending over net
* @param query to be encoded * @param query to be encoded
@ -143,5 +161,4 @@ public class KeywordSearchUtil {
return false; return false;
} }
} }
} }

View File

@ -50,6 +50,7 @@ public class LuceneQuery implements KeywordSearchQuery {
private boolean isEscaped; private boolean isEscaped;
private Keyword keywordQuery = null; private Keyword keywordQuery = null;
private KeywordQueryFilter filter = null; private KeywordQueryFilter filter = null;
private String field = null;
//use different highlight Solr fields for regex and literal search //use different highlight Solr fields for regex and literal search
static final String HIGHLIGHT_FIELD_LITERAL = Server.Schema.CONTENT.toString(); static final String HIGHLIGHT_FIELD_LITERAL = Server.Schema.CONTENT.toString();
static final String HIGHLIGHT_FIELD_REGEX = Server.Schema.CONTENT.toString(); static final String HIGHLIGHT_FIELD_REGEX = Server.Schema.CONTENT.toString();
@ -71,6 +72,11 @@ public class LuceneQuery implements KeywordSearchQuery {
public void setFilter(KeywordQueryFilter filter) { public void setFilter(KeywordQueryFilter filter) {
this.filter = filter; this.filter = filter;
} }
@Override
public void setField(String field) {
this.field = field;
}
@Override @Override
public void escape() { public void escape() {
@ -164,11 +170,11 @@ public class LuceneQuery implements KeywordSearchQuery {
return null; return null;
} }
/** /**
* Just perform the query and return result without updating the GUI * Perform the query and return result
* This utility is used in this class, can be potentially reused by other classes * @return list of ContentHit objects
* @param query * @throws NoOpenCoreException
* @return matches List
*/ */
private List<ContentHit> performLuceneQuery() throws NoOpenCoreException { private List<ContentHit> performLuceneQuery() throws NoOpenCoreException {
@ -181,14 +187,22 @@ public class LuceneQuery implements KeywordSearchQuery {
SolrQuery q = new SolrQuery(); SolrQuery q = new SolrQuery();
q.setQuery(queryEscaped); //set query, force quotes/grouping around all literal queries
final String groupedQuery = KeywordSearchUtil.quoteQuery(queryEscaped);
String theQueryStr = groupedQuery;
if (field != null) {
//use the optional field
StringBuilder sb = new StringBuilder();
sb.append(field).append(":").append(groupedQuery);
theQueryStr = sb.toString();
}
q.setQuery(theQueryStr);
q.setRows(ROWS_PER_FETCH); q.setRows(ROWS_PER_FETCH);
q.setFields(Server.Schema.ID.toString()); q.setFields(Server.Schema.ID.toString());
if (filter != null) { if (filter != null) {
q.addFilterQuery(filter.toString()); q.addFilterQuery(filter.toString());
} }
for (int start = 0; !allMatchesFetched; start = start + ROWS_PER_FETCH) { for (int start = 0; !allMatchesFetched; start = start + ROWS_PER_FETCH) {
q.setStart(start); q.setStart(start);
@ -247,7 +261,6 @@ public class LuceneQuery implements KeywordSearchQuery {
throw ex; throw ex;
} catch (SolrServerException ex) { } catch (SolrServerException ex) {
logger.log(Level.WARNING, "Error executing Lucene Solr Query: " + query, ex); logger.log(Level.WARNING, "Error executing Lucene Solr Query: " + query, ex);
// TODO: handle bad query strings, among other issues
} }
} }
@ -303,8 +316,8 @@ public class LuceneQuery implements KeywordSearchQuery {
q.setQuery(sb.toString()); q.setQuery(sb.toString());
} else { } else {
//simplify query/escaping and use default field //simplify query/escaping and use default field
//quote only if user supplies quotes //always force grouping/quotes
q.setQuery(query); q.setQuery(KeywordSearchUtil.quoteQuery(query));
} }
String contentIDStr = null; String contentIDStr = null;

View File

@ -22,35 +22,22 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException; import java.util.regex.PatternSyntaxException;
import javax.swing.SwingWorker;
import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.response.TermsResponse; import org.apache.solr.client.solrj.response.TermsResponse;
import org.apache.solr.client.solrj.response.TermsResponse.Term; import org.apache.solr.client.solrj.response.TermsResponse.Term;
import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import org.openide.windows.TopComponent;
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
import org.sleuthkit.autopsy.keywordsearch.KeywordSearchQueryManager.Presentation;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE; import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE; import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
import org.sleuthkit.datamodel.FsContent;
import org.sleuthkit.datamodel.TskException; import org.sleuthkit.datamodel.TskException;
public class TermComponentQuery implements KeywordSearchQuery { public class TermComponentQuery implements KeywordSearchQuery {
@ -67,6 +54,7 @@ public class TermComponentQuery implements KeywordSearchQuery {
private List<Term> terms; private List<Term> terms;
private Keyword keywordQuery = null; private Keyword keywordQuery = null;
private KeywordQueryFilter filter = null; private KeywordQueryFilter filter = null;
private String field = null;
public TermComponentQuery(Keyword keywordQuery) { public TermComponentQuery(Keyword keywordQuery) {
this.keywordQuery = keywordQuery; this.keywordQuery = keywordQuery;
@ -76,12 +64,16 @@ public class TermComponentQuery implements KeywordSearchQuery {
terms = null; terms = null;
} }
@Override @Override
public void setFilter(KeywordQueryFilter filter) { public void setFilter(KeywordQueryFilter filter) {
this.filter = filter; this.filter = filter;
} }
@Override
public void setField(String field) {
this.field = field;
}
@Override @Override
public void escape() { public void escape() {
queryEscaped = Pattern.quote(termsQuery); queryEscaped = Pattern.quote(termsQuery);
@ -109,7 +101,7 @@ public class TermComponentQuery implements KeywordSearchQuery {
public boolean isEscaped() { public boolean isEscaped() {
return isEscaped; return isEscaped;
} }
@Override @Override
public boolean isLiteral() { public boolean isLiteral() {
return false; return false;
@ -224,7 +216,7 @@ public class TermComponentQuery implements KeywordSearchQuery {
} }
@Override @Override
public Map<String, List<ContentHit>> performQuery() throws NoOpenCoreException{ public Map<String, List<ContentHit>> performQuery() throws NoOpenCoreException {
Map<String, List<ContentHit>> results = new HashMap<String, List<ContentHit>>(); Map<String, List<ContentHit>> results = new HashMap<String, List<ContentHit>>();
final SolrQuery q = createQuery(); final SolrQuery q = createQuery();
@ -232,15 +224,13 @@ public class TermComponentQuery implements KeywordSearchQuery {
for (Term term : terms) { for (Term term : terms) {
final String termS = KeywordSearchUtil.escapeLuceneQuery(term.getTerm(), true, false); final String termStr = KeywordSearchUtil.escapeLuceneQuery(term.getTerm(), true, false);
StringBuilder filesQueryB = new StringBuilder(); LuceneQuery filesQuery = new LuceneQuery(termStr);
filesQueryB.append(TERMS_SEARCH_FIELD).append(":").append(termS); filesQuery.setField(TERMS_SEARCH_FIELD);
final String queryStr = filesQueryB.toString(); if (filter != null) {
LuceneQuery filesQuery = new LuceneQuery(queryStr);
if (filter != null)
filesQuery.setFilter(filter); filesQuery.setFilter(filter);
}
try { try {
Map<String, List<ContentHit>> subResults = filesQuery.performQuery(); Map<String, List<ContentHit>> subResults = filesQuery.performQuery();
Set<ContentHit> filesResults = new HashSet<ContentHit>(); Set<ContentHit> filesResults = new HashSet<ContentHit>();
@ -248,12 +238,10 @@ public class TermComponentQuery implements KeywordSearchQuery {
filesResults.addAll(subResults.get(key)); filesResults.addAll(subResults.get(key));
} }
results.put(term.getTerm(), new ArrayList<ContentHit>(filesResults)); results.put(term.getTerm(), new ArrayList<ContentHit>(filesResults));
} } catch (NoOpenCoreException e) {
catch (NoOpenCoreException e) {
logger.log(Level.WARNING, "Error executing Solr query,", e); logger.log(Level.WARNING, "Error executing Solr query,", e);
throw e; throw e;
} } catch (RuntimeException e) {
catch (RuntimeException e) {
logger.log(Level.WARNING, "Error executing Solr query,", e); logger.log(Level.WARNING, "Error executing Solr query,", e);
} }
@ -262,5 +250,4 @@ public class TermComponentQuery implements KeywordSearchQuery {
return results; return results;
} }
} }

View File

@ -44,7 +44,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
// TSK Imports // TSK Imports
import javax.swing.JPanel;
import org.openide.modules.InstalledFileLocator; import org.openide.modules.InstalledFileLocator;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.datamodel.ContentUtils; import org.sleuthkit.autopsy.datamodel.ContentUtils;

View File

@ -1,4 +1,3 @@
file.reference.commons-logging-1.1.jar=release/modules/ext/commons-logging-1.1.jar
file.reference.dom4j-1.6.1.jar=release/modules/ext/dom4j-1.6.1.jar file.reference.dom4j-1.6.1.jar=release/modules/ext/dom4j-1.6.1.jar
file.reference.jdom-1.1.2.jar=release/modules/ext/jdom-1.1.2.jar file.reference.jdom-1.1.2.jar=release/modules/ext/jdom-1.1.2.jar
file.reference.junit-3.8.1.jar=release/modules/ext/junit-3.8.1.jar file.reference.junit-3.8.1.jar=release/modules/ext/junit-3.8.1.jar

View File

@ -137,6 +137,14 @@
<runtime-relative-path>ext/junit-3.8.1.jar</runtime-relative-path> <runtime-relative-path>ext/junit-3.8.1.jar</runtime-relative-path>
<binary-origin>release/modules/ext/junit-3.8.1.jar</binary-origin> <binary-origin>release/modules/ext/junit-3.8.1.jar</binary-origin>
</class-path-extension> </class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/commons-logging-1.1.1.jar</runtime-relative-path>
<binary-origin>release/modules/ext/commons-logging-1.1.1.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/commons-lang-2.4.jar</runtime-relative-path>
<binary-origin>release/modules/ext/commons-lang-2.4.jar</binary-origin>
</class-path-extension>
<class-path-extension> <class-path-extension>
<runtime-relative-path>ext/poi-ooxml-schemas-3.8-20120326.jar</runtime-relative-path> <runtime-relative-path>ext/poi-ooxml-schemas-3.8-20120326.jar</runtime-relative-path>
<binary-origin>release/modules/ext/poi-ooxml-schemas-3.8-20120326.jar</binary-origin> <binary-origin>release/modules/ext/poi-ooxml-schemas-3.8-20120326.jar</binary-origin>
@ -165,10 +173,6 @@
<runtime-relative-path>ext/stax-api-1.0.1.jar</runtime-relative-path> <runtime-relative-path>ext/stax-api-1.0.1.jar</runtime-relative-path>
<binary-origin>release/modules/ext/stax-api-1.0.1.jar</binary-origin> <binary-origin>release/modules/ext/stax-api-1.0.1.jar</binary-origin>
</class-path-extension> </class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/commons-logging-1.1.jar</runtime-relative-path>
<binary-origin>release/modules/ext/commons-logging-1.1.jar</binary-origin>
</class-path-extension>
<class-path-extension> <class-path-extension>
<runtime-relative-path>ext/log4j-1.2.13.jar</runtime-relative-path> <runtime-relative-path>ext/log4j-1.2.13.jar</runtime-relative-path>
<binary-origin>release/modules/ext/log4j-1.2.13.jar</binary-origin> <binary-origin>release/modules/ext/log4j-1.2.13.jar</binary-origin>
@ -177,10 +181,6 @@
<runtime-relative-path>ext/xmlbeans-2.3.0.jar</runtime-relative-path> <runtime-relative-path>ext/xmlbeans-2.3.0.jar</runtime-relative-path>
<binary-origin>release/modules/ext/xmlbeans-2.3.0.jar</binary-origin> <binary-origin>release/modules/ext/xmlbeans-2.3.0.jar</binary-origin>
</class-path-extension> </class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/commons-lang3-3.1.jar</runtime-relative-path>
<binary-origin>release/modules/ext/commons-lang3-3.1.jar</binary-origin>
</class-path-extension>
</data> </data>
</configuration> </configuration>
</project> </project>

Binary file not shown.

Binary file not shown.

View File

@ -34,7 +34,7 @@ import java.util.Map.Entry;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.openide.util.Exceptions; import org.apache.commons.lang.StringEscapeUtils;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.datamodel.*; import org.sleuthkit.datamodel.*;
@ -281,11 +281,10 @@ public class ReportHTML implements ReportModule {
String value = ""; String value = "";
Integer type = tempatt.getAttributeTypeID(); Integer type = tempatt.getAttributeTypeID();
if (type.equals(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID()) || type.equals(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_LAST_ACCESSED.getTypeID())) { if (type.equals(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID()) || type.equals(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_LAST_ACCESSED.getTypeID())) {
try {
SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
value = sdf.format(new java.util.Date((tempatt.getValueLong()))); value = sdf.format(new java.util.Date((tempatt.getValueLong() * 1000)));
} catch (Exception ex) {
}
} else { } else {
value = tempatt.getValueString(); value = tempatt.getValueString();
} }
@ -293,7 +292,7 @@ public class ReportHTML implements ReportModule {
value = ""; value = "";
} }
value = ReportUtils.insertPeriodically(value, "<br>", 30); value = ReportUtils.insertPeriodically(value, "<br>", 30);
attributes.put(type, value); attributes.put(type, StringEscapeUtils.escapeHtml(value));
} }

View File

@ -21,7 +21,6 @@
package org.sleuthkit.autopsy.report; package org.sleuthkit.autopsy.report;
import java.awt.Desktop; import java.awt.Desktop;
import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.File; import java.io.File;
@ -34,6 +33,7 @@ import java.util.Map.Entry;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
@ -214,7 +214,7 @@ public class ReportXLS implements ReportModule {
sheetKeyword.getRow(0).createCell(0).setCellValue("Keyword"); sheetKeyword.getRow(0).createCell(0).setCellValue("Keyword");
sheetKeyword.getRow(0).createCell(1).setCellValue("File Name"); sheetKeyword.getRow(0).createCell(1).setCellValue("File Name");
sheetKeyword.getRow(0).createCell(2).setCellValue("Preview"); sheetKeyword.getRow(0).createCell(2).setCellValue("Preview");
sheetKeyword.getRow(0).createCell(3).setCellValue("Keyword LIst"); sheetKeyword.getRow(0).createCell(3).setCellValue("Keyword List");
sheetRecent.setDefaultColumnStyle(1, defaultstyle); sheetRecent.setDefaultColumnStyle(1, defaultstyle);
sheetRecent.createRow(0).setRowStyle(style); sheetRecent.createRow(0).setRowStyle(style);
@ -283,6 +283,7 @@ public class ReportXLS implements ReportModule {
int cc = 0; int cc = 0;
Long objId = entry.getKey().getObjectID(); Long objId = entry.getKey().getObjectID();
AbstractFile file = skCase.getAbstractFileById(objId); AbstractFile file = skCase.getAbstractFileById(objId);
String filename = file.getName();
Long filesize = file.getSize(); Long filesize = file.getSize();
TreeMap<Integer, String> attributes = new TreeMap<Integer, String>(); TreeMap<Integer, String> attributes = new TreeMap<Integer, String>();
// Get all the attributes, line them up to be added. Place empty string placeholders for each attribute type // Get all the attributes, line them up to be added. Place empty string placeholders for each attribute type
@ -297,14 +298,13 @@ public class ReportXLS implements ReportModule {
} }
String value = ""; String value = "";
int type = tempatt.getAttributeTypeID(); int type = tempatt.getAttributeTypeID();
if (tempatt.getValueString() == null || "null".equals(tempatt.getValueString())) { if (tempatt.getAttributeTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID() || tempatt.getAttributeTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_LAST_ACCESSED.getTypeID()) {
} else if (type == 2 || type == 33) { value = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(new java.util.Date((tempatt.getValueLong()) * 1000)).toString();
value = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(new java.util.Date((tempatt.getValueLong()) * 1000));
} else { } else {
value = tempatt.getValueString(); value = tempatt.getValueString();
} }
attributes.put(type, value); attributes.put(type, StringEscapeUtils.escapeXml(value));
cc++; cc++;
} }
@ -368,7 +368,7 @@ public class ReportXLS implements ReportModule {
countedKeyword++; countedKeyword++;
Row temp = sheetKeyword.createRow(countedKeyword); Row temp = sheetKeyword.createRow(countedKeyword);
temp.createCell(0).setCellValue(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID())); temp.createCell(0).setCellValue(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID()));
temp.createCell(1).setCellValue(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME.getTypeID())); temp.createCell(1).setCellValue(filename);
temp.createCell(2).setCellValue(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID())); temp.createCell(2).setCellValue(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID()));
temp.createCell(3).setCellValue(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID())); temp.createCell(3).setCellValue(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()));
} }

View File

@ -32,7 +32,7 @@ import java.util.Map.Entry;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang.StringEscapeUtils;
import org.jdom.Comment; import org.jdom.Comment;
import org.jdom.Document; import org.jdom.Document;
import org.jdom.Element; import org.jdom.Element;
@ -129,7 +129,7 @@ public class ReportXML implements ReportModule {
Element attribute = new Element("Attribute").setAttribute("Type", tempatt.getAttributeTypeDisplayName()); Element attribute = new Element("Attribute").setAttribute("Type", tempatt.getAttributeTypeDisplayName());
String tempvalue = tempatt.getValueString(); String tempvalue = tempatt.getValueString();
//INVALID_XML_CHARS.matcher(tempvalue).replaceAll(""); //INVALID_XML_CHARS.matcher(tempvalue).replaceAll("");
Element value = new Element("Value").setText(tempvalue); Element value = new Element("Value").setText(StringEscapeUtils.escapeXml(tempvalue));
attribute.addContent(value); attribute.addContent(value);
Element context = new Element("Context").setText(StringEscapeUtils.escapeXml(tempatt.getContext())); Element context = new Element("Context").setText(StringEscapeUtils.escapeXml(tempatt.getContext()));
attribute.addContent(context); attribute.addContent(context);

View File

@ -1,71 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See harness/README in the NetBeans platform --> <!-- 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). --> <!-- 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. --> <!-- If you delete this file and reopen the project it will be recreated. -->
<project name="org.sleuthkit.autopsy.testing" default="netbeans" basedir="."> <project name="org.sleuthkit.autopsy.testing" default="netbeans" basedir=".">
<description>Builds, tests, and runs the project org.sleuthkit.autopsy.testing.</description> <description>Builds, tests, and runs the project org.sleuthkit.autopsy.testing.</description>
<import file="nbproject/build-impl.xml"/> <import file="nbproject/build-impl.xml"/>
<target name="set-args"> <target name="set-args">
<property name="img_path" value="C:\Users\dfickling\Desktop\test-data\64mb2.img"/> <property name="img_path" value="C:\Users\dfickling\Desktop\test-data\64mb2.img"/>
<property name="known_bad_path" value="C:\Users\dfickling\Desktop\test-data\notable_files.txt"/> <property name="known_bad_path" value="C:\Users\dfickling\Desktop\test-data\notable_files.txt"/>
<property name="nsrl_path" value="C:\Users\dfickling\Desktop\NSRLComplete.txt-md5.idx"/> <property name="nsrl_path" value="C:\Users\dfickling\Desktop\NSRLComplete.txt-md5.idx"/>
<property name="keyword_path" value="C:\Users\dfickling\Desktop\test-data\notable_words.xml"/> <property name="keyword_path" value="C:\Users\dfickling\Desktop\test-data\notable_words.xml"/>
<property name="gold_path" value="C:\Users\dfickling\Desktop\test-data\win7-ren.txt"/> <property name="gold_path" value="C:\Users\dfickling\Desktop\test-data\win7-ren.txt"/>
<property name="out_path" value="C:\Users\dfickling\Desktop\test-data"/> <property name="out_path" value="C:\Users\dfickling\Desktop\test-data"/>
</target> </target>
<target name="check-args"> <!-- remove dependency on set-args to get from script --> <target name="check-args"> <!-- remove dependency on set-args to get from script -->
<fail message="Missing required argument: img_path" unless="img_path"/> <fail message="Missing required argument: img_path" unless="img_path"/>
<fail message="Missing required argument: gold_path" unless="gold_path"/> <fail message="Missing required argument: gold_path" unless="gold_path"/>
<fail message="Missing required argument: out_path" unless="out_path"/> <fail message="Missing required argument: out_path" unless="out_path"/>
<fail message="Missing required argument: known_bad_path" unless="known_bad_path"/> <fail message="Missing required argument: known_bad_path" unless="known_bad_path"/>
<fail message="Missing required argument: nsrl_path" unless="nsrl_path"/> <fail message="Missing required argument: nsrl_path" unless="nsrl_path"/>
<fail message="Missing required argument: keyword_path" unless="keyword_path"/> <fail message="Missing required argument: keyword_path" unless="keyword_path"/>
</target> </target>
<target name="regression-test" depends="check-args,init,test-init,test-build" if="exists.test.qa-functional.src.dir"> <target name="regression-test" depends="check-args,init,test-init,test-build" if="exists.test.qa-functional.src.dir">
<test test.type="qa-functional"/> <test test.type="qa-functional"/>
</target> </target>
<macrodef name="test"> <macrodef name="test">
<attribute name="test.type"/> <attribute name="test.type"/>
<attribute name="disable.apple.ui" default="false"/> <attribute name="disable.apple.ui" default="false"/>
<sequential> <sequential>
<property name="test.config" value="default"/> <property name="test.config" value="default"/>
<property name="test.config.default.includes" value="**/*Test.class"/> <property name="test.config.default.includes" value="**/*Test.class"/>
<property name="test.config.${test.config}.includes" value="NOTHING"/> <property name="test.config.${test.config}.includes" value="NOTHING"/>
<metaproperty name="test.includes" value="test.config.${test.config}.includes"/> <metaproperty name="test.includes" value="test.config.${test.config}.includes"/>
<property name="test.config.${test.config}.excludes" value=""/> <property name="test.config.${test.config}.excludes" value=""/>
<metaproperty name="test.excludes" value="test.config.${test.config}.excludes"/> <metaproperty name="test.excludes" value="test.config.${test.config}.excludes"/>
<mkdir dir="${build.test.@{test.type}.results.dir}"/> <mkdir dir="${build.test.@{test.type}.results.dir}"/>
<junit fork="true" failureproperty="tests.failed" errorproperty="tests.failed" filtertrace="${test.filter.trace}" tempdir="${build.test.@{test.type}.results.dir}"> <junit fork="true" failureproperty="tests.failed" errorproperty="tests.failed" filtertrace="${test.filter.trace}" tempdir="${build.test.@{test.type}.results.dir}">
<batchtest todir="${build.test.@{test.type}.results.dir}"> <batchtest todir="${build.test.@{test.type}.results.dir}">
<fileset dir="${build.test.@{test.type}.classes.dir}" includes="${test.includes}" excludes="${test.excludes}"/> <fileset dir="${build.test.@{test.type}.classes.dir}" includes="${test.includes}" excludes="${test.excludes}"/>
</batchtest> </batchtest>
<classpath refid="test.@{test.type}.run.cp"/> <classpath refid="test.@{test.type}.run.cp"/>
<syspropertyset refid="test.@{test.type}.properties"/> <syspropertyset refid="test.@{test.type}.properties"/>
<jvmarg line="${test.bootclasspath.prepend.args}"/> <jvmarg line="${test.bootclasspath.prepend.args}"/>
<jvmarg line="${test.run.args}"/> <jvmarg line="${test.run.args}"/>
<sysproperty key="img_path" value="${img_path}"/> <jvmarg line="-Xmx1024m"/>
<sysproperty key="gold_path" value="${gold_path}"/> <sysproperty key="img_path" value="${img_path}"/>
<sysproperty key="out_path" value="${out_path}"/> <sysproperty key="gold_path" value="${gold_path}"/>
<sysproperty key="known_bad_path" value="${known_bad_path}"/> <sysproperty key="out_path" value="${out_path}"/>
<sysproperty key="nsrl_path" value="${nsrl_path}"/> <sysproperty key="known_bad_path" value="${known_bad_path}"/>
<sysproperty key="keyword_path" value="${keyword_path}"/> <sysproperty key="nsrl_path" value="${nsrl_path}"/>
<!--needed to have tests NOT to steal focus when running, works in latest apple jdk update only.--> <sysproperty key="keyword_path" value="${keyword_path}"/>
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/> <!--needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
<formatter type="brief" usefile="false"/> <sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
<formatter type="xml"/> <formatter type="brief" usefile="false"/>
</junit> <formatter type="xml"/>
<fail message="Some tests failed; see details above."> </junit>
<condition> <fail message="Some tests failed; see details above.">
<and> <condition>
<isset property="tests.failed"/> <and>
<isfalse value="${continue.after.failing.tests}"/> <isset property="tests.failed"/>
</and> <isfalse value="${continue.after.failing.tests}"/>
</condition> </and>
</fail> </condition>
</sequential> </fail>
</macrodef> </sequential>
</project> </macrodef>
</project>