RSS
 

Archive for the ‘Mac OS’ Category

Installing Mac OS X Mountain Lion in VMWare

22 Nov

Apple is not releasing the updates for Mac OS Lion Developer edition, so DP4 vm became older now and the latest version of Xcode (4.5)  is not working on it. To install the Mountain Lion on Vmware follow the steps provided below.

Mountain Lion VM:
1) Download VMware workstation 8 – Torrent Link
2) Enable hardware virtualization in the computer BIOS – If you don’t know how to do this, Read this link
3) Download Mac OS X Mountain Lion Vmware Image - Torrent Link
4) Vmware does not support the virtualization of OS X. To unlock the Vmware, extract the Mountain Lion Vmware image and go to ‘VMware Unlocker – Mac OS X Guest\VMware 8.x Series\VMware Workstation Unlocker – Windows’ folder. Right click on the ‘Install.bat’ and run it as administrator. It patches the Vmware and allows the installation of Mac OS X.
5) In the extracted vmware image, click on the .vmx file and it will load the Mountain Lion VM.

Vmware Tools:
1. Edit virtual machine settings, go to ‘Cd/Dvd’ and use ‘VMware Unlocker – Mac OS X Guest\VMware 8.x Series\Tools\darwin.iso’ as iso image.

mountain lion vm settings

2. Power On the virtual machine and click on Finder. Click on the iSO image listed on the right side and install the vmware tools. Vmware tools installation displays ‘The Installation Failed’ message and that is expected.

mountain lion vmware tools

3. Restart the VM and now it supports the Full screen mode.

XCode
1. Open Mac AppStore and login with iTunes account.
2. Search for Xcode and install it. It installs the Xcode 4.5 & iOS 6 simulator.

mountain lion xcode

Note: I tried updating the VM to Mountain Lion 10.8.2 but not succeeded.

 
 

Safari/iOS – Cookies.binarycookies reader

27 Oct

Safari browser and iOS applications store the persistent cookies in Cookies.binarycookies file. This is different from other desktop browsers. For example Internet Explorer stores the persistent cookies in text files under Temporary internet files folder. Similarly Firefox and Chrome browsers store the cookies in Sqlite database files. It is very easy to read the cookies stored in the text files and Sqlite database files. But there is no tool available to read the cookies from Cookies.binarycookies binary file. So I wrote a python script (BinaryCookieReader.py), when executed takes a Cookies.binarycookies file as input and dumps all the cookies in that file.

Usage of BinaryCookieReader
1. Download and install Python.
2. Add python installation folder to system PATH.
3. Download BinaryCookieReader.py
4. Open command prompt and run the below command. It dumps all the cookies from Cookies.binarycookies file.

Python BinaryCookieReader.py [Cookie.binarycookies-file-path]

Cookies.binarycookies reader

On the iPhone, Safari browser and third party iOS applications store the cookies in Cookies.binarycookies files located at the path shown below. Cookies created only with the future expiration date (persistent cookies) are stored in the binary Cookies.binarycookies file.

Cookies.binarycookies location

Most of the iOS applications create session cookies with future expiration dates as they don’t want to prompt the user for login every time. Usually those cookies will never get expire unless the user logout from the application. Also, during the iTunes backup, the Cookies.binarycookies file is copied to the backup folder. So if some one gain access to your iPhone  backup folder (Metasploit: Apple iOS backup extraction module), they can also get access to your email accounts and social network websites by reading the cookies from Cookies.binarycookies file.

Cookies.binarycookies Format:

Cookies.binarycookies file is composed of several pages and each page can have one or more cookies. The complete file format is explained below:

File Format:
1. The file starts with a 4 byte magic string: cook. It is used to identify the file type.
2. Next four bytes is an integer specifying the number of pages in the file.
3. Following that, a 4 byte integer for each page, represents the page size.
4. Next to that, the file contains the actual page content. Each page is of length corresponding to the page size. Page format is explained below.
5. The file ends with an 8 byte value and it might be file checksum.

cookies.binarycookies-file format

Page Format:
1. Every page starts with a 4 byte page header: 0×00000100.
2. Next four bytes is an integer specifying the number of cookies in the page.
3. Following that, a 4 byte integer for each cookie, represents the cookie offset. Offset specifies the start of the cookie in bytes from the start of the page.
4. Next to that, the page contains the actual cookie contents. Each cookie is of variable length. Cookie format is explained below.
5. Page ends with a 4 byte value and it is always 0×00000000.

cookies.binarycookies- page format

Cookie Format:
1. First 4 bytes in the cookie is the size of the cookie.
2. The next 4 bytes are unknown (may be related to cookies flags).
3. The next four bytes are the cookie flags. This is an integer value (1=Secure, 4=HttpOnly, 5= Secure+HttpOnly).
4. The next 4 bytes are unknown.
5. The next 4 bytes is an integer specifying the start of the url field in bytes from the start of the cookie record.
6. The next 4 bytes is an integer specifying the start of the name field in bytes from the start of the cookie record.
7. The next 4 bytes is an integer specifying the start of the path field in bytes from the start of the cookie record.
8. The next 4 bytes is an integer specifying the start of the value field in bytes from the start of the cookie record.
9. The next 8 bytes represents the end of the cookie and it is always 0×0000000000000000.
10. The next 8 bytes are the cookie expiration date. Date is in Mac epoch format (Mac absolute time). Mac epoch format starts from Jan 2001.
11. The next 8 bytes are the cookie creation date.
12. Next to that, the cookie contains the actual cookie domain, name, path & value. The order is not specific and they can appear in any order.

Cookies.binarycookies cookie format

*LE – Little Endian
*BE – Big Endian

References:
Tengu-Labs: Miyake%20-%20Safari%20Cookie.binarycookie%20Format%200_2[Draft].pdf
StackOverflow: safari-5-1-cookie-format-specs
Toolbox: understanding-the-safari-cookiesbinarycookies-file-format-49980

 
 

Mac Os X Lion – Copying files to Pen Drive

14 Oct

Mac OS X default file system is HFS (It also supports FAT 32 file system). If you connect a Pen Drive which is formatted in NTFS format, Mac detects it as a disk. You can read files from disk, but you can not write into it. So if you try to copy some files from Mac to Pen Drive it will not work. To do that, format the Pen Drive in FAT 32 format. Then Mac recognizes it as a hard drive. Now you can drag files from Mac to Pen Drive.

In Mac OS X, everything is complicated. Not as easy as in windows. In Windows if you copy files from NTFS formatted drive to FAT 32 drive, it automatically converts from one format to other. But it takes extra space to store those format conversion details.

 
2 Comments

Posted in Mac OS

 

Installing Mac OS X in Vmware

28 Sep

Apple has some sort of tie-up with Vmware/VirutalBox to disable the Mac OS virtualization. So when you try to install Mac OS in vmware, it will fail.

Follow the below steps to get a Mac OS X Lion VM-

1)  Download VMware workstation 7 – Torrent Link
2)  Install a patch for VMware workstation and this enables Mac OS virtualization.
Download the patch from - VMware Workstation Unlocker
3)  Enable hardware virtualization in the computer BIOS – If you don’t know how to do this, Read this link
4)  Download Mac OS X Lion Developer Preview Vmware Image – Torrent Link
5)  Extract the Vmware image and click on .vmx file. It will load the Mac OS X Lion VM. Have Fun :)

To develop applications for iPhone or iPad, you must need XCode developer tools. To install Xcode on OS X, follow the steps -

1) Download and install OS X developer preview latest update –  Lion OS X DP4
2) Download the latest XCode from Mac AppStore. To download apps from AppStore, you will require an Apple account. To create an Apple ID without supplying your credit card details visit this link.
3) Double click on XCode installer to install it.  Now you can develop your own ios Apps :)

[Update on Jan-05-2012]
VMware workstation 8 guest unlocker is available now and you can download it from below links.
VMware workstation 8
VMware Guest unlocker