mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
check number of segments first
This commit is contained in:
parent
b8c02c6cd3
commit
4f1248cc87
@ -377,25 +377,16 @@ final class ChromeCacheExtractor {
|
|||||||
|
|
||||||
// Get the cache entry and its data segments
|
// Get the cache entry and its data segments
|
||||||
CacheEntry cacheEntry = new CacheEntry(cacheEntryAddress, cacheEntryFile.get() );
|
CacheEntry cacheEntry = new CacheEntry(cacheEntryAddress, cacheEntryFile.get() );
|
||||||
|
|
||||||
List<CacheData> dataEntries = cacheEntry.getData();
|
List<CacheData> dataEntries = cacheEntry.getData();
|
||||||
|
|
||||||
BlackboardAttribute urlAttr = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL,
|
|
||||||
moduleName,
|
|
||||||
((cacheEntry.getKey() != null) ? cacheEntry.getKey() : ""));
|
|
||||||
|
|
||||||
BlackboardAttribute createTimeAttr = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED,
|
|
||||||
moduleName,
|
|
||||||
cacheEntry.getCreationTime());
|
|
||||||
|
|
||||||
BlackboardAttribute hhtpHeaderAttr = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_HEADERS,
|
|
||||||
moduleName,
|
|
||||||
cacheEntry.getHTTPHeaders());
|
|
||||||
|
|
||||||
|
|
||||||
// Only process the first payload data segment in each entry
|
// Only process the first payload data segment in each entry
|
||||||
// first data segement has the HTTP headers, 2nd is the payload
|
// first data segement has the HTTP headers, 2nd is the payload
|
||||||
|
if (dataEntries.size() < 2) {
|
||||||
|
return derivedFiles;
|
||||||
|
}
|
||||||
CacheData dataSegment = dataEntries.get(1);
|
CacheData dataSegment = dataEntries.get(1);
|
||||||
|
|
||||||
|
|
||||||
// name of the file that was downloaded and cached (or data_X if it was saved into there)
|
// name of the file that was downloaded and cached (or data_X if it was saved into there)
|
||||||
String cachedFileName = dataSegment.getAddress().getFilename();
|
String cachedFileName = dataSegment.getAddress().getFilename();
|
||||||
Optional<AbstractFile> cachedFileAbstractFile = this.findCacheFile(cachedFileName, cachePath);
|
Optional<AbstractFile> cachedFileAbstractFile = this.findCacheFile(cachedFileName, cachePath);
|
||||||
@ -404,13 +395,22 @@ final class ChromeCacheExtractor {
|
|||||||
return derivedFiles;
|
return derivedFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
boolean isBrotliCompressed = false;
|
boolean isBrotliCompressed = false;
|
||||||
if (dataSegment.getType() != CacheDataTypeEnum.HTTP_HEADER && cacheEntry.isBrotliCompressed() ) {
|
if (dataSegment.getType() != CacheDataTypeEnum.HTTP_HEADER && cacheEntry.isBrotliCompressed() ) {
|
||||||
isBrotliCompressed = true;
|
isBrotliCompressed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// setup some attributes for later use
|
||||||
|
BlackboardAttribute urlAttr = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL,
|
||||||
|
moduleName,
|
||||||
|
((cacheEntry.getKey() != null) ? cacheEntry.getKey() : ""));
|
||||||
|
BlackboardAttribute createTimeAttr = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED,
|
||||||
|
moduleName,
|
||||||
|
cacheEntry.getCreationTime());
|
||||||
|
BlackboardAttribute httpHeaderAttr = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_HEADERS,
|
||||||
|
moduleName,
|
||||||
|
cacheEntry.getHTTPHeaders());
|
||||||
|
|
||||||
Collection<BlackboardAttribute> sourceArtifactAttributes = new ArrayList<>();
|
Collection<BlackboardAttribute> sourceArtifactAttributes = new ArrayList<>();
|
||||||
sourceArtifactAttributes.add(urlAttr);
|
sourceArtifactAttributes.add(urlAttr);
|
||||||
sourceArtifactAttributes.add(createTimeAttr);
|
sourceArtifactAttributes.add(createTimeAttr);
|
||||||
@ -418,8 +418,7 @@ final class ChromeCacheExtractor {
|
|||||||
Collection<BlackboardAttribute> webCacheAttributes = new ArrayList<>();
|
Collection<BlackboardAttribute> webCacheAttributes = new ArrayList<>();
|
||||||
webCacheAttributes.add(urlAttr);
|
webCacheAttributes.add(urlAttr);
|
||||||
webCacheAttributes.add(createTimeAttr);
|
webCacheAttributes.add(createTimeAttr);
|
||||||
webCacheAttributes.add(hhtpHeaderAttr);
|
webCacheAttributes.add(httpHeaderAttr);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// add artifacts to the f_XXX file
|
// add artifacts to the f_XXX file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user