当前位置:网站首页>[VNCTF 2022]ezmath wp
[VNCTF 2022]ezmath wp
2022-07-06 17:20:00 【bestkasscn】
[VNCTF 2022]ezmath wp
One sha256 Blast + A mathematical problem , You can go to baidu , The answer is num * 4, But looking at the source code, you can find that you want to submit 777 Secondary answer , So we can only write scripts to solve , This kind of interactive question is generally to nc The server , You can also use python Third party Library in pwntools.
exp
from hashlib import sha256
import random
from pwn import *
import string
# Create a dictionary of upper and lower case letters and numbers
dir = string.ascii_letters + string.digits
# Change the environment yourself
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)
# Burst four digit string
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
# Decryption of mathematical problems
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))
边栏推荐
- Use of mongodb in node
- 唯有学C不负众望 TOP5 S1E8|S1E9:字符和字符串&&算术运算符
- February database ranking: how long can Oracle remain the first?
- 1. Introduction to JVM
- Design of DS18B20 digital thermometer system
- Only learning C can live up to expectations top2 P1 variable
- The daemon thread starts redis and modifies the configuration file
- Interpretation of Flink source code (III): Interpretation of executiongraph source code
- 程序员定位解决问题方法论
- 【逆向】脱壳后修复IAT并关闭ASLR
猜你喜欢
Wu Jun trilogy insight (IV) everyone's wisdom
Activiti目录(三)部署流程、发起流程
Resume of a microservice architecture teacher with 10 years of work experience
肖申克的救赎有感
The daemon thread starts redis and modifies the configuration file
字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
Flink 解析(四):恢复机制
Activit fragmented deadly pit
Ruoyi-Cloud 踩坑的BUG
Serial serialold parnew of JVM garbage collector
随机推荐
TCP的三次握手和四次挥手
Typescript basic operations
Flink parsing (VI): savepoints
吴军三部曲见识(四) 大家智慧
Log4j2 major vulnerabilities and Solutions
JS garbage collection mechanism and memory leakage
字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
Activit零零碎碎要人命的坑
Resume of a microservice architecture teacher with 10 years of work experience
Interview collection library
汇编课后作业
JVM 垃圾回收器之Garbage First
EasyRE WriteUp
Flink 解析(三):内存管理
Learn the wisdom of investment Masters
關於Stream和Map的巧用
连接局域网MySql
DOS 功能调用
数据仓库建模使用的模型以及分层介绍
8086 CPU 内部结构