🐧
Hassan Saad
  • WHO AM I ?
  • Red Teaming
    • C2 Infrastructure
    • External Reconnaissance
    • Initial Compromise
      • Executable File (EXE)
      • HTML Application (HTA)
      • Visual Basic (VBA Macros)
      • Password Spraying
      • MITM Attack
      • Email Spoofing
    • Host Reconnaissance
      • Seatbelt
      • Screenshots & Keylogging
    • Host Persistence
      • Task Scheduler
      • Startup Folder
      • Registry AutoRun
      • COM Hijacking
    • Host Privilege Escalation
      • Automated Tools
      • Unquoted Service Path
      • Weak Service Permission
      • Weak Service Binary
      • Always Install Elevated
      • UAC Bypass
    • Domain Reconnaissance
      • PowerView
      • BloodHound
      • Linux Host
      • Internal Applications
    • Lateral Movement
      • PowerShell Remoting
      • PsExec
      • WMI
      • DCOM
    • Credentials Access
      • LogonPasswords
      • Security Account Manager (SAM)
      • Domain Cached Creds
      • Kerberos Tickets
      • DPAPI
      • User Impersonation
      • Pass The Hash
      • Over Pass The Hash
      • Internal Password Spraying
      • Sniffing
      • NTLM Relay
    • Pivoting & Forwarding
      • SOCKS Proxy
      • Reverse Port Forwards
      • Local Port Forwards
      • Session Passing
      • P2P Listeners
      • NTLM Relay
    • Kerberos
      • Authentication
      • Kerberoasting
      • ASREP-Roasting
      • Unconstrained Delegation
      • Constrained Delegation
      • Linux Credential Cache
    • Group Policy
      • Enumeration
      • RSAT (GPMC)
      • Sharp GPO Abuse
    • Access Control Lists (DACL)
      • GenericAll
      • WriteDacl
      • WriteOwner
    • MS SQL Servers
      • Enumeration
      • NetNTLM Capture
      • Command Execution
      • Lateral Movement
      • Privilege Escalation
    • Domain Dominance
      • DCSync Backdoor
      • AdminSDHolder
      • Remote Registry Backdoor
      • Skeleton Key
      • Silver Ticket
      • Golden Ticket
    • Forest & Domain Trusts
      • Parent/Child
      • One Way (Inbound)
      • One Way (Outbound)
    • Evasion Techniques
      • Obfuscation
      • Process Injection
      • LAPS
      • AppLocker
      • PowerShell Constrained Mode
      • AMSI
      • Antivirus Exclusion
  • Penetration Testing
    • Information Gathering
    • Scanning
    • Exploitation
    • Post Exploitation
    • Password Attacks
    • Web Attacks
    • Exploit Development
  • Technology Essentials
    • Linux
      • Basics
      • Tasks
    • Windows
      • Basics
      • Tasks
    • Network
      • Basics
      • Tasks
    • Programming
      • Basics
      • Tasks
  • Bug Hunting
    • XSS on Nokia
    • XSS on Wuzzuf
    • Business Logic Flaw on Souq (Amazon Company)
    • Rate Limit Bypass on LinkedIn
    • Sensitive Data Exposure on Google
  • Tools
    • Recon Hunter
    • Mail Hunter
    • Mobile Hunter
    • Chimera (Threat Hunter)
  • Extras
    • SQL Injection
    • Web Basics
    • Mobile Testing
      • Mobile Testing 1
      • Mobile Testing 2
      • Mobile Testing 3
Powered by GitBook
On this page
  • Static Analysis
  • Reverse Engineering
  • Signing
  • Manifest Analysis
  1. Extras
  2. Mobile Testing

Mobile Testing 1

Static Analysis

# Signing Information
unzip -p diva.apk META-INF/CERT.RSA | keytool -printcert

# MD5Sum
md5sum diva.apk

Reverse Engineering

# Unzipping archive
unzip diva.apk -d folder
strings classes.dex | grep -i "content://\|getdevice"

# Jadx (generate java code)
/usr/share/jadx/bin/jadx diva.apk -d folder
grep -ir "sharedpreferences\|externalstorage\|sms" .

# Jadx GUI
/usr/share/jadx/bin/jadx-gui diva.apk

# To read AndroidManifest.xml and generate smali files
apktool d diva.apk -o folder
apktool b folder

# Bytecode Viewer
https://github.com/Konloch/bytecode-viewer/releases
java -jar Bytecode-Viewer-2.9.22.jar

Signing

# Generate Key
keytool -genkey -keyalg RSA -keysize 2048 -validity 1000 -alias my_alias -keystore result.key -storepass 123456

# Signing
jarsigner -sigalg SHA1withRSA -digestalg SHA1 -keystore result.key my_application.apk my_alias

# Verify
jarsigner -verify -verbose -certs InsecureBankv2.apk
# OR
apksigner verify --verbose InsecureBankv2.apk

# Align
zipalign -v 4 InsecureBankv2.apk InsecureBankv2-aligned.apk

Manifest Analysis

# Package Name where the data will be stored (/data/data/jakhar.aseem.diva/)
package="jakhar.aseem.diva"

# API Version (API 23 -> Android 6)
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />

# Android Flags
<application android:debuggable="true" android:allowBackup="true">

# Permissions
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />

# Application Component (Public Ones)
# Exported IPC through Intent-Filter
<activity android:name="jakhar.aseem.diva.APICredsActivity">
    <intent-filter>
        <action android:name="jakhar.aseem.diva.action.VIEW_CREDS" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

# Exported IPC through Export Flag
<provider android:name="jakhar.aseem.diva.NotesProvider" android:exported="true" />

PreviousMobile TestingNextMobile Testing 2

Last updated 2 years ago