zoukankan      html  css  js  c++  java
  • 2017年陕西省网络空间安全技术大赛——人民的名义-抓捕赵德汉1——Writeup

    • 下载文件,die和binwalk都显示文件确实是jar包

    • 运行,观察外部特征:

      是一个要求输入正确password的程序

    • jd-jui打开jar包,分析代码逻辑,找到两端关键代码:

       
       
       
       
       
      x
       
       
       
        public static void main(String[] args)
          throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException
        {
          CheckInterface checkerObject = loadCheckerObject();
          
          BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
          for (;;)
          {
            System.out.println("Enter password:");
            String line = stdin.readLine();
            if (checkerObject.checkPassword(line))
            {
              System.out.println("Well done, that is the correct password");
              System.exit(0);
            }
            else
            {
              System.out.println("Incorrect password");
            }
          }
        }
       
       
       
       
       
       
      x
       
       
      publicbooleancheckPassword(Stringinput)
        {
          MessageDigestmd5Obj=null;
          try
          {
            md5Obj=MessageDigest.getInstance("MD5");
          }
          catch (NoSuchAlgorithmExceptione)
          {
            System.out.println("Hash Algorithm not supported");
            System.exit(-1);
          }
          byte[] hashBytes=newbyte[40];
          md5Obj.update(input.getBytes(), 0, input.length());
          hashBytes=md5Obj.digest();
          returnbyteArrayToHexString(hashBytes).equals("fa3733c647dca53a66cf8df953c2d539");
        }
       
    • 解题的思路如下:

    • 那么只需将字符串fa3733c647dca53a66cf8df953c2d539进行MD5解密即可

    • flag即为flag{monkey99}

    本题中虽然定义的函数很多,但从主函数逐个分析可以看出关键的只有两个

    checkPassword()函数中调用了大量的Java库函数,看不懂的函数百度即可

  • 相关阅读:
    3.3 直方图处理与函数绘图
    光头强
    考试代码模板
    【2015初赛】预备
    NOIP2018 模拟题
    NOIP2017 模拟赛
    【解题报告】树形DP入门
    【解题报告】区间DP
    【解题报告】树形背包
    二分刷题单
  • 原文地址:https://www.cnblogs.com/WangAoBo/p/6736915.html
Copyright © 2011-2022 走看看