Perimeter
4/2/2012
05:15 PM
John H. Sawyer
John H. Sawyer
Commentary
Connect Directly
RSS
E-Mail
50%
50%

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

How to compile, copy, and run mac-robber on rooted Android devices

In the first part of this series, I covered an introductory approach to basic 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. Today, we'll be digging into some of the gritty details on how to accomplish getting mac-robber on your own Android device, followed by how to do it on iOS devices in the next blog.

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

First, you'll need a rooted Android device. How to actually perform the rooting and rooting-related issues is 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 rooting my device is an SSH server. It comes in handy for several reasons, such as copying files using scp. Alternatively, I'll use adb (part of the Android SDK) to push the files to the device via a USB cable. There are plenty of other methods, but these are two of the quickest and easiest.

Next, you need mac-robber compiled from source code into an executable binary to run on your device. In my test environment, I used a Ubuntu Linux server, but you can easily use MobiSec or Backtrack Linux for the next steps. You'll need to download mac-robber, decompress it, open up a terminal window, and change directories into the folder containing the extracted mac-robber files. Then, run the following commands:

  1. sudo add-apt-repository ppa:linaro-maintainers/toolchain
  2. sudo apt-get install gcc-arm-linux-gnueabi
  3. arm-linux-gnueabi-gcc -static -o -mac-robber mac-robber.c

The first command adds a new Debian package repository that can be used to download and install software from. The second command installs the GNU C Compiler (GCC) cross-compiler allowing C code to be compile for ARM platforms. The third command uses the GCC cross-compiler to compile mac-robber into an executable. After step three, you should have a freshly compiled executable called "mac-robber."

Next, let's create a directory to store mac-robber on the Android filesystem and copy it over. Make sure the adb tool from the Android SDK is in your PATH or run it directly from the "platform-tools" directory.

  1. adb shell
  2. mkdir /data/mac-robber
  3. chmod 755 /data/mac-robber
  4. exit
  5. adb push mac-robber /data/mac-robber/
  6. adb shell "/data/mac-robber/mac-robber -V"

The first four steps start a shell on the Android device, create a new directory to house the mac-robber executable, set permissions on the new directory, and exit the shell. The last two commands push the mac-robber executable that we compiled earlier over to the Android device in the new directory, then run mac-robber with the "-V" flag to show the version information. Provided all of those commands completed successfully, we're ready to proceed. If not, feel free to email me at the address below.

I run mac-robber two ways on the Android device. The first is using SSH like so:

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

The second is using adb:

  • ./adb shell "/system/bin/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 Android filesystem. In the next part of this series, I'll cover how to do the same with iOS, followed by a blog looking at some interesting things 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
Comments
Newest First  |  Oldest First  |  Threaded View
Jessica Findlay
50%
50%
Jessica Findlay,
User Rank: Apprentice
4/3/2012 | 8:47:58 AM
re: Quick-Start Guide: Compiling Mac-Robber For Android Vuln Research
IGÇÿm sick of the too many VoIPGÇÖs in the market. They claim so much and the output is duuhhh! It doesnGÇÖt work for me though! Does anyone know a quality standard VoIP that runs great on my iPhone 3G? I'm using FriendCaller currently. They are better than any other in term of pricing. Offering great voice quality but cheap Calls to mobile phones and landlines. Works on 3G. Supporting Group Video Calls is a plus as I need to commute for my business purposes. You might try as well http://fc.vc/infographic-fc
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.