测试文件:https://static2.ichunqiu.com/icq/resources/fileupload//CTF/JCTF2014/re100

1.准备

获得信息

  • ZIP文件
  • Java文件

用解压文件打开

获得信息

  • APK文件

2.Smali2JavaUI打开

 /**
* Generated by smali2java 1.0.0.558
* Copyright (C) 2013 Hensence.com
*/ package com.example.encoding; import android.app.Activity;
import android.widget.Button;
import android.widget.EditText;
import java.security.NoSuchAlgorithmException;
import java.security.MessageDigest;
import android.util.Base64;
import android.os.Bundle;
import android.view.View;
import android.view.Menu;
import android.view.MenuInflater; public class MainActivity extends Activity {
private Button button;
private MyDialog dialog1;
private MyDialog dialog2;
private MyDialog dialog3;
private EditText edittext;
private StringBuffer str; protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(0x7f030000);
dialog1 = new MyDialog(this, "try again");
dialog2 = new MyDialog(this, "congratulations, you success!!!");
dialog3 = new MyDialog(this, "sorry,please try again");
edittext = (EditText)findViewById(0x7f080000);
button = (Button)findViewById(0x7f080001);
button.setOnClickListener(new View.OnClickListener(this) { 1(MainActivity p1) {
} public void onClick(View v) {
MyDialog dialog3 = this$0new StringBuffer(edittext.getText().toString());
str = localString1;
if(str.length() < 0x5) {
edittext.setText("");
dialog1.showDialog();
return;
}
str.reverse();
Log.i("ClownQiang", localString1.append(new String(str)).toString());
String md5_string = encode(new String(str));
Log.i("ClownQiang", str);
String base64 = getBASE64(md5_string).trim();
Log.i("ClownQiang", md5_string);
if(base64.equalsIgnoreCase("NzU2ZDJmYzg0ZDA3YTM1NmM4ZjY4ZjcxZmU3NmUxODk=")) {
dialog2.showDialog();
return;
}
edittext.setText("");
dialog3.showDialog();
}
});
} public static String getBASE64(String s) {
if(s == null) {
return null;
}
return Base64.encodeToString(getBytes(), 0x0);
} public static final String encode(String s) {
// :( Parsing error. Please contact me.
} public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(0x7f070000, menu);
return true;
}
}

3.代码分析

提取出主要的代码

str.reverse();//字符串反向
Log.i("ClownQiang", localString1.append(new String(str)).toString());
String md5_string = encode(new String(str));//md5加密
Log.i("ClownQiang", str);
String base64 = getBASE64(md5_string).trim();//base64加密
Log.i("ClownQiang", md5_string);
if(base64.equalsIgnoreCase("NzU2ZDJmYzg0ZDA3YTM1NmM4ZjY4ZjcxZmU3NmUxODk=")) {
dialog2.showDialog();
return;
}

根据代码,我们只需要将经过md5和base64加密后的字符串"NzU2ZDJmYzg0ZDA3YTM1NmM4ZjY4ZjcxZmU3NmUxODk="解密后反向即可。

base64解密:756d2fc84d07a356c8f68f71fe76e189

md5解密:}321nimda{galflj

反向输出:jlflag{admin123}

 

4.get flag!

flag{admin123}

JCTF 2014 小菜一碟的更多相关文章

  1. JCTF 2014 小菜两碟

    测试文件:https://static2.ichunqiu.com/icq/resources/fileupload//CTF/JCTF2014/re200 参考文章:https://blog.csd ...

  2. JCTF 2014(Reverse)

    小菜一碟: 点击下载附件 下载的附件没有后缀,用c32打开看看 是apk文件,用Smali2JavaUI打开 程序把输入框的字符串反转,然后进行MD5加密,最后进行base64编码,与NzU2ZDJm ...

  3. ▲教你如何轻易的做linux计划任务▲——小菜一碟

    一次性计划任务的安排: at :安排作业在某一时刻执行一次(一般都是用它) batch:安排作业在系统负载不重时执行一次 第一步: #service atd start  开启一次性计划任务   at ...

  4. JCTF 2014(Misc)

    小试身手: 点击下载附件 res/raw/hehe,打开 得到flag

  5. 转载:iOS开发之让你的应用“动”起来

    在iOS中随处都可以看到绚丽的动画效果,实现这些动画的过程并不复杂,今天将带大家一窥iOS动画全貌.在这里你可以看到iOS中如何使用图层精简非交互式绘图,如何通过核心动画创建基础动画.关键帧动画.动画 ...

  6. iOS开发系列--让你的应用“动”起来

    --iOS核心动画 概览 在iOS中随处都可以看到绚丽的动画效果,实现这些动画的过程并不复杂,今天将带大家一窥iOS动画全貌.在这里你可以看到iOS中如何使用图层精简非交互式绘图,如何通过核心动画创建 ...

  7. [翻译]用 Puppet 搭建易管理的服务器基础架构(4)

    我通过伯乐在线翻译了一个Puppet简明教程,一共分为四部分,这是第四部分. 原文地址:http://blog.jobbole.com/89214/ 本文由 伯乐在线 - Wing 翻译,黄利民 校稿 ...

  8. 如何读懂复杂的C语言声明

    本文已迁移至: http://www.danfengcao.info/c/c++/2014/02/25/howto-understand-complicated-declaration-of-c.ht ...

  9. Google推荐的图片加载库Glide介绍

    英文原文 Introduction to Glide, Image Loader Library for Android, recommended by Google 译文首发  http://jco ...

随机推荐

  1. vue-cli3.0配置

    仅在项目根目录中新建vue.config.js文件即可,部分配置如下 module.exports = { // 基本路径 baseUrl: '/', // 输出文件目录 outputDir: 'di ...

  2. 举个例子去理解vuex(状态管理),通俗理解vuex原理,通过vue例子类比

    通俗理解vuex原理---通过vue例子类比   本文主要通过简单的理解来解释下vuex的基本流程,而这也是vuex难点之一. 首先我们先了解下vuex的作用vuex其实是集中的数据管理仓库,相当于数 ...

  3. 【CF10D】LCIS(LCIS)

    题意:求两个序列的LCIS n,m<=300,a[i]<=1e9 题意:O(n^2) O(n^3)的话设dp[i,j]为A终点为a[1..i]且B终点为b[j]的最大长度,分a[i]==b ...

  4. WWDC2017-advanced_animations_with_uikit

    最后修改时间: 2017-12-1 官方视频链接 这个Session主要讲一下的几个内容: Basic(基础的): 动画工作原理 以及 动画如何计时 Interactive and Interrupt ...

  5. Customizable Route Planning

    w https://www.microsoft.com/en-us/research/wp-content/uploads/2011/05/crp-sea.pdf 1 Introduction The ...

  6. Visual Studio Code - 在 JS 源码(TS、压缩前代码)上使用断点

    步骤: 在构建工具(webpack.gulp 等)的配置中开启生成 source map 将 VSCode 配置中的debug.allowBreakpointsEverywhere设置为true(重要 ...

  7. 010-Spring Boot 扩展分析-ApplicationContextInitializer、CommandLineRunner、ApplicationRunner

    一.常见的两个扩展点 1.ApplicationContextInitializer 1.1.作用实现 作用:接口实在Spring容器执行refresh之前的一个回调. Callback interf ...

  8. Delphi XE2 之 FireMonkey 入门(17) - 特效

    刚打开 XE2 时, 就从 Tool Palette 窗口的 Effects 组中发现洋洋洒洒的六十多个特效... 每个特效分别对应一个类, 分别来自 FMX.Effects 和 FMX.Filter ...

  9. JMeterContext----上下文

    http://jmeter.apache.org/api/org/apache/jmeter/threads/JMeterContext.html org.apache.jmeter.threads ...

  10. Machine Learning 文章导读

    Machine Learning Algorithms Linear Regression and Gradient Descent Local Weighted Regression Algorit ...