In this chapter, we will cover the following recipes:
The previous chapter discussed the flaws in the applications; they can be exploited and discovered without the need to know exactly how they have been developed. Though there were detailed explanations on some common source code that caused this specific issue, we didn't need to read the source code to know that a SQL injection was possible. Largely, our first step in the direction of a successful exploit was to analyze the behavior of an application from a context that is ignorant of the actual details surrounding its behavior. The reverse engineering discussed in this chapter aims to uncover every single detail of an application's inner workings in order to exploit it.
Reverse engineering, when applied to computer software, is the process of learning how something works and developing ways to make use of, or abuse, this information. For example, reading the source code of a kernel driver may lead to finding a potential memory-corruption flaw, such as improper bounds checking for buffers. Knowing this may allow you to develop an exploit, given the context in which this vulnerability exists. Reverse engineering is the most essential skill of any security specialist and is at the heart of all true development exploits. When exploits and vulnerabilities are developed somewhere in the chain of events that lead to successful exploitation, reverse engineering has occurred.
Android applications are not different from other computer software types, and thus, they can be reverse engineered, too. In order to reverse engineer an application, one needs to understand how they are built, what goes where, and why. Not having this information leads to endless, sleepless nights of fuzz testing and brute forcing, which in most cases, will ultimately end in frustration. This chapter discusses a few recipes that you can use for extracting information about the inner workings of an application, and discusses some novel tricks that malware developers and security auditors use to abuse and reverse engineer applications.
Before we get cooking with the recipes, there's just one question that begs to be asked; why would you reverse engineer an Android application?
Here are a few ways to answer that:
With these goals in mind, let's get going with the recipes.
18.222.111.134