23 package org.sleuthkit.autopsy.recentactivity;
26 import java.nio.file.Paths;
27 import java.util.ArrayList;
28 import java.util.List;
29 import java.util.logging.Level;
30 import org.openide.util.NbBundle;
49 private final List<Extract>
extractors =
new ArrayList<>();
65 iexplore =
new ExtractIE();
66 edge =
new ExtractEdge();
71 Extract registry =
new ExtractRegistry();
72 Extract recentDocuments =
new RecentDocumentsByLnk();
73 Extract chrome =
new Chromium();
74 Extract firefox =
new Firefox();
75 Extract SEUQA =
new SearchEngineURLQueryAnalyzer();
76 Extract osExtract =
new ExtractOs();
77 Extract dataSourceAnalyzer =
new DataSourceUsageAnalyzer();
78 Extract safari =
new ExtractSafari();
79 Extract zoneInfo =
new ExtractZoneIdentifier();
80 Extract recycleBin =
new ExtractRecycleBin();
81 Extract sru =
new ExtractSru();
82 Extract prefetch =
new ExtractPrefetch();
83 Extract webAccountType =
new ExtractWebAccountType();
84 Extract messageDomainType =
new DomainCategoryRunner();
86 extractors.add(chrome);
87 extractors.add(firefox);
88 extractors.add(iexplore);
90 extractors.add(safari);
91 extractors.add(recentDocuments);
92 extractors.add(SEUQA);
93 extractors.add(webAccountType);
94 extractors.add(registry);
95 extractors.add(osExtract);
96 extractors.add(dataSourceAnalyzer);
97 extractors.add(zoneInfo);
98 extractors.add(recycleBin);
100 extractors.add(prefetch);
101 extractors.add(messageDomainType);
103 browserExtractors.add(chrome);
104 browserExtractors.add(firefox);
105 browserExtractors.add(iexplore);
106 browserExtractors.add(edge);
107 browserExtractors.add(safari);
109 for (Extract extractor : extractors) {
117 NbBundle.getMessage(this.getClass(),
118 "RAImageIngestModule.process.started",
119 dataSource.getName())));
123 ArrayList<String> errors =
new ArrayList<>();
125 for (
int i = 0; i < extractors.size(); i++) {
126 Extract extracter = extractors.get(i);
128 logger.log(Level.INFO,
"Recent Activity has been canceled, quitting before {0}", extracter.getName());
132 progressBar.
progress(extracter.getName(), i);
135 extracter.process(dataSource, context, progressBar);
136 }
catch (Exception ex) {
137 logger.log(Level.SEVERE,
"Exception occurred in " + extracter.getName(), ex);
138 subCompleted.append(NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.errModFailed",
139 extracter.getName()));
144 errors.addAll(extracter.getErrorMessages());
148 StringBuilder errorMessage =
new StringBuilder();
149 String errorMsgSubject;
151 if (errors.isEmpty() ==
false) {
154 NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.errMsg.errsEncountered"));
155 for (String msg : errors) {
156 errorMessage.append(
"<li>").append(msg).append(
"</li>\n");
158 errorMessage.append(
"</ul>\n");
160 if (errors.size() == 1) {
161 errorMsgSubject = NbBundle.getMessage(this.getClass(),
"RAImageIngestModule.process.errMsgSub.oneErr");
163 errorMsgSubject = NbBundle.getMessage(this.getClass(),
164 "RAImageIngestModule.process.errMsgSub.nErrs", errors.size());
167 errorMessage.append(NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.errMsg.noErrs"));
168 errorMsgSubject = NbBundle.getMessage(this.getClass(),
"RAImageIngestModule.process.errMsgSub.noErrs");
171 NbBundle.getMessage(this.getClass(),
172 "RAImageIngestModule.process.ingestMsg.finished",
173 dataSource.getName(), errorMsgSubject),
174 errorMessage.toString());
177 StringBuilder historyMsg =
new StringBuilder();
179 NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.histMsg.title", dataSource.getName()));
180 for (Extract module : browserExtractors) {
181 historyMsg.append(
"<li>").append(module.getName());
182 historyMsg.append(
": ").append((module.foundData()) ? NbBundle
183 .getMessage(this.getClass(),
"RAImageIngestModule.process.histMsg.found") : NbBundle
184 .getMessage(this.getClass(),
"RAImageIngestModule.process.histMsg.notFnd"));
185 historyMsg.append(
"</li>");
187 historyMsg.append(
"</ul>");
189 NbBundle.getMessage(this.getClass(),
190 "RAImageIngestModule.process.ingestMsg.results",
191 dataSource.getName()),
192 historyMsg.toString());
199 for (
int i = 0; i < extractors.size(); i++) {
200 Extract extracter = extractors.get(i);
202 extracter.complete();
203 }
catch (Exception ex) {
204 logger.log(Level.SEVERE,
"Exception occurred when completing " + extracter.getName(), ex);
205 subCompleted.append(NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.complete.errMsg.failed",
206 extracter.getName()));
224 String tmpDir = a_case.
getTempDirectory() + File.separator +
"RecentActivity" + File.separator + mod;
225 File dir =
new File(tmpDir);
226 if (dir.exists() ==
false) {
243 String tmpDir = a_case.
getModuleDirectory() + File.separator +
"RecentActivity" + File.separator + mod;
244 File dir =
new File(tmpDir);
245 if (dir.exists() ==
false) {
259 "RecentActivity").normalize().toString() ;
String getModuleOutputDirectoryRelativePath()
final List< Extract > extractors
static final Logger logger
String getTempDirectory()
static String getRATempPath(Case a_case, String mod)
StringBuilder subCompleted
static IngestMessage createMessage(MessageType messageType, String source, String subject, String detailsHtml)
ProcessResult process(Content dataSource, DataSourceIngestModuleProgress progressBar)
static String getRAOutputPath(Case a_case, String mod)
void postMessage(final IngestMessage message)
String getModuleDirectory()
void startUp(IngestJobContext context)
boolean dataSourceIngestIsCancelled()
final List< Extract > browserExtractors
void switchToDeterminate(int workUnits)
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
void progress(int workUnits)
static synchronized IngestServices getInstance()