首页
社区
课程
招聘
[分享] 安卓逆向课题之7, mobile spider get started. 看电视直播App(未加固)去广告升级 (笔记待完善)
2023-11-18 02:20 2669

[分享] 安卓逆向课题之7, mobile spider get started. 看电视直播App(未加固)去广告升级 (笔记待完善)

2023-11-18 02:20
2669

入门学习逆向的个人笔记,预览(欢迎探讨)

[原创] 肉丝的r0env2022(kali linux)配置xrdp远程桌面,以及Genymotion安卓11的ssh登陆问题和11系统amr64转译问题.
[分享] (Android) 逆向入门记录 一篇杂文, 记录.
[分享] Adndroid逆向的基础环境准备 的一些记录 , 抄袭royuse的课 第3课
[分享] 安卓逆向课题之4, Activity,service,content provider,broadcast receiver和实例演示,完毕
[分享] 安卓逆向课题之5, mobile spider get started. 两天高度集中学习, 承上启下的流程,a明白,b上手练.(5th完结)
[分享] 安卓逆向课题之6, mobile spider get started. Object的自动化动态分析和快速定位(笔记完毕)
[分享] 安卓逆向课题之7, mobile spider get started. 看电视直播App(未加固)去广告升级 (笔记待完善)
[分享] 安卓逆向课题之8, 真实App实操带壳App重打包去强制升级(部分抄袭别人笔记)(一次不完美的实践)
[讨论] Android Reverse Project No.9, "Types of App Security Protection, Identification and Handling Methods"
[原创] Android Reverse Project No.9, "Types of App Protection“ ---- Video Course


纵览

针对老课程还是需要用心学习, 虽然apk 不在了, 肉丝也不提供, 在去2020年的版本估计挂了, 无法还原. 但是还是 一步步看,追求源头, 虽然想快, 但是.... 一步步看明白吧,哪怕 无法复现, 手敲上去的 , 伪代码一样可以看明白...

虎头蛇尾, 说过一定要一一复现, 可惜, 肉丝的话很响亮,我们执行也到位,可惜等到的是app没有那么长的命, 等待我们对他3年前裸奔的version 动刀子, 如果他们还活着, 我相信这个app会非常长寿. 因为一个 font , hold on.

  • (重)打包核心原理分析
  • Dalvik下常见格式互转
  • Dex格式反编译与Smali
  • 解包改包改业务流程
  • 手动重签名重打包

ios app通过签名管理, 控制权在苹果手上
android app 签名,就是摆设

就是对dex的分析

jadx-gui
直接search keywords. (去掉升级) (属于碰运气)

目标是立刻升级去掉

修改逻辑, 在 jadx 里 修改smali 逻辑.

Android中的几种弹出框实现
jianshu.com/p/18e1f518c625

安卓 几种 弹窗窗口的方法.
一,activity以窗口形式呈现:

1
在AndroidManifest.xml中注册一个activity.

二,Android:将activity设置为弹出式的并设置为透明的
三,Dialog
四,PopupWindow

1
2
3
4
5
6
# objection -g com.hd.zhibo explore
 
# android hooking list activities
 
com.zhibo.media.channel_main
Found 1 classes

only 1 activities. no optiona. main interface is only one activity.

picture 0

picture 1

百分之1000有 memory 这个实例的.

1
2
3
4
5
6
# android heap search instances android.app.AlertDialog
Class instance enumeration complete for android.app.AlertDialog
Hashcode    Class                    restrina tostring ()
........    ....                     .......
18933884    android.app.AlertDialog  android.app.AlertDialog@12087c
# com.hd.zhibo on (google: 8.1.0) [usb] #

使用葫芦娃的工具, wallbreaker

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# plugin load /root/.objection/plugins/Wallbreaker
Loaded plugin: wallbreaker
 
看下类的结构 根据一个pattern来寻找一个类.
# plugin wallbreaker objectsearch  android.app.AlertDialog
[0x22d6]: android.app.AlertDialog@120e887c
 
找到了这个handle.
# plugin wallbreaker objectdump 0x22d6 //就 print 了它的域信息.
 
class AlertDialog (
 
/* static fields */ 静态域
stat ic int SHOW; => 69
static int DISMISS: => 67
static int CANCEL;  => 68
static String DIALOG_HIERARCHY_TAG; => android:dialogHierarchy
static String TAG; => Dialog
static string DIALOG_SHOWING_TAG; => android:dialogShowing
static int THEME_DEVICE_DEFAULT_LIGHT: => 5
static int THEME_DEVICE_DEFAULT_DARK: => 4
static int THEME_HOLO_DARK:
static int LAYOUT_HINT_NONE
static int THEME_HOLO_LIGHT:
static int LAYOUT_HINT_SIDE:3 1
static int THEME_TRADTTIONAL
 
/* instance fields */ 实例域
int shadows$_monitor; E> -2128549764
Class shadows klass ES [0x2302]: class android.app.AlertDialog
DialogInterface$OnKeyListener mOnkeyListener; => null
boolean mshowing: => true SearchEvent m
SearchEvent; => null
ActionMode mActionMode:•> null

picture 2

继续参考 Android 系统原生dialog使用

透过开发的视角,看问题.

picture 3
picture 4

核心在于dialog interface.

picture 5

1
# plugin wallbreaker objectdump 0x23fa // 内存中的信息全部打印出来了.

picture 7

picture 6

1
2
# plugin wallbreaker objectsearch android.app.AlertDialog
[0x25a6]: android.app.AlertDialog@120e87c

亲自hook, 看下是否走到了这里.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# adb shell
# su
# ps -e | grep zhibo
u0_a104 7709 558 1811216 122644 sys_epoll_wait f546ca74 S com.hd.zhibo
# kill 7709
// the app as ended.
 
objection hook 它的话会出现来不及的情况.
 
# objection -g com.hd.zhibo explore
 
# android hooking search watch class method class android.app.AlertDialog
 
// 刚刚hook 上,  app 已经 弹出了 升级提示框.所以我们需要加快.
 
# ps -e | grep zhibo
u0_a104 8445 558 1811216 122644 sys_epoll_wait f546ca74 S com.hd.zhibo
# kill 8445
 
# exit objection
 
# objection -g com.hd.zhibo explore
# android hooking watch class android.app.AlertDialog
 
// 速度比app 启动要快.
 
com.hd.zhibo on (google: 8.1.0) (usb] # (agent) [p0c8jp71s3г] Called android.app.
AlertDialog. resolveDialogTheme (android, content. Context, int)
(agent ) [poc81p71s3rl Called android.app.AlertDialog.resolveDialogTheme(android.c ontent, Context, int)
(agent) (pOc8jp71s3г) Called android.app.AletDialog.onCreate(android.os.Bundle)
 
#  exit
 
# objection -g com.hd.zhibo explore
 
现在开始追踪, android.app.AletDialog.onCreate 这个函数的上级函数是谁. 父函数是谁.
 
# android hooking watch class method android.app.AlertDialog.onCreate --dump-args --dump-backtrace --dump-return
 
现在来不及了,杀掉 process.
 
# ps -e | grep zhibo
# kill 8616
 
#  objection -g com.hd.zhibo explore
#  android hooking watch class method android.app.AlertDialog.onCreate --dump-args
 
ok, Dialog对话框已经出现.

picture 9

picture 10

picture 11

查看最上面的一个.

picture 12

picture 13

一步步定位 ,1000% 是正确的.

刚才的方法是对着 app 启动赛跑.

在 App 刚刚启动就去hook 它.

如何处理启动时 hook 的问题. 首先确定 objection是否支持 spawn 的模式.

看下源码就知道了,
picture 14

frida 有2种模式, 一种是 attach. 这种模式是 process 已经存在了.
还有一种模式是 spawn 模式, process 不存在, 相对应的process的 packageName 是没有的. frida 会主动用app process , 主动喂给孵化器. 启动这个process, 一开始就可以hook的话就使用这个spawn 模式. objection 是支持这个模式的.

picture 15

picture 16

picture 17

picture 18

https://github.com/sensepost/objection/wiki/Early-Instrumentation

picture 19

picture 20

1
2
3
# objection -g com.hd.zhibo explore --startup-command " android hooking watch class method android.app.AlertDialog.onCreate --dump-args --dump-backtrace --dump-return"
 
我只是告诉你我是怎么知道一步步探索到它的使用方法,虽然help里面没有, 但是文档有, objection理解了 Frida 的精髓, 实现原理是调用 Frida 的RPC实现.

  1
picture 22


[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

最后于 2024-1-19 23:02 被calleng编辑 ,原因:
收藏
点赞0
打赏
分享
最新回复 (4)
雪    币: 80
活跃值: (2521)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
calleng 2023-11-18 02:25
2
0


以上课程,我购买后的自己写的课程笔记,目前虽然有盗版课程出现,但是解决问题,还是需要作者指导. 如果喜欢r0yuse的课,可以组队学习, (需加入请留言).用少量的时间学明白基础,节省时间.. 

# 参考  AD 附上 , (抄自肉丝的课)


狗皮膏药       




雪    币: 19516
活跃值: (29191)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
秋狝 2023-11-18 17:24
3
1
感谢分享
雪    币: 22
活跃值: (3629)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
New对象处 2023-11-19 18:51
4
0
上大号
雪    币: 88
活跃值: (56)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
mb_vmmuhiig 2023-11-24 18:38
5
0
上大号 上大号
游客
登录 | 注册 方可回帖
返回