-
Notifications
You must be signed in to change notification settings - Fork 5
/
aft.py
67 lines (54 loc) · 1.94 KB
/
aft.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import os
import re
from lib.adb import AndroidDebugBridge
import string
from lib.read_db import *
adb = AndroidDebugBridge()
def main():
dir = raw_input("Enter the location at which the workspace is to be created: ")
if not os.path.exists(dir):
os.makedirs(dir)
os.makedirs("%s/database" % dir)
os.makedirs("%s/photos" % dir)
os.makedirs("%s/reports" % dir)
db = dir + "/database"
photo = dir + "/photos"
report = dir + "/reports"
aphoto = "/mnt/sdcard/DCIM/Camera/"
result = adb.get_state()
result = result.strip('\n')
if result == "unknown":
print "Not able to access device. Please check whether the device is connected properly and USB debugging mode is enabled"
print "Extracting databases:"
print "Extracting accounts.db"
adb.pull('/data/system/accounts.db',db)
print "Extracting mmssms.db"
adb.pull('/data/data/com.android.providers.telephony/databases/mmssms.db',db)
print "Extracting contacts2.db"
adb.pull('/data/data/com.android.providers.contacts/databases/contacts2.db',db)
print "Extracting webviewCache.db"
adb.pull('/data/data/com.android.browser/databases/webviewCache.db',db)
print "Extracting webview.db"
adb.pull('/data/data/com.android.browser/databases/webview.db',db)
print "Extracting browser"
adb.pull('/data/data/com.android.browser/databases/browser.db',db)
print "Extracting telephony.db"
adb.pull('/data/data/com.android.providers.telephony/databases/telephony.db',db)
print "\nExtracting photos:"
result = adb.shell("ls /mnt/sdcard/DCIM/Camera")
f = open ("%s/list.txt" % photo, 'w')
f.write(result)
f.close()
regex = r'\S[^\r\n\t]*\.jpg'
f = open("%s/list.txt" % photo,'r')
content = f.read()
fList = content.strip().split()
regex = r'\S[^\r\n\t]*\.jpg'
for x in range(0,len(fList)):
if re.search(regex,fList[x]):
adb.pull('/mnt/sdcard/DCIM/Camera/%s' % fList[x], photo)
read_account(db, report)
read_history(db, report)
read_mmssms (db,report)
if __name__ == "__main__":
main()