google earth cache forensics - jesse kornblumjessekornblum.com/presentations/dodcc10-2.pdf ·...

31
C Y B E R S E C T O R Google Earth Cache Forensics Jesse Kornblum

Upload: phamdan

Post on 12-Mar-2018

239 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

C Y B E R S E C T O R

Google Earth Cache Forensics

Jesse Kornblum

Page 2: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

2

Outline •  Introduction •  Disclaimer •  Reverse Engineering Technique •  Index File •  Coordinate Information •  Data File •  Mobile Devices •  Trivia •  Conclusion

Page 3: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Introduction •  Google Earth

–  http://earth.google.com/ –  Free and Pro versions –  Windows, OS X, and Linux –  Mobile version for iPhone

•  View satellite and aerial images •  Overlay roads, borders, 3-D

buildings, images, etc etc

3

Page 4: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Introduction •  Keeps two cache files •  Defaults to 2000 MiB •  Stored in user’s Application Data folder

C:\Documents and Settings\username\Local Settings\Application Data\Google\Google Earth

•  dbCache.dat.index –  Metadata for each record –  Pointer into data file

•  dbCache.dat –  Contains encrypted records –  Can contain slack

•  Entries in cache but not in index

4

Page 5: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Introduction •  Search queries not saved in cache file

5

Page 6: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Disclaimer •  Information on cache file format came from “Zed” •  http://starmen.at.tut.by/

–  Yes, it’s in Russian –  The Google language tools did a good job

6

Page 7: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Reverse Engineering Technique 1.  Find unique binary string 2.  Search for that binary string 3.  Follow first result in Russian or Chinese

•  Translation engines are great! –  But some things don’t translate –  黑客 vs. Dark Visitor

7

Page 8: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Reverse Engineering Technique

“Причинa и решение всех жизненных проблем.”

(The cause of, and solution to, all of life’s problems.)

8

Page 9: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Reverse Engineering Technique •  Data file header

–  d5 e1 c1 ca –  When viewed as 32-bit little endian number –  0xcac1e1d5 –  Notice how it kind of looks like “cache”

•  Led us to Zed’s web page –  http://starmen.at.tut.by/

9

Page 10: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Reverse Engineering Technique •  Poke around in the file

–  Hex viewer is your friend –  My favorite is WinHex, but YMMV –  Look for values at round numbered offsets

•  "What does this button do?" –  You can't break it

•  Look for evidence of activity –  Save file state –  Do something specific in the program –  See effect in file

•  Make changes in file –  See the effect in the program

10

Page 11: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Index File Series of 32 byte entries

D5 BF 93 75 C4 00 80 01 0F 00 00 00 34 35 15 81 00 00 00 00 00 00 00 00 00 AA B8 00 76 00 00 00

11

Page 12: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Index File

12

Offset Bytes Description 0x0 4 Signature, 0x7593bfd5 0x4 2 0x6 1 Entry type 0x7 1 0x8 1 Zoom level 0x9 1 0xa 2 0xc 4 Location 1

0x10 4 Location 2 0x14 4 0x18 4 Offset of entry in data file 0x1c 4 Size of entry in data file

Page 13: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Entry Types •  Entry type at offset 0x6

–  Authorization (key) –  JPEG image –  Text –  Binary Data

•  Roads •  Relief information •  Buildings

–  Unknown

13

Page 14: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Location Information •  Up to 64-bits of data encoded in base four notation (2 bit values) •  Each base four digit indicates a quadrant of a map

14

3 2

0 1

Page 15: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Location Information •  The world starts as a single map

15

Page 16: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Location Information

16

180,-180

-180,-180

180,180

-180,180

Page 17: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Location Information

17

Page 18: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Example

18

Zoom level 0xF = 16 two bit values = 32 bits = 4 bytes 34 35 15 81 = 0 0 1 1 0 1 0 0 0 0 1 1 0 1 0 1 0 0 0 1 1 0 0 0 0 0 0 1 = 00 11 01 00 00 11 01 01 00 01 10 00 00 01 Convert to base 4 0 3 1 0 0 3 1 1 0 1 2 0 0 1

Page 19: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Source Code int i; double lat1, lat2, lon1, lon2;

Lat1 = 180; Lon1 = -180; Lat2 = -180; Lon2 = 180;

for (i = 0 ; i < zoom ; ++i) {

switch (location[i]) { case ‘0’: lat1 = (lat1 + lat2) / 2; lon2 = (lon1 + lon2) / 2; break; case ‘1’: lat1 = (lat1 + lat2) / 2; lon1 = (lon1 + lon2) / 2;

19

case ‘2’: lat2 = (lat1 + lat2) / 2; lon1 = (lon1 + lon2) / 2; break; case ‘3’: lat2 = (lat1 + lat2) / 2; lon2 = (lon1 + lon2) / 2; break; }

}

Page 20: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Example

20

Zoom level 0xF = 16 two bit values = 32 bits = 4 bytes 34 35 15 81 = 0 0 1 1 0 1 0 0 0 0 1 1 0 1 0 1 0 0 0 1 1 0 0 0 0 0 0 1 = 00 11 01 00 00 11 01 01 00 01 10 00 00 01 Convert to base 4 0 3 1 0 0 3 1 1 0 1 2 0 0 1

0.384521 N, 32.618408 E x 0.373535 N, 32.629395 E

Page 21: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Zoom Levels •  Generally, max zoom is 22 •  Can go higher in certain areas

–  For example, around DC3, it's 24 –  With aerial photography, it's 27

21

Page 22: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Data Files •  Header

–  File size –  Offset of first record –  Timestamps for sever connections

•  Series of encrypted records –  Header similar to index entries –  A series of "files" –  Contain data pointed to by the index file

22

Page 23: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Record Format

23

Offset Bytes Description 0x0 4 Signature, 0xcac1e1d5 0x4 3 Entry size 0x7 3 0xa 1 Entry type 0xb 1 0xc 1 Zoom level 0xd 3

0x10 4 Location 1 0x14 4 Location 2 0x18 4 0x1c 4 File size 0x20 4 File checksum

Page 24: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Encryption •  Entries are encrypted •  First response from server includes the key

–  First response may not be in the cache file anymore –  Key does not appear to change

int i, j = 16, keystart = 16; for (i = 0 ; i < file_size ; ++i)

{ plaintext[i] = ciphertext[i] ^ key[j + 8]; ++j;

if (0 == j % 8) j += 16; if (j >= key_length) {

keystart = (keystart + 8) % 24; j = keystart; }

}

24

Page 25: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Decrypted data •  Also has a header

–  Zlib compressed data •  0x7468dead

–  JPEG compressed image •  0xe0ffd8ff

–  Unknown data

25

Page 26: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Viewing the Data •  Stitch images together

–  Multiple views –  Going to end up with a picture of the earth –  At higher zoom levels, that's a big picture!

•  Parse XML information •  Location data

26

Page 27: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Viewing the Data

27

Page 28: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

28

Mobile Devices •  Google Earth and Google Maps for mobile devices

–  Has a similar cache format •  Also includes navigation information

–  Android devices cache WAV files of instructions –  See Andrew Hoog's talk for details

Page 29: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Trivia –  The signature values are numbers, not strings

•  They are reversed on big-endian systems •  0xcac1e1d5 becomes 0xd5e1c1ca

–  There are still modern big-endian platforms! •  ARM* •  PowerPC

–  Wii, Playstation

29

Page 30: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

30

Outline •  Introduction •  Disclaimer •  Reverse Engineering Technique •  Index File •  Coordinate Information •  Data File •  Mobile Devices •  Trivia •  Conclusion

Page 31: Google Earth Cache Forensics - Jesse Kornblumjessekornblum.com/presentations/dodcc10-2.pdf · Introduction • Google Earth – – Free and Pro versions – Windows, OS X, and Linux

Questions?

Jesse Kornblum [email protected]

31

Image courtesy Flickr user toastyken and licensed under the Creative Commons