[WP]xctf-parallel-comparator-200
1、查看源代码
2、由check函数可以得到
//argument[i] = (first_letter + difference[i]) ^ user_string[i]
//generated_string[i] = argument[i] + just_a_string[i]
//generated_string[i] == just_a_string[i]
由这三个式子我们可以得到 argument[i] 为0,也就是 first_letter + difference[i] 与 user_string[i] (输入) 相等
因此由first_letter 和 difference[i] 我们便能求出 flag
3、根据条件遍历 first_letter 取值便能构造 EXP
1 a = [115, 116, 114, 97, 110, 103, 101, 95, 115, 116, 114, 105, 110, 103, 95, 105, 116, 95, 105, 115] # just_string 2 b = [0, 9, -9, -1, 13, -13, -4, -11, -9, -1, -7, 6, -13, 13, 3, 9, -13, -11, 6, -7] # difference 3 c = [] 4 for i in range(97, 123): # i --> first_letter 5 flag = '' 6 for j in range(20): 7 s = b[j] + i 8 flag += chr(s) 9 print(flag)