Perimeter
4/5/2012
06:41 PM
John H. Sawyer
John H. Sawyer
Commentary
Connect Directly
RSS
E-Mail
50%
50%

Quick-Start Guide: Compiling Mac-Robber For iOS Vuln Research

How to compile, copy, and run mac-robber on jailbroken iOS devices

In the first part of this series, I covered an introductory approach to mobile device security research using some of the same tools and techniques I've used over the years as a forensic investigator. At the end, I mentioned using mac-robber directly on Android and iOS devices followed by mactime to generate a timeline of the filesystem as a basic method of identifying system activity that can find mobile app vulnerabilities. I followed that up with how to get mac-robber compiled for Android, how to run it on an Android device, and how to process the resulting file into a timeline. Today, I'll be digging into how to do the same thing for iOS and detailing the extra hoops we have to jump through for iOS.

Warning: The following steps require a familiarity and comfort with using Linux or a similar Unix-based operating system, which you really and truly need if you're going to be analyzing iOS--a BSD-based operating.

First, you'll need a jailbroken iOS device. How to actually perform the jailbreaking and any jailbreaking-related issues are beyond the scope of this series, but there are plenty of resources on the Internet with detailed steps. The important part is that you must have root access on the device to use mac-robber.

Second, you'll need a way to get files onto your device. One of the first things I install after jailbreaking my device is an SSH server. It comes in handy for several reasons such as copying files using scp.

Where things deviate from the previous process we followed for Android is that we'll actually be compiling mac-robber on the iOS device. This requires we install a few necessary pre-requisites in addition to copying the actual mac-robber source code to the device. Note that I'm using aptitude to install some of the prerequisites and it must be installed using Cydia.

First, copy the mac-robber archive via SSH (or another method), and then, log into the device as root using SSH. Next, decompress the archive, change directories into the mac-robber folder, and run the following commands:

  1. aptitude install make automake ldid wget
  2. wget http://iphone-gcc-full.googlecode.com/files/libgcc.deb
  3. wget http://iphone-gcc-full.googlecode.com/files/headers-libs.deb
  4. dpkg -i libgcc.deb
  5. aptitude install iphone-gcc
  6. dpkg -i --force-overwrite headers-libs.deb
  7. gcc -o mac-robber mac-robber.c

The first command installs a few tools that are helpful for later tasks. The next three commands download some necessary pre-requisite libraries and install them. The fifth command actually installs GCC while the sixth installs some necessary C libraries and headers needed during compilation of certain C programs. The final command is where we finally compile mac-robber into an executable we can run on iOS.

I typically run mac-robber using SSH like so:

  • ssh root@IP_of_iOS_device "mac-robber /" > AttachmentOpen.body

The resulting file can then be processed into a timeline using mactime from the Sleuth Kit.

mactime -b AttachmentOpen.body > AttachmentOpen.timeline

At this point, you have the basics to start creating timelines of the iOS filesystem. In the next part, I'll cover some of the interesting things you can find and actual vulnerabilities you can uncover using timeline analysis.

John Sawyer is a Senior Security Analyst with InGuardians, Inc. The views and opinions expressed in this blog are his own and do not represent those of his employer. He can be reached at johnhsawyer@gmail.com and found on Twitter @johnhsawyer.

Comment  | 
Print  | 
More Insights
Register for Dark Reading Newsletters
Partner Perspectives
What's This?
In a digital world inundated with advanced security threats, Intel Security seeks to transform how we live and work to keep our information secure. Through hardware and software development, Intel Security delivers robust solutions that integrate security into every layer of every digital device. In combining the security expertise of McAfee with the innovation, performance, and trust of Intel, this vision becomes a reality.

As we rely on technology to enhance our everyday and business life, we must too consider the security of the intellectual property and confidential data that is housed on these devices. As we increase the number of devices we use, we increase the number of gateways and opportunity for security threats. Intel Security takes the “security connected” approach to ensure that every device is secure, and that all security solutions are seamlessly integrated.
Featured Writers
White Papers
Cartoon
Current Issue
Dark Reading's October Tech Digest
Fast data analysis can stymie attacks and strengthen enterprise security. Does your team have the data smarts?
Flash Poll
Title Partner’s Role in Perimeter Security
Title Partner’s Role in Perimeter Security
Considering how prevalent third-party attacks are, we need to ask hard questions about how partners and suppliers are safeguarding systems and data.
Video
Slideshows
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2013-3304
Published: 2014-10-30
Directory traversal vulnerability in Dell EqualLogic PS4000 with firmware 6.0 allows remote attackers to read arbitrary files via a .. (dot dot) in the default URI.

CVE-2013-7409
Published: 2014-10-30
Buffer overflow in ALLPlayer 5.6.2 through 5.8.1 allows remote attackers to cause a denial of service (crash) and possibly execute arbitrary code via a long string in a .m3u (playlist) file.

CVE-2014-3446
Published: 2014-10-30
SQL injection vulnerability in wcm/system/pages/admin/getnode.aspx in BSS Continuity CMS 4.2.22640.0 allows remote attackers to execute arbitrary SQL commands via the nodeid parameter.

CVE-2014-3584
Published: 2014-10-30
The SamlHeaderInHandler in Apache CXF before 2.6.11, 2.7.x before 2.7.8, and 3.0.x before 3.0.1 allows remote attackers to cause a denial of service (infinite loop) via a crafted SAML token in the authorization header of a request to a JAX-RS service.

CVE-2014-3623
Published: 2014-10-30
Apache WSS4J before 1.6.17 and 2.x before 2.0.2, as used in Apache CXF 2.7.x before 2.7.13 and 3.0.x before 3.0.2, when using TransportBinding, does properly enforce the SAML SubjectConfirmation method security semantics, which allows remote attackers to conduct spoofing attacks via unspecified vect...

Best of the Web
Dark Reading Radio
Archived Dark Reading Radio
Follow Dark Reading editors into the field as they talk with noted experts from the security world.