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)

上面的指令碼將產生以下輸出。

Indexing Output
廣告