ctf逆向安卓篇

ctf逆向安卓篇

ID:42235227

大小:37.51 KB

页数:13页

时间:2019-09-11

ctf逆向安卓篇_第1页
ctf逆向安卓篇_第2页
ctf逆向安卓篇_第3页
ctf逆向安卓篇_第4页
ctf逆向安卓篇_第5页
资源描述:

《ctf逆向安卓篇》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、CTF逆向--安卓篇Androideasy使用APKToolBOX中的jadx打开该apk文件找到MainActivity查看主函数,如下所示packagecom.a.sample.androidtest;importandroid.content.Context;importandroid.os.Bundle;importandroid.support.v7.app.AppCompatActivity;importandroid.view.View;importandroid.view.View.OnClickListener;import

2、android.widget.EditText;importandroid.widget.Toast;publicclassMainActivityextendsAppCompatActivity{privateEditTexteditText;privatebyte[]s=newbyte[]{(byte)113,(byte)123,(byte)118,(byte)112,(byte)108,(byte)94,(byte)99,(byte)72,(byte)38,(byte)68,(byte)72,(byte)87,(byte)89,(byt

3、e)72,(byte)36,(byte)118,(byte)100,(byte)78,(byte)72,(byte)87,(byte)121,(byte)83,(byte)101,(byte)39,(byte)62,(byte)94,(byte)62,(byte)38,(byte)107,(byte)115,(byte)106};publicbooleancheck(){byte[]chars=this.editText.getText().toString().getBytes();if(chars.length!=this.s.lengt

4、h){returnfalse;}inti=0;while(iif(this.s[i]!=(chars[i]^23)){returnfalse;}i++;}returntrue;}protectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView((int)R.layout.activity_main);finalContextcontext=this;this.editText=(EditText)findViewB

5、yId(R.id.edit_text);findViewById(R.id.button).setOnClickListener(newOnClickListener(){publicvoidonClick(Viewv){if(MainActivity.this.check()){Toast.makeText(context,'Yougottheflag!',1).show();}else{Toast.makeText(context,'Sorryyourflagiswrong',1).show();}}});}}查看onClick函数,其中

6、调用了check函数,check函数中将用户输入的字符串与23进行异或,然后与数组s进行比较,判断其是否一致。所以我们可以写出flag脚本s=[113,123,118,112,108,94,99,72,38,68,72,87,89,72,36,118,100,78,72,87,121,83,101,39,62,94,62,38,107,115,106]flag=''foriins:flag+=chr(i^0x17)printflagFlag:flag{It_1S_@N_3asY_@nDr0)I)1

7、d}DDAndroidEasy拖进APKTo

8、olBOX的jadx中,找到FlagActivity,如下所示packagecom.didi_ctf.flagapp;importandroid.os.Bundle;importandroid.support.v7.a.d;importandroid.view.View;importandroid.widget.TextView;publicclassFlagActivityextendsd{privatestaticStringm='com.didi_ctf.flagapp.FlagActivity';privatestaticfinalb

9、yte[]p=newbyte[]{(byte)-40,(byte)-62,(byte)107,(byte)66,(byte)-126,(byte)103,(byte

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。