mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
merge
This commit is contained in:
commit
16401fc95f
@ -108,6 +108,7 @@ AddImageWizardIterator.stepXofN=Step {0} of {1}
|
|||||||
AddLocalFilesTask.localFileAdd.progress.text=Adding\: {0}/{1}
|
AddLocalFilesTask.localFileAdd.progress.text=Adding\: {0}/{1}
|
||||||
Case.getCurCase.exception.noneOpen=Cannot get the current case; there is no case open\!
|
Case.getCurCase.exception.noneOpen=Cannot get the current case; there is no case open\!
|
||||||
Case.create.exception.msg=Error creating a case\: {0} in dir {1}
|
Case.create.exception.msg=Error creating a case\: {0} in dir {1}
|
||||||
|
Case.databaseConnectionInfo.error.msg=Error accessing case database connection info
|
||||||
Case.open.exception.blankCase.msg=Case name is blank.
|
Case.open.exception.blankCase.msg=Case name is blank.
|
||||||
Case.open.msgDlg.updated.msg=Updated case database schema.\nA backup copy of the database with the following path has been made\:\n {0}
|
Case.open.msgDlg.updated.msg=Updated case database schema.\nA backup copy of the database with the following path has been made\:\n {0}
|
||||||
Case.open.msgDlg.updated.title=Case Database Schema Update
|
Case.open.msgDlg.updated.title=Case Database Schema Update
|
||||||
|
@ -72,6 +72,7 @@ import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagDeletedEvent
|
|||||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent;
|
||||||
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
||||||
|
import org.sleuthkit.autopsy.core.UserPreferencesException;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifactTag;
|
import org.sleuthkit.datamodel.BlackboardArtifactTag;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
import org.sleuthkit.datamodel.ContentTag;
|
import org.sleuthkit.datamodel.ContentTag;
|
||||||
@ -348,7 +349,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
}
|
}
|
||||||
// start listening for TSK errors for the new case
|
// start listening for TSK errors for the new case
|
||||||
currentCase.tskErrorReporter = new IntervalErrorReportData(currentCase, MIN_SECONDS_BETWEEN_ERROR_REPORTS,
|
currentCase.tskErrorReporter = new IntervalErrorReportData(currentCase, MIN_SECONDS_BETWEEN_ERROR_REPORTS,
|
||||||
NbBundle.getMessage(Case.class, "IntervalErrorReport.ErrorText"));
|
NbBundle.getMessage(Case.class, "IntervalErrorReport.ErrorText"));
|
||||||
doCaseChange(currentCase);
|
doCaseChange(currentCase);
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
RecentCases.getInstance().addRecentCase(currentCase.name, currentCase.configFilePath); // update the recent cases
|
RecentCases.getInstance().addRecentCase(currentCase.name, currentCase.configFilePath); // update the recent cases
|
||||||
@ -377,7 +378,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receiveError(String context, String errorMessage) {
|
public void receiveError(String context, String errorMessage) {
|
||||||
/* NOTE: We are accessing tskErrorReporter from two different threads.
|
/* NOTE: We are accessing tskErrorReporter from two different threads.
|
||||||
@ -464,6 +465,10 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||||
});
|
});
|
||||||
throw new CaseActionException(NbBundle.getMessage(Case.class, "CaseOpenException.DatabaseSettingsIssue") + " " + ex.getMessage()); //NON-NLS
|
throw new CaseActionException(NbBundle.getMessage(Case.class, "CaseOpenException.DatabaseSettingsIssue") + " " + ex.getMessage()); //NON-NLS
|
||||||
|
} catch (UserPreferencesException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS
|
||||||
|
throw new CaseActionException(
|
||||||
|
NbBundle.getMessage(Case.class, "Case.databaseConnectionInfo.error.msg"), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -575,7 +580,13 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
if (!UserPreferences.getIsMultiUserModeEnabled()) {
|
if (!UserPreferences.getIsMultiUserModeEnabled()) {
|
||||||
throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.multiUserCaseNotEnabled"));
|
throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.multiUserCaseNotEnabled"));
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
db = SleuthkitCase.openCase(metadata.getCaseDatabaseName(), UserPreferences.getDatabaseConnectionInfo(), caseDir);
|
db = SleuthkitCase.openCase(metadata.getCaseDatabaseName(), UserPreferences.getDatabaseConnectionInfo(), caseDir);
|
||||||
|
} catch (UserPreferencesException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS
|
||||||
|
throw new CaseActionException(
|
||||||
|
NbBundle.getMessage(Case.class, "Case.databaseConnectionInfo.error.msg"), ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -693,7 +704,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
*
|
*
|
||||||
* @deprecated As of release 4.0, replaced by {@link #notifyAddingDataSource(java.util.UUID) and
|
* @deprecated As of release 4.0, replaced by {@link #notifyAddingDataSource(java.util.UUID) and
|
||||||
* {@link #notifyDataSourceAdded(org.sleuthkit.datamodel.Content, java.util.UUID) and
|
* {@link #notifyDataSourceAdded(org.sleuthkit.datamodel.Content, java.util.UUID) and
|
||||||
* {@link #notifyFailedAddingDataSource(java.util.UUID)}
|
* {@link #notifyFailedAddingDataSource(java.util.UUID)}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Image addImage(String imgPath, long imgId, String timeZone) throws CaseActionException {
|
public Image addImage(String imgPath, long imgId, String timeZone) throws CaseActionException {
|
||||||
@ -708,13 +719,13 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finishes adding new local data source to the case. Sends out event and
|
* Finishes adding new local data source to the case. Sends out event and
|
||||||
* reopens windows if needed.
|
* reopens windows if needed.
|
||||||
*
|
*
|
||||||
* @param newDataSource new data source added
|
* @param newDataSource new data source added
|
||||||
*
|
*
|
||||||
* @deprecated As of release 4.0, replaced by {@link #notifyAddingDataSource(java.util.UUID) and
|
* @deprecated As of release 4.0, replaced by {@link #notifyAddingDataSource(java.util.UUID) and
|
||||||
* {@link #notifyDataSourceAdded(org.sleuthkit.datamodel.Content, java.util.UUID) and
|
* {@link #notifyDataSourceAdded(org.sleuthkit.datamodel.Content, java.util.UUID) and
|
||||||
* {@link #notifyFailedAddingDataSource(java.util.UUID)}
|
* {@link #notifyFailedAddingDataSource(java.util.UUID)}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
void addLocalDataSource(Content newDataSource) {
|
void addLocalDataSource(Content newDataSource) {
|
||||||
|
@ -47,7 +47,6 @@ import javax.swing.JScrollPane;
|
|||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.openide.util.Exceptions;
|
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case.CaseType;
|
import org.sleuthkit.autopsy.casemodule.Case.CaseType;
|
||||||
@ -1391,6 +1390,8 @@ public class SingleUserCaseImporter implements Runnable {
|
|||||||
JTextArea jta = new JTextArea(casesThatWillBeProcessed.toString() + SEP + casesThatWillNotBeProcessed.toString());
|
JTextArea jta = new JTextArea(casesThatWillBeProcessed.toString() + SEP + casesThatWillNotBeProcessed.toString());
|
||||||
jta.setEditable(false);
|
jta.setEditable(false);
|
||||||
JScrollPane jsp = new JScrollPane(jta) {
|
JScrollPane jsp = new JScrollPane(jta) {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dimension getPreferredSize() {
|
public Dimension getPreferredSize() {
|
||||||
return new Dimension(700, 480);
|
return new Dimension(700, 480);
|
||||||
|
@ -20,5 +20,7 @@ ServicesMonitor.statusChange.notify.title=Service Status Update
|
|||||||
ServicesMonitor.statusChange.notify.msg=Status for {0} is {1}
|
ServicesMonitor.statusChange.notify.msg=Status for {0} is {1}
|
||||||
ServicesMonitor.nullServiceName.excepton.txt=Requested service name is null
|
ServicesMonitor.nullServiceName.excepton.txt=Requested service name is null
|
||||||
ServicesMonitor.unknownServiceName.excepton.txt=Requested service name {0} is unknown
|
ServicesMonitor.unknownServiceName.excepton.txt=Requested service name {0} is unknown
|
||||||
|
TextConverter.convert.exception.txt=Unable to convert text {0} to hex text
|
||||||
|
TextConverter.convertFromHex.exception.txt=Unable to convert hex text to text
|
||||||
ServicesMonitor.KeywordSearchNull=Cannot find Keyword Search service
|
ServicesMonitor.KeywordSearchNull=Cannot find Keyword Search service
|
||||||
ServicesMonitor.InvalidPortNumber=Invalid port number.
|
ServicesMonitor.InvalidPortNumber=Invalid port number.
|
@ -239,7 +239,14 @@ public class ServicesMonitor {
|
|||||||
* Performs case database service availability status check.
|
* Performs case database service availability status check.
|
||||||
*/
|
*/
|
||||||
private void checkDatabaseConnectionStatus() {
|
private void checkDatabaseConnectionStatus() {
|
||||||
CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo();
|
CaseDbConnectionInfo info;
|
||||||
|
try {
|
||||||
|
info = UserPreferences.getDatabaseConnectionInfo();
|
||||||
|
} catch (UserPreferencesException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS
|
||||||
|
setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.DOWN.toString(), "Error accessing case database connection info");
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
SleuthkitCase.tryConnect(info);
|
SleuthkitCase.tryConnect(info);
|
||||||
setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.UP.toString(), "");
|
setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.UP.toString(), "");
|
||||||
@ -277,7 +284,15 @@ public class ServicesMonitor {
|
|||||||
* Performs messaging service availability status check.
|
* Performs messaging service availability status check.
|
||||||
*/
|
*/
|
||||||
private void checkMessagingServerConnectionStatus() {
|
private void checkMessagingServerConnectionStatus() {
|
||||||
MessageServiceConnectionInfo info = UserPreferences.getMessageServiceConnectionInfo();
|
MessageServiceConnectionInfo info;
|
||||||
|
try {
|
||||||
|
info = UserPreferences.getMessageServiceConnectionInfo();
|
||||||
|
} catch (UserPreferencesException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Error accessing messaging service connection info", ex); //NON-NLS
|
||||||
|
setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.DOWN.toString(), "Error accessing messaging service connection info");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
info.tryConnect();
|
info.tryConnect();
|
||||||
setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.UP.toString(), "");
|
setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.UP.toString(), "");
|
||||||
|
@ -18,10 +18,17 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.core;
|
package org.sleuthkit.autopsy.core;
|
||||||
|
|
||||||
|
import java.util.Base64;
|
||||||
import java.util.prefs.BackingStoreException;
|
import java.util.prefs.BackingStoreException;
|
||||||
import org.sleuthkit.autopsy.events.MessageServiceConnectionInfo;
|
import org.sleuthkit.autopsy.events.MessageServiceConnectionInfo;
|
||||||
import java.util.prefs.PreferenceChangeListener;
|
import java.util.prefs.PreferenceChangeListener;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import javax.crypto.SecretKeyFactory;
|
||||||
|
import javax.crypto.spec.PBEKeySpec;
|
||||||
|
import javax.crypto.spec.PBEParameterSpec;
|
||||||
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.NbPreferences;
|
import org.openide.util.NbPreferences;
|
||||||
import org.sleuthkit.datamodel.CaseDbConnectionInfo;
|
import org.sleuthkit.datamodel.CaseDbConnectionInfo;
|
||||||
import org.sleuthkit.datamodel.TskData.DbType;
|
import org.sleuthkit.datamodel.TskData.DbType;
|
||||||
@ -130,7 +137,12 @@ public final class UserPreferences {
|
|||||||
preferences.putInt(NUMBER_OF_FILE_INGEST_THREADS, value);
|
preferences.putInt(NUMBER_OF_FILE_INGEST_THREADS, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CaseDbConnectionInfo getDatabaseConnectionInfo() {
|
/**
|
||||||
|
* Reads persisted case database connection info.
|
||||||
|
* @return An object encapsulating the database connection info.
|
||||||
|
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||||
|
*/
|
||||||
|
public static CaseDbConnectionInfo getDatabaseConnectionInfo() throws UserPreferencesException {
|
||||||
DbType dbType;
|
DbType dbType;
|
||||||
try {
|
try {
|
||||||
dbType = DbType.valueOf(preferences.get(EXTERNAL_DATABASE_TYPE, "POSTGRESQL"));
|
dbType = DbType.valueOf(preferences.get(EXTERNAL_DATABASE_TYPE, "POSTGRESQL"));
|
||||||
@ -141,15 +153,22 @@ public final class UserPreferences {
|
|||||||
preferences.get(EXTERNAL_DATABASE_HOSTNAME_OR_IP, ""),
|
preferences.get(EXTERNAL_DATABASE_HOSTNAME_OR_IP, ""),
|
||||||
preferences.get(EXTERNAL_DATABASE_PORTNUMBER, "5432"),
|
preferences.get(EXTERNAL_DATABASE_PORTNUMBER, "5432"),
|
||||||
preferences.get(EXTERNAL_DATABASE_USER, ""),
|
preferences.get(EXTERNAL_DATABASE_USER, ""),
|
||||||
preferences.get(EXTERNAL_DATABASE_PASSWORD, ""),
|
TextConverter.convertHexTextToText(preferences.get(EXTERNAL_DATABASE_PASSWORD, "")),
|
||||||
dbType);
|
dbType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setDatabaseConnectionInfo(CaseDbConnectionInfo connectionInfo) {
|
/**
|
||||||
|
* Persists case database connection info.
|
||||||
|
*
|
||||||
|
* @param connectionInfo An object encapsulating the database connection
|
||||||
|
* info.
|
||||||
|
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||||
|
*/
|
||||||
|
public static void setDatabaseConnectionInfo(CaseDbConnectionInfo connectionInfo) throws UserPreferencesException {
|
||||||
preferences.put(EXTERNAL_DATABASE_HOSTNAME_OR_IP, connectionInfo.getHost());
|
preferences.put(EXTERNAL_DATABASE_HOSTNAME_OR_IP, connectionInfo.getHost());
|
||||||
preferences.put(EXTERNAL_DATABASE_PORTNUMBER, connectionInfo.getPort());
|
preferences.put(EXTERNAL_DATABASE_PORTNUMBER, connectionInfo.getPort());
|
||||||
preferences.put(EXTERNAL_DATABASE_USER, connectionInfo.getUserName());
|
preferences.put(EXTERNAL_DATABASE_USER, connectionInfo.getUserName());
|
||||||
preferences.put(EXTERNAL_DATABASE_PASSWORD, connectionInfo.getPassword());
|
preferences.put(EXTERNAL_DATABASE_PASSWORD, TextConverter.convertTextToHexText(connectionInfo.getPassword()));
|
||||||
preferences.put(EXTERNAL_DATABASE_TYPE, connectionInfo.getDbType().toString());
|
preferences.put(EXTERNAL_DATABASE_TYPE, connectionInfo.getDbType().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,20 +200,22 @@ public final class UserPreferences {
|
|||||||
* Persists message service connection info.
|
* Persists message service connection info.
|
||||||
*
|
*
|
||||||
* @param info An object encapsulating the message service info.
|
* @param info An object encapsulating the message service info.
|
||||||
|
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||||
*/
|
*/
|
||||||
public static void setMessageServiceConnectionInfo(MessageServiceConnectionInfo info) {
|
public static void setMessageServiceConnectionInfo(MessageServiceConnectionInfo info) throws UserPreferencesException {
|
||||||
preferences.put(MESSAGE_SERVICE_HOST, info.getHost());
|
preferences.put(MESSAGE_SERVICE_HOST, info.getHost());
|
||||||
preferences.put(MESSAGE_SERVICE_PORT, Integer.toString(info.getPort()));
|
preferences.put(MESSAGE_SERVICE_PORT, Integer.toString(info.getPort()));
|
||||||
preferences.put(MESSAGE_SERVICE_USER, info.getUserName());
|
preferences.put(MESSAGE_SERVICE_USER, info.getUserName());
|
||||||
preferences.put(MESSAGE_SERVICE_PASSWORD, info.getPassword());
|
preferences.put(MESSAGE_SERVICE_PASSWORD, TextConverter.convertTextToHexText(info.getPassword()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads persisted message service connection info.
|
* Reads persisted message service connection info.
|
||||||
*
|
*
|
||||||
* @return An object encapsulating the message service info.
|
* @return An object encapsulating the message service info.
|
||||||
|
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||||
*/
|
*/
|
||||||
public static MessageServiceConnectionInfo getMessageServiceConnectionInfo() {
|
public static MessageServiceConnectionInfo getMessageServiceConnectionInfo() throws UserPreferencesException {
|
||||||
int port;
|
int port;
|
||||||
try {
|
try {
|
||||||
port = Integer.parseInt(preferences.get(MESSAGE_SERVICE_PORT, DEFAULT_PORT_STRING));
|
port = Integer.parseInt(preferences.get(MESSAGE_SERVICE_PORT, DEFAULT_PORT_STRING));
|
||||||
@ -207,7 +228,7 @@ public final class UserPreferences {
|
|||||||
preferences.get(MESSAGE_SERVICE_HOST, ""),
|
preferences.get(MESSAGE_SERVICE_HOST, ""),
|
||||||
port,
|
port,
|
||||||
preferences.get(MESSAGE_SERVICE_USER, ""),
|
preferences.get(MESSAGE_SERVICE_USER, ""),
|
||||||
preferences.get(MESSAGE_SERVICE_PASSWORD, ""));
|
TextConverter.convertHexTextToText(preferences.get(MESSAGE_SERVICE_PASSWORD, "")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -257,4 +278,68 @@ public final class UserPreferences {
|
|||||||
public static void setIsTimeOutEnabled(boolean enabled) {
|
public static void setIsTimeOutEnabled(boolean enabled) {
|
||||||
preferences.putBoolean(PROCESS_TIME_OUT_ENABLED, enabled);
|
preferences.putBoolean(PROCESS_TIME_OUT_ENABLED, enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides ability to convert text to hex text.
|
||||||
|
*/
|
||||||
|
static final class TextConverter {
|
||||||
|
|
||||||
|
private static final char[] TMP = "hgleri21auty84fwe".toCharArray();
|
||||||
|
private static final byte[] SALT = {
|
||||||
|
(byte) 0xde, (byte) 0x33, (byte) 0x10, (byte) 0x12,
|
||||||
|
(byte) 0xde, (byte) 0x33, (byte) 0x10, (byte) 0x12,};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert text to hex text.
|
||||||
|
*
|
||||||
|
* @param property Input text string.
|
||||||
|
*
|
||||||
|
* @return Converted hex string.
|
||||||
|
*
|
||||||
|
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||||
|
*/
|
||||||
|
static String convertTextToHexText(String property) throws UserPreferencesException {
|
||||||
|
try {
|
||||||
|
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
|
||||||
|
SecretKey key = keyFactory.generateSecret(new PBEKeySpec(TMP));
|
||||||
|
Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES");
|
||||||
|
pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec(SALT, 20));
|
||||||
|
return base64Encode(pbeCipher.doFinal(property.getBytes("UTF-8")));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new UserPreferencesException(
|
||||||
|
NbBundle.getMessage(TextConverter.class, "TextConverter.convert.exception.txt"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String base64Encode(byte[] bytes) {
|
||||||
|
return Base64.getEncoder().encodeToString(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert hex text back to text.
|
||||||
|
*
|
||||||
|
* @param property Input hex text string.
|
||||||
|
*
|
||||||
|
* @return Converted text string.
|
||||||
|
*
|
||||||
|
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||||
|
*/
|
||||||
|
static String convertHexTextToText(String property) throws UserPreferencesException {
|
||||||
|
try {
|
||||||
|
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
|
||||||
|
SecretKey key = keyFactory.generateSecret(new PBEKeySpec(TMP));
|
||||||
|
Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES");
|
||||||
|
pbeCipher.init(Cipher.DECRYPT_MODE, key, new PBEParameterSpec(SALT, 20));
|
||||||
|
return new String(pbeCipher.doFinal(base64Decode(property)), "UTF-8");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new UserPreferencesException(
|
||||||
|
NbBundle.getMessage(TextConverter.class, "TextConverter.convertFromHex.exception.txt"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static byte[] base64Decode(String property) {
|
||||||
|
return Base64.getDecoder().decode(property);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2015 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.sleuthkit.autopsy.core;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception thrown when text conversion (such as from text to hex text or vice versa) resulted in
|
||||||
|
* an error
|
||||||
|
*/
|
||||||
|
public class UserPreferencesException extends Exception {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public UserPreferencesException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserPreferencesException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
}
|
@ -22,6 +22,7 @@ import java.util.logging.Level;
|
|||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import org.openide.util.ImageUtilities;
|
import org.openide.util.ImageUtilities;
|
||||||
import org.openide.util.Lookup;
|
import org.openide.util.Lookup;
|
||||||
|
import org.sleuthkit.autopsy.core.UserPreferencesException;
|
||||||
import org.sleuthkit.autopsy.events.MessageServiceException;
|
import org.sleuthkit.autopsy.events.MessageServiceException;
|
||||||
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
|
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
|
||||||
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchServiceException;
|
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchServiceException;
|
||||||
@ -560,17 +561,25 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
|
|||||||
lbTestSolrWarning.setText("");
|
lbTestSolrWarning.setText("");
|
||||||
lbTestMessageWarning.setText("");
|
lbTestMessageWarning.setText("");
|
||||||
|
|
||||||
CaseDbConnectionInfo dbInfo = UserPreferences.getDatabaseConnectionInfo();
|
try {
|
||||||
tbDbHostname.setText(dbInfo.getHost().trim());
|
CaseDbConnectionInfo dbInfo = UserPreferences.getDatabaseConnectionInfo();
|
||||||
tbDbPort.setText(dbInfo.getPort().trim());
|
tbDbHostname.setText(dbInfo.getHost().trim());
|
||||||
tbDbUsername.setText(dbInfo.getUserName().trim());
|
tbDbPort.setText(dbInfo.getPort().trim());
|
||||||
tbDbPassword.setText(dbInfo.getPassword());
|
tbDbUsername.setText(dbInfo.getUserName().trim());
|
||||||
|
tbDbPassword.setText(dbInfo.getPassword());
|
||||||
|
} catch (UserPreferencesException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS
|
||||||
|
}
|
||||||
|
|
||||||
MessageServiceConnectionInfo msgServiceInfo = UserPreferences.getMessageServiceConnectionInfo();
|
try {
|
||||||
tbMsgHostname.setText(msgServiceInfo.getHost().trim());
|
MessageServiceConnectionInfo msgServiceInfo = UserPreferences.getMessageServiceConnectionInfo();
|
||||||
tbMsgPort.setText(Integer.toString(msgServiceInfo.getPort()));
|
tbMsgHostname.setText(msgServiceInfo.getHost().trim());
|
||||||
tbMsgUsername.setText(msgServiceInfo.getUserName().trim());
|
tbMsgPort.setText(Integer.toString(msgServiceInfo.getPort()));
|
||||||
tbMsgPassword.setText(msgServiceInfo.getPassword());
|
tbMsgUsername.setText(msgServiceInfo.getUserName().trim());
|
||||||
|
tbMsgPassword.setText(msgServiceInfo.getPassword());
|
||||||
|
} catch (UserPreferencesException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS
|
||||||
|
}
|
||||||
|
|
||||||
String indexingServerHost = UserPreferences.getIndexingServerHost().trim();
|
String indexingServerHost = UserPreferences.getIndexingServerHost().trim();
|
||||||
if (!indexingServerHost.isEmpty()) {
|
if (!indexingServerHost.isEmpty()) {
|
||||||
@ -646,7 +655,11 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
|
|||||||
new String(tbDbPassword.getPassword()),
|
new String(tbDbPassword.getPassword()),
|
||||||
dbType);
|
dbType);
|
||||||
|
|
||||||
UserPreferences.setDatabaseConnectionInfo(info);
|
try {
|
||||||
|
UserPreferences.setDatabaseConnectionInfo(info);
|
||||||
|
} catch (UserPreferencesException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS
|
||||||
|
}
|
||||||
|
|
||||||
int port = 0;
|
int port = 0;
|
||||||
try {
|
try {
|
||||||
@ -661,7 +674,11 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
|
|||||||
tbMsgUsername.getText().trim(),
|
tbMsgUsername.getText().trim(),
|
||||||
new String(tbMsgPassword.getPassword()));
|
new String(tbMsgPassword.getPassword()));
|
||||||
|
|
||||||
UserPreferences.setMessageServiceConnectionInfo(msgServiceInfo);
|
try {
|
||||||
|
UserPreferences.setMessageServiceConnectionInfo(msgServiceInfo);
|
||||||
|
} catch (UserPreferencesException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Error accessing messaging service connection info", ex); //NON-NLS
|
||||||
|
}
|
||||||
|
|
||||||
UserPreferences.setIndexingServerHost(tbSolrHostname.getText().trim());
|
UserPreferences.setIndexingServerHost(tbSolrHostname.getText().trim());
|
||||||
UserPreferences.setIndexingServerPort(Integer.parseInt(tbSolrPort.getText().trim()));
|
UserPreferences.setIndexingServerPort(Integer.parseInt(tbSolrPort.getText().trim()));
|
||||||
|
@ -23,6 +23,7 @@ import java.net.URISyntaxException;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import javax.jms.JMSException;
|
import javax.jms.JMSException;
|
||||||
|
import org.sleuthkit.autopsy.core.UserPreferencesException;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
|
||||||
@ -70,6 +71,10 @@ public final class AutopsyEventPublisher {
|
|||||||
String message = "Failed to open remote event channel"; //NON-NLS
|
String message = "Failed to open remote event channel"; //NON-NLS
|
||||||
logger.log(Level.SEVERE, message, ex);
|
logger.log(Level.SEVERE, message, ex);
|
||||||
throw new AutopsyEventException(message, ex);
|
throw new AutopsyEventException(message, ex);
|
||||||
|
} catch (UserPreferencesException ex) {
|
||||||
|
String message = "Error accessing messaging service connection info"; //NON-NLS
|
||||||
|
logger.log(Level.SEVERE, message, ex);
|
||||||
|
throw new AutopsyEventException(message, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,6 +223,7 @@ Server.connect.exception.msg=Failed to connect to Solr server\:
|
|||||||
Server.openCore.exception.msg=Core open requested, but server not yet running
|
Server.openCore.exception.msg=Core open requested, but server not yet running
|
||||||
Server.openCore.exception.cantOpen.msg=Could not open Core
|
Server.openCore.exception.cantOpen.msg=Could not open Core
|
||||||
Server.openCore.exception.cantOpen.msg2=Could not open Core
|
Server.openCore.exception.cantOpen.msg2=Could not open Core
|
||||||
|
Server.openCore.exception.cantOpenForCase.msg=Could not create keyword search index for case {0}
|
||||||
Server.request.exception.exception.msg=Could not issue Solr request
|
Server.request.exception.exception.msg=Could not issue Solr request
|
||||||
Server.commit.exception.msg=Could not commit index
|
Server.commit.exception.msg=Could not commit index
|
||||||
Server.addDoc.exception.msg=Could not add document to index via update handler\: {0}
|
Server.addDoc.exception.msg=Could not add document to index via update handler\: {0}
|
||||||
|
@ -626,7 +626,12 @@ public class Server {
|
|||||||
|
|
||||||
Case currentCase = Case.getCurrentCase();
|
Case currentCase = Case.getCurrentCase();
|
||||||
|
|
||||||
currentCore = openCore(currentCase);
|
try {
|
||||||
|
currentCore = openCore(currentCase);
|
||||||
|
} catch (KeywordSearchModuleException ex) {
|
||||||
|
MessageNotifyUtil.Notify.error(NbBundle.getMessage(Server.class, "Server.openCore.exception.cantOpenForCase.msg", currentCase.getName()), ex.getCause().getMessage());
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
serverAction.putValue(CORE_EVT, CORE_EVT_STATES.STARTED);
|
serverAction.putValue(CORE_EVT, CORE_EVT_STATES.STARTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,20 @@ There are also a set of tutorials that Basis Technology published on their blog:
|
|||||||
|
|
||||||
\section mod_dev_py_setup Basic Setup
|
\section mod_dev_py_setup Basic Setup
|
||||||
|
|
||||||
You don't really need anything to develop a python Autopsy module except for the standard Autopsy and your favorite text editor. We recommend pyCharm or the Python plug-in to NetBeans.
|
-You don't really need anything to develop a python Autopsy module except for the standard Autopsy and your favorite text editor. We recommend IntelliJ IDEA or the Jython plug-in to NetBeans.
|
||||||
|
|
||||||
|
To install NetBeans' plug-in:
|
||||||
|
-# Download and install the Jython 2.7 installer (http://www.jython.org/downloads.html).
|
||||||
|
-# Download NetBeans Python plug-in zip file (http://plugins.netbeans.org/plugin/56795/python4netbeans802).
|
||||||
|
-# Unpack the content (.nbm files) of the zip file to the desired location.
|
||||||
|
-# In NetBeans go to Tools->Plugins. In Download tab, click on Add Plugins, then choose extracted .nbm files.
|
||||||
|
-# Setup Jython path from Tools->Python Platform, click on new, then choose Jython.exe (usually in C:/Program files/Jython2.7/bin/)
|
||||||
|
|
||||||
|
To install IntelliJ IDEA + Python plug-in:
|
||||||
|
-# Download and install IDEA https://www.jetbrains.com/idea/download/
|
||||||
|
-# In File->Settings->Plugins-> install Python Community Edition
|
||||||
|
-# In File->Project Structure->Project-> Project SDK-> choose IntelliJ IDEA Community Edition
|
||||||
|
-# In Libraries->add new libraries->choose desired autopsy modules (usually in C:\Program Files\Autopsy-3.1.3\autopsy\modules)
|
||||||
|
|
||||||
\section mod_dev_py_create Creating a Basic Python Module
|
\section mod_dev_py_create Creating a Basic Python Module
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user