1. apk 安装到手机, 啥输入框都没有

2. apk拖入到jadx中看看

public class MainActivity extends Activity {
@Override // android.app.Activity
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(getApplicationContext());
tv.setText("Select the activity you wish to interact with.To-Do: Add buttons to select activity, for now use Send_to_Activity");
setContentView(tv);
IntentFilter filter = new IntentFilter();
filter.addAction("com.ctf.INCOMING_INTENT");
Send_to_Activity receiver = new Send_to_Activity();
registerReceiver(receiver, filter, Manifest.permission._MSG, null);
}
}

大概就是动态注册了一个广播接收器,看看接收器代码

/* loaded from: classes.dex */
public class Send_to_Activity extends BroadcastReceiver {
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
String msgText = intent.getStringExtra("msg");
if (msgText.equalsIgnoreCase("ThisIsTheRealOne")) {
Intent outIntent = new Intent(context, ThisIsTheRealOne.class);
context.startActivity(outIntent);
} else if (msgText.equalsIgnoreCase("IsThisTheRealOne")) {
Intent outIntent2 = new Intent(context, IsThisTheRealOne.class);
context.startActivity(outIntent2);
} else if (msgText.equalsIgnoreCase("DefinitelyNotThisOne")) {
Intent outIntent3 = new Intent(context, DefinitelyNotThisOne.class);
context.startActivity(outIntent3);
} else {
Toast.makeText(context, "Which Activity do you wish to interact with?", 1).show();
}
}
}

广播接收就跳转到各个activity,直接使用objecttion来实现直接跳到对应的activity

└─# objection -g com.example.hellojni explore

A newer version of objection is available!
You have v1.9.6 and v1.11.0 is ready for download. Upgrade with: pip3 install objection --upgrade
For more information, please see: https://github.com/sensepost/objection/wiki/Updating Using USB device `MI 5X`
Agent injected and responds ok! _ _ _ _
___| |_|_|___ ___| |_|_|___ ___
| . | . | | -_| _| _| | . | |
|___|___| |___|___|_| |_|___|_|_|
|___|(object)inject(ion) v1.9.6 Runtime Mobile Exploration
by: @leonjza from @sensepost [tab] for command suggestions
com.example.hellojni on (xiaomi: 8.1.0) [usb] # android intent launch_activity com.example.application.Def
initelyNotThisOne (agent) Starting activity com.example.application.DefinitelyNotThisOne...
(agent) Activity successfully asked to start.
com.example.hellojni on (xiaomi: 8.1.0) [usb] # android intent launch_activity com.example.application.IsT
hisTheRealOne
(agent) Starting activity com.example.application.IsThisTheRealOne...
(agent) Activity successfully asked to start.
com.example.hellojni on (xiaomi: 8.1.0) [usb] #

每个activity 都使用了一个native函数, hook住它,看看有没有什么发现

3. 编写脚本



function main() {
Java.perform(function() {
var DefinitelyNotThisOneHandler = Java.use('com.example.application.DefinitelyNotThisOne')
DefinitelyNotThisOneHandler.definitelyNotThis.implementation = function(arg0, arg1) {
console.log('DefinitelyNotThisOneHandler called: ' + arg0 + " \n" + arg1)
var ret = this.definitelyNotThis(arg0, arg1)
console.log('DefinitelyNotThisOneHandler ret: ' + ret )
return ret
} var ThisIsTheRealOneHandler = Java.use('com.example.application.ThisIsTheRealOne')
ThisIsTheRealOneHandler.orThat.overload('java.lang.String', 'java.lang.String', 'java.lang.String').implementation = function(arg0, arg1, arg2) {
console.log('ThisIsTheRealOneHandler called: ' + arg0 + " \n" + arg1 + " \n" + arg2)
var ret = this.orThat(arg0, arg1, arg2)
console.log('ThisIsTheRealOneHandler ret: ' + ret )
return ret
} var IsThisTheRealOneHandler = Java.use('com.example.application.IsThisTheRealOne')
IsThisTheRealOneHandler.perhapsThis.overload('java.lang.String', 'java.lang.String', 'java.lang.String').implementation = function(arg0, arg1, arg2) {
console.log('IsThisTheRealOneHandler called: ' + arg0 + " \n" + arg1 + " \n" + arg2)
var ret = this.perhapsThis(arg0, arg1, arg2)
console.log('IsThisTheRealOneHandler ret: ' + ret )
return ret
}
})
} setImmediate(main)

日志

(hooker_3.8.5) ┌──(hooker_3.8.5)(root㉿r0env)-[~/Documents/code_dir/study/20230215/001]
└─# frida -U com.example.hellojni -l lesson16.js --no-pause
____
/ _ | Frida 14.2.2 - A world-class dynamic instrumentation toolkit
| (_| |
> _ | Commands:
/_/ |_| help -> Displays the help system
. . . . object? -> Display information about 'object'
. . . . exit/quit -> Exit
. . . .
. . . . More info at https://www.frida.re/docs/home/ [MI 5X::com.example.hellojni]-> DefinitelyNotThisOneHandler called: YjYwYWZjMjRkMhVhZTQhZDIwZGFkNWJhMGZmZGYiYmQaMmFkMjBiMTEhNDAtMzMzMjdlZmEWNzU? MzYwNjMeNjgxNWZkNGQeOTFhOTIhNDkiMDVhNDBkYTAyNWQtYhYxNWYwOTUxMzZiMTlmMzciMjM? DefinitelyNotThisOneHandler ret: Told you so!
[MI 5X::com.example.hellojni]->
[MI 5X::com.example.hellojni]->
[MI 5X::com.example.hellojni]->
[MI 5X::com.example.hellojni]-> IsThisTheRealOneHandler called: TRytfrgooq|F{i-JovFBungFk\VlphgQbwvj~HuDgaeTzuSt.@Lex^~
ZGFkNGIwYzIWYjEzMTUWNjVjNTVlNjZhOGJkNhYtODIyOGEaMTMWNmQaOTVjZjkhMzRjYmUzZGE? MzQxZTZmZjAxMmIiMWUzNjUxMmRiYjIxNDUwYTUxMWItZGQzNWUtMzkyOWYyMmQeYjZmMzEaNDQ? IsThisTheRealOneHandler ret: Congratulation!YouFoundTheRightActivityHereYouGo-CTF{IDontHaveABadjokeSorry}

日志中(返回值)发现flag

【Android 逆向】【攻防世界】ill-intentions的更多相关文章

  1. 逆向-攻防世界-crackme

    查壳,nSpack壳,直接用软件脱壳,IDA载入程序. 很明显,就是将402130的数据和输入的数据进行异或,判断是否等于402150处的数据.dwrd占4字节. 这道题主要记录一下刚学到的,直接在I ...

  2. 逆向-攻防世界-maze

    题目提示是走迷宫. IDA载入程序分析. 输入字符长度必须是24,开头必须是nctf{,结尾必须是}.在125处按R就可以变成字符. sub_400650和sub_400660是关键函数,分析sub_ ...

  3. 逆向-攻防世界-CSAW2013Reversing2

    运行程序乱码,OD载入搜索字符串,断电到弹窗Flag附近. 发现跳过00B61000函数,弹窗乱码,我们试试调用00B61000函数.将00B61094的指令修改为JE SHORT 00B6109b. ...

  4. 逆向-攻防世界-logmein

    iDA载入程序,shift+F12查看关键字符串,找到双击来到所在地址,进入函数 然后进入主函数, 经过分析,可以得出:输入的字符要等于  经过处理的v7和v8的异或.v8很明显,但是v7是怎么回事呢 ...

  5. 逆向-攻防世界-no-strings-attached

    看题目就知道查找不到关键字符串,为防止踩坑,strings命令查看,没有找到有用的字符串.IDA载入程序查找入口函数, main函数中有4个函数,经过分析判断authenticate()为关键函数,跟 ...

  6. 攻防世界逆向——game

    攻防世界逆向:game wp 攻防世界逆向新手区的一道题目. 是一道windows的creak,动态调试打开是这样的: 题目说明是让屏幕上所有的图像都亮之后,会出现flag,看来应该是可以玩出来的. ...

  7. [转]Android逆向之动态调试总结

    一.在SO中关键函数上下断点 刚学逆向调试时.大多都满足于在SO中某关键函数上下断点.然后通过操作应用程序,去触发这个断点,然后进行调试 详细的步骤可以参见非虫大大的<Android软件安全与逆 ...

  8. 攻防世界 reverse evil

    这是2017 ddctf的一道逆向题, 挑战:<恶意软件分析> 赛题背景: 员工小A收到了一封邮件,带一个文档附件,小A随手打开了附件.随后IT部门发现小A的电脑发出了异常网络访问请求,进 ...

  9. 攻防世界 reverse 进阶 APK-逆向2

    APK-逆向2 Hack-you-2014 (看名以为是安卓逆向呢0.0,搞错了吧) 程序是.net写的,直接祭出神器dnSpy 1 using System; 2 using System.Diag ...

  10. Android trap攻防思路整理

    Android trap攻防                                                                      图/文 h_one 0x01 反 ...

随机推荐

  1. [转帖]Linux中find命令使用示例

    https://zhuanlan.zhihu.com/p/99170116 Linux查找命令是类Unix操作系统中最重要且最常用的命令行实用程序之一. 查找命令可以根据你设定的参数匹配的文件指定的条 ...

  2. [转帖]Guanaco, Llama, Vicuña, Alpaca该怎么区别

    https://zhuanlan.zhihu.com/p/106262896 在智利和秘鲁高原区经常会遇到的一种动物让人十分挠头,学术点称呼就是骆驼科其中一个族群--羊驼属和骆马属.头疼在于,分不清楚 ...

  3. [转帖]CPU缓存行

    https://www.jianshu.com/p/e338b550850f CPU缓存 执行程序是靠运行CPU执行主存中代码,但是CPU和主存的速度差异是非常大的,为了降低这种差距,在架构中使用了C ...

  4. [转帖]性能分析之TCP全连接队列占满问题分析及优化过程(转载)

    https://www.cnblogs.com/wx170119/p/12068005.html 前言 在对一个挡板系统进行测试时,遇到一个由于TCP全连接队列被占满而影响系统性能的问题,这里记录下如 ...

  5. 从零开始配置vim(31)——git 配置

    很抱歉又拖更了这么久了,在这个新公司我想快速度过试用期,所以大部分的精力主要花在日常工作上面.但是这个系列还是得更新下去,平时只能抽有限的业余时间来准备.这就导致我写这些文章就慢了一些. 废话不多说, ...

  6. vim 从嫌弃到依赖(2)——vim 模式

    在上一篇文章中我们获取到了neovim 并对它进行了基础配置.现在已经具备一般编辑器的基本功能了.让我们先学会如何使用vim基本功能进行编辑,后面再看如何进行配置,以达到某某IDE或者编辑器的效果 v ...

  7. linxu下面的绝对路径和相对路径

    绝对路径和相对路径 前言 相对路径与绝对路径 绝对路径 相对路径 目录的相关操作 绝对路径和相对路径 前言 学习linux,对于里面的路径肯定要很清楚.做下总结吧. 相对路径与绝对路径 绝对路径 路径 ...

  8. C# 实现对网站Get与Post请求

    C# 是一种面向对象的编程语言,提供了强大的Web请求库和API来执行 HTTP GET 和 POST 请求.在C#中,我们可以使用 System.Net 命名空间下的 WebRequest 和 We ...

  9. hadoop-3.0.0-cdh6.3.2源码编译实践

    1.编译过程 参考:https://blog.mygallop.cn/2020/10/centos/hadoop-cdh6-compile/ 2.问题记录 CDH6.3.2 Hadoop源码位置发生变 ...

  10. 英特尔发布酷睿Ultra移动处理器:Intel 4制程工艺、AI性能飙升

    英特尔今日发布了第一代酷睿Ultra移动处理器,是首款基于Intel 4制程工艺打造的处理器. 据了解,英特尔酷睿Ultra采用了英特尔首个用于客户端的片上AI加速器"神经网络处理单元(NP ...