吾愛論壇2023年春節(jié)紅包安卓題,隨便玩一玩;
https://www.52pojie.cn/thread-1738015-1-1.html
第四題:https://www.52pojie.cn/home.php?mod=task&do=view&id=23
首先我們下載后,打開apk看下界面提示情況;
看界面是用到了, 你的吾愛uid 以及計(jì)算出來的flag 進(jìn)行效驗(yàn);
先定位到方法,我們又看到,用到了MD5加密和 base64;
還是先看方法邏輯吧:
obj也就是第一個(gè)輸入框的內(nèi)容,那不就是uid嗎
String obj = StringsKt.trim((CharSequence) editText.getText().toString()).toString();
后面這個(gè)就是第二個(gè)輸入框,flag
StringsKt.trim((CharSequence) editText2.getText().toString()).toString())
進(jìn)入a.m25B方法:
uid -> str ->encode ->c.cipher(mD5Utils.MD5(base64Utils.encodeToString(bytes)), 5)
flag -> str2 -> substring
顯然這個(gè)方法是 返回一個(gè) bool類型結(jié)果,那就是 true | false;
又看到最后確實(shí)是比對這兩個(gè)值:
分析其邏輯,我們只要知道,c.cipher(mD5Utils.MD5(base64Utils.encodeToString(bytes)), 5)
就是比對的結(jié)果;
分析運(yùn)算邏輯:
將 uid + “Wuaipojie2023” 進(jìn)行 encode 方法運(yùn)算:
public static String encode(String str) {
int length = str.length();
char[] cArr = new char[length];
int i = length - 1;
while (i >= 0) {
int i2 = i - 1;
cArr[i] = (char) (str.charAt(i) ^ '5');
if (i2 < 0) {
break;
}
i = i2 - 1;
cArr[i2] = (char) (str.charAt(i2) ^ '2');
}
return new String(cArr);
}
后轉(zhuǎn)bytes進(jìn)行base64編碼;
====這里的base64也都是標(biāo)準(zhǔn)的,無魔改,無改碼表;
然后將base64之后進(jìn)行md5加密,加密后得出32位值,再用 cipher 做運(yùn)算;
public final String cipher(String str, int i) {
Intrinsics.checkNotNullParameter(str, "str");
StringBuilder sb = new StringBuilder();
int length = str.length();
for (int i2 = 0; i2 < length; i2++) {
if (Intrinsics.compare((int) str.charAt(i2), 65) >= 0 && Intrinsics.compare((int) str.charAt(i2), 90) <= 0) {
sb.append(cipher(str.charAt(i2), i));
} else if (Intrinsics.compare((int) str.charAt(i2), 97) < 0 || Intrinsics.compare((int) str.charAt(i2), 122) > 0) {
sb.append(str.charAt(i2));
} else {
sb.append(cipher(str.charAt(i2), i));
}
}
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "sb.toString()");
return sb2;
}
運(yùn)算之后:
那就是 cipher之后:h8203kj86395hf8677jgj599ki82g0i9;
那么格式就是 flag{cipher之后的值了} ;文章來源:http://www.zghlxwxcb.cn/news/detail-520991.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-520991.html
到了這里,關(guān)于吾愛2023新年紅包題第四題的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!