CTFshow 2023 ——愚人杯 Re题解

简介: CTFshow 2023 ——愚人杯 Re题解

1.easy_pyc

反编译

使用python反编译 - 在线工具反编译得到源代码

#!/usr/bin/env python
# visit https://tool.lu/pyc/ for more information
# Version: Python 2.7
print 'Welcome to CTFshow Re!'
print 'your flag is here!'
flag = ''
l = len(flag)
for i in range(l):
    num = ((flag[i] + i) % 114514 + 114514) % 114514
    code += chr(num)
code = map(ord, code)
for i in range((l - 4) + 1):
    code[i] = code[i] ^ code[i + 1]
print code
code = [
    '%16',
    '%1d',
    '%1e',
    '%1a',
    '%18',
    '\t',
    '%ff',
    '%d0',
    ',',
    '%03',
    '%02',
    '%14',
    '8',
    'm',
    '%01',
    'C',
    'D',
    '%bd',
    '%f7',
    '*',
    '\r',
    '%da',
    '%f9',
    '%1c',
    '&',
    '5',
    "'",
    '%da',
    '%d4',
    '%d1',
    '%0b',
    '%c7',
    '%c7',
    '%1a',
    '%90',
    'D',
    '%a1']

wp

Python提取一下数据的ASCLL值

data = ['\x16', '\x1d', '\x1e', '\x1a', '\x18', '\t', '\xff', '\xd0', ',', '\x03', '\x02', '\x14', '8', 'm', '\x01', 'C', 'D', '\xbd', '\xf7', '*', '\r', '\xda', '\xf9', '\x1c', '&', '5', "'", '\xda', '\xd4', '\xd1', '\x0b', '\xc7', '\xc7', '\x1a', '\x90', 'D', '\xa1']
code=list(map(ord,data))
print(code)

C++逆向两段循环

#include<iostream>
using namespace std;
int main(){
  int code[]={22, 29, 30, 26, 24, 9, 255, 208, 44, 3, 2, 20, 56, 109, 1, 67, 68, 189, 247, 42, 13, 218, 249, 28, 38, 53, 39, 218, 212, 209, 11, 199, 199, 26, 144, 68, 161};
  int s=sizeof(code)/sizeof(int);
  for(int i=s-3;i>=1;i--)
    code[i-1]=code[i-1]^code[i];
  for(int i=0;i<s;i++){
    int a=(code[i]-i)%114514;
    printf("%c",a); 
  }
  return 0;
}

Python

data = ['\x16', '\x1d', '\x1e', '\x1a', '\x18', '\t', '\xff', '\xd0', ',', '\x03', '\x02', '\x14', '8', 'm', '\x01', 'C', 'D', '\xbd', '\xf7', '*', '\r', '\xda', '\xf9', '\x1c', '&', '5', "'", '\xda', '\xd4', '\xd1', '\x0b', '\xc7', '\xc7', '\x1a', '\x90', 'D', '\xa1']
code=list(map(ord,data))
l=len(code)
flag=''
for i in range(l-3,0,-1):
    code[i-1]=code[i-1]^code[i];
for i in range(l):
    flag+=chr((code[i]-i)%114514)
print(flag)

ctfshow{Just_F00l's_D@y_R3_Ch3ck-in!}

相关文章
|
数据安全/隐私保护
[羊城杯 2020]easyre 1题解
buuctf-[羊城杯 2020]easyre 1题解
350 0
[羊城杯 2020]easyre 1题解
|
10月前
【USACO题库】1.2.1 Milking Cows挤牛奶
【USACO题库】1.2.1 Milking Cows挤牛奶
49 0
|
1月前
|
Java
【LeetCode-六月每日一题-】-回文数
【LeetCode-六月每日一题-】-回文数
|
10月前
|
安全 Shell PHP
ctfshow原谅杯
ctfshow原谅杯
109 0
|
10月前
|
编解码 Shell PHP
Ctfshow [单身杯]
Ctfshow [单身杯]
104 0
|
11月前
|
C++
【PTA天梯赛】L1-011 —— L1-020 c++ 题解
【PTA天梯赛】L1-011 —— L1-020 c++ 题解
284 0
|
存储 C++
【PAT甲级 - C++题解】1036 Boys vs Girls
【PAT甲级 - C++题解】1036 Boys vs Girls
57 0
|
C++
【PAT甲级 - C++题解】1005 Spell It Right
【PAT甲级 - C++题解】1005 Spell It Right
50 0
|
C++
【PAT甲级 - C++题解】1061 Dating
【PAT甲级 - C++题解】1061 Dating
55 0
|
存储 Go
新年快乐题解
新年快乐题解
74 0
新年快乐题解