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库函数,看不懂的函数百度即可

  • 相关阅读:
    [转]script之defer&async
    css3渐变gradient
    [转]提高 web 应用性能之 CSS 性能调优
    [转]深入了解 CSS3 新特性
    进程中t.start(), t.daemon() t.jion()的使用
    创建进程
    进程与进程之间通信Manager
    简版线程池
    Python上下文管理
    绝版线程池
  • 原文地址:https://www.cnblogs.com/WangAoBo/p/6736915.html
Copyright © 2011-2022 走看看