第一道逆向题
大致流程就是,随机给你出几道题,题目是这样的:给你2个不是太大的数,求最小公因数,然后计算最小公因数+3的阶乘
所有题目回答正确并且用时小于30秒就能获得flag
讲真的,这种程度的题目我室友应该能2秒一道口算出结果
我算不了这么快,还是老老实实上python脚本吧
这里借用一下pwn题的模板
from pwn import *
from LibcSearcher import *
from struct import pack
context.os='linux'
context.arch='amd64'
context.log_level='debug'
sd=lambda x:io.send(x)
sl=lambda x:io.sendline(x)
ru=lambda x:io.recvuntil(x)
rl=lambda :io.recvline()
ra=lambda :io.recv()
rn=lambda x:io.recv(x)
sla=lambda x,y:io.sendlineafter(x,y)
def fun1(a,b):
r=0
i=1
while True:
if a<i or b<i:
break
if not(a%i) and not(b%i):
r=i
i=i+1
return r
def fun2(a):
if a!=0:
return a*fun2(a-1)
else:
return 1
io=remote('chall.csivit.com',30827)
while True:
t=ru(' ')[:-1]
if t=='fun()':
break
a=int(t)
b=int(rl()[:-1])
sl(str(fun2(fun1(a,b)+3)))
io.interactive()