当前位置:网站首页>[VNCTF 2022]ezmath wp
[VNCTF 2022]ezmath wp
2022-07-06 09:33:00 【bestkasscn】
[VNCTF 2022]ezmath wp
一个sha256爆破+一个数学问题,可以去百度一下,得到答案就是num * 4,但是查看源码可以发现要提交777次答案,所以只能写脚本来解决,这类交互题一般是去nc服务器,也可以使用python中的第三方库pwntools。
exp
from hashlib import sha256
import random
from pwn import *
import string
# 创建由大小写字母和数字组成的字典
dir = string.ascii_letters + string.digits
# 自己改环境
p = remote("node4.buuoj.cn", 27166)
p.recvuntil('[+] sha256(XXXX+')
salt = p.recv(16).strip().decode()
p.recvuntil(') == ')
hash = p.recv(64).strip().decode()
print('salt: %s' % salt)
print('target hash: %s' % hash)
# 爆破四位字符串
while True:
rand_str = (''.join([random.choice(dir) for _ in range(4)])) + salt
if sha256(rand_str.encode()).hexdigest() == hash:
print(rand_str[:4])
p.sendlineafter('[+] Plz Tell Me XXXX :', rand_str[:4])
break
# 数学题解密
for i in range(777):
p.recvuntil("plz give me the ")
count = p.recv(10).strip().decode()
count = int(count)
res = str(count*4)
p.recvuntil('th (n) that satisfying (2^n-1) % 15 == 0 (the 1st 2^n-1 is 15):')
p.sendline(res)
p.recvuntil('You get flag!')
print(p.recvlines(2))
边栏推荐
猜你喜欢

Wu Jun trilogy insight (IV) everyone's wisdom

学习投资大师的智慧

IDEA断点调试技巧,多张动图包教包会。

8086 CPU internal structure

Flink源码解读(二):JobGraph源码解读

Activiti directory (IV) inquiry agency / done, approved
![[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.](/img/ef/2072aac5f85c7daf39174784dec7ee.jpg)
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.

Activiti directory (V) reject, restart and cancel process

原型链继承

JVM 垃圾回收器之Serial SerialOld ParNew
随机推荐
连接局域网MySql
Login to verify the simple use of KOA passport Middleware
Flink 解析(三):内存管理
学习投资大师的智慧
原型链继承
登陆验证koa-passport中间件的简单使用
Design of DS18B20 digital thermometer system
List集合数据移除(List.subList.clear)
vscode
yum install xxx报错
暑假刷题嗷嗷嗷嗷
肖申克的救赎有感
JVM类加载子系统
Shawshank's sense of redemption
JVM garbage collector part 1
手把手带你做强化学习实验--敲级详细
arithmetic operation
SQL调优小记
Flink 解析(二):反压机制解析
Akamai 反混淆篇