一台神秘终端等待你的输入,你的输入会被终端经过未知逻辑处理生成内部密文。只有推理出整体处理规律,才能...

创建于:2026年5月6日

使用 GPT-5.5 Thinking 回答 Chat01

问题

attachment-8 (1).apk

一台神秘终端等待你的输入,你的输入会被终端经过未知逻辑处理生成内部密文。只有推理出整体处理规律,才能恢复正确的密钥并通过验证。找flag 样式是ISCC{}

思考

Finalizing base64 table logic and key rotation

I need to complete the base64 table construction. It first copies 64 characters from the base64 table, then calculates the sum of the key modulo 64. The code checks the base string and creates a substring based on an offset. Afterward, the string is rotated using the key sum, resulting in a rotated base64 table.

Thought for 5m 21s

思考

bash -lc python3 - <<'PY' from binascii import unhexlify

target='7qnnDZm85b05ef011cb4229154d3a' b64key='demo-5483' base='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' offset=sum(b64key.encode()) & 0x3f table=base[offset:]+base[:offset] print('offset', offset) print('table', table)

c1=target[:7] c2=target[7:19] c3=target[19:] print(c1,c2,c3,len(c3))

def custom_decode(s, table): bits=0; nbits=0; out=[] for ch in s: val=table.index(ch) bits=(bits<<6)|val nbits+=6 while nbits>=8: nbits-=8 out.append((bits>>nbits)&0xff) bits &= (1<<nbits)-1 return bytes(out)

def custom_encode(data, table): bits=0; nbits=0; out=[] for b in data: bits=(bits<<8)|b nbits+=8 while nbits>=6: nbits-=6 out.append(table[(bits>>nbits)&0x3f]) bits &= (1<<nbits)-1 if nbits: out.append(table[(bits<<(6-nbits))&0x3f]) return ''.join(out)

def rc4(data, key): key=list(key) S=list(range(256)); j=0 for i in range(256): j=(j+S[i]+key[i%len(key)]) & 0xff S[i],S[j]=S[j],S[i] i=j=0; out=[] for b in data: i=(i+1)&0xff j=(j+S[i])&0xff S[i],S[j]=S[j],S[i] K=S[(S[i]+S[j])&0xff] out.append(b^K) return bytes(out)

p1=custom_decode(c1, table) p2=rc4(bytes.fromhex(c2), b'onmlkjihg') xorkey=b'mnpkmlwlmno' p3=bytes(b ^ xorkey[i%len(xorkey)] for i,b in enumerate(bytes.fromhex(c3))) print('p1',p1) print('p2',p2) print('p3',p3) body=p1+p2+p3 print('body', body, body.decode('latin1')) flag='ISCC{'+body.decode('latin1')+'}' print('flag',flag)

verify

enc=custom_encode(p1,table)+rc4(p2,b'onmlkjihg').hex()+bytes(p3[i]^xorkey[i%len(xorkey)] for i in range(len(p3))).hex() print('enc',enc, enc==target) PY

Thought for 5m 37s

回答

找到的 flag 是:

text
ISCC{T@Aw0:,~}!m/Ge&W}

注意:中间那个 } 是 flag 内容的一部分,真正的结尾是最后一个 }

核心逻辑:Java 层只做格式检查,真正校验在 libmobile01.sobin.data 经过 AES/CBC 解密得到 demo-5483,用于生成自定义 Base64 表;native 将 ISCC{...} 内部内容分成三段处理:

  1. 前 5 字节:自定义 Base64,无 padding
  2. 中间 6 字节:RC4,key 为 onmlkjihg,再转 hex
  3. 剩余部分:XOR,key 为 mnpkmlwlmno,再转 hex

逆向目标密文:

text
7qnnDZm85b05ef011cb4229154d3a

得到内容:

text
T@Aw0:,~}!m/Ge&W

问题

attachment-11.zip

找flag,样式是ISCC{}

思考

Reversing shellcode transformation for flag extraction

To get the original flag, I need to reverse the transformations applied to the input bytes. For each byte, I must invert the operations applied by f1, f2, and f3. I also need to account for anti-debugging checks at the start of the shellcode, which use the BeingDebugged flag to detect debug environments. Once that's sorted, I can apply the inverse functions to deduce the correct byte values.

Thought for 1m 17s

回答

找到的 flag 是:

text
ISCC{:wY>Ful+|0MghBbYi+KqfCbZ1KYWkC}

简要逆向逻辑:

程序要求输入长度为 36,先对每个字符按索引做三层变换:

c
b = rol8(b ^ 0x55, 2) + i; b = (b ^ key[i % 8]) + 0x7f; b = b ^ (i + 0x20);

其中:

text
key = 12 34 56 78 90 ab cd ef

随后解密并执行一段 shellcode,shellcode 将变换后的 36 字节与目标字节逐位比较。逆向目标字节并反推原输入后得到:

text
ISCC{:wY>Ful+|0MghBbYi+KqfCbZ1KYWkC}

分享这个问答