Greetings neighbor. My name’s Crazy Dave but you can just call me Crazy Dave. I found this weird website that seems to represent something. Says something about taco as a reward Can you find whatever the code is and hand it to me? I could really go for a taco right now
wp
从源码中找到关键加密部分:
1 2 3 4 5 6 7 8
withopen("flag.txt") as f: flag = bytearray(f.read().encode()) flag_str = "" for b in flag: b = b << 4 ^ ((b << 4 & 0xFF) >> 4) bm = 1 << random.randint(0, 11) cb = b ^ bm flag_str += bin(cb)[2:].zfill(12)
defsolve(): binstr_list = [ "111000100010011000110111011000010011011000111011011100000100011101100110011010111011111011101110000100000000011101100111001011010101010110001000010001000101011110100010001000110011001101110111011000110011001011111101010000000010101011011101011100000100011000010101011001110011011011011111011011011101111000110011010001010111011110001001011010011000011000101010011011100110010000100010011010101010000010011001010010001100011110101010011110101000010010010001010010101000011100001000011101100111011000100000010101100111010010101000011100000010010110101000011111011111", "001000100010011000110010011000010101011000110111011101000101011001100111011010111011011111101110001101000000001101110111011011011101010010101000010001110101011100100011101100110011001001110011011000110011011011011101110000000000001010011101011101000101010000010001011000010011111011111111101011011101111000110011010001100111001110001000011010001010011000110010011011101111010110100010001110101010010010001001010010001001110110101010001110101010010010011011010010000000111100000000011111100110111000100010010101111111011010101010011110000000010111101010011111111101", "011100100010011000110111011000000001011100110011001101000100011001000110010110111011011001101110001100000010011101110011001011011100010011001000000001010101111100100010001100010011001001110011011100100011001011011100000000000000001011011111011101000000001000010001011000110010011011011111011011011101011100110011010001111111011111001000011010001010011000100011011011101010010100000010011111101010010010011011000010001000010100101010011110101000000010011001010010011000011100010000011101000110011000100110010100110111011010101010011000000000010110111010011111011001", "001000100010001000110011011000110001011000110010011001000100011001100100011010111011011011101111001000000000011111110111001011001101010010011000010001011101010100100010001100100011001001110110001100110011001011111101110000000000001011011001011101100100011000000001011000111011011111111111000011011101001000110011010101110111011110101000001010001000011000100110010011101110010110100010011110111010010010010001011010001000110110101010011110111010010000011001010010000000011101000000011101100010011000000010010101110011010010101000111100000000000110101010011111011001", "011001100010011000110111011000010000011000110010011111000100011001110110011110111111011011101111001110000000111101110111001011011001010010011000010001000101011100000010001100111011001001110110001100110011001111011101010100000000011011011101011100000100011000010101011010110011011011111101001011011111011001110011000001110111111110001000011000001000011001100010011011001110010101100010001110101010011010011001010010000000010110101000011110101000011010011001011010001000011000000000011001100110011000100110010001110111010010111010011100001000110110101010011111001101", "011000100000011000110001011000010000011010110011011111000100001001100110011111111011011011100110101100000000010101110111101011011101000010001000010001010001011100100011101100110011001001111111011100110111001011011001010001000000001011011001011101010100011000010000011000110010011011111101001011011111111000110011110001110111011110011000011010001100011000110010011111101110011100100010011110111010010110011001010010001100010110101110011110001010011010011001010011001000011100000010011101101110011001100010010101110110000010101010001100000000010110100010111111011101", ] suspicious = [] decode_dict = {} for b inbytearray(string.printable.encode()): c = b << 4 ^ ((b << 4 & 0xFF) >> 4) decode_dict[c] = chr(b) masks = [1 << i for i inrange(12)]
for binstr in binstr_list: bin_list = [binstr[i : i + 12] for i inrange(0, len(binstr), 12)] # 12位分组 for bin_segment in bin_list: e = int(bin_segment, 2) sus = "" for mask in masks: masked_value = e ^ mask if masked_value in decode_dict: sus += decode_dict[masked_value] suspicious.append(sus)
for i inrange(num_segments): find = False for char in suspicious[i]: if find: break for k inrange(segment_length): if char notin suspicious[k * num_segments + i]: break else: print(char, end="") find = True
flag : bcactf{Wr1tING_pyJaiL5_iS_hArD_f56450aadefcc}
webex
phone-number
描述
I was trying to sign into this website, but now it’s asking me for a phone number. The way I’m supposed to input it is strange. Can you help me sign in? My phone number is 1234567890
题目让我们给 1234567890打电话,但是前端无法输入,简单干掉三个限制就可以拿到flag了。
“User #1”
wp
进到界面,发现是一个sql注入题,应该是让我们修改自己的id值。 先输入双引号进行闭合,得到报错信息unrecognized token: ""1"" WHERE id=1" 接下来分别构造两个语句,修改admin的id值和自己的id值 1",id = 2 WHERE id=0--,1",id = id-1-- 得到flagbcactf{g3t_BEtA_t3StERs_f6a71451d481a8}
NoSQL
描述
I found this database that does not use SQL, is there any way to break it?