标签:add input parent clear throws display 定义 property aaa
下载文件,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库函数,看不懂的函数百度即可
2017年陕西省网络空间安全技术大赛——人民的名义-抓捕赵德汉1——Writeup
标签:add input parent clear throws display 定义 property aaa
原文地址:http://www.cnblogs.com/WangAoBo/p/6736915.html