Red Squad
BuyMeACoffee
  • 🏠/home/red-squad
    • ⏰Recently Added
    • πŸ₯³Support our projects
    • ⚰️Is There Life After Death ?
  • 🌐Web Hacking
    • 🚩CTFs shortcuts
    • πŸ—ΊοΈAudits plan
      • Exposition Audit - Plan
      • Internal Audit - Plan
      • External Audit - Plan
    • πŸ•΅οΈOSINT
      • πŸ”Search Engines
      • πŸ§‘User OSINT
      • πŸ‡«πŸ‡²Domains, IP, IOT
      • πŸ•ΈοΈWebsite OSINT
      • πŸ—£οΈBreaches/Leaks
      • πŸ’ΌBusiness OSINT
      • πŸ§…TOR network
      • πŸ”¬Source Code
      • πŸ₯ΈDorks
      • βš”οΈVulnerabilities and IOC
      • πŸ“¦MISC
    • Enumeration
      • Network Scanners
      • Directory/Files Scanners
      • Web Scanners
        • Subdomains
    • πŸ”—HTTP Stuff
      • HTTP Methods
        • 403 Bypass
      • Security Headers
      • HTTP Parameters
    • πŸ”Sessions / Tokens
      • Cookies
      • JWT
        • Attacking JWT
    • πŸ’‰Injections
      • HTML | XSS
      • SQLi
        • SQLmap
        • NoSQLi
      • XXE
      • LaTex
    • πŸͺ±Web Vulnerabilities
      • CSRF
      • ClickJacking
      • Files / Upload
        • πŸ—ƒοΈFile Upload Bypass
        • πŸ“¦ZIP Slip
      • IDOR
      • LFI
        • Files to look for
      • Remote Code Execution
    • β›”WAF Bypass
    • ✍️Servers / CMS
      • 🐈Tomcat
      • πŸ’§Drupal
      • ✏️Oracle APEX
      • 🐦Apache
      • πŸ”·WordPress
        • Wordpress eBook Download < 1.2 - CVE-2016-10924
      • ⏩SAP
      • πŸ•΄οΈJenkins
      • πŸ–‡οΈJoomla!
      • 🏒Server-Side Vulnerabilities
        • Server-Side Request Forgery
        • Server-Side Template Injection
    • πŸ–‡οΈAPI
      • GraphQL
  • 🐧Linux Hacking
    • πŸ§—Privilege Escalation
      • Find passwords
      • Ansible
      • Manual Checks
      • Automated Checks
    • πŸ‘£Cover tracks
    • πŸšͺBackdoors
    • β­•Reverse Shells
      • Shell Stabilizing
      • PwnCat
      • Ping-Pong
    • πŸ”’Compiled Binaries
    • 🌊Buffer Overflow
      • Introduction
      • Fundamentals
      • Exploits
    • 🐳Docker Escape
    • 🀝File sharing
  • πŸͺŸWindows Hacking
    • πŸ‘₯Active Directory
      • 1. Reconnaissance
        • Domain Network Enumeration
          • SMB Enumeration
          • LDAP Enumeration
      • 2. Initial Attack Vectors
        • Kerberos
          • Lookupsid
          • findDelegation
          • ASREPRoast
          • Kerbrute
        • AD CS
          • Basics
          • Exploits
        • Network
          • SMBRelay
          • LLMNR_NBT NS Poisoning
            • Relay Poisoning Ressources
          • IPv6 Attacks
        • Impacket
          • Windows Secrets
        • Autologon
        • PowerView.ps1
      • 3. Post-Compromise Enumeration
        • ACLs Abuse
        • Computer enumeration
        • PowerView
        • BloodHound
        • MimiKatz
        • PingCastle
      • 4. Post-Compromise Attacks
        • WSUS Poison
        • AlwaysInstallElevated
        • DCSync
        • Dumping LSASS
        • Dumping NTDS.dit
        • Golden Tickets
        • GPP Attacks
        • Kerberoasting - SPN
        • Pass the Hash
        • Pass the Password
        • Rubeus
      • 5. PrivEsc & MISC
        • Automated scripts
        • Exploits
          • noPac - CVE-2021-42278
          • ZeroLogon - CVE-2020-1472
          • LocalPotato - CVE-2023-21746
          • PrintNightMare - CVE-2021-34527
          • Other CVEs
    • πŸ’‘Useful AD Commands
    • πŸ§—Privilege Escalation
    • 🐚Shells
    • πŸ”“Bypasses
      • UAC
      • Antivirus
      • AppLocker
      • BitLocker
    • πŸ“ƒOffice
      • Analyze office files
      • Forgot password of file ?
      • CVE-2023-21716 (Microsoft Word RCE)
    • πŸ‘©β€πŸ’»SCCM | MECM
      • Configuration Audit
      • Dump
      • Hack It
        • Reconnaisance
        • PXE/OSD Exploitation
        • NTLM Relay from SCCM Clients
        • Privilege Escalation
        • Lateral Movement
        • Malware Deployment
      • Basics
    • πŸ’ŽMicrosoft 365
      • Configuration
      • Hacking
  • πŸ’½Systems
    • πŸ•β€πŸ¦ΊServices Enumeration
    • πŸ–¨οΈPrinters
      • Printer Exploitation Tool (PRET)
      • CUPS
    • πŸ›‘οΈFortinet
    • πŸ“ΉCCTV / IP Cameras
      • Hacking
  • πŸŽ†Networks
    • πŸŒͺ️Pivoting
      • Tools / Guide
        • Proxychains / FoxyProxy
        • SSH Tunnelling / Port Forwarding
        • Plinx.exe
        • Socat
        • Chisel
        • Sshuttle
        • Ligolo-Ng : Pivoting use cases
      • SocksOverRDP
    • πŸ”₯Firewalls
      • πŸ”₯Evasion
    • πŸ”—Proxies
  • πŸ“±Mobile Hacking
    • πŸ€–Android
      • Introduction
      • Reversing
      • Static Analysis
      • Dynamic Analysis
      • Disable SSL Pinning
      • Bypass Root Detection
      • Network / Traffic Analysis
    • 🍏iOS
      • Introduction
      • Static Analysis
      • Dynamic Analysis
      • JailBreak
    • πŸ“ΊIOT
      • IOTGoat OWASP | Walkthrough
      • Resources
  • Configuration
    • ChromeOS
    • Mobile
      • Android
    • IBM
      • AS400
      • AIX
  • πŸ“‘Wireless Hacking
    • πŸŽ†Wi-Fi Attacks
      • EvilTwin
      • Cracking WPA/WPA2
      • Sniffing
    • 🫐Bluetooth
      • BLE Locks Hacking
  • πŸ‘¨β€πŸ’»Code Audit
    • βœ”οΈBest Practices
    • ❌Bad Practices
    • βš’οΈTools
  • πŸ‘Thick Client Hacking
    • πŸ“Thick Client Pentesting Methodology
    • πŸ—„οΈResources
  • πŸ—„οΈMISC
    • πŸ”‘Default Credentials
    • πŸ”»CVEs
      • [CVE-2022-0847] - dirtypipe
      • [CVE-2021-4034] - Pwnkit
      • [CVE-2021-45105] - Log4J
      • [CVE-2018-15473] - OPENSSH < 7.7
    • 🦊Browser Extensions
    • πŸ€–AI
      • chatGPT alternatives
      • Large Language Model Hacking
    • πŸ”­Hacking Labs
    • πŸ”«Exploitation Frameworks
  • πŸ•΅οΈOPSEC
    • πŸ—οΈPrivacy
      • Best tools
      • Online Anonymity
      • Browser Configuration
  • πŸ”‘CRACKING | ENCODING
    • πŸ₯ŠBruteforce tools
    • πŸ“Wordlists
    • 🧨Cracking Tools
    • πŸ”¬Encoding | Decoding Tools
    • πŸ”Steganography | Cipher
  • πŸ”΄RED TEAM
    • πŸ“₯Password Extract
      • Firefox
    • πŸ•΅οΈSpy cam
    • πŸ”’Lock Picking
    • 🎣Phishing
      • Infrastructure
      • Resources
  • πŸŒ€Whistle Blowing
    • πŸ“ΉCCTV
  • πŸ”΅BLUE TEAM
    • 🧩Forensics
    • 🦹Malware Analysis
    • πŸ› οΈTools
    • 🍯HoneyPots
    • πŸŽ†Networks Security
    • πŸͺ™Online IoC Scanners
  • 🐞Bug Bounty Related
    • Searching for CVEs
    • [FR] Legal
    • Dorks
  • πŸ–₯️DEVELOPERS
    • πŸ‘¨β€πŸ’»IDE
  • πŸ“šLEARNING
    • Windows
      • Active Directory
      • Kerberos
      • Pass-the-*
    • SQL
      • SQSHell | sqsh | skwish
      • NoSQL
      • DB infos
    • SSL/TLS
      • Configuration on MariaDB
Powered by GitBook
On this page
  • Static Analysis
  • MobSF
  • Dump App Path Files on Host
  • Binary Analysis
  • Files Analysis
  • Databases

Was this helpful?

Edit on GitHub
Export as PDF
  1. Mobile Hacking
  2. iOS

Static Analysis

Static Analysis

MobSF

Run MobSF > Drag and drop IPA file

Dump App Path Files on Host

git clone https://github.com/AloneMonkey/frida-ios-dump
cd frida-ios-dump/
pip3 install -r requirements.txt

python3 dump.py -H $ios-device-ip -p 22 $app-name

Binary Analysis

otool

# obtain path of the app
find /var/ -name "*.plist" | grep "<app>"

<<'
Script that does all the checks for binary
https://github.com/saladandonionrings/iOS-Binary-Security-Analyzer
'>>
./check-binary.sh <binary>

<<'
Protections in the Binary
'>>
# PIE (Position Independent Executable): When enabled, the application loads into a random memory address every-time it launches, making it harder to predict its initial memory address.
otool -hv <app-binary> | grep PIE
# Output : should return PIE

# Stack Canaries: To validate the integrity of the stack, a β€˜canary’ value is placed on the stack before calling a function and is validated again once the function ends.
otool -I -v <app-binary> | grep stack_chk
# Good practice output : 
# stack_chk_fail
# stack_chk_guard

# ARC (Automatic Reference Counting): To prevent common memory corruption flaws
otool -I -v <app-binary> | grep _objc_
# Good practice output :
# _objc_retain
# _objc_release
# _objc_storeStrong
# _objc_releaseReturnValue
# _objc_autoreleaseReturnValue
# _objc_retainAutoreleaseReturnValue

# Encrypted Binary: The binary should be encrypted
otool -arch all -Vl <app-binary> | grep -A5 LC_ENCRYPT
# Output : if cryptid is 0 -> not encrypted

<<'
Weak Crypto
'>>
# Weak Hashing Algorithms
otool -I -v <app-binary> | grep -w "_CC_MD5"
otool -I -v <app-binary> | grep -w "_CC_SHA1"
# Good practice : no output

<<'
Insecure Functions
'>>
# Insecure Random Functions
otool -I -v <app-binary> | grep -w "_random"
otool -I -v <app-binary> | grep -w "_srand"
otool -I -v <app-binary> | grep -w "_rand"
# Good practice : no output

# Insecure β€˜Malloc’ Function - Lead to memory related vulnerabilities
otool -I -v <app-binary> | grep -w "_malloc"
# Good practice : no output

# Insecure and Vulnerable Functions
otool -I -v <app-binary> | grep -w "_gets"
otool -I -v <app-binary> | grep -w "_memcpy"
otool -I -v <app-binary> | grep -w "_strncpy"
otool -I -v <app-binary> | grep -w "_strlen"
otool -I -v <app-binary> | grep -w "_vsnprintf"
otool -I -v <app-binary> | grep -w "_sscanf"
otool -I -v <app-binary> | grep -w "_strtok"
otool -I -v <app-binary> | grep -w "_alloca"
otool -I -v <app-binary> | grep -w "_sprintf"
otool -I -v <app-binary> | grep -w "_printf"
otool -I -v <app-binary> | grep -w "_vsprintf"
# Good practice : no output

objection

# binary analysis
objection -g "app" explore
ios info binary

<<'
PLIST Checks
'>>
# unzip the ipa file and then get the info.plist
# convert into xml
plistutil -i Info.plist -o Infoxml.plist

# or objection
objection -g "app" explore
ios plist cat Info.plist

# Check in the info.plist :
#     Bundle identifier ; Bundle version ; Supported device types ; Required permissions ; URL schemes ; NSAppTransportSecurity
# MinimumOSVersion must be 14.0 (non vulnerable)
# NSAppTransportSecurity
#	 Must be set and NSAllowArbitraryLoads must be set to NO (by default), setting it to YES will opt-out of ATS and its security
# Hardcoded API Keys

Files Analysis

  • Search for sensitive information in application files

  • App files in :

    • /var/mobile/Containers/Data/Application/XXXXXXXX/

    • /private/var/containers/Bundle/Application/XXXXXXXX/

# search for IP
grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' -r *

# search for Emails
grep -Eo '[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$' -r *

# search for DNI
grep -Eo '[0-9]{8,8}[A-Za-z]$' -r *

# search for IBAN
grep -Eo '[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}' -r *

# search for Base64
grep -Eo '(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$' -r *

Cookies

/var/mobile/Containers/Data/Application/XXXXXXXX/Library/Cookies/ 
wget https://raw.githubusercontent.com/as0ler/BinaryCookieReader/master/BinaryCookieReader.py
python3 BinaryCookieReader.py $cookie-file

Databases

Core Data

/var/mobile/Containers/Data/Application/XXXXXXXX/Library/Application Support/.sqlite

Realm

/var/mobile/Containers/Data/Application/XXXXXXXX/Documents/.realm

Couchbase

/var/mobile/Containers/Data/Application/XXXXXXXX/Library/Application Support/CouchbaseLite/

YapDatabase

/var/mobile/Containers/Data/Application/XXXXXXXX/Library/Application Support/YapDatabase
PreviousIntroductionNextDynamic Analysis

Last updated 1 year ago

Was this helpful?

πŸ“±
🍏
GitHub - as0ler/BinaryCookieReader: A tool to read the binarycookie format of Cookies on iOS applicationsGitHub
Use this tool
Logo