Friday, October 23, 2015

Penetration Testing in Android Security

Penetration testing are done by security professionals to evaluate the security of a systems by simulating an attack from malicious insiders or attackers. The goal is to discover issues before they are discovered by an attacker.

Steps to Penetration Test Android OS and Devices

  1. Obtain the IP address of the Android device(s).
  2. Run an NMAP scan to see the services that are running on those devices.
  3. For suspicious devices (e.g., rooted devices), capture and analyze packets through Wireshark.
  4. If device is deemed compromised, use utilities like busybox to explore device internals (which processes are running, etc.) and for forensics.
  5. Perform a static analysis of the source code of the libraries and OS. Specifically look for codes contributed by vendors such as HTC. Code should be reviewed for the following type of issues: resource leaks, null pointer references, illegal access operations, and control flow issues, which can potentially bypass security checks.
  6. Review configuration files and code for plain text passwords and other sensitive data that is being stored without appropriate security considerations.

Things to consider while pen testing an Android application include attack surface, interactions with other components (internally and externally), communications, and storage.

Pen Testing should provide an application benchmark against the following best practices:

  1. Timely patching libraries and applications as vulnerabilities are identified.
  2. Sensitive information (e.g., SSN) is not passed as a parameter through a URL. Information in a URL is accessed through the GET request, and this can be logged at multiple places. A POST request solves this problem. However, although information through a POST request is not visible in a URL, a POST request can still reveal this information in the request-header. For truly sensitive information, one should always use an HTTPS connection.
  3. Brute force attacks are not possible due to a limited number of attempts to authenticate.
  4. A Secure Sockets Layer (SSL) is used pervasively to request resources.
  5. Session identifiers are not sent in URLs.
  6. Tokens are not easily guessable.
  7. Password complexity is enforced.
  8. Log files do not contain sensitive information and are protected appropriately.
  9. Files are encrypted on local and external storage.
  10. Proper data validation is performed to prevent XSS, SQLi, command injection, etc.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.