Merge pull request #927 from rcordovano/release_3.1.1_updates

Release 3.1.1 updates
This commit is contained in:
Richard Cordovano 2014-10-29 17:43:29 -04:00
commit 46a82a92f8

View File

@ -27,7 +27,6 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE. # OTHER DEALINGS IN THE SOFTWARE.
import jarray import jarray
from java.lang import System from java.lang import System
from org.sleuthkit.datamodel import SleuthkitCase from org.sleuthkit.datamodel import SleuthkitCase
@ -97,10 +96,10 @@ class SampleJythonDataSourceIngestModule(DataSourceIngestModule):
services = Services(sleuthkitCase) services = Services(sleuthkitCase)
fileManager = services.getFileManager() fileManager = services.getFileManager()
# Get count of files with .doc extension. # Get count of files with "test" in name.
fileCount = 0; fileCount = 0;
docFiles = fileManager.findFiles(dataSource, "%.doc") files = fileManager.findFiles(dataSource, "%test%")
for docFile in docFiles: for file in files:
fileCount += 1 fileCount += 1
progressBar.progress(1) progressBar.progress(1)
@ -110,7 +109,7 @@ class SampleJythonDataSourceIngestModule(DataSourceIngestModule):
# Get files by creation time. # Get files by creation time.
currentTime = System.currentTimeMillis() / 1000 currentTime = System.currentTimeMillis() / 1000
minTime = currentTime - (14 * 24 * 60 * 60) # Go back two weeks. minTime = currentTime - (14 * 24 * 60 * 60) # Go back two weeks.
otherFiles = sleuthkitCase.findFilesWhere("crtime > %d" % minTime) otherFiles = sleuthkitCase.findAllFilesWhere("crtime > %d" % minTime)
for otherFile in otherFiles: for otherFile in otherFiles:
fileCount += 1 fileCount += 1
progressBar.progress(1); progressBar.progress(1);
@ -119,7 +118,8 @@ class SampleJythonDataSourceIngestModule(DataSourceIngestModule):
return IngestModule.ProcessResult.OK; return IngestModule.ProcessResult.OK;
#Post a message to the ingest messages in box. #Post a message to the ingest messages in box.
message = IngestMessage.createMessage(IngestMessage.MessageType.DATA, "Sample Jython Data Source Ingest Module", "Found %d files" % fileCount) message = IngestMessage.createMessage(IngestMessage.MessageType.DATA,
"Sample Jython Data Source Ingest Module", "Found %d files" % fileCount)
IngestServices.getInstance().postMessage(message) IngestServices.getInstance().postMessage(message)
return IngestModule.ProcessResult.OK; return IngestModule.ProcessResult.OK;
@ -135,9 +135,9 @@ class SampleJythonFileIngestModule(FileIngestModule):
def process(self, file): def process(self, file):
# If the file has a txt extension, post an artifact to the blackboard. # If the file has a txt extension, post an artifact to the blackboard.
if file.getName().endswith("txt"): if file.getName().find("test") != -1:
art = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT) art = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT)
att = BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID(), "Sample Jython File Ingest Module", "Text file") att = BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID(), "Sample Jython File Ingest Module", "Text Files")
art.addAttribute(att) art.addAttribute(att)
# Read the contents of the file. # Read the contents of the file.