安卓动态调试so文件

Title
安卓动态调试so文件
Date
May 14, 2023
如果有些app需要输入密码和用户名之类的,用IDA静态调试,看不到,只能通过IDA动态调试APP。

动态调试步骤:

网上教程一大堆,不在赘述

实例1:ctf_100:

如果不达到要爬的楼层,是看不到FLAG的。
notion image
反编译后,分析了一下,发现不用动态调试也可以,所以就直接在java层修改一下就可以了:
notion image
只要去到if-get 这一行的判断就可以了:
notion image
效果:只要爬一层楼,点击看FLAG就可以看到FLAG了:
notion image

案例二:crackme1:

这次需要IDA动态调试才可以看到正确的输入密码:
notion image
IDA调试步骤:
IDA先静态分析一下:
notion image
分析bc为关键解密函数,wolf_de 为解密函数,传入的应该是解密的密钥:
notion image
 
notion image
notion image
notion image
 
notion image
 
notion image
notion image
notion image
notion image
其实也可以在hex view中显示R6寄存器,就可以显示出密钥了
notion image
密码就是:hello5.1
notion image

案例3:自毁程序密码:

 
notion image
IDA静态分析:
关键方法是 Java_com_yaotong_crackme_MainActivity_securityCheck 这个函数是静态注册函数,没有在jni_onload中进行静态注册:
notion image
Java_com_yaotong_crackme_MainActivity_securityCheck 中的字符串并不是密钥:
notion image
IDA动态调试:
notion image
小技巧:
在IDA中按ctrl+s找到segment窗口,找到载入so文件中的库的起始地址,用另一个IDA打开so文件,找到对应函数的偏移地址,绝对地址=基址+偏移地址(静态分析中的函数地址),绝对地址就是IDA动态分析中的函数的地址。
notion image
运行到这里就可以看到密钥了:
notion image
notion image
密钥是:aiyou,bucuoo

案例4:find_tracer:

这个应用检测程序是否在被调试:
notion image
反调试检测的函数:
notion image
Built with Potion.so