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

    2017年陕西省网络空间安全技术大赛——人民的名义-抓捕赵德汉1——Writeup

  • 运行,观察外部特征:

    2017年陕西省网络空间安全技术大赛——人民的名义-抓捕赵德汉1——Writeup

    是一个要求输入正确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");
      }
     
  • 解题的思路如下:

    2017年陕西省网络空间安全技术大赛——人民的名义-抓捕赵德汉1——Writeup

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

    2017年陕西省网络空间安全技术大赛——人民的名义-抓捕赵德汉1——Writeup

  • flag即为flag{monkey99}

 

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

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

相关文章:

  • 2021-06-20
  • 2021-04-22
  • 2021-06-29
  • 2021-12-13
  • 2021-06-03
  • 2022-12-23
  • 2022-01-11
  • 2021-10-14
猜你喜欢
  • 2021-07-08
  • 2021-12-26
  • 2022-12-23
  • 2021-11-12
  • 2021-06-24
  • 2021-06-21
  • 2022-12-23
相关资源
相似解决方案