Python取证 - 索引

索引实际上让调查员可以完整地查看文件并从中收集潜在的证据.证据可以包含在文件,磁盘映像,内存快照或网络跟踪中.

索引有助于减少耗时任务的时间,例如关键字搜索的.法医调查还涉及交互式搜索阶段,其中索引用于快速定位关键字.

索引还有助于将关键字列在排序列表中.

示例

以下示例说明如何在Python中使用索引.

aList = [123, 'sample', 'zara', 'indexing'];

print "Index for sample : ", aList.index('sample')
print "Index for indexing : ", aList.index('indexing')

str1 = "This is sample message for forensic investigation indexing";
str2 = "sample";

print "Index of the character keyword found is " 
print str1.index(str2)

上面的脚本将产生以下输出.

索引输出