Decoding cache.cell and cache.wifi files

As everybody knows, Android is maintaining two cache files with location information. One is cache.wifi (a wifi router database with MAC and GPS of the router) the other is cache.cell (a database with mobile communication cells and their GPS). Due to the fact, that these files are in binary format the following Python code-snippet should help to encode the actual data:

cacheFile = open("cache.wifi", 'rb')
version, entries = struct.unpack('>hh',
i = 0
while i < entries:
   key ='>h',[0])
   (accuracy, confidence, latitude, longitude, readtime) = struct.unpack('>iiddQ',
   outputFile.write('%25s %7d %5d %10f %10f %s \n' % (key,accuracy,confidence,latitude,longitude,time.strftime("%x %X %z", time.localtime(readtime/1000))))

The cache files are located at:

This snippet works for both cache files, just change the filename 🙂

Mobile Phone Forensic Toolkit: Terminal view

Within the scope of this diploma thesis, a tool for forensic analysis of Twister Box dumps for Nokia smartphones has been developed. The tool contains sev- eral scripts which are written in Python. The various scripts correspond to modules which are responsible for certain telephone functions (address book, SMS, call history, etc.). Those are accessed via a global script. The global script accepts the Twister Box dump file, the mobile phone type and the reporting type as an argument.

After starting the tool, data processing is initiated as shown in the figure above. Here we tryed to analyze a Nokia 6500.

Convert date from GSM to DEC

# converts a given date from GSM to DEC
decString = encodedDate.decode( ’hex ’)
decString = struct.unpack from(’>H5B’, decString)

This code fragment translates the given date from the GSM Standard to a readable DEC format.