-
Notifications
You must be signed in to change notification settings - Fork 4
/
wp78_parser.py
1409 lines (1192 loc) · 62.7 KB
/
wp78_parser.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Gabriele Zambelli (Twitter: @gazambelli)
# Blog : http://forensenellanebbia.blogspot.it
#
# WARNING: This program is provided "as-is"
# See http://forensenellanebbia.blogspot.it/2015/09/windows-phone-78-forensics.html for further details.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You can view the GNU General Public License at <http://www.gnu.org/licenses/>
#
# __ __
# __ SCRIPT TESTED ON PYTHON 2.7 __
#
#
# Python script to parse the following artifacts from a Windows 7.8 phone:
# - App IDs
# - Account - Create Time
# - Account - Default ID
# - Account - Last Sync Success
# - Bluetooth connected devices
# - Call Log
# - Contacts (from store.vol only - partial extraction)
# - Device friendly name
# - DHCP IP Address
# - Email addresses
# - GPS Last Known Position
# - GPS Last Position Injected
# - GPS Location Sync Start
# - IMEI
# - Internet Explorer - Typed URLs
# - Last SIM IMSI
# - OneDrive - DiskQuotaTotal and DiskQuotaRemaining
# - OneDrive - list of uploaded files
# - Shutdown Date Time
# - SIM IMSI
# - SMS (sent message decoding still lacks the recipient's phone number)
# - Wifi Adapter MAC Address
# - Wireless SSIDs
#
# You can run the script against: user.hv, system.hv, store.vol, pim.vol and image file
# Change history
# 2015-09-04 (v0.1) First public release
# 2016-03-20 (v0.2) Thanks to Vincent ECKERT for decoding the timestamp and the message type (SENT/RECEIVED) of SMS text messages
# 2016-03-26 (v0.3) improved unicode support + several small bugs fixed
# 2016-03-27 (v0.4) Timestamp decoded for calls log
# ***************************************************************************************************************************************************
# Welcome
# ***************************************************************************************************************************************************
from datetime import datetime,timedelta
import binascii
import codecs
import os
import re
import struct
import sys
import time
import urllib
script_version = "0.4"
def welcome():
os.system('cls')
print "\n\n Windows Phone 7.8 - Artifacts Parser (v%s)\n\n" % script_version
print " How to use ==> python wp78_parser.py [file] [options]\n\n"
print " Important files to analyze are:\n store.vol, pim.vol, CommsBackup.xml, system.hv, user.hv\n"
print " -a ...... account information (Default ID, Account Create Time,\n Last Sync Success)"
print " -d ...... device artifacts (IMEI, WiFi MAC Address,\n Device friendly name, Last Shutdown, SIM IMSI)"
print " -g ...... GPS (LastKnownLocation, LastPosInjected, LocationSyncStart)"
print " -h ...... Internet Explorer History (Typed URLs)"
print " -ip ...... DHCP IP Address"
print " -o ...... OneDrive artifacts (DiskQuotaUse, Files Uploaded)"
print " -p ...... Personal information (contacts, Call Log, E-mail addresses)"
print " -s ...... SMS messages"
print " -w ...... Wireless connections (Bluetooth, Wireless SSIDs)"
print " -i ...... AppID"
print " -all ...... Extract all artifacts (it can take up to 2h 30min\n against a forensic image)\n"
print "\n Except for SMS messages, all output goes to STDOUT.\n Use redirection to output to a file.\n"
if len(sys.argv) > 2:
if os.path.exists(sys.argv[1]) == True:
pass
else:
welcome()
sys.exit()
else:
welcome()
sys.exit()
fb = open(sys.argv[1], "rb")
# ***************************************************************************************************************************************************
# FUNCTIONS
# ***************************************************************************************************************************************************
# -- BEGIN -- From https://github.com/cheeky4n6monkey/4n6-scripts/blob/master/wp8-callhistory.py -- BEGIN --
# Find all indices of the "pattern" regular expression in a given string (using regex)
# Where pattern is a compiled Python re pattern object (ie the output of "re.compile")
CHUNK_SIZE = 50000000 #50MB 2000000000 # max value of CHUNK_SIZE + DELTA is 2147483647 (C long limit with Python 2)
DELTA = 1000 # read this extra bit to catch any hits crossing chunk boundaries. Should be AT LEAST max size of record being searched for.
def regsearch(bigstring, pattern, listindex=[]):
hitsit = pattern.finditer(bigstring)
for it in hitsit:
# iterators only last for one shot so we capture the offsets to a list
listindex.append(it.start())
return listindex
# Searches chunks of a file (using RE) and returns file offsets of any hits.
# Intended for searching of large files where we cant read the whole thing into memory
# This function calls the "regsearch" search method
def sliceNsearchRE(fd, chunksize, delta, term):
final_hitlist = [] # list of file offsets which contain the search term
pattern = re.compile(term, re.DOTALL) # should only really call this once at start, if same substring.
stats = os.fstat(fd.fileno())
#print("sliceNsearchRE Input file " + filename + " is " + str(stats.st_size) + " bytes\n")
begin_chunk = 0
# Handle if filesize is less than CHUNK_SIZE (eg Phone file instead of image.bin)
# Should be able to read whole file in 1 chunk
if (chunksize >= stats.st_size):
fd.seek(begin_chunk)
raw = fd.read()
final_hitlist = regsearch(raw, pattern, [])
#print(str(len(final_hitlist)) + " hits found in 1 chunk for " + str(term))
else:
# Filesize is greater than 1 chunk, need to loop thru
while ((begin_chunk + chunksize) <= stats.st_size) :
chunk_size_to_read = chunksize + delta
if ((chunk_size_to_read + begin_chunk) > stats.st_size):
chunk_size_to_read = stats.st_size - begin_chunk
#print("seeking " + str(begin_chunk) + " with size = " + str(chunk_size_to_read))
fd.seek(begin_chunk)
rawchunk = fd.read(chunk_size_to_read)
subhits = regsearch(rawchunk, pattern, [])
#print(str(len(subhits)) + " hits found at " + str(subhits))
# Items in subhits will be offsets relative to the start of the rawchunk (not relative to the file)
# Need to adjust offsets ...
for hit in subhits :
if (hit < chunksize) :
final_hitlist.append(begin_chunk + hit)
#print("adding " + str(begin_chunk + hit) + " to list")
elif (hit >= chunksize) :
#print("ignoring " + str(begin_chunk + hit) + " to list")
break # don't care if we get here because hit should be processed in next chunk
# subhits can start at index 0 so possible hit offsets are 0 to chunksize-1 inclusive
begin_chunk += chunksize
#print("final_hitlist = " + str(final_hitlist))
return(final_hitlist)
# -- END -- From https://github.com/cheeky4n6monkey/4n6-scripts/blob/master/wp8-callhistory.py -- END --
def f_search_ip(ip2search):
ip = re.findall( r'[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}', ip2search)
return ip
def f_dhcp(off1,off2):
#find DhcpSubnetMask
fb.seek(off1+off2+28)
raw_ip=fb.read(30).split("\x00\x00")
try:
raw_ip=raw_ip[0].replace("\x00","")
b = "DhcpSubnetMask : " + str(f_search_ip(raw_ip)[0]) #DhcpSubnetMask
except:
b = "DhcpSubnetMask : Not found" #DhcpSubnetMask
return b
def f_getaway(off1,off2):
fb.seek(off1+off2+36)
raw_ip=fb.read(30).split("\x00\x00")
try:
raw_ip=raw_ip[0].replace("\x00","")
c = "DhcpDefaultGateway: " + str(f_search_ip(raw_ip)[0]) #DhcpDefaultGateway
except:
c = "DhcpDefaultGateway: Not found" #DhcpDefaultGateway
return c
def f_dns(off1,off2):
fb.seek(off1+off2+14)
raw_ip=fb.read(30).split("\x00\x00")
try:
raw_ip=raw_ip[0].replace("\x00","")
d = "DhcpDNS : " + str(f_search_ip(raw_ip)[0]) #DhcpDNS
except:
d = "DhcpDNS : Not found" #DhcpDNS
return d
def f_lease(off1,off2):
fb.seek(off1+off2+30)
data=binascii.hexlify(fb.read(8))
#invert byte order for conversion
#http://stackoverflow.com/questions/4869769/convert-64-bit-windows-date-time-in-python
dt=data[14]+data[15]+data[12]+data[13]+data[10]+data[11]+data[8]+data[9]+data[6]+data[7]+data[4]+data[5]+data[2]+data[3]+data[0]+data[1]
us = int(dt,16) / 10
try:
conversion= datetime(1601,1,1) + timedelta(microseconds=us)
e = "LeaseObtainedHigh : " + str(conversion) + " (UTC)"
except:
e = "LeaseObtainedHigh : Not found"
return e
def f_timestamp_filetime(data):
#invert byte order for conversion
dt=data[14]+data[15]+data[12]+data[13]+data[10]+data[11]+data[8]+data[9]+data[6]+data[7]+data[4]+data[5]+data[2]+data[3]+data[0]+data[1]
us = int(dt,16) / 10
try:
conversion= datetime(1601,1,1) + timedelta(microseconds=us)
except:
conversion = "not found"
return conversion
def f_timestamp_tick(tick):
ticks = int(tick[-18:])
# http://stackoverflow.com/questions/3875806/how-does-one-convert-a-net-tick-to-a-python-datetime
dmoc = datetime(1, 1, 1) + timedelta(microseconds = ticks/10)
return dmoc #dateModifiedOnClient
def f_timestamp_sql(data):
# Timestamp parsing provided by Vincent ECKERT
hour = binascii.hexlify(struct.pack('<L',int(data[0:8],16)))
hour = time.strftime('%H:%M:%S', time.gmtime(int(hour,16)/1000))
mstime = binascii.hexlify(struct.pack('<H',int(data[8:12],16)))
date = datetime(1900,1,1)+timedelta(int(mstime,16))
date_string = str(date)
date_string = date_string[:10] #grab the first 10 characters: YYYY-MM-DD
timestamp_sql = date_string + " " + hour + " " + "(UTC)"
return timestamp_sql
# ***************************************************************************************************************************************************
# SIGNATURES
# ***************************************************************************************************************************************************
#device
sig_imei = "\x04\x49\x4D\x45\x49\x04\x00\x0F"
sig_friendlyname = "\x0c\x00\x46\x00\x72\x00\x69\x00\x65\x00\x6E\x00\x64\x00\x6C\x00\x79\x00\x4E\x00\x61\x00\x6D\x00\x65\x00" #..F.r.i.e.n.d.l.y.N.a.m.e.
sig_sim_imsi = "\x07\x02\x53\x00\x69\x00\x6D\x00\x49\x00\x6D\x00\x73\x00\x69\x00"
sig_last_sim_imsi = "\x0B\x00\x4C\x00\x61\x00\x73\x00\x74\x00\x53\x00\x69\x00\x6D\x00\x49\x00\x6D\x00\x73\x00\x69"
sig_last_shutdown = "\x4C\x00\x61\x00\x73\x00\x74\x00\x53\x00\x68\x00\x75\x00\x74\x00\x64\x00\x6F\x00\x77\x00\x6E\x00\x44\x00\x61\x00\x74\x00\x65\x00\x54\x00\x69\x00\x6D\x00\x65"
sig_wifi_adapter_mac = "\x41\x00\x64\x00\x61\x00\x70\x00\x74\x00\x65\x00\x72\x00\x4D\x00\x61\x00\x63\x00\x41\x00\x64\x00\x64\x00\x72\x00\x65\x00\x73\x00\x73\x00"
#dhcp
sig_dhcpipaddress = "\x44\x00\x68\x00\x63\x00\x70\x00\x49\x00\x50\x00\x41\x00\x64\x00\x64\x00\x72\x00\x65\x00\x73\x00\x73\x00"
sig_dhcpsubnetmask = "\x44\x00\x68\x00\x63\x00\x70\x00\x53\x00\x75\x00\x62\x00\x6E\x00\x65\x00\x74\x00\x4D\x00\x61\x00\x73\x00\x6B\x00"
sig_dhcpdefaultgetaway = "\x44\x00\x68\x00\x63\x00\x70\x00\x44\x00\x65\x00\x66\x00\x61\x00\x75\x00\x6C\x00\x74\x00\x47\x00\x61\x00\x74\x00\x65\x00\x77\x00\x61\x00\x79\x00"
sig_dhcpserver = "\x44\x00\x68\x00\x63\x00\x70\x00\x53\x00\x65\x00\x72\x00\x76\x00\x65\x00\x72\x00"
sig_dhcpdns = "\x44\x00\x68\x00\x63\x00\x70\x00\x44\x00\x4E\x00\x53\x00"
sig_gprsaddress = "\x47\x00\x50\x00\x52\x00\x53\x00\x41\x00\x64\x00\x64\x00\x72\x00\x65\x00\x73\x00\x73\x00"
sig_lease_obtained_hi = "\x4C\x00\x65\x00\x61\x00\x73\x00\x65\x00\x4F\x00\x62\x00\x74\x00\x61\x00\x69\x00\x6E\x00\x65\x00\x64\x00\x48\x00\x69\x00"
#gps
sig_lastposinjected = "\x4C\x00\x61\x00\x73\x00\x74\x00\x50\x00\x6F\x00\x73\x00\x49\x00\x6E\x00\x6A\x00\x65\x00\x63\x00\x74\x00\x65\x00\x64\x00"
sig_lastknownlocation = "\x4C\x00\x61\x00\x73\x00\x74\x00\x4B\x00\x6E\x00\x6F\x00\x77\x00\x6E\x00\x4C\x00\x6F\x00\x63\x00\x61\x00\x74\x00\x69\x00\x6F\x00\x6E\x00"
sig_locationsyncstart = "\x4C\x00\x6F\x00\x63\x00\x61\x00\x74\x00\x69\x00\x6F\x00\x6E\x00\x53\x00\x79\x00\x6E\x00\x63\x00\x53\x00\x74\x00\x61\x00\x72\x00\x74\x00"
#Bluetooth
sig_bt_name = "\x04\x00\x6E\x00\x61\x00\x6D\x00\x65\x00" #n.a.m.e.
sig_bt_lastconnecttime = "\x4C\x00\x61\x00\x73\x00\x74\x00\x43\x00\x6F\x00\x6E\x00\x6E\x00\x65\x00\x63\x00\x74\x00\x54\x00\x69\x00\x6D\x00\x65\x00" # L.a.s.t.C.o.n.n.e.c.t.T.i.m.e.
sig_bt_class = "\x63\x00\x6C\x00\x61\x00\x73\x00\x73\x00" #c.l.a.s.s.
#URL
sig_url_lastvisited = "\x4C\x00\x61\x00\x73\x00\x74\x00\x56\x00\x69\x00\x73\x00\x69\x00\x74\x00\x65\x00\x64\x00"
sig_url_title = "\x54\x00\x69\x00\x74\x00\x6C\x00\x65\x00"
#OneDrive livefilestore.com
sig_od_download = "\x22\x75\x72\x6C\x73\x22\x3A\x7B\x22\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x22\x3A" # "urls":{"download":
sig_od_url = "\x22\x75\x72\x6C\x22\x3A\x22\x2E\x6C\x69\x76\x65\x66\x69\x6C\x65\x73\x74\x6F\x72\x65\x2E\x63\x6F\x6D" # "url":".livefilestore.com
sig_od_datemodifiedonclient = "\x2C\x22\x64\x61\x74\x65\x4D\x6F\x64\x69\x66\x69\x65\x64\x4F\x6E\x43\x6C\x69\x65\x6E\x74\x22\x3A" # ,"dateModifiedOnClient":
sig_od_displayquotaremaining = "\x22\x64\x69\x73\x70\x6C\x61\x79\x51\x75\x6F\x74\x61\x52\x65\x6D\x61\x69\x6E\x69\x6E\x67\x22\x3A" # "displayQuotaRemaining":
sig_od_displayquotatotal = "\x22\x64\x69\x73\x70\x6C\x61\x79\x51\x75\x6F\x74\x61\x54\x6F\x74\x61\x6C\x22\x3A\x22" # "displayQuotaTotal":"
sig_od_displayquotaused = "\x22\x64\x69\x73\x70\x6C\x61\x79\x51\x75\x6F\x74\x61\x55\x73\x65\x64\x22\x3A\x22 " # "displayQuotaUsed":"
#account
sig_account_defaultid ="\x44\x00\x65\x00\x66\x00\x61\x00\x75\x00\x6C\x00\x74\x00\x49\x00\x44\x00"
sig_account_create_time = "\x41\x00\x63\x00\x63\x00\x6F\x00\x75\x00\x6E\x00\x74\x00\x43\x00\x72\x00\x65\x00\x61\x00\x74\x00\x65\x00\x54\x00\x69\x00\x6D\x00\x65\x00"
sig_account_last_sync_success = "\x4C\x00\x61\x00\x73\x00\x74\x00\x53\x00\x79\x00\x6E\x00\x63\x00\x53\x00\x75\x00\x63\x00\x63\x00\x65\x00\x73\x00\x73\x00"
#smtp
sig_smtp_email_address = "\x80\x53\x4D\x54\x50\x00"
#wifi
sig_ssid_start = "\x3C\x2F\x68\x65\x78\x3E\x0D\x0A\x09\x09\x09\x3C\x6E\x61\x6D\x65\x3E" # </hex>.....<name>
sig_ssid_end = "\x3C\x2F\x6E\x61\x6D\x65\x3E\x0D\x0A\x09\x09\x3C\x2F\x53\x53\x49\x44\x3E" # </name>....</SSID>
#SMS
sig_sms_pre1 = "\x40\x00\x07\x00\x0A" # hex sequence before SMS header
sig_sms_pre2 = "\x40\x00\x07\x00\xFF" # hex sequence before SMS header
sig_sms_pre3 = "\x38\x00\x07\x00\x0A" # hex sequence before SMS header
sig_sms_pre4 = "\x40\x00\x07\x00\x0B" # hex sequence before SMS header
sig_sms_header1 = "\x49\x50\x4D\x2E\x53\x4D\x53\x74" # (SMS HEADER) IPM.SMSt
sig_sms_header2 = "\x49\x50\x4D\x2E\x53\x4D\x53\x74\x65\x78\x74" # (SMS HEADER) IPM.SMStext
sig_sms_footer1 = "\x00\x00\x53\x4D\x53\x00\x00" # (SMS FOOTER) ..SMS..
sig_sms_footer2 = "\x00\x00\x53\x4D\x53\x00\xFF" # (SMS FOOTER) ..SMS..
sig_sms_footer3 = "\xFF\x0F\x53\x4D\x53\x00\x00" # (SMS FOOTER) ÿ.SMS..
#call
sig_call_header = "\xEE\xFF\xF3\x00"
#APPID
sig_appid = "\x3D\x00\x22\x00\x61\x00\x70\x00\x70\x00\x3A\x00\x2F\x00\x2F\x00" # ="app://
# ***************************************************************************************************************************************************
# App ID
# ***************************************************************************************************************************************************
def af_appid():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_appid)
appid_list=[]
for hit in hits:
fb.seek(hit)
fb.seek(hit+16)
raw_text=fb.read(72).replace("\x00","")
find = re.findall(r'[A-F0-9]{8}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{12}', raw_text)
if len(find)>0:
appid_list.append(find[0])
appid_list=set(appid_list)
appid_list=sorted(list(appid_list))
if len(appid_list) > 0:
print "\n********************************************\n AppIDs (%s)\n\n (Use the script wp_appid.py to get AppNames\n from the following AppIDs)\n********************************************\n" % str(len(appid_list))
for i in appid_list:
print i
# ***************************************************************************************************************************************************
# Friendly name (system.hv)
# ***************************************************************************************************************************************************
def af_friendly_name():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_friendlyname)
friendlyname_list=[]
for hit in hits:
fb.seek(hit)
fb.seek(hit+26)
raw_text=fb.read(32).replace("\x00","")
find = re.findall( r'[ 0-9a-zA-Z_-]{2,21}', raw_text)
if len(find)>0:
if "proxy" in find[0].lower():
pass
else:
friendlyname_list.append(find[0])
friendlyname_list=sorted(set(friendlyname_list))
if len(friendlyname_list) > 0:
print "\n********************************************\n Device friendly name (%s)\n********************************************\n" % str(len(friendlyname_list))
for i in friendlyname_list:
print i
# ***************************************************************************************************************************************************
# IMEI
# *****************************************************************************************************************************************************
def af_imei():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_imei)
imei_list=[]
for hit in hits:
fb.seek(hit+8)
raw_text=fb.read(17)
find = re.findall( r'[0-9]{15,17}', raw_text)
try:
if len(find)>0:
imei_list.append(find[0])
except:
pass
imei_list=sorted(set(imei_list))
if len(imei_list) > 0:
print "\n********************************************\n IMEI \n********************************************\n"
for i in imei_list:
print i
# ***************************************************************************************************************************************************
# DHCP (system.hv)
# *****************************************************************************************************************************************************
# offsets from DhcpIpAddress
#
# length of strings: dhcipaddress (26), sig_dhcpsubnetmask (28), DhcpDefaultGateway (36), sig_dhcpdns (14), LeaseObtainedHigh (30)
def af_dhcp():
off_dhcpsubnetMask = [76,80,84]
off_dhcpdefaultgetaway= [160,164,168,236,240,244,248]
off_dhcpdns = [248,252,256,320,324,328,336,340]
off_leaseObtainedHigh = [372,376,416,452,464,468,480,488,496,716]
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_dhcpipaddress)
hits_smask = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_dhcpsubnetmask)
hits_dhcpserver = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_dhcpserver)
hits_getaway = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_dhcpdefaultgetaway)
hits_dns = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_dhcpdns)
hits_lease = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_lease_obtained_hi)
dhcp_temp=[]
for hit in hits:
nf = 0 #counter to keep track of not found values
#find DhcpIPAddress
fb.seek(hit+26)
try:
raw_ip=fb.read(30).replace("\x00","")
a = "DhcpIPAddress : " + f_search_ip(raw_ip)[0] #print IP Address
except:
pass
#find DhcpSubnetMask
if off_dhcpsubnetMask[0]+hit in hits_smask:
b=f_dhcp(hit,off_dhcpsubnetMask[0])
elif off_dhcpsubnetMask[1]+hit in hits_smask:
b=f_dhcp(hit,off_dhcpsubnetMask[1])
elif off_dhcpsubnetMask[2]+hit in hits_smask:
b=f_dhcp(hit,off_dhcpsubnetMask[2])
else:
b = "DhcpSubnetMask : Not found"
nf += 1
#find DhcpGetaway
if off_dhcpdefaultgetaway[0]+hit in hits_getaway:
c = f_getaway(hit, off_dhcpdefaultgetaway[0])
elif off_dhcpdefaultgetaway[1]+hit in hits_getaway:
c = f_getaway(hit, off_dhcpdefaultgetaway[1])
elif off_dhcpdefaultgetaway[2]+hit in hits_getaway:
c = f_getaway(hit, off_dhcpdefaultgetaway[2])
elif off_dhcpdefaultgetaway[3]+hit in hits_getaway:
c = f_getaway(hit, off_dhcpdefaultgetaway[3])
elif off_dhcpdefaultgetaway[4]+hit in hits_getaway:
c = f_getaway(hit, off_dhcpdefaultgetaway[4])
elif off_dhcpdefaultgetaway[5]+hit in hits_getaway:
c = f_getaway(hit, off_dhcpdefaultgetaway[5])
elif off_dhcpdefaultgetaway[6]+hit in hits_getaway:
c = f_getaway(hit, off_dhcpdefaultgetaway[6])
else:
c = "DhcpDefaultGateway: Not found"
nf += 1
#find DhcpDns
if off_dhcpdns[0]+hit in hits_dns:
d = f_dns(hit, off_dhcpdns[0])
elif off_dhcpdns[1]+hit in hits_dns:
d = f_dns(hit, off_dhcpdns[1])
elif off_dhcpdns[2]+hit in hits_dns:
d = f_dns(hit, off_dhcpdns[2])
elif off_dhcpdns[3]+hit in hits_dns:
d = f_dns(hit, off_dhcpdns[3])
elif off_dhcpdns[4]+hit in hits_dns:
d = f_dns(hit, off_dhcpdns[4])
elif off_dhcpdns[5]+hit in hits_dns:
d = f_dns(hit, off_dhcpdns[5])
elif off_dhcpdns[6]+hit in hits_dns:
d = f_dns(hit, off_dhcpdns[6])
elif off_dhcpdns[7]+hit in hits_dns:
d = f_dns(hit, off_dhcpdns[7])
else:
d = "DhcpDNS : Not found"
nf += 1
#find DhcpLease
if off_leaseObtainedHigh[0]+hit in hits_lease:
e = f_lease(hit, off_leaseObtainedHigh[0])
elif off_leaseObtainedHigh[1]+hit in hits_lease:
e = f_lease(hit, off_leaseObtainedHigh[1])
elif off_leaseObtainedHigh[2]+hit in hits_lease:
e = f_lease(hit, off_leaseObtainedHigh[2])
elif off_leaseObtainedHigh[3]+hit in hits_lease:
e = f_lease(hit, off_leaseObtainedHigh[3])
elif off_leaseObtainedHigh[4]+hit in hits_lease:
e = f_lease(hit, off_leaseObtainedHigh[4])
elif off_leaseObtainedHigh[5]+hit in hits_lease:
e = f_lease(hit, off_leaseObtainedHigh[5])
elif off_leaseObtainedHigh[6]+hit in hits_lease:
e = f_lease(hit, off_leaseObtainedHigh[6])
elif off_leaseObtainedHigh[7]+hit in hits_lease:
e = f_lease(hit, off_leaseObtainedHigh[7])
elif off_leaseObtainedHigh[8]+hit in hits_lease:
e = f_lease(hit, off_leaseObtainedHigh[8])
elif off_leaseObtainedHigh[9]+hit in hits_lease:
e = f_lease(hit, off_leaseObtainedHigh[9])
else:
e = "LeaseObtainedHigh : Not found"
nf += 1
f_htm = a + ";" + b + ";" + c + ";" + d + ";" + e
if nf <= 3: #skip DhcpIpAddresses with 4 values not found
dhcp_temp.append(f_htm)
dhcp_final=[]
for i in dhcp_temp:
pos=i.rfind(";")
new = i[-(len(i)-pos)+1:] + ";" + i[:pos].strip() #put timestamp in front to sort later by timestamp
dhcp_final.append(new)
dhcp_final=set(dhcp_final)
dhcp_final=sorted(list(dhcp_final))
if len(dhcp_final)>0:
print "\n********************************************\n DHCP (%s) \n********************************************" % str(len(dhcp_final))
for i in dhcp_final:
pos=i.find(";")
new = i[-(len(i)-pos)+1:] + ";" + i[:pos] #put timestamp back to the original position
print "\n" + new.replace(";","\n")
dhcpserver_list=[]
for hit in hits_dhcpserver:
fb.seek(hit+20)
raw_ip=fb.read(30).replace("\x00","")
try:
dhcpserver_list.append(f_search_ip(raw_ip)[0]) #print IP Address
except:
pass
dhcpserver_list = set(dhcpserver_list)
dhcpserver_list = sorted(list(dhcpserver_list))
if len(dhcpserver_list)>0:
print "\n********************************************\n DHCP Server (%s) \n********************************************" % str(len(dhcpserver_list))
for i in dhcpserver_list:
print i
# ****************************************************************************************************************************************************
# Wi-Fi MAC Address (system.hv)
# ****************************************************************************************************************************************************
def af_wifi_adapter_mac():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_wifi_adapter_mac)
if len(hits) > 0:
fb.seek(hits[0]+34)
print "\n********************************************\n Wi-Fi MAC address\n********************************************\n"
print binascii.hexlify(fb.read(6))
# ****************************************************************************************************************************************************
# SIM IMSI (15 digit long number) (system.hv)
#*****************************************************************************************************************************************************
def af_sim_imsi():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_sim_imsi)
simimsi_list=[]
for hit in hits:
fb.seek(hit)
fb.seek(hit+2+14)
simimsi_list.append(fb.read(30).replace("\x00",""))
simimsi_list=sorted(set(simimsi_list))
if len(simimsi_list)>0:
print "\n********************************************\n SIM - IMSI (%s)\n********************************************\n" % str(len(simimsi_list))
for i in simimsi_list:
print i
# ***************************************************************************************************************************************************
# Last SIM IMSI (system.hv)
#*****************************************************************************************************************************************************
def af_last_sim_imsi():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_last_sim_imsi)
lastsimimsi_list=[]
for hit in hits:
fb.seek(hit)
fb.seek(hit+2+22)
raw_data = fb.read(30).replace("\x00","")
find = re.findall( r'[0-9]{15,16}', raw_data)
if find:
lastsimimsi_list.append(find[0])
else:
pass #skipped false positive
lastsimimsi_list=sorted(set(lastsimimsi_list))
if len(lastsimimsi_list) > 0:
print "\n********************************************\n SIM - Last SIM IMSI (%s) \n********************************************\n" % str(len(lastsimimsi_list))
for i in lastsimimsi_list:
print i
# ***************************************************************************************************************************************************
# Last Shutdown Date Time (system.hv)
# ***************************************************************************************************************************************************
def af_last_shutdown():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_last_shutdown)
timestamp = []
for hit in hits:
fb.seek(hit)
fb.seek(hit+40)
data=binascii.hexlify(fb.read(8))
conversion=f_timestamp_filetime(data)
if str(conversion).startswith('20'):
timestamp.append(conversion)
timestamp = sorted(set(timestamp))
if len(timestamp)>0:
print "\n********************************************\n Device - Last shutdown date time (UTC) (%s)\n********************************************\n" % str(len(timestamp))
for i in timestamp:
print i
# ****************************************************************************************************************************************************
# GPRS IP Address in unallocated space (system.hv)
# ****************************************************************************************************************************************************
def af_gprs_ipaddress():
temp = []
if 'system.hv' not in sys.argv[1]:
hits_gprsaddress = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_gprsaddress)
for hit in hits_gprsaddress:
fb.seek(hit+22)
raw_ip=fb.read(30).replace("\x00","")
find = f_search_ip(raw_ip) #print GPRS IP Address
try:
temp.append(find[0])
except:
pass
if len(temp)>0:
temp=set(temp)
temp=sorted(list(temp))
print "\n********************************************\n GPRS Address (%s)\n********************************************" % str(len(temp))
for i in temp:
print i
# ***************************************************************************************************************************************************
# GPS: LastPosInjected - coordinates reported by geolocation apps (system.hv)
# ***************************************************************************************************************************************************
def af_gps_lastposinjected():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_lastposinjected)
lastposinjected_list=[]
for hit in hits:
fb.seek(hit)
fb.seek(hit+30)
raw_text=fb.read(62).replace("\x00","")
find = re.findall( r'[-]?[0-9]{1,3}\.[0-9]{6},[-]?[0-9]{1,3}\.[0-9]{6}', raw_text) #find decimal coordinates
if find:
lastposinjected_list.append(find[0])
else:
pass #skip false positive
lastposinjected_list=sorted(set(lastposinjected_list))
if len(lastposinjected_list) > 0:
print "\n********************************************\n GPS - Last Position Injected (%s)\n********************************************\n" % str(len(lastposinjected_list))
for i in lastposinjected_list:
print i
# ***************************************************************************************************************************************************
# GPS: LastKnownLocation (system.hv)
# ***************************************************************************************************************************************************
def af_gps_last_known_location():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_lastknownlocation)
lastknownlocation_list=[]
for hit in hits:
fb.seek(hit)
fb.seek(hit+34)
raw_text=fb.read(100).replace("\x00","")
find = re.findall( r'[0-9Z: \-()]{23}[-]?[0-9]{1,3}\.[0-9]{6},[-]?[0-9]{1,3}\.[0-9]{6}', raw_text)
if find:
lastknownlocation_list.append(find[0])
else:
pass #skipped false positive
if len(lastknownlocation_list) > 0:
print "\n****************************************\n GPS - Last Known Location (%s)\n****************************************\n" % str(len(lastknownlocation_list))
for i in lastknownlocation_list:
print i
# **************************************************************************************************************************************************
# GPS: Location Sync Start (system.hv)
# **************************************************************************************************************************************************
def af_gps_location_syncstart():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_locationsyncstart)
locationsyncstart_list=[]
for hit in hits:
fb.seek(hit)
fb.seek(hit+34)
raw_text=fb.read(32).replace("\x00","")
raw_text=raw_text[:4] + "-" + raw_text[4:6] + "-" + raw_text[6:8] + " " + raw_text[9:11] + ":" + raw_text[11:13] + ":" + raw_text[13:16]
try:
if '20' in raw_text:
locationsyncstart_list.append(raw_text)
except:
pass
locationsyncstart_list = set(locationsyncstart_list)
locationsyncstart_list = sorted(list(locationsyncstart_list))
if len(locationsyncstart_list) > 0:
print "\n****************************************\n GPS - Location Sync Start (UTC) (%s)\n****************************************\n" % str(len(locationsyncstart_list))
for i in locationsyncstart_list:
print i
# **************************************************************************************************************************************************
# Bluetooth connected devices (system.hv)
# ***************************************************************************************************************************************************
# Keytype | ...macaddress ... | name | class | LastConnectTime
def af_bluetooth():
hits_bt_name = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_bt_name)
hits_bt_class = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_bt_class)
hits_bt_lastconnecttime = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_bt_lastconnecttime)
temp = []
for btclass in hits_bt_class:
if btclass+84 in hits_bt_lastconnecttime:
if btclass-54 in hits_bt_name: #from "class" go back to find "name"
fb.seek(btclass+84+30) #read timestamp
data=binascii.hexlify(fb.read(8))
conversion=f_timestamp_filetime(data)
a = "\nLastConnectTime: " + str(conversion) + " (UTC)"
fb.seek(btclass-54+10) # 10 is the length of the string "..name" in unicode
raw_text=fb.read(28).split("\x00\x00") #bluetooth device name
raw_text=raw_text[0].replace("\x00","") #bluetooth device name
find = re.findall( r'[0-9a-zA-Z -_#!?:]*', raw_text)
b = "Device name : " + find[0]
fb.seek(btclass-98) #macaddress
raw_text=fb.read(24).replace("\x00","")
c = "MAC Address : " + raw_text
temp.append(a + "\t" + b + "\t" + c)
temp = set(temp)
temp = sorted(list(temp))
if len(temp) > 0:
print "\n****************************************\n Bluetooth - connected devices\n****************************************"
for i in temp:
print i.replace("\t","\n")
# *************************************************************************************************************************************************
# Internet Explorer - Typed URLs (user.hv)
# (item sequence in hex: URL, LastVisited, Title)
# *************************************************************************************************************************************************
def af_ie_typed_urls():
hits_lastvisited = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_url_lastvisited)
hits_title = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_url_title)
temp=[]
for hit in hits_lastvisited:
fb.seek(hit-240) #from LastVisited go back and look for URLs nearby
raw_text=fb.read(240).replace("\x00","").lower()
find = re.findall(r'(?:https|http):[0-9a-zA-Z:/\.\-\=%?&+]*', raw_text) #look for URLs
if len(find) == 0:
pass
else:
fb.seek(hit+22) #lastvisited
data=binascii.hexlify(fb.read(8))
conversion=f_timestamp_filetime(data)
a = urllib.unquote(find[0]) #URL found, decode escaped characters in URL
b ="LastVisited: " + str(conversion) + " (UTC)"
if hit+96 in hits_title:
fb.seek(hit+96+10)
raw_text=fb.read(200).replace("\x00","")
title_grab=re.findall(r'[0-9a-zA-Z:/, -]*', raw_text)
c = "Title : " + title_grab[0]
d = b + ";" + a + ";" + c #LastVisited, URL, Title
temp.append(d)
elif hit+144 in hits_title:
fb.seek(hit+144+10)
raw_text=fb.read(200).replace("\x00","")
title_grab=re.findall(r'[0-9a-zA-Z:/, -]*', raw_text)
c = "Title : " + title_grab[0]
d = b + ";" + a + ";" + c
temp.append(d)
else:
d = b + ";" + a
temp.append(d)
temp=set(temp)
temp=sorted(list(temp))
if len(temp)>0:
print "\n********************************************\n Internet Explorer (Typed URLs) (%s)\n********************************************\n" % str(len(temp))
for i in temp:
i=i.replace(";","\n")
print "URL : " + i[46:] #print URL, Title
print i[:46] #print LastVisited
# ***************************************************************************************************************************************************
# Account (user.hv)
# ***************************************************************************************************************************************************
def af_account():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_account_defaultid) #defaultid in user.hv is the current Microsoft account set up on the mobile device
defaultid_list=[]
for hit in hits:
fb.seek(hit)
fb.seek(hit+18)
raw_text=fb.read(72).replace("\x00","")
find = re.findall( r'\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b', raw_text) #grep e-mail addresses after DefaultID
if len(find)>0:
defaultid_list.append(find[0])
else:
pass
defaultid_list=set(defaultid_list)
defaultid_list=sorted(list(defaultid_list))
if len(defaultid_list) > 0:
print "\n****************************************\n Current/Previous account (%s) \n****************************************" % str(len(defaultid_list))
if 'user.hv' in sys.argv[1]:
print "\nDefault ID (current account)"
else:
print "\nDefault ID (current/previous account)"
for i in defaultid_list :
print i
# **************************************************************************************************************************************************
# Account Create Time = when the account was set up on the phone (user.hv)
# Account Last Sync Success - last time the account was synced (unallocated space)
# **************************************************************************************************************************************************
def af_account_create_time():
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_account_create_time)
hits2 = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_account_last_sync_success)
temp=[]
for hit in hits: #for each AccountCreateTime
fb.seek(hit)
fb.seek(hit+34)
data=binascii.hexlify(fb.read(8)) #read timestamp
conversion=f_timestamp_filetime(data)
if 'user.hv' in sys.argv[1]:
fb.seek(hit-1364+10) #email 1364 - email field 10
raw_text=fb.read(100).replace("\x00","")
find = re.findall( r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}', raw_text) #grep email address
if len(find)>0:
print "\nUser : " + find[0]
print "Account Create Time: " + str(conversion) + " (UTC)"
for i in hits2:
diff=i-hit
if diff<20000:
fb.seek(i+30)
data=binascii.hexlify(fb.read(8)) #reads timestamp
conversion=f_timestamp_filetime(data)
print "Last Sync Success : " + str(conversion) + " (UTC)" #usually found in user.hv
else:
fb.seek(hit-412+10) #email (412), email field length (10)
raw_text=fb.read(100).replace("\x00","")
find = re.findall( r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}', raw_text)
if len(find)>0:
a = "\nUser : " + find[0]
b= "Account Create Time: " + str(conversion) + " (UTC)"
c = a + ";" + b
temp.append(c)
#dedupe User / AccountCreateTime found in the unallocated space
temp=set(temp)
temp=sorted(list(temp))
for i in temp:
print i.replace(";","\n")
temp=[]
if 'user.hv' not in sys.argv[1]:
for i in hits2:
fb.seek(i+30)
data=binascii.hexlify(fb.read(8)) #read timestamp
conversion=f_timestamp_filetime(data)
a = "Last Sync Success: " + str(conversion) + " (UTC)"
temp.append(a)
if len(temp)>0:
#dedupe LastSyncSuccess hits
temp=set(temp)
temp=sorted(list(temp))
print "\n\nLastSyncSuccess\n(correlate these dates with the AccountCreateTime of each account)\n"
for i in temp:
print i
# **************************************************************************************************************************************************
# OneDrive - Disk Quota and Usage
# **************************************************************************************************************************************************
# dateModifiedOnClient | DisplayQuotaRemaining | DisplayQuotaTotal | DisplayQuotaUsed
def af_onedrive_disk_quota():
od_quota_list = []
hits_dqr = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_od_displayquotaremaining)
if len(hits_dqr) > 0:
for hit_dqr in hits_dqr:
dqr = ""
dqt = ""
#dqu = ""
dmoc = ""
fb.seek(hit_dqr+25)
raw_text = fb.read(10)
find = re.findall( r'[0-9 MGT\.,]*B', raw_text)
if len(find) > 0:
dqr = "DisplayQuotaRemaining: " + str(find[0]) #DisplayQuotaRemaining
fb.seek(hit_dqr+25)
raw_text = fb.read(100)
find = re.findall( r'displayQuotaTotal[\":0-9 MGT\.,]*B', raw_text) #displayquotatotal
if len(find) > 0:
dqt = str(find[0]).replace('"',"").replace(":", " : ")
fb.seek(hit_dqr-130)
raw_text = fb.read(130)
find = re.findall( r'dateModifiedOnClient[\":0-9 ]*', raw_text) #dateModifiedOnClient
if len(find) > 0:
dmoc = find[0].replace('"',"")
dmoc = f_timestamp_tick(dmoc)
dmoc = "DateModifiedOnClient : " + str(dmoc)
sms_complete = dmoc + "\t" + dqr + "\t" + dqt
if sms_complete.count(':') >=3 :
od_quota_list.append(sms_complete)
od_quota_list = set(od_quota_list)
od_quota_list = sorted(list(od_quota_list))
if len(od_quota_list) > 0:
print "\n****************************************\n OneDrive - Disk Quota and Usage (%s)\n****************************************" % str(len(od_quota_list))
for i in od_quota_list:
print "\n" + i.replace("\t","\n")
# **************************************************************************************************************************************************
# OneDrive - Files Uploaded #livefilestore
# **************************************************************************************************************************************************
def af_onedrive_files_uploaded():
od_download_list=[]
hits = sliceNsearchRE(fb, CHUNK_SIZE, DELTA, sig_od_download)
for hit in hits:
a="" #name
b="" #estension
c="" #displaysize
d="" #lastaccess
e="" #modifieddate
f_htm="" #ownername
g="" #sharinglevel
h="" #url
fb.seek(hit-900)
raw_text=fb.read(900).split(',')
for i in raw_text:
if "name" in i:
if "cropped" not in i and "scaled" not in i:
a = i.replace('\"','').replace(":"," : ")
elif "extension" in i:
b = i.replace('\"','').replace(":"," : ")
elif "displaySize" in i:
c = i.replace('\"','').replace(":"," : ")
elif "lastAccess" in i:
d = f_timestamp_tick(i)
d = "lastAccess : " + str(d)
elif "modifiedDate" in i:
e = f_timestamp_tick(i)