23package org.sleuthkit.autopsy.recentactivity;
26import java.nio.file.Path;
27import java.nio.file.Paths;
28import java.util.ArrayList;
30import java.util.logging.Level;
31import org.openide.util.NbBundle;
32import org.sleuthkit.autopsy.casemodule.Case;
33import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
34import org.sleuthkit.autopsy.coreutils.Logger;
35import org.sleuthkit.autopsy.ingest.DataSourceIngestModule;
36import org.sleuthkit.autopsy.ingest.DataSourceIngestModuleProgress;
37import org.sleuthkit.autopsy.ingest.IngestServices;
38import org.sleuthkit.autopsy.ingest.IngestMessage;
39import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
40import org.sleuthkit.datamodel.Content;
41import org.sleuthkit.autopsy.ingest.IngestModule.ProcessResult;
42import org.sleuthkit.autopsy.ingest.IngestJobContext;
43import org.sleuthkit.datamodel.SleuthkitCase;
52 private final List<Extract>
extractors =
new ArrayList<>();
58 RAImageIngestModule() {
67 Extract iexplore =
new ExtractIE(
context);
68 Extract edge =
new ExtractEdge(
context);
69 Extract registry =
new ExtractRegistry(
context);
70 Extract recentDocuments =
new RecentDocumentsByLnk(
context);
71 Extract chrome =
new Chromium(
context);
72 Extract firefox =
new Firefox(
context);
73 Extract SEUQA =
new SearchEngineURLQueryAnalyzer(
context);
74 Extract osExtract =
new ExtractOs(
context);
75 Extract dataSourceAnalyzer =
new DataSourceUsageAnalyzer(
context);
76 Extract safari =
new ExtractSafari(
context);
77 Extract zoneInfo =
new ExtractZoneIdentifier(
context);
78 Extract recycleBin =
new ExtractRecycleBin(
context);
79 Extract sru =
new ExtractSru(
context);
80 Extract prefetch =
new ExtractPrefetch(
context);
81 Extract webAccountType =
new ExtractWebAccountType(
context);
82 Extract messageDomainType =
new DomainCategoryRunner(
context);
83 Extract jumpList =
new ExtractJumpLists(
context);
84 Extract thumbcache =
new ExtractThumbcache(
context);
119 NbBundle.getMessage(
this.getClass(),
120 "RAImageIngestModule.process.started",
121 dataSource.getName())));
125 ArrayList<String> errors =
new ArrayList<>();
129 if (
context.dataSourceIngestIsCancelled()) {
130 logger.log(Level.INFO,
"Recent Activity has been canceled, quitting before {0}", extracter.getDisplayName());
134 progressBar.
progress(extracter.getDisplayName(), i);
137 extracter.process(dataSource, progressBar);
138 }
catch (Exception ex) {
139 logger.log(Level.SEVERE,
"Exception occurred in " + extracter.getDisplayName(), ex);
143 errors.addAll(extracter.getErrorMessages());
147 StringBuilder errorMessage =
new StringBuilder();
148 String errorMsgSubject;
150 if (errors.isEmpty() ==
false) {
153 NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.errMsg.errsEncountered"));
154 for (String msg : errors) {
155 errorMessage.append(
"<li>").append(msg).append(
"</li>\n");
157 errorMessage.append(
"</ul>\n");
159 if (errors.size() == 1) {
160 errorMsgSubject = NbBundle.getMessage(this.getClass(),
"RAImageIngestModule.process.errMsgSub.oneErr");
162 errorMsgSubject = NbBundle.getMessage(this.getClass(),
163 "RAImageIngestModule.process.errMsgSub.nErrs", errors.size());
166 errorMessage.append(NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.errMsg.noErrs"));
167 errorMsgSubject = NbBundle.getMessage(this.getClass(),
"RAImageIngestModule.process.errMsgSub.noErrs");
170 NbBundle.getMessage(
this.getClass(),
171 "RAImageIngestModule.process.ingestMsg.finished",
172 dataSource.getName(), errorMsgSubject),
173 errorMessage.toString());
176 StringBuilder historyMsg =
new StringBuilder();
178 NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.histMsg.title", dataSource.getName()));
180 historyMsg.append(
"<li>").append(module.getDisplayName());
181 historyMsg.append(
": ").append((module.foundData()) ? NbBundle
182 .getMessage(
this.getClass(),
"RAImageIngestModule.process.histMsg.found") : NbBundle
183 .getMessage(
this.getClass(),
"RAImageIngestModule.process.histMsg.notFnd"));
184 historyMsg.append(
"</li>");
186 historyMsg.append(
"</ul>");
188 NbBundle.getMessage(
this.getClass(),
189 "RAImageIngestModule.process.ingestMsg.results",
190 dataSource.getName()),
191 historyMsg.toString());
202 extracter.shutDown();
203 }
catch (Exception ex) {
204 logger.log(Level.SEVERE,
"Exception occurred when completing " + extracter.getDisplayName(), ex);
222 String moduleFolder = String.format(
"%s_%d", module, ingestJobId);
224 File dir = tmpPath.toFile();
225 if (dir.exists() ==
false) {
228 return tmpPath.toString();
241 static String getRATempPath(
Case a_case, String mod,
long ingestJobId) {
255 static String getRAOutputPath(Case a_case, String mod,
long ingestJobId) {
265 static String getRelModuleOutputPath(Case autCase, String mod,
long ingestJobId) {
266 return Paths.get(
getAndMakeRAPath(autCase.getModuleOutputDirectoryRelativePath(), mod, ingestJobId))
SleuthkitCase getSleuthkitCase()
static Case getCurrentCase()
String getTempDirectory()
synchronized static Logger getLogger(String name)
void progress(int workUnits)
void switchToDeterminate(int workUnits)
static IngestMessage createMessage(MessageType messageType, String source, String subject, String detailsHtml)
static synchronized IngestServices getInstance()
static final Logger logger
final List< Extract > browserExtractors
static final String RECENT_ACTIVITY_FOLDER
final List< Extract > extractors
ProcessResult process(Content dataSource, DataSourceIngestModuleProgress progressBar)
static String getAndMakeRAPath(String basePath, String module, long ingestJobId)
final IngestServices services
void startUp(IngestJobContext context)