.. | ||
drozer-tutorial | ||
frida-tutorial | ||
adb-commands.md | ||
android-applications-basics.md | ||
android-burp-suite-settings.md | ||
android-task-hijacking.md | ||
apk-decompilers.md | ||
avd-android-virtual-device.md | ||
bypass-biometric-authentication-android.md | ||
content-protocol.md | ||
exploiting-a-debuggeable-applciation.md | ||
google-ctf-2018-shall-we-play-a-game.md | ||
inspeckage-tutorial.md | ||
install-burp-certificate.md | ||
intent-injection.md | ||
make-apk-accept-ca-certificate.md | ||
manual-deobfuscation.md | ||
react-native-application.md | ||
README.md | ||
reversing-native-libraries.md | ||
smali-changes.md | ||
spoofing-your-location-in-play-store.md | ||
tapjacking.md | ||
webview-attacks.md |
Android Applications Pentesting
{% hint style="success" %}
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Support HackTricks
- Check the subscription plans!
- Join the ð¬ Discord group or the telegram group or follow us on Twitter ðŠ @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
Join HackenProof Discord server to communicate with experienced hackers and bug bounty hunters!
Hacking Insights
ãããã³ã°ã®ã¹ãªã«ãšèª²é¡ã«æ·±ãæãäžããã³ã³ãã³ãã«åå ããŠãã ãã
Real-Time Hack News
ãªã¢ã«ã¿ã€ã ã®ãã¥ãŒã¹ãšæŽå¯ãéããŠãæ¥éã«å€åãããããã³ã°ã®äžçã«é
ããã«ã€ããŠãããŸããã
Latest Announcements
æ°ãããã°ããŠã³ãã£ã®éå§ãéèŠãªãã©ãããã©ãŒã ã®æŽæ°ã«ã€ããŠææ°æ
å ±ãå
¥æããŠãã ãã
Join us on Discord and start collaborating with top hackers today!
Android Applications Basics
ãã®ããŒãžãèªãããšã匷ããå§ãããŸããAndroidã»ãã¥ãªãã£ã«é¢é£ããæãéèŠãªéšåãšAndroidã¢ããªã±ãŒã·ã§ã³ã®æãå±éºãªã³ã³ããŒãã³ãã«ã€ããŠç¥ãããã§ãïŒ
{% content-ref url="android-applications-basics.md" %} android-applications-basics.md {% endcontent-ref %}
ADB (Android Debug Bridge)
ããã¯ãAndroidããã€ã¹ïŒãšãã¥ã¬ãŒããŸãã¯ç©çïŒã«æ¥ç¶ããããã«å¿
èŠãªäž»ãªããŒã«ã§ãã
ADBã¯ãã³ã³ãã¥ãŒã¿ããUSBãŸãã¯ãããã¯ãŒã¯çµç±ã§ããã€ã¹ãå¶åŸ¡ããããšãå¯èœã«ããŸãããã®ãŠãŒãã£ãªãã£ã¯ããã¡ã€ã«ã®ã³ããŒãã¢ããªã®ã€ã³ã¹ããŒã«ãšã¢ã³ã€ã³ã¹ããŒã«ãã·ã§ã«ã³ãã³ãã®å®è¡ãããŒã¿ã®ããã¯ã¢ããããã°ã®èªã¿åããªã©ã®æ©èœãæäŸããŸãã
以äžã®ADB Commandsã®ãªã¹ãã確èªããŠãadbã®äœ¿ãæ¹ãåŠãã§ãã ããã
Smali
æã«ã¯ãã¢ããªã±ãŒã·ã§ã³ã³ãŒããä¿®æ£ããŠé ãããæ
å ±ïŒããããããé£èªåããããã¹ã¯ãŒãããã©ã°ïŒã«ã¢ã¯ã»ã¹ããããšãèå³æ·±ãå ŽåããããŸãããã®ãããapkãéã³ã³ãã€ã«ããã³ãŒããä¿®æ£ããŠåã³ã³ãã€ã«ããããšãèå³æ·±ããããããŸããã
ãã®ãã¥ãŒããªã¢ã«ã§ã¯ãAPKãéã³ã³ãã€ã«ããSmaliã³ãŒããä¿®æ£ããŠãæ°ããæ©èœãæã€APKãåã³ã³ãã€ã«ããæ¹æ³ãåŠã¶ããšãã§ããŸããããã¯ãåçåæäžã®ããã€ãã®ãã¹ãã®ä»£æ¿æ段ãšããŠéåžžã«åœ¹ç«ã€å¯èœæ§ããããŸãããããã£ãŠããã®å¯èœæ§ãåžžã«å¿µé ã«çœ®ããŠãããŠãã ããã
Other interesting tricks
- Play Storeã§ã®äœçœ®æ å ±ã®åœè£
- APKã®ããŠã³ããŒã: https://apps.evozi.com/apk-downloader/, https://apkpure.com/es/, https://www.apkmirror.com/, https://apkcombo.com/es-es/apk-downloader/, https://github.com/kiber-io/apkd
- ããã€ã¹ããAPKãæœåº:
adb shell pm list packages
com.android.insecurebankv2
adb shell pm path com.android.insecurebankv2
package:/data/app/com.android.insecurebankv2-Jnf8pNgwy3QA_U5f-n_4jQ==/base.apk
adb pull /data/app/com.android.insecurebankv2-Jnf8pNgwy3QA_U5f-n_4jQ==/base.apk
- APKEditorã䜿çšããŠããã¹ãŠã®ã¹ããªãããšããŒã¹APKãããŒãžããŸãïŒ
mkdir splits
adb shell pm path com.android.insecurebankv2 | cut -d ':' -f 2 | xargs -n1 -i adb pull {} splits
java -jar ../APKEditor.jar m -i splits/ -o merged.apk
# after merging, you will need to align and sign the apk, personally, I like to use the uberapksigner
java -jar uber-apk-signer.jar -a merged.apk --allowResign -o merged_signed
éçåæ
ãŸããAPKãåæããããã«ã¯ãJavaã³ãŒãã確èªããããã«ãã³ã³ãã€ã©ã䜿çšããå¿
èŠããããŸãã
ãã¡ããèªãã§ãå©çšå¯èœãªãã³ã³ãã€ã©ã«é¢ããæ
å ±ãèŠã€ããŠãã ããã
èå³æ·±ãæ å ±ãæ¢ã
APKã®æååã確èªããã ãã§ããã¹ã¯ãŒããURLïŒhttps://github.com/ndelphit/apkurlgrepïŒãAPIããŒãæå·åãBluetooth UUIDãããŒã¯ã³ãããã³èå³æ·±ããã®ãæ€çŽ¢ã§ããŸã... ã³ãŒãå®è¡ã®ããã¯ãã¢ãèªèšŒããã¯ãã¢ïŒã¢ããªãžã®ããŒãã³ãŒãã£ã³ã°ããã管çè è³æ Œæ å ±ïŒãæ¢ããŠãã ããã
Firebase
Firebaseã®URLã«ç¹ã«æ³šæãæããèšå®ãäžé©åã§ãªãã確èªããŠãã ãããFirebaseãšã¯äœããã©ã®ããã«æªçšãããã«ã€ããŠã®è©³çŽ°æ å ±ã¯ãã¡ãã
ã¢ããªã±ãŒã·ã§ã³ã®åºæ¬ç解 - Manifest.xml, strings.xml
ã¢ããªã±ãŒã·ã§ã³ã®**_Manifest.xml****ããã³**strings.xml_**ãã¡ã€ã«ã®æ€æ»ã¯ãæœåšçãªã»ãã¥ãªãã£è匱æ§ãæããã«ããããšãã§ããŸãããããã®ãã¡ã€ã«ã¯ãã³ã³ãã€ã©ã䜿çšããããAPKãã¡ã€ã«ã®æ¡åŒµåã.zipã«å€æŽããŠãã解åããããšã§ã¢ã¯ã»ã¹ã§ããŸãã
Manifest.xmlããç¹å®ãããè匱æ§ã«ã¯ä»¥äžãå«ãŸããŸãïŒ
- ãããã°å¯èœãªã¢ããªã±ãŒã·ã§ã³ïŒ_Manifest.xml_ãã¡ã€ã«ã§ãããã°å¯èœãšããŠèšå®ãããã¢ããªã±ãŒã·ã§ã³ïŒ
debuggable="true"
ïŒã¯ãæ¥ç¶ãèš±å¯ãããããæªçšã®ãªã¹ã¯ããããŸãããããã°å¯èœãªã¢ããªã±ãŒã·ã§ã³ãèŠã€ããŠæªçšããæ¹æ³ã«ã€ããŠã¯ãããã€ã¹äžã§ã®ãã¥ãŒããªã¢ã«ãåç §ããŠãã ããã - ããã¯ã¢ããèšå®ïŒæ©å¯æ
å ±ãæ±ãã¢ããªã±ãŒã·ã§ã³ã«ã¯ã
android:allowBackup="false"
å±æ§ãæ瀺çã«èšå®ããŠãç¹ã«USBãããã°ãæå¹ãªå Žåã«adbãä»ããäžæ£ãªããŒã¿ããã¯ã¢ãããé²ãå¿ èŠããããŸãã - ãããã¯ãŒã¯ã»ãã¥ãªãã£ïŒ_res/xml/_å
ã®ã«ã¹ã¿ã ãããã¯ãŒã¯ã»ãã¥ãªãã£æ§æïŒ
android:networkSecurityConfig="@xml/network_security_config"
ïŒã¯ã蚌ææžãã³ãHTTPãã©ãã£ãã¯èšå®ãªã©ã®ã»ãã¥ãªãã£è©³çŽ°ãæå®ã§ããŸããç¹å®ã®ãã¡ã€ã³ã«å¯ŸããŠHTTPãã©ãã£ãã¯ãèš±å¯ããäŸããããŸãã - ãšã¯ã¹ããŒããããã¢ã¯ãã£ããã£ãšãµãŒãã¹ïŒãããã§ã¹ãå ã®ãšã¯ã¹ããŒããããã¢ã¯ãã£ããã£ãšãµãŒãã¹ãç¹å®ããããšã§ãæªçšãããå¯èœæ§ã®ããã³ã³ããŒãã³ããæããã«ã§ããŸããåçãã¹ãäžã®ãããªãåæã«ããããããã®ã³ã³ããŒãã³ããæªçšããæ¹æ³ãæããã«ãªããŸãã
- ã³ã³ãã³ããããã€ããŒãšãã¡ã€ã«ãããã€ããŒïŒå ¬éãããã³ã³ãã³ããããã€ããŒã¯ãäžæ£ãªã¢ã¯ã»ã¹ãããŒã¿ã®å€æŽãèš±å¯ããå¯èœæ§ããããŸãããã¡ã€ã«ãããã€ããŒã®æ§æã泚ææ·±ã確èªããå¿ èŠããããŸãã
- ãããŒããã£ã¹ãã¬ã·ãŒããŒãšURLã¹ããŒã ïŒãããã®ã³ã³ããŒãã³ãã¯æªçšãããå¯èœæ§ããããç¹ã«å ¥åè匱æ§ã«å¯ŸããURLã¹ããŒã ã®ç®¡çæ¹æ³ã«æ³šæãæãå¿ èŠããããŸãã
- SDKããŒãžã§ã³ïŒ
minSdkVersion
ãtargetSDKVersion
ãããã³maxSdkVersion
å±æ§ã¯ããµããŒããããŠããAndroidããŒãžã§ã³ã瀺ããã»ãã¥ãªãã£äžã®çç±ããå€ãè匱ãªAndroidããŒãžã§ã³ããµããŒãããªãããšã®éèŠæ§ã匷調ããŸãã
strings.xmlãã¡ã€ã«ããã¯ãAPIããŒãã«ã¹ã¿ã ã¹ããŒããããã³ãã®ä»ã®éçºè ããŒããªã©ã®æ©å¯æ å ±ãçºèŠãããå¯èœæ§ãããããããã®ãªãœãŒã¹ã®æ³šææ·±ãã¬ãã¥ãŒã®å¿ èŠæ§ã匷調ããŠããŸãã
ã¿ãããžã£ããã³ã°
ã¿ãããžã£ããã³ã°ã¯ãæªæã®ãã ã¢ããªã±ãŒã·ã§ã³ãèµ·åããã被害è
ã¢ããªã±ãŒã·ã§ã³ã®äžã«äœçœ®ããæ»æã§ãã被害è
ã¢ããªãèŠèŠçã«é ããšããã®ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹ã¯ãŠãŒã¶ãŒãéšããŠãããšå¯Ÿè©±ãããããã«èšèšãããŠãããå®éã«ã¯è¢«å®³è
ã¢ããªã«å¯Ÿããã€ã³ã¿ã©ã¯ã·ã§ã³ãæž¡ããŠããŸãã
å®éã«ã¯ããŠãŒã¶ãŒã被害è
ã¢ããªã§å®éã«ã¢ã¯ã·ã§ã³ãå®è¡ããŠããããšãç¥ããªãããã«ããŠããŸãã
詳现æ å ±ã¯ä»¥äžã§ç¢ºèªã§ããŸãïŒ
{% content-ref url="tapjacking.md" %} tapjacking.md {% endcontent-ref %}
ã¿ã¹ã¯ãã€ãžã£ãã¯
launchMode
ãsingleTask
ã«èšå®ãããtaskAffinity
ãå®çŸ©ãããŠããªãã¢ã¯ãã£ããã£ã¯ãã¿ã¹ã¯ãã€ãžã£ãã¯ã«å¯ŸããŠè匱ã§ããããã¯ãã¢ããªã±ãŒã·ã§ã³ãã€ã³ã¹ããŒã«ãããå®éã®ã¢ããªã±ãŒã·ã§ã³ã®åã«èµ·åããããšãå®éã®ã¢ããªã±ãŒã·ã§ã³ã®ã¿ã¹ã¯ããã€ãžã£ãã¯ããå¯èœæ§ãããããšãæå³ããŸãïŒã€ãŸãããŠãŒã¶ãŒã¯æªæã®ããã¢ããªã±ãŒã·ã§ã³ãšå¯Ÿè©±ããŠãããšæã£ãŠããïŒã
詳现æ å ±ã¯ä»¥äžã§ç¢ºèªã§ããŸãïŒ
{% content-ref url="android-task-hijacking.md" %} android-task-hijacking.md {% endcontent-ref %}
äžå®å®ãªããŒã¿ã¹ãã¬ãŒãž
å éšã¹ãã¬ãŒãž
Androidã§ã¯ãå
éšã¹ãã¬ãŒãžã«ä¿åããããã¡ã€ã«ã¯ãäœæããã¢ããªã®ã¿ãã¢ã¯ã»ã¹ã§ããããã«èšèšãããŠããŸãããã®ã»ãã¥ãªãã£å¯Ÿçã¯Androidãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«ãã£ãŠåŒ·å¶ãããã»ãšãã©ã®ã¢ããªã±ãŒã·ã§ã³ã®ã»ãã¥ãªãã£ããŒãºã«ã¯äžè¬çã«ååã§ããããããéçºè
ã¯ææãMODE_WORLD_READABLE
ãMODE_WORLD_WRITABLE
ã®ãããªã¢ãŒããå©çšããŠããã¡ã€ã«ãç°ãªãã¢ããªã±ãŒã·ã§ã³éã§å
±æã§ããããã«ããŸãããããããããã®ã¢ãŒãã¯ãæœåšçã«æªæã®ããä»ã®ã¢ããªã±ãŒã·ã§ã³ã«ãããããã®ãã¡ã€ã«ãžã®ã¢ã¯ã»ã¹ãå¶éããŸããã
- éçåæïŒ
MODE_WORLD_READABLE
ããã³MODE_WORLD_WRITABLE
ã®äœ¿çšã泚ææ·±ã粟æ»ãããããšã確èªããŠãã ããããããã®ã¢ãŒãã¯ãæå³ããªããŸãã¯äžæ£ãªã¢ã¯ã»ã¹ã«ãã¡ã€ã«ããããå¯èœæ§ããããŸãã
- åçåæïŒ
- ã¢ããªã«ãã£ãŠäœæããããã¡ã€ã«ã«èšå®ãããæš©éã確èªããŠãã ãããç¹ã«ããã¡ã€ã«ãå šäžçã«å¯ŸããŠèªã¿åããŸãã¯æžã蟌ã¿å¯èœã«èšå®ãããŠãããã©ããã確èªããŠãã ãããããã¯é倧ãªã»ãã¥ãªãã£ãªã¹ã¯ãåŒãèµ·ããå¯èœæ§ããããããã€ã¹ã«ã€ã³ã¹ããŒã«ãããä»»æã®ã¢ããªã±ãŒã·ã§ã³ããåºæãæå³ã«é¢ä¿ãªãããããã®ãã¡ã€ã«ãèªã¿åã£ããå€æŽãããã§ããããã«ãªããŸãã
å€éšã¹ãã¬ãŒãž
å€éšã¹ãã¬ãŒãžäžã®ãã¡ã€ã«ãæ±ãéã«ã¯ãããã€ãã®æ³šæãå¿ èŠã§ãïŒ
- ã¢ã¯ã»ã¹å¯èœæ§ïŒ
- å€éšã¹ãã¬ãŒãžäžã®ãã¡ã€ã«ã¯å šäžçã«å¯ŸããŠèªã¿åãããã³æžã蟌ã¿å¯èœã§ããã€ãŸããä»»æã®ã¢ããªã±ãŒã·ã§ã³ããŠãŒã¶ãŒããããã®ãã¡ã€ã«ã«ã¢ã¯ã»ã¹ã§ããŸãã
- ã»ãã¥ãªãã£ã®æžå¿µïŒ
- ã¢ã¯ã»ã¹ã®å®¹æããèæ ®ããŠãæ©å¯æ å ±ãå€éšã¹ãã¬ãŒãžã«ä¿åããªãããšããå§ãããŸãã
- å€éšã¹ãã¬ãŒãžã¯åãå€ãå¯èœã§ãããä»»æã®ã¢ããªã±ãŒã·ã§ã³ã«ãã£ãŠã¢ã¯ã»ã¹ãããå¯èœæ§ããããããã»ãã¥ãªãã£ãäœäžããŸãã
- å€éšã¹ãã¬ãŒãžããã®ããŒã¿åŠçïŒ
- å€éšã¹ãã¬ãŒãžããååŸããããŒã¿ã«å¯ŸããŠã¯åžžã«å ¥åæ€èšŒãè¡ã£ãŠãã ãããããã¯ãããŒã¿ãä¿¡é Œã§ããªããœãŒã¹ããã®ãã®ã§ãããããéèŠã§ãã
- åçèªã¿èŸŒã¿ã®ããã«å€éšã¹ãã¬ãŒãžã«å®è¡å¯èœãã¡ã€ã«ãã¯ã©ã¹ãã¡ã€ã«ãä¿åããããšã¯åŒ·ãæšå¥šãããŸããã
- ã¢ããªã±ãŒã·ã§ã³ãå€éšã¹ãã¬ãŒãžããå®è¡å¯èœãã¡ã€ã«ãååŸããå¿ èŠãããå Žåããããã®ãã¡ã€ã«ã眲åãããæå·çã«æ€èšŒãããŠããããšã確èªããŠãã ããããã®ã¹ãããã¯ãã¢ããªã±ãŒã·ã§ã³ã®ã»ãã¥ãªãã£ã®æŽåæ§ãç¶æããããã«éèŠã§ãã
å€éšã¹ãã¬ãŒãžã¯/storage/emulated/0
ã/sdcard
ã/mnt/sdcard
ã§ã¢ã¯ã»ã¹å¯èœã§ãã
{% hint style="info" %} Android 4.4ïŒAPI 17ïŒä»¥éãSDã«ãŒãã«ã¯ãã¢ããªãç¹å®ã®ã¢ããªçšã®ãã£ã¬ã¯ããªã«ã®ã¿ã¢ã¯ã»ã¹ã§ããããã«å¶éãããã£ã¬ã¯ããªæ§é ããããŸããããã«ãããæªæã®ããã¢ããªã±ãŒã·ã§ã³ãä»ã®ã¢ããªã®ãã¡ã€ã«ã«å¯ŸããŠèªã¿åããŸãã¯æžã蟌ã¿ã¢ã¯ã»ã¹ãåŸãããšãé²æ¢ãããŸãã {% endhint %}
å¹³æã§ä¿åãããæ©å¯ããŒã¿
- å
±æèšå®ïŒAndroidã¯åã¢ããªã±ãŒã·ã§ã³ã
/data/data/<packagename>/shared_prefs/
ãã¹ã«XMLãã¡ã€ã«ãç°¡åã«ä¿åã§ããããã«ããŠãããæã«ã¯ãã®ãã©ã«ãå ã«å¹³æã§æ©å¯æ å ±ãèŠã€ããããšããããŸãã - ããŒã¿ããŒã¹ïŒAndroidã¯åã¢ããªã±ãŒã·ã§ã³ã
/data/data/<packagename>/databases/
ãã¹ã«SQLiteããŒã¿ããŒã¹ãç°¡åã«ä¿åã§ããããã«ããŠãããæã«ã¯ãã®ãã©ã«ãå ã«å¹³æã§æ©å¯æ å ±ãèŠã€ããããšããããŸãã
å£ããTLS
ãã¹ãŠã®èšŒææžãåãå ¥ãã
äœããã®çç±ã§ãéçºè ã¯æã ããã¹ãåã以äžã®ãããªã³ãŒãè¡ãšäžèŽããªãå Žåã§ãããã¹ãŠã®èšŒææžãåãå ¥ããŸãïŒ
SSLSocketFactory sf = new cc(trustStore);
sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
A good way to test this is to try to capture the traffic using some proxy like Burp without authorising Burp CA inside the device. Also, you can generate with Burp a certificate for a different hostname and use it.
Broken Cryptography
Poor Key Management Processes
äžéšã®éçºè ã¯ãæ©å¯ããŒã¿ãããŒã«ã«ã¹ãã¬ãŒãžã«ä¿åããã³ãŒãå ã«ããŒãã³ãŒãã£ã³ã°ããã/äºæž¬å¯èœãªããŒã§æå·åããŸããããã¯è¡ãã¹ãã§ã¯ãªãããªããŒã¹ãšã³ãžãã¢ãªã³ã°ã«ããæ»æè ãæ©å¯æ å ±ãæœåºã§ããå¯èœæ§ããããŸãã
Use of Insecure and/or Deprecated Algorithms
éçºè ã¯ãèªèšŒãã§ãã¯ãããŒã¿ã®ä¿åãŸãã¯éä¿¡ãè¡ãããã«éæšå¥šã®ã¢ã«ãŽãªãºã ã䜿çšãã¹ãã§ã¯ãããŸããããããã®ã¢ã«ãŽãªãºã ã«ã¯ãRC4ãMD4ãMD5ãSHA1ãªã©ããããŸããäŸãã°ããã¹ã¯ãŒããä¿åããããã«ããã·ã¥ã䜿çšãããå Žåããœã«ãã䜿çšããããã·ã¥ã®ãã«ãŒããã©ãŒã¹èæ§ãå¿ èŠã§ãã
Other checks
- APKãé£èªåããããšãæšå¥šããŸããããã«ãããæ»æè ã®ãªããŒã¹ãšã³ãžãã¢ãªã³ã°äœæ¥ãå°é£ã«ãªããŸãã
- ã¢ããªãæ©å¯æ§ãé«ãå ŽåïŒéè¡ã¢ããªãªã©ïŒãã¢ãã€ã«ãã«ãŒãåãããŠãããã©ããã確èªããç¬èªã®ãã§ãã¯ãå®è¡ããé©åã«å¯ŸåŠããå¿ èŠããããŸãã
- ã¢ããªãæ©å¯æ§ãé«ãå ŽåïŒéè¡ã¢ããªãªã©ïŒããšãã¥ã¬ãŒã¿ãŒã䜿çšãããŠãããã©ããã確èªããå¿ èŠããããŸãã
- ã¢ããªãæ©å¯æ§ãé«ãå ŽåïŒéè¡ã¢ããªãªã©ïŒãå®è¡åã«èªèº«ã®æŽåæ§ã確èªããå€æŽãããŠããªããã確èªããå¿ èŠããããŸãã
- APKiDã䜿çšããŠãAPKããã«ãããããã«äœ¿çšãããã³ã³ãã€ã©/ããã«ãŒ/é£èªåããŒã«ã確èªããŸãã
React Native Application
Read the following page to learn how to easily access javascript code of React applications:
{% content-ref url="react-native-application.md" %} react-native-application.md {% endcontent-ref %}
Xamarin Applications
Read the following page to learn how to easily access C# code of a xamarin applications:
{% content-ref url="../xamarin-apps.md" %} xamarin-apps.md {% endcontent-ref %}
Superpacked Applications
According to this blog post superpacked is a Meta algorithm that compress the content of an application into a single file. The blog talks about the possibility of creating an app that decompress these kind of apps... and a faster way which involves to execute the application and gather the decompressed files from the filesystem.
Automated Static Code Analysis
The tool mariana-trench is capable of finding vulnerabilities by scanning the code of the application. This tool contains a series of known sources (that indicates to the tool the places where the input is controlled by the user), sinks (which indicates to the tool dangerous places where malicious user input could cause damages) and rules. These rules indicates the combination of sources-sinks that indicates a vulnerability.
With this knowledge, mariana-trench will review the code and find possible vulnerabilities on it.
Secrets leaked
An application may contain secrets (API keys, passwords, hidden urls, subdomains...) inside of it that you might be able to discover. You could us a tool such as https://github.com/dwisiswant0/apkleaks
Bypass Biometric Authentication
{% content-ref url="bypass-biometric-authentication-android.md" %} bypass-biometric-authentication-android.md {% endcontent-ref %}
Other interesting functions
- Code execution:
Runtime.exec(), ProcessBuilder(), native code:system()
- Send SMSs:
sendTextMessage, sendMultipartTestMessage
- Native functions declared as
native
:public native, System.loadLibrary, System.load
- Read this to learn how to reverse native functions
Other tricks
{% content-ref url="content-protocol.md" %} content-protocol.md {% endcontent-ref %}
Join HackenProof Discord server to communicate with experienced hackers and bug bounty hunters!
Hacking Insights
Engage with content that delves into the thrill and challenges of hacking
Real-Time Hack News
Keep up-to-date with fast-paced hacking world through real-time news and insights
Latest Announcements
Stay informed with the newest bug bounties launching and crucial platform updates
Join us on Discord and start collaborating with top hackers today!
Dynamic Analysis
First of all, you need an environment where you can install the application and all the environment (Burp CA cert, Drozer and Frida mainly). Therefore, a rooted device (emulated or not) is extremely recommended.
Online Dynamic analysis
You can create a free account in: https://appetize.io/. This platform allows you to upload and execute APKs, so it is useful to see how an apk is behaving.
You can even see the logs of your application in the web and connect through adb.
Thanks to the ADB connection you can use Drozer and Frida inside the emulators.
Local Dynamic Analysis
Using an emulator
- Android Studio (You can create x86 and arm devices, and according to this latest x86 versions support ARM libraries without needing an slow arm emulator).
- Learn to set it up in this page:
{% content-ref url="avd-android-virtual-device.md" %} avd-android-virtual-device.md {% endcontent-ref %}
- Genymotion (Free version: Personal Edition, you need to create an account. It's recommend to download the version WITH VirtualBox to avoid potential errors.)
- Nox (Free, but it doesn't support Frida or Drozer).
{% hint style="info" %} When creating a new emulator on any platform remember that the bigger the screen is, the slower the emulator will run. So select small screens if possible. {% endhint %}
To install google services (like AppStore) in Genymotion you need to click on the red marked button of the following image:
Also, notice that in the configuration of the Android VM in Genymotion you can select Bridge Network mode (this will be useful if you will be connecting to the Android VM from a different VM with the tools).
Use a physical device
You need to activate the debugging options and it will be cool if you can root it:
- Settings.
- (FromAndroid 8.0) Select System.
- Select About phone.
- Press Build number 7 times.
- Go back and you will find the Developer options.
Once you have installed the application, the first thing you should do is to try it and investigate what does it do, how does it work and get comfortable with it.
I will suggest to perform this initial dynamic analysis using MobSF dynamic analysis + pidcat, so we will be able to learn how the application works while MobSF captures a lot of interesting data you can review later on.
Unintended Data Leakage
Logging
éçºè
ã¯ããããã°æ
å ±ãå
¬éããããšã«æ³šæãã¹ãã§ããããã¯æ©å¯ããŒã¿ã®æŒæŽ©ã«ã€ãªããå¯èœæ§ããããŸããã¢ããªã±ãŒã·ã§ã³ãã°ãç£èŠããŠæ©å¯æ
å ±ãç¹å®ãä¿è·ããããã«ãpidcatãšadb logcat
ãæšå¥šããŸããPidcatã¯äœ¿ãããããšå¯èªæ§ã®ããã«å¥œãŸããŸãã
{% hint style="warning" %}
Android 4.0以éãã¢ããªã±ãŒã·ã§ã³ã¯èªåèªèº«ã®ãã°ã«ã®ã¿ã¢ã¯ã»ã¹ã§ããããšã«æ³šæããŠãã ããããããã£ãŠãã¢ããªã±ãŒã·ã§ã³ã¯ä»ã®ã¢ããªã®ãã°ã«ã¢ã¯ã»ã¹ã§ããŸããã
ããã§ããæ©å¯æ
å ±ããã°ã«èšé²ããªãããšãæšå¥šããŸãã
{% endhint %}
Copy/Paste Buffer Caching
Androidã®ã¯ãªããããŒãããŒã¹ã®ãã¬ãŒã ã¯ãŒã¯ã¯ãã¢ããªå ã§ã®ã³ããŒïŒããŒã¹ãæ©èœãå¯èœã«ããŸãããä»ã®ã¢ããªã±ãŒã·ã§ã³ãã¯ãªããããŒãã«ã¢ã¯ã»ã¹ã§ãããããæ©å¯ããŒã¿ãæŒæŽ©ãããªã¹ã¯ããããŸããã¯ã¬ãžããã«ãŒãã®è©³çŽ°ãªã©ãã¢ããªã±ãŒã·ã§ã³ã®æ©å¯ã»ã¯ã·ã§ã³ã§ã¯ã³ããŒ/ããŒã¹ãæ©èœãç¡å¹ã«ããããšãéèŠã§ãã
Crash Logs
ã¢ããªã±ãŒã·ã§ã³ãã¯ã©ãã·ã¥ãããã°ãä¿åããå Žåããããã®ãã°ã¯æ»æè ã«åœ¹ç«ã€å¯èœæ§ããããŸããç¹ã«ã¢ããªã±ãŒã·ã§ã³ããªããŒã¹ãšã³ãžãã¢ãªã³ã°ã§ããªãå Žåã¯ããã§ãããã®ãªã¹ã¯ã軜æžããããã«ãã¯ã©ãã·ã¥æã«ãã°ãèšé²ããªãããã«ãããã°ããããã¯ãŒã¯çµç±ã§éä¿¡ããå¿ èŠãããå Žåã¯ãSSLãã£ãã«ãä»ããŠéä¿¡ãããããšã確èªããŠãã ããã
ãã³ãã¹ã¿ãŒãšããŠããããã®ãã°ã確èªããããšããå§ãããŸãã
Analytics Data Sent To 3rd Parties
ã¢ããªã±ãŒã·ã§ã³ã¯ãGoogle Adsenseãªã©ã®ãµãŒãã¹ãçµ±åããããšãå€ããéçºè ã«ããäžé©åãªå®è£ ã«ããæ©å¯ããŒã¿ãæŒæŽ©ããå¯èœæ§ããããŸããæœåšçãªããŒã¿æŒæŽ©ãç¹å®ããããã«ãã¢ããªã±ãŒã·ã§ã³ã®ãã©ãã£ãã¯ãååãã第äžè ãµãŒãã¹ã«éä¿¡ãããæ©å¯æ å ±ããªããã確èªããããšããå§ãããŸãã
SQLite DBs
ã»ãšãã©ã®ã¢ããªã±ãŒã·ã§ã³ã¯ãæ
å ±ãä¿åããããã«å
éšSQLiteããŒã¿ããŒã¹ã䜿çšããŸãããã³ãã¹ãäžã«äœæãããããŒã¿ããŒã¹ãããŒãã«ãšã«ã©ã ã®ååãä¿åããããã¹ãŠã®ããŒã¿ã確èªããŠãã ãããæ©å¯æ
å ±ãèŠã€ããããšãã§ãããããããŸããïŒããã¯è匱æ§ãšãªããŸãïŒã
ããŒã¿ããŒã¹ã¯/data/data/the.package.name/databases
ã«é
眮ãããã¹ãã§ããäŸãã°/data/data/com.mwr.example.sieve/databases
ããŒã¿ããŒã¹ãæ©å¯æ å ±ãä¿åããŠãããæå·åãããŠããããã¢ããªã±ãŒã·ã§ã³å ã«ãã¹ã¯ãŒããèŠã€ããå Žåãããã§ãè匱æ§ã§ãã
.tables
ã䜿çšããŠããŒãã«ãåæãã.schema <table_name>
ã䜿çšããŠããŒãã«ã®ã«ã©ã ãåæããŸãã
Drozer (Exploit Activities, Content Providers and Services)
From Drozer Docs: Drozer allows you to assume the role of an Android app and interact with other apps. It can do anything that an installed application can do, such as make use of Androidâs Inter-Process Communication (IPC) mechanism and interact with the underlying operating system. .
Drozer is s useful tool to exploit exported activities, exported services and Content Providers as you will learn in the following sections.
Exploiting exported Activities
Read this if you want to refresh what is an Android Activity.
Also remember that the code of an activity starts in the onCreate
method.
Authorisation bypass
Activityããšã¯ã¹ããŒãããããšãå€éšã¢ããªãããã®ç»é¢ãåŒã³åºãããšãã§ããŸãããããã£ãŠãæ©å¯æ å ±ãå«ãActivityããšã¯ã¹ããŒããããŠããå ŽåãèªèšŒã¡ã«ããºã ããã€ãã¹ããŠã¢ã¯ã»ã¹ã§ããå¯èœæ§ããããŸãã
Learn how to exploit exported activities with Drozer.
You can also start an exported activity from adb:
- PackageName is com.example.demo
- Exported ActivityName is com.example.test.MainActivity
adb shell am start -n com.example.demo/com.example.test.MainActivity
泚æ: MobSFã¯ãã¢ã¯ãã£ããã£ã®android:launchMode
ã«ããã_singleTask/singleInstance_ã®äœ¿çšãæªæã®ãããã®ãšããŠæ€åºããŸãããããã«ãããšãããã¯å€ãããŒãžã§ã³ïŒAPIããŒãžã§ã³< 21ïŒã§ã®ã¿å±éºãªããã§ãã
{% hint style="info" %} èªå¯ãã€ãã¹ã¯åžžã«è匱æ§ã§ã¯ãªãããšã«æ³šæããŠãã ããããã€ãã¹ã®åäœãšã©ã®æ å ±ãå ¬éãããŠãããã«ãããŸãã {% endhint %}
æ©å¯æ å ±ã®æŒæŽ©
ã¢ã¯ãã£ããã£ã¯çµæãè¿ãããšãã§ããŸããããã**setResult
**ã¡ãœãããåŒã³åºããæ©å¯æ
å ±ãè¿ããšã¯ã¹ããŒããããä¿è·ãããŠããªãã¢ã¯ãã£ããã£ãèŠã€ããããšãã§ããã°ãæ©å¯æ
å ±ã®æŒæŽ©ããããŸãã
ã¿ãããžã£ããã³ã°
ã¿ãããžã£ããã³ã°ãé²æ¢ãããŠããªãå Žåããšã¯ã¹ããŒããããã¢ã¯ãã£ããã£ãæªçšããŠãŠãŒã¶ãŒã«äºæããªãã¢ã¯ã·ã§ã³ãå®è¡ãããããšãã§ããŸããã¿ãããžã£ããã³ã°ã«ã€ããŠã®è©³çŽ°ã¯ããã¡ãã®ãªã³ã¯ãåç §ããŠãã ããã
ã³ã³ãã³ããããã€ããŒã®æªçš - æ©å¯æ å ±ãžã®ã¢ã¯ã»ã¹ãšæäœ
ã³ã³ãã³ããããã€ããŒãšã¯äœããå確èªãããå Žåã¯ããã¡ãããèªã¿ãã ããã
ã³ã³ãã³ããããã€ããŒã¯åºæ¬çã«ããŒã¿ãå
±æããããã«äœ¿çšãããŸããã¢ããªã«å©çšå¯èœãªã³ã³ãã³ããããã€ããŒãããå Žåãããããæ©å¯ããŒã¿ãæœåºã§ãããããããŸããããŸããSQLã€ã³ãžã§ã¯ã·ã§ã³ããã¹ãã©ããŒãµã«ã®å¯èœæ§ããã¹ãããããšãèå³æ·±ãã§ãããããã¯è匱ã§ããå¯èœæ§ããããŸãã
Drozerã䜿çšããŠã³ã³ãã³ããããã€ããŒãæªçšããæ¹æ³ãåŠã³ãŸãããã
ãµãŒãã¹ã®æªçš
ãµãŒãã¹ãšã¯äœããå確èªãããå Žåã¯ããã¡ãããèªã¿ãã ããã
ãµãŒãã¹ã®ã¢ã¯ã·ã§ã³ã¯onStartCommand
ã¡ãœããã§å§ãŸãããšãèŠããŠãããŠãã ããã
ãµãŒãã¹ã¯åºæ¬çã«ããŒã¿ãåä¿¡ããåŠçããå¿çïŒãŸãã¯ããªãïŒãè¿ãããšãã§ãããã®ã§ãããããã£ãŠãã¢ããªã±ãŒã·ã§ã³ãããã€ãã®ãµãŒãã¹ããšã¯ã¹ããŒãããŠããå Žåã¯ãã³ãŒãã確èªããŠäœãããŠããã®ããç解ããæ©å¯æ
å ±ãæœåºããããã«åçã«ãã¹ãããå¿
èŠããããŸããèªèšŒæ段ããã€ãã¹ããããšã...
Drozerã䜿çšããŠãµãŒãã¹ãæªçšããæ¹æ³ãåŠã³ãŸãããã
ãããŒããã£ã¹ãã¬ã·ãŒããŒã®æªçš
ãããŒããã£ã¹ãã¬ã·ãŒããŒãšã¯äœããå確èªãããå Žåã¯ããã¡ãããèªã¿ãã ããã
ãããŒããã£ã¹ãã¬ã·ãŒããŒã®ã¢ã¯ã·ã§ã³ã¯onReceive
ã¡ãœããã§å§ãŸãããšãèŠããŠãããŠãã ããã
ãããŒããã£ã¹ãã¬ã·ãŒããŒã¯ãç¹å®ã®ã¡ãã»ãŒãžãåŸ
æ©ããŠããŸããã¬ã·ãŒããŒãã¡ãã»ãŒãžãã©ã®ããã«åŠçãããã«ãã£ãŠãè匱ã§ããå¯èœæ§ããããŸãã
Drozerã䜿çšããŠãããŒããã£ã¹ãã¬ã·ãŒããŒãæªçšããæ¹æ³ãåŠã³ãŸãããã
ã¹ããŒã /ãã£ãŒããªã³ã¯ã®æªçš
æåã§ãã£ãŒããªã³ã¯ãæ¢ãããšãã§ããMobSFã®ãããªããŒã«ããã®ã¹ã¯ãªããã䜿çšã§ããŸãã
adbããã©ãŠã¶ã䜿çšããŠå®£èšãããã¹ããŒã ãéãããšãã§ããŸãïŒ
{% code overflow="wrap" %}
adb shell am start -a android.intent.action.VIEW -d "scheme://hostname/path?param=value" [your.package.name]
{% endcode %}
ããã±ãŒãžåãçç¥ããããšãã§ããã¢ãã€ã«ã¯èªåçã«ãã®ãªã³ã¯ãéãã¹ãã¢ããªãåŒã³åºããŸãã
{% code overflow="wrap" %}
<!-- Browser regular link -->
<a href="scheme://hostname/path?param=value">Click me</a>
<!-- fallback in your url you could try the intent url -->
<a href="intent://hostname#Intent;scheme=scheme;package=your.package.name;S.browser_fallback_url=http%3A%2F%2Fwww.example.com;end">with alternative</a>
{% endcode %}
å®è¡ãããã³ãŒã
ã¢ããªã§å®è¡ãããã³ãŒããèŠã€ããããã«ããã£ãŒããªã³ã¯ã«ãã£ãŠåŒã³åºãããã¢ã¯ãã£ããã£ã«ç§»åããé¢æ°**onNewIntent
**ãæ€çŽ¢ããŸãã
æ©å¯æ å ±
ãã£ãŒããªã³ã¯ãèŠã€ãããã³ã«ãURLãã©ã¡ãŒã¿ãä»ããŠæ©å¯ããŒã¿ïŒãã¹ã¯ãŒããªã©ïŒãåä¿¡ããŠããªãã確èªããŠãã ãããä»ã®ã¢ããªã±ãŒã·ã§ã³ããã£ãŒããªã³ã¯ãåœè£ ããŠãã®ããŒã¿ãçãå¯èœæ§ããããŸãïŒ
ãã¹å ã®ãã©ã¡ãŒã¿
URLã®ãã¹å
ã«ãã©ã¡ãŒã¿ã䜿çšããŠãããã£ãŒããªã³ã¯ããããã©ããã確èªããå¿
èŠããããŸããäŸãã°: https://api.example.com/v1/users/{username}
ã®å Žåããã¹ãã©ããŒãµã«ã匷å¶ããŠãexample://app/users?username=../../unwanted-endpoint%3fparam=value
ã®ãããªãã®ã«ã¢ã¯ã»ã¹ã§ããŸãã
ã¢ããªã±ãŒã·ã§ã³å
ã§æ£ãããšã³ããã€ã³ããèŠã€ããå ŽåããªãŒãã³ãªãã€ã¬ã¯ãïŒãã¹ã®äžéšããã¡ã€ã³åãšããŠäœ¿çšãããå ŽåïŒãã¢ã«ãŠã³ãä¹ã£åãïŒCSRFããŒã¯ã³ãªãã§ãŠãŒã¶ãŒã®è©³çŽ°ãå€æŽã§ããè匱ãªãšã³ããã€ã³ããæ£ããã¡ãœããã䜿çšããŠããå ŽåïŒãããã³ãã®ä»ã®è匱æ§ãåŒãèµ·ããå¯èœæ§ããããŸãã詳现ã¯ãã¡ããåç
§ããŠãã ããã
ãããªãäŸ
ãªã³ã¯ã«é¢ããèå³æ·±ããã°ããŠã³ãã£ã¬ããŒãïŒ/.well-known/assetlinks.jsonïŒã
ãã©ã³ã¹ããŒãå±€ã®æ€æ»ãšæ€èšŒã®å€±æ
- 蚌ææžã¯Androidã¢ããªã±ãŒã·ã§ã³ã«ãã£ãŠåžžã«é©åã«æ€æ»ãããããã§ã¯ãããŸããããããã®ã¢ããªã±ãŒã·ã§ã³ã¯èŠåãèŠèœãšããèªå·±çœ²å蚌ææžãåãå ¥ããããå Žåã«ãã£ãŠã¯HTTPæ¥ç¶ã«æ»ã£ããããããšãäžè¬çã§ãã
- SSL/TLSãã³ãã·ã§ã€ã¯äžã®äº€æžã¯æã 匱ããå®å šã§ãªãæå·ã¹ã€ãŒãã䜿çšããŠããŸãããã®è匱æ§ã«ãããæ¥ç¶ãäžéè æ»æïŒMITMïŒã«å¯ŸããŠè匱ã«ãªããæ»æè ãããŒã¿ã埩å·åã§ããããã«ãªããŸãã
- æ©å¯æ å ±ã®æŒæŽ©ã¯ãã¢ããªã±ãŒã·ã§ã³ãå®å šãªãã£ãã«ã䜿çšããŠèªèšŒããããä»ã®ãã©ã³ã¶ã¯ã·ã§ã³ã®ããã«éå®å šãªãã£ãã«ã§éä¿¡ããå Žåã«ãªã¹ã¯ããããŸãããã®ã¢ãããŒãã¯ãã»ãã·ã§ã³ã¯ãããŒããŠãŒã¶ãŒã®è©³çŽ°ãªã©ã®æ©å¯ããŒã¿ãæªæã®ãããšã³ãã£ãã£ã«ããååããä¿è·ã§ããŸããã
蚌ææžã®æ€èšŒ
蚌ææžã®æ€èšŒã«çŠç¹ãåœãŠãŸãããµãŒããŒã®èšŒææžã®æŽåæ§ã確èªããããšã¯ãã»ãã¥ãªãã£ã匷åããããã«éèŠã§ããããã¯ãå®å šã§ãªãTLSæ§æãæå·åãããŠããªããã£ãã«ãä»ããŠæ©å¯ããŒã¿ãéä¿¡ããããšãé倧ãªãªã¹ã¯ããããããããéèŠã§ãããµãŒããŒèšŒææžã®æ€èšŒãšè匱æ§ãžã®å¯ŸåŠã«é¢ãã詳现ãªæé ã¯ããã®ãªãœãŒã¹ã§å æ¬çã«èª¬æãããŠããŸãã
SSLãã³ãã³ã°
SSLãã³ãã³ã°ã¯ãã¢ããªã±ãŒã·ã§ã³ããµãŒããŒã®èšŒææžãã¢ããªã±ãŒã·ã§ã³å ã«ä¿åãããæ¢ç¥ã®ã³ããŒãšç §åããã»ãã¥ãªãã£å¯Ÿçã§ãããã®æ¹æ³ã¯ãMITMæ»æãé²ãããã«äžå¯æ¬ ã§ããæ©å¯æ å ±ãæ±ãã¢ããªã±ãŒã·ã§ã³ã«ã¯ãSSLãã³ãã³ã°ã®å®è£ ã匷ãæšå¥šãããŸãã
ãã©ãã£ãã¯ã®æ€æ»
HTTPãã©ãã£ãã¯ãæ€æ»ããã«ã¯ããããã·ããŒã«ã®èšŒææžãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãïŒäŸïŒBurpïŒããã®èšŒææžãã€ã³ã¹ããŒã«ããªããšãæå·åããããã©ãã£ãã¯ã¯ãããã·ãéããŠè¡šç€ºãããªãå¯èœæ§ããããŸããã«ã¹ã¿ã CA蚌ææžã®ã€ã³ã¹ããŒã«ã«é¢ããã¬ã€ãã¯ããã¡ããã¯ãªãã¯ããŠãã ããã
APIã¬ãã«24以äžãã¿ãŒã²ãããšããã¢ããªã±ãŒã·ã§ã³ã¯ããããã·ã®CA蚌ææžãåãå ¥ããããã«ãããã¯ãŒã¯ã»ãã¥ãªãã£æ§æãå€æŽããå¿ èŠããããŸãããã®ã¹ãããã¯ãæå·åããããã©ãã£ãã¯ãæ€æ»ããããã«éèŠã§ãããããã¯ãŒã¯ã»ãã¥ãªãã£æ§æã®å€æŽã«é¢ããæ瀺ã¯ããã®ãã¥ãŒããªã¢ã«ãåç §ããŠãã ããã
SSLãã³ãã³ã°ã®ãã€ãã¹
SSLãã³ãã³ã°ãå®è£ ãããŠããå ŽåãHTTPSãã©ãã£ãã¯ãæ€æ»ããããã«ããããã€ãã¹ããå¿ èŠããããŸãããã®ç®çã®ããã«ããŸããŸãªæ¹æ³ããããŸãïŒ
- èªåçã«apkãä¿®æ£ããŠSSLãã³ãã³ã°ããã€ãã¹ããã«ã¯ãapk-mitmã䜿çšããŸãããã®ãªãã·ã§ã³ã®æ倧ã®å©ç¹ã¯ãSSLãã³ãã³ã°ããã€ãã¹ããããã«rootãå¿ èŠãªãããšã§ãããã¢ããªã±ãŒã·ã§ã³ãåé€ããŠæ°ãããã®ãåã€ã³ã¹ããŒã«ããå¿ èŠãããããããåžžã«æ©èœããããã§ã¯ãããŸããã
- FridaïŒäžèšã§èª¬æïŒã䜿çšããŠãã®ä¿è·ããã€ãã¹ããããšãã§ããŸããBurp+Frida+Genymotionã䜿çšããããã®ã¬ã€ãã¯ãã¡ãã§ãïŒhttps://spenkk.github.io/bugbounty/Configuring-Frida-with-Burp-and-GenyMotion-to-bypass-SSL-Pinning/
- objectionã䜿çšããŠSSLãã³ãã³ã°ãèªåçã«ãã€ãã¹ããããšãã§ããŸãïŒ
objection --gadget com.package.app explore --startup-command "android sslpinning disable"
- MobSFåçåæã䜿çšããŠSSLãã³ãã³ã°ãèªåçã«ãã€ãã¹ããããšãè©Šã¿ãããšãã§ããŸãïŒäžèšã§èª¬æïŒã
- ãŸã ãã£ããã£ããŠããªããã©ãã£ãã¯ããããšæãããå Žåã¯ãiptablesã䜿çšããŠãã©ãã£ãã¯ãburpã«è»¢éããããšãè©Šã¿ãããšãã§ããŸãããã®ããã°ãèªãã§ãã ããïŒhttps://infosecwriteups.com/bypass-ssl-pinning-with-ip-forwarding-iptables-568171b52b62
äžè¬çãªWebè匱æ§ã®æ€çŽ¢
ã¢ããªã±ãŒã·ã§ã³å ã§äžè¬çãªWebè匱æ§ãæ€çŽ¢ããããšãéèŠã§ãããããã®è匱æ§ãç¹å®ãã軜æžããããã®è©³çŽ°ãªæ å ±ã¯ãã®èŠçŽã®ç¯å²ãè¶ ããŠããŸãããä»ã®å Žæã§åºç¯ã«ã«ããŒãããŠããŸãã
Frida
Fridaã¯ãéçºè
ããªããŒã¹ãšã³ãžãã¢ãã»ãã¥ãªãã£ç 究è
ã®ããã®åçã€ã³ã¹ãã«ã¡ã³ããŒã·ã§ã³ããŒã«ãããã§ãã
å®è¡äžã®ã¢ããªã±ãŒã·ã§ã³ã«ã¢ã¯ã»ã¹ããå®è¡æã«ã¡ãœãããããã¯ããŠåäœãå€æŽããããå€ãå€æŽããããå€ãæœåºããããç°ãªãã³ãŒããå®è¡ãããã§ããŸã...
Androidã¢ããªã±ãŒã·ã§ã³ããã³ãã¹ãããå Žåã¯ãFridaã®äœ¿ãæ¹ãç¥ã£ãŠããå¿
èŠããããŸãã
- Fridaã®äœ¿ãæ¹ãåŠã¶ïŒFridaãã¥ãŒããªã¢ã«
- Fridaã§ã®ã¢ã¯ã·ã§ã³çšã®ãGUIãïŒhttps://github.com/m0bilesecurity/RMS-Runtime-Mobile-Security
- Ojectionã¯Fridaã®äœ¿çšãèªååããã®ã«æé©ã§ãïŒhttps://github.com/sensepost/objection , https://github.com/dpnishant/appmon
- ããã§çŽ æŽãããFridaã¹ã¯ãªãããèŠã€ããããšãã§ããŸãïŒhttps://codeshare.frida.re/
- https://erfur.github.io/blog/dev/code-injection-without-ptraceã«ç€ºãããŠããããã«Fridaãèªã¿èŸŒãã§ãã¢ã³ããããã°/ã¢ã³ãFridaã¡ã«ããºã ããã€ãã¹ããŠã¿ãŠãã ããïŒããŒã«linjectorïŒã
ã¡ã¢ãªãã³ã - Fridump
ã¢ããªã±ãŒã·ã§ã³ããã¹ã¯ãŒããããŒã¢ããã¯ã®ãããªæ©å¯æ å ±ãä¿åããŠããªãã確èªããŠãã ããã
Fridump3ã䜿çšããŠãã¢ããªã®ã¡ã¢ãªããã³ãã§ããŸãïŒ
# With PID
python3 fridump3.py -u <PID>
# With name
frida-ps -Uai
python3 fridump3.py -u "<Name>"
ããã¯./dumpãã©ã«ããŒã«ã¡ã¢ãªããã³ãããŸããããã§ã次ã®ããã«grepã§ããŸãïŒ
{% code overflow="wrap" %}
strings * | grep -E "^[a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+$"
{% endcode %}
ããŒã¹ãã¢å ã®æ©å¯ããŒã¿
Androidã§ã¯ãããŒã¹ãã¢ã¯æ©å¯ããŒã¿ãä¿åããã®ã«æé©ãªå Žæã§ãããååãªæš©éãããã°ã¢ã¯ã»ã¹ããããšãå¯èœã§ããã¢ããªã±ãŒã·ã§ã³ã¯ããã«å¹³æã§æ©å¯ããŒã¿ãä¿åããåŸåãããããããã³ãã¹ãã¯ããã確èªããå¿ èŠããããŸããã«ãŒããŠãŒã¶ãŒãããã€ã¹ã«ç©ççã«ã¢ã¯ã»ã¹ã§ãã誰ãããã®ããŒã¿ãçãããšãã§ãããããããŸããã
ã¢ããªãããŒã¹ãã¢ã«ããŒã¿ãä¿åããŠããŠãããã®ããŒã¿ã¯æå·åãããŠããã¹ãã§ãã
ããŒã¹ãã¢å ã®ããŒã¿ã«ã¢ã¯ã»ã¹ããã«ã¯ã次ã®Fridaã¹ã¯ãªããã䜿çšã§ããŸã: https://github.com/WithSecureLabs/android-keystore-audit/blob/master/frida-scripts/tracer-cipher.js
frida -U -f com.example.app -l frida-scripts/tracer-cipher.js
æçŽ/çäœèªèšŒãã€ãã¹
次ã®Fridaã¹ã¯ãªããã䜿çšããããšã§ãAndroidã¢ããªã±ãŒã·ã§ã³ãç¹å®ã®æ©å¯é åãä¿è·ããããã«å®è¡ããŠããæçŽèªèšŒããã€ãã¹ããããšãå¯èœã§ã:
{% code overflow="wrap" %}
frida --codeshare krapgras/android-biometric-bypass-update-android-11 -U -f <app.package>
{% endcode %}
ããã¯ã°ã©ãŠã³ãç»å
ã¢ããªã±ãŒã·ã§ã³ãããã¯ã°ã©ãŠã³ãã«çœ®ããšãAndroidã¯ã¢ããªã±ãŒã·ã§ã³ã®ã¹ãããã·ã§ãããä¿åããŸããããã«ããããã©ã¢ã°ã©ãŠã³ãã«åŸ©åž°ãããšãã«ãã¢ããªãããæ©ãèªã¿èŸŒãŸããŠããããã«èŠããŸãã
ãããããã®ã¹ãããã·ã§ããã«æ©å¯æ å ±ãå«ãŸããŠããå Žåãã¹ãããã·ã§ããã«ã¢ã¯ã»ã¹ã§ãã人ã¯ãã®æ å ±ãçãå¯èœæ§ããããŸãïŒã¢ã¯ã»ã¹ããã«ã¯rootãå¿ èŠã§ãïŒã
ã¹ãããã·ã§ããã¯éåžžã**/data/system_ce/0/snapshots
**ã®åšèŸºã«ä¿åãããŸãã
Androidã¯ãFLAG_SECUREã¬ã€ã¢ãŠããã©ã¡ãŒã¿ãèšå®ããããšã§ã¹ã¯ãªãŒã³ã·ã§ããã®ãã£ããã£ãé²ãæ¹æ³ãæäŸããŸãããã®ãã©ã°ã䜿çšãããšããŠã£ã³ããŠã®å 容ã¯å®å šãšèŠãªãããã¹ã¯ãªãŒã³ã·ã§ããã«è¡šç€ºãããããéå®å šãªãã£ã¹ãã¬ã€ã§è¡šç€ºããããããããšãé²ããŸãã
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
Android Application Analyzer
ãã®ããŒã«ã¯ãåçåæäžã«ç°ãªãããŒã«ã管çããã®ã«åœ¹ç«ã¡ãŸã: https://github.com/NotSoSecure/android_application_analyzer
Intent Injection
éçºè
ã¯ããããã®ã€ã³ãã³ããåŠçããstartActivity(...)
ãsendBroadcast(...)
ãªã©ã®ã¡ãœããã«æž¡ããããã·ã³ã³ããŒãã³ãïŒã¢ã¯ãã£ããã£ããµãŒãã¹ããããŒããã£ã¹ãã¬ã·ãŒããŒãªã©ïŒãäœæããããšããããããŸãããããã¯ãªã¹ã¯ã䌎ããŸãã
å±éºã¯ãæ»æè
ããããã®ã€ã³ãã³ãã誀ã£ãŠèªå°ããããšã«ãã£ãŠãéãšã¯ã¹ããŒãã¢ããªã³ã³ããŒãã³ããããªã¬ãŒããããæ©å¯ã³ã³ãã³ããããã€ããŒã«ã¢ã¯ã»ã¹ãããã§ããããšã«ãããŸãã泚ç®ãã¹ãäŸã¯ãWebView
ã³ã³ããŒãã³ããURLãIntent
ãªããžã§ã¯ãã«å€æããIntent.parseUri(...)
ãä»ããŠå®è¡ããããšã§ãæªæã®ããã€ã³ãã³ã泚å
¥ãåŒãèµ·ããå¯èœæ§ãããããšã§ãã
Essential Takeaways
- Intent Injectionã¯ããŠã§ãã®ãªãŒãã³ãªãã€ã¬ã¯ãåé¡ã«äŒŒãŠããŸãã
- è匱æ§ã¯ã
Intent
ãªããžã§ã¯ãããšã¯ã¹ãã©ãšããŠæž¡ãããšã«é¢äžãããããäžå®å šãªæäœãå®è¡ããããã«ãªãã€ã¬ã¯ããããå¯èœæ§ããããŸãã - æ»æè ã«éãšã¯ã¹ããŒãã³ã³ããŒãã³ããã³ã³ãã³ããããã€ããŒãé²åºãããå¯èœæ§ããããŸãã
WebView
ã®URLããIntent
ãžã®å€æã¯ãæå³ããªãã¢ã¯ã·ã§ã³ãä¿é²ããå¯èœæ§ããããŸãã
Android Client Side Injections and others
ãããããããªãã¯ãŠã§ããããã®çš®ã®è匱æ§ã«ã€ããŠç¥ã£ãŠããã§ããããAndroidã¢ããªã±ãŒã·ã§ã³ã«ãããŠã¯ããããã®è匱æ§ã«ç¹ã«æ³šæããå¿ èŠããããŸãïŒ
- SQL Injection: åçã¯ãšãªãã³ã³ãã³ããããã€ããŒãæ±ãéã¯ããã©ã¡ãŒã¿åãããã¯ãšãªã䜿çšããŠããããšã確èªããŠãã ããã
- JavaScript Injection (XSS): ãã¹ãŠã®WebViewã«å¯ŸããŠJavaScriptãšãã©ã°ã€ã³ã®ãµããŒããç¡å¹ã«ãªã£ãŠããããšã確èªããŠãã ããïŒããã©ã«ãã§ç¡å¹ïŒã More info here.
- Local File Inclusion: WebViewã¯ãã¡ã€ã«ã·ã¹ãã ãžã®ã¢ã¯ã»ã¹ãç¡å¹ã«ããå¿
èŠããããŸãïŒããã©ã«ãã§æå¹ïŒ -
(webview.getSettings().setAllowFileAccess(false);)
ã More info here. - Eternal cookies: Androidã¢ããªã±ãŒã·ã§ã³ãã»ãã·ã§ã³ãçµäºãããšããã¯ãããŒãåãæ¶ãããªãå Žåãããã£ã¹ã¯ã«ä¿åãããããšããããŸãã
- Secure Flag in cookies
çµéšè±å¯ãªããã«ãŒããã°ããŠã³ãã£ãã³ã¿ãŒãšã³ãã¥ãã±ãŒã·ã§ã³ãåãããã«ãHackenProof DiscordãµãŒããŒã«åå ããŠãã ããïŒ
Hacking Insights
ãããã³ã°ã®ã¹ãªã«ãšèª²é¡ã«æ·±ãæãäžããã³ã³ãã³ãã«åå ããŠãã ããã
Real-Time Hack News
ãªã¢ã«ã¿ã€ã ã®ãã¥ãŒã¹ãšæŽå¯ãéããŠãæ¥éã«å€åãããããã³ã°ã®äžçã«é
ããã«ã€ããŠãããŸãããã
Latest Announcements
æ°ãããã°ããŠã³ãã£ã®éå§ãéèŠãªãã©ãããã©ãŒã ã®æŽæ°ã«ã€ããŠææ°æ
å ±ãå
¥æããŠãã ããã
Join us on Discord and start collaborating with top hackers today!
Automatic Analysis
MobSF
Static analysis
ã¢ããªã±ãŒã·ã§ã³ã®è匱æ§è©äŸ¡ãè¡ãããã®çŽ æŽããããŠã§ãããŒã¹ã®ããã³ããšã³ãã䜿çšããŸããåçåæãå®è¡ã§ããŸãããç°å¢ãæºåããå¿ èŠããããŸãã
docker pull opensecurity/mobile-security-framework-mobsf
docker run -it -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest
泚æããŠãã ãããMobSFã¯Android(apk)ãIOS(ipa)ãããã³Windows(apx)ã¢ããªã±ãŒã·ã§ã³ãåæã§ããŸãïŒWindowsã¢ããªã±ãŒã·ã§ã³ã¯Windowsãã¹ãã«ã€ã³ã¹ããŒã«ãããMobSFããåæããå¿
èŠããããŸãïŒã
ãŸããAndroidãŸãã¯IOSã¢ããªã®ãœãŒã¹ã³ãŒãã§ZIPãã¡ã€ã«ãäœæãããšïŒã¢ããªã±ãŒã·ã§ã³ã®ã«ãŒããã©ã«ããŒã«ç§»åãããã¹ãŠãéžæããŠZIPãã¡ã€ã«ãäœæïŒããããåæã§ããŸãã
MobSFã¯ãŸããdiff/Compareåæãè¡ããVirusTotalãçµ±åããããšãå¯èœã§ãïŒ_MobSF/settings.py_ã§APIããŒãèšå®ããæå¹ã«ããå¿
èŠããããŸãïŒVT_ENABLED = TRUE
VT_API_KEY = <Your API key>
VT_UPLOAD = TRUE
ïŒãVT_UPLOAD
ãFalse
ã«èšå®ãããšãããã·ã¥ãã¢ããããŒãããããã¡ã€ã«ã§ã¯ãªããªããŸãã
MobSFã«ããæ¯æŽãããåçåæ
MobSFã¯Androidã«ãããåçåæã«ãéåžžã«åœ¹ç«ã¡ãŸããããã®å Žåã¯ãã¹ãã«MobSFãšgenymotionãã€ã³ã¹ããŒã«ããå¿
èŠããããŸãïŒVMãDockerã§ã¯åäœããŸããïŒã泚ïŒæåã«genymotionã§VMãèµ·åãã**ãã®åŸMobSFãèµ·åããå¿
èŠããããŸãã
MobSFåçã¢ãã©ã€ã¶ãŒã¯ä»¥äžãè¡ãããšãã§ããŸãïŒ
- ã¢ããªã±ãŒã·ã§ã³ããŒã¿ããã³ãïŒURLããã°ãã¯ãªããããŒããããªããäœæããã¹ã¯ãªãŒã³ã·ã§ããã"Exported Activity Tester"ã«ãã£ãŠäœæãããã¹ã¯ãªãŒã³ã·ã§ãããã¡ãŒã«ãSQLiteããŒã¿ããŒã¹ãXMLãã¡ã€ã«ããã®ä»ã®äœæããããã¡ã€ã«ïŒããããã¯ãã¹ãŠèªåçã«è¡ãããŸãããã¹ã¯ãªãŒã³ã·ã§ããã¯ãã¹ã¯ãªãŒã³ã·ã§ãããååŸããããšãã«æŒãå¿ èŠããããŸãããŸãã¯ããã¹ãŠã®ãšã¯ã¹ããŒããããã¢ã¯ãã£ããã£ã®ã¹ã¯ãªãŒã³ã·ã§ãããååŸããã«ã¯"Exported Activity Tester"ãæŒãå¿ èŠããããŸãã
- HTTPSãã©ãã£ãã¯ããã£ããã£
- Fridaã䜿çšããŠã©ã³ã¿ã€ã ã®æ å ±ãååŸ
Androidã®ããŒãžã§ã³ > 5ã§ã¯ãFridaãèªåçã«èµ·åãããã©ãã£ãã¯ããã£ããã£ããããã«ã°ããŒãã«ãããã·èšå®ãè¡ããŸãããã¹ããããã¢ããªã±ãŒã·ã§ã³ããã®ãã©ãã£ãã¯ã®ã¿ããã£ããã£ããŸãã
Frida
ããã©ã«ãã§ã¯ãSSLãã³ãã³ã°ãã«ãŒãæ€åºãããã³ãããã¬æ€åºããã€ãã¹ããèå³æ·±ãAPIãç£èŠããããã«ããã€ãã®Fridaã¹ã¯ãªããã䜿çšããŸãã
MobSFã¯ãŸãããšã¯ã¹ããŒããããã¢ã¯ãã£ããã£ãåŒã³åºãããããã®ã¹ã¯ãªãŒã³ã·ã§ãããååŸããã¬ããŒãçšã«ä¿åããããšãã§ããŸãã
åçãã¹ããéå§ããã«ã¯ãç·ã®ãã¿ã³"Start Instrumentation"ãæŒããŸãã"Frida Live Logs"ãæŒããšãFridaã¹ã¯ãªããã«ãã£ãŠçæããããã°ãèŠãããšãã§ãã"Live API Monitor"ãæŒããšãããã¯ãããã¡ãœãããžã®ãã¹ãŠã®åŒã³åºããæž¡ãããåŒæ°ãããã³è¿ãããå€ãèŠãããšãã§ããŸãïŒããã¯"Start Instrumentation"ãæŒããåŸã«è¡šç€ºãããŸãïŒã
MobSFã¯ãŸããç¬èªã®Fridaã¹ã¯ãªãããèªã¿èŸŒãããšãã§ããŸãïŒFridaã¹ã¯ãªããã®çµæãMobSFã«éä¿¡ããã«ã¯ãsend()
é¢æ°ã䜿çšããŸãïŒããŸããèªã¿èŸŒãããšãã§ããããã€ãã®äºåã«æžãããã¹ã¯ãªããããããŸãïŒMobSF/DynamicAnalyzer/tools/frida_scripts/others/
ã«è¿œå ã§ããŸãïŒããã éžæãã"Load"ãæŒãã"Start Instrumentation"ãæŒããŸãïŒãã®ã¹ã¯ãªããã®ãã°ã¯"Frida Live Logs"å
ã§èŠãããšãã§ããŸãïŒã
ããã«ãããã€ãã®è£å©çãªFridaæ©èœããããŸãïŒ
- èªã¿èŸŒãŸããã¯ã©ã¹ãåæïŒãã¹ãŠã®èªã¿èŸŒãŸããã¯ã©ã¹ãå°å·ããŸã
- æååããã£ããã£ïŒã¢ããªã±ãŒã·ã§ã³ã䜿çšäžã«ãã£ããã£ããããã¹ãŠã®æååãå°å·ããŸãïŒéåžžã«éšãããïŒ
- æååæ¯èŒããã£ããã£ïŒéåžžã«åœ¹ç«ã€å¯èœæ§ããããŸããæ¯èŒãããŠãã2ã€ã®æååãšçµæãTrueãFalseãã衚瀺ããŸãã
- ã¯ã©ã¹ã¡ãœãããåæïŒã¯ã©ã¹åïŒäŸïŒ"java.io.File"ïŒãå ¥åãããšããã®ã¯ã©ã¹ã®ãã¹ãŠã®ã¡ãœãããå°å·ããŸãã
- ã¯ã©ã¹ãã¿ãŒã³ãæ€çŽ¢ïŒãã¿ãŒã³ã§ã¯ã©ã¹ãæ€çŽ¢
- ã¯ã©ã¹ã¡ãœããããã¬ãŒã¹ïŒã¯ã©ã¹å šäœããã¬ãŒã¹ïŒãã®ã¯ã©ã¹ã®ãã¹ãŠã®ã¡ãœããã®å ¥åãšåºåã確èªïŒãããã©ã«ãã§ã¯ãMobSFã¯èå³æ·±ãAndroid APIã¡ãœãããããã€ããã¬ãŒã¹ããŸãã
䜿çšãããè£å©ã¢ãžã¥ãŒã«ãéžæãããã"Start Intrumentation"ãæŒãå¿ èŠãããããã¹ãŠã®åºåã¯"Frida Live Logs"ã«è¡šç€ºãããŸãã
ã·ã§ã«
Mobsfã¯ãŸããåçåæããŒãžã®äžéšã«ããã€ãã®adbã³ãã³ããMobSFã³ãã³ããããã³äžè¬çãªã·ã§ã«ã³ãã³ããæã€ã·ã§ã«ãæäŸããŸããããã€ãã®èå³æ·±ãã³ãã³ãïŒ
help
shell ls
activities
exported_activities
services
receivers
HTTPããŒã«
httpãã©ãã£ãã¯ããã£ããã£ããããšã"HTTP(S) Traffic"ã®äžã«ãã£ããã£ããããã©ãã£ãã¯ã®éããã¥ãŒã衚瀺ããããã"Start HTTPTools"ã®ç·ã®ãã¿ã³ã§ããè¯ããã¥ãŒã衚瀺ãããŸãã2çªç®ã®ãªãã·ã§ã³ãããcaptured requestsãBurpãOwasp ZAPã®ãããªproxiesã«sendã§ããŸãã
ãã®ããã«ã¯ãBurpãèµ·å --> Interceptããªãã«ãã --> MobSB HTTPToolsã§ãªã¯ãšã¹ããéžæ --> "Send to Fuzzer"ãæŒã --> ãããã·ã¢ãã¬ã¹ãéžæ (http://127.0.0.1:8080\)ã
MobSFã§åçåæãå®äºãããã"Start Web API Fuzzer"ãæŒããŠfuzz http requestsãè¡ããè匱æ§ãæ¢ããŸãã
{% hint style="info" %} MobSFã§åçåæãå®è¡ããåŸããããã·èšå®ã誀ã£ãŠæ§æãããå¯èœæ§ããããGUIããä¿®æ£ã§ããªããªãããšããããŸãããããã·èšå®ãä¿®æ£ããã«ã¯ã次ã®æé ãå®è¡ããŸãïŒ
adb shell settings put global http_proxy :0
{% endhint %}
Assisted Dynamic Analysis with Inspeckage
ããŒã«ã¯Inspeckageããå
¥æã§ããŸãã
ãã®ããŒã«ã¯ãåçåæãå®è¡ããŠããéã«ã¢ããªã±ãŒã·ã§ã³ã§äœãèµ·ãã£ãŠããããç¥ãããã«ããã€ãã®Hooksã䜿çšããŸãã
Yaazhini
ããã¯GUIã䜿çšããéçåæãå®è¡ããããã®åªããããŒã«ã§ãã
Qark
ãã®ããŒã«ã¯ããœãŒã¹ã³ãŒããŸãã¯ããã±ãŒãžåãããAPKã®ããããã§ãããã€ãã®ã»ãã¥ãªãã£é¢é£ã®Androidã¢ããªã±ãŒã·ã§ã³ã®è匱æ§ãæ¢ãããã«èšèšãããŠããŸãããã®ããŒã«ã¯ãèŠã€ãã£ãè匱æ§ã®ããã€ããæªçšããããã®**ãProof-of-Conceptããããã€å¯èœAPKãšADBã³ãã³ããäœæããããšãå¯èœã§ã**ïŒå ¬éãããã¢ã¯ãã£ããã£ãã€ã³ãã³ããã¿ãããžã£ããã³ã°...ïŒãDrozerãšåæ§ã«ããã¹ãããã€ã¹ãã«ãŒãåããå¿ èŠã¯ãããŸããã
pip3 install --user qark # --user is only needed if not using a virtualenv
qark --apk path/to/my.apk
qark --java path/to/parent/java/folder
qark --java path/to/specific/java/file.java
ReverseAPK
- åç §ã®ããã«ãã¹ãŠã®æœåºãã¡ã€ã«ã衚瀺
- APKãã¡ã€ã«ãèªåçã«Javaããã³Smali圢åŒã«ãã³ã³ãã€ã«
- äžè¬çãªè匱æ§ãšåäœã®ããã«AndroidManifest.xmlãåæ
- äžè¬çãªè匱æ§ãšåäœã®ããã®éçãœãŒã¹ã³ãŒãåæ
- ããã€ã¹æ å ±
- ãã®ä»å€æ°
reverse-apk relative/path/to/APP.apk
SUPER Android Analyzer
SUPERã¯ãWindowsãMacOS XãLinuxã§äœ¿çšã§ããã³ãã³ãã©ã€ã³ã¢ããªã±ãŒã·ã§ã³ã§ãè匱æ§ãæ¢ãããã«_.apk_ãã¡ã€ã«ãåæããŸããããã¯ãAPKã解åããäžé£ã®ã«ãŒã«ãé©çšããŠè匱æ§ãæ€åºããããšã«ãã£ãŠè¡ãããŸãã
ãã¹ãŠã®ã«ãŒã«ã¯rules.json
ãã¡ã€ã«ã«éäžããŠãããåäŒæ¥ããã¹ã¿ãŒã¯èªåãã¡ã®å¿
èŠã«å¿ããŠåæããããã®ç¬èªã®ã«ãŒã«ãäœæã§ããŸãã
ææ°ã®ãã€ããªã¯ããŠã³ããŒãããŒãžããããŠã³ããŒãããŠãã ããã
super-analyzer {apk_file}
StaCoAn
StaCoAnã¯ãéçºè ããã°ããŠã³ãã£ãã³ã¿ãŒãå«ççããã«ãŒãã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ã«å¯ŸããŠéçã³ãŒãåæãè¡ãã®ãæ¯æŽããã¯ãã¹ãã©ãããã©ãŒã ããŒã«ã§ãã
ã³ã³ã»ããã¯ãã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ãã¡ã€ã«ïŒ.apkãŸãã¯.ipaãã¡ã€ã«ïŒãStaCoAnã¢ããªã±ãŒã·ã§ã³ã«ãã©ãã°ã¢ã³ããããããããšãèŠèŠçã§ããŒã¿ãã«ãªã¬ããŒããçæããããšãããã®ã§ããèšå®ãã¯ãŒããªã¹ãã調æŽããŠãã«ã¹ã¿ãã€ãºãããäœéšãåŸãããšãã§ããŸãã
ææ°ãªãªãŒã¹ãããŠã³ããŒã:
./stacoan
AndroBugs
AndroBugs Frameworkã¯ãéçºè
ãããã«ãŒãAndroidã¢ããªã±ãŒã·ã§ã³ã®æœåšçãªã»ãã¥ãªãã£è匱æ§ãèŠã€ããã®ãå©ããAndroidè匱æ§åæã·ã¹ãã ã§ãã
WindowsãªãªãŒã¹
python androbugs.py -f [APK file]
androbugs.exe -f [APK file]
Androwarn
Androwarnã¯ãAndroidã¢ããªã±ãŒã·ã§ã³ã«ãã£ãŠéçºãããæœåšçãªæªæã®ããåäœãæ€åºãããŠãŒã¶ãŒã«èŠåããããšãäž»ãªç®çãšããããŒã«ã§ãã
æ€åºã¯ãã¢ããªã±ãŒã·ã§ã³ã®Dalvikãã€ãã³ãŒãã®éç解æã䜿çšããŠè¡ãããSmaliãšããŠè¡šçŸãããŸããandroguard
ã©ã€ãã©ãªã䜿çšããŠããŸãã
ãã®ããŒã«ã¯ã次ã®ãããª**ãæªããã¢ããªã±ãŒã·ã§ã³ã®äžè¬çãªåäœ**ãæ¢ããŸãïŒãã¬ãã©ããŒèå¥åã®æµåºãé³å£°/ãããªãããŒã®ååãPIMããŒã¿ã®å€æŽãä»»æã®ã³ãŒãå®è¡...
python androwarn.py -i my_application_to_be_analyzed.apk -r html -v 3
MARA Framework
MARAã¯ã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ã®éã¢ã»ã³ãã«ãšåæãã¬ãŒã ã¯ãŒã¯ã§ããããã¯ãOWASPã¢ãã€ã«ã»ãã¥ãªãã£è åšã«å¯ŸããŠã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ããã¹ãããããã«ãäžè¬çã«äœ¿çšãããã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ã®éã¢ã»ã³ãã«ããã³åæããŒã«ããŸãšããããŒã«ã§ãããã®ç®çã¯ããã®äœæ¥ãã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ã®éçºè ãã»ãã¥ãªãã£å°é家ã«ãšã£ãŠããç°¡åã§èŠªãã¿ãããããããšã§ãã
以äžã®ããšãå¯èœã§ãïŒ
- ç°ãªãããŒã«ã䜿çšããŠJavaããã³Smaliã³ãŒããæœåºãã
- smaliscaãClassySharkãandrobugsãandrowarnãAPKiDã䜿çšããŠAPKãåæãã
- regexpsã䜿çšããŠAPKãããã©ã€ããŒãæ å ±ãæœåºãã
- ãããã§ã¹ããåæãã
- pyssltestãtestsslãããã³whatwebã䜿çšããŠèŠã€ãã£ããã¡ã€ã³ãåæãã
- apk-deguard.comãä»ããŠAPKãããªããã¹ã±ãŒããã
Koodous
ãã«ãŠã§ã¢ãæ€åºããã®ã«åœ¹ç«ã¡ãŸã: https://koodous.com/
ã³ãŒãã®é£èªå/ããªããã¹ã±ãŒã
䜿çšãããµãŒãã¹ãšæ§æã«ãã£ãŠãã³ãŒããé£èªåããéã«ç§å¯ãé£èªåãããå Žåãšãããªãå ŽåããããŸãã
ProGuard
Wikipediaãã: ProGuardã¯ãJavaã³ãŒããçž®å°ãæé©åãé£èªåãããªãŒãã³ãœãŒã¹ã®ã³ãã³ãã©ã€ã³ããŒã«ã§ãããã€ãã³ãŒããæé©åããæªäœ¿çšã®åœä»€ãæ€åºããŠåé€ããããšãã§ããŸããProGuardã¯ããªãŒãœãããŠã§ã¢ã§ãGNUäžè¬å ¬è¡ã©ã€ã»ã³ã¹ç¬¬2çã®äžã§é åžãããŠããŸãã
ProGuardã¯Android SDKã®äžéšãšããŠé åžãããã¢ããªã±ãŒã·ã§ã³ããªãªãŒã¹ã¢ãŒãã§ãã«ãããéã«å®è¡ãããŸãã
DexGuard
APKãããªããã¹ã±ãŒãããããã®ã¹ããããã€ã¹ãããã¬ã€ãã¯https://blog.lexfo.fr/dexguard.htmlã«ãããŸãã
ïŒãã®ã¬ã€ãããïŒæåŸã«ç¢ºèªãããšããDexguardã®åäœã¢ãŒãã¯æ¬¡ã®ãšããã§ããïŒ
- ãªãœãŒã¹ãInputStreamãšããŠèªã¿èŸŒã;
- çµæãFilterInputStreamããç¶æ¿ããã¯ã©ã¹ã«æž¡ããŠåŸ©å·åãã;
- ãªããŒã¹ãšã³ãžãã¢ã«æ°åã®æéãç¡é§ã«ãããããã«ç¡é§ãªé£èªåãè¡ã;
- 埩å·åãããçµæãZipInputStreamã«æž¡ããŠDEXãã¡ã€ã«ãååŸãã;
- æåŸã«ã
loadDex
ã¡ãœããã䜿çšããŠçµæã®DEXããªãœãŒã¹ãšããŠèªã¿èŸŒãã
DeGuard
DeGuardã¯ãAndroidã®é£èªåããŒã«ã«ãã£ãŠè¡ãããé£èªåããã»ã¹ãé転ãããŸããããã«ãããã³ãŒãæ€æ»ãã©ã€ãã©ãªã®äºæž¬ãªã©ãæ°å€ãã®ã»ãã¥ãªãã£åæãå¯èœã«ãªããŸãã
é£èªåãããAPKã圌ãã®ãã©ãããã©ãŒã ã«ã¢ããããŒãã§ããŸãã
Simplify
ããã¯æ±çšã®Androidããªããã¹ã±ãŒã¿ãŒã§ããSimplifyã¯ã¢ããªãä»®æ³çã«å®è¡ããŠãã®åäœãç解ãããã®åŸã³ãŒããæé©åããããšããŸããåæé©åã¿ã€ãã¯ã·ã³ãã«ã§æ±çšçã§ããããã䜿çšãããç¹å®ã®é£èªåã®çš®é¡ã¯é¢ä¿ãããŸããã
APKiD
APKiDã¯APKãã©ã®ããã«äœæããããã«é¢ããæ å ±ãæäŸããŸããå€ãã®ã³ã³ãã€ã©ãããã«ãŒãé£èªåããŒã«ãããã³ãã®ä»ã®å¥åŠãªãã®ãç¹å®ããŸããããã¯Androidçšã®PEiDã§ãã
ããã¥ã¢ã«
ã©ã
Androl4b
AndroL4bã¯ãubuntu-mateã«åºã¥ããAndroidã»ãã¥ãªãã£ä»®æ³ãã·ã³ã§ããªããŒã¹ãšã³ãžãã¢ãªã³ã°ãšãã«ãŠã§ã¢åæã®ããã®ææ°ã®ãã¬ãŒã ã¯ãŒã¯ããã¥ãŒããªã¢ã«ãã©ãã®ã³ã¬ã¯ã·ã§ã³ãå«ãã§ããŸãã
åèæç®
- https://owasp.org/www-project-mobile-app-security/
- https://appsecwiki.com/#/ ããã¯çŽ æŽããããªãœãŒã¹ã®ãªã¹ãã§ã
- https://maddiestone.github.io/AndroidAppRE/ Androidã®ã¯ã€ãã¯ã³ãŒã¹
- https://manifestsecurity.com/android-application-security/
- https://github.com/Ralireza/Android-Security-Teryaagh
- https://www.youtube.com/watch?v=PMKnPaGWxtg&feature=youtu.be&ab_channel=B3nacSec
ãŸã è©ŠããŠããªã
HackenProof DiscordãµãŒããŒã«åå ããŠãçµéšè±å¯ãªããã«ãŒããã°ããŠã³ãã£ãã³ã¿ãŒãšã³ãã¥ãã±ãŒã·ã§ã³ãåããŸãããïŒ
ãããã³ã°ã®æŽå¯
ãããã³ã°ã®ã¹ãªã«ãšèª²é¡ã«é¢ããã³ã³ãã³ãã«åå ãã
ãªã¢ã«ã¿ã€ã ããã¯ãã¥ãŒã¹
ãªã¢ã«ã¿ã€ã ã®ãã¥ãŒã¹ãšæŽå¯ãéããŠãæ¥éã«é²åãããããã³ã°ã®äžçãææ¡ãã
ææ°ã®çºè¡š
æ°ãããã°ããŠã³ãã£ã®éå§ãéèŠãªãã©ãããã©ãŒã ã®æŽæ°ã«ã€ããŠæ
å ±ãåŸã
Discordã«åå ããŠãä»æ¥ãããããããã«ãŒãšã³ã©ãã¬ãŒã·ã§ã³ãå§ããŸãããïŒ
{% hint style="success" %}
AWSãããã³ã°ãåŠã³ãå®è·µãã:HackTricks Training AWS Red Team Expert (ARTE)
GCPãããã³ã°ãåŠã³ãå®è·µãã: HackTricks Training GCP Red Team Expert (GRTE)
HackTricksããµããŒããã
- ãµãã¹ã¯ãªãã·ã§ã³ãã©ã³ã確èªããŠãã ããïŒ
- **ð¬ Discordã°ã«ãŒããŸãã¯ãã¬ã°ã©ã ã°ã«ãŒãã«åå ããããTwitter ðŠ @hacktricks_liveããã©ããŒããŠãã ããã
- ãããã³ã°ã®ããªãã¯ãå ±æããããã«ãHackTricksããã³HackTricks Cloudã®GitHubãªããžããªã«PRãæåºããŠãã ããã