Skip to content

Instantly share code, notes, and snippets.

@WinMin

WinMin/solve.py Secret

Last active January 27, 2024 13:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save WinMin/b93c7ee59a7bd0c7f2ed4aa5eed7e2d6 to your computer and use it in GitHub Desktop.
Save WinMin/b93c7ee59a7bd0c7f2ed4aa5eed7e2d6 to your computer and use it in GitHub Desktop.
rwctf challenge Proof of work (PoW) solve script
#!/usr/bin/env python3
from pwnlib.util.iters import mbruteforce
from hashlib import sha256
import string
import sys
"""
$ ncat -v [HOST] [PORT]
sha256("KOcNc"+"?") starts with 26bits of zero:
usage: $ python3 solve.py KOcNc
"""
prefixes = sys.argv[1]
def brute(cur):
content = prefixes + str(cur)
s = sha256(content.encode())
if s.hexdigest().startswith("000000") and int(s.hexdigest()[6:8], 16) < 0x40:
return True
return False
import pwn
res = mbruteforce(brute, string.ascii_lowercase + string.digits, method = 'upto', length=6, threads = 20)
print(res)
@kunle-create
Copy link

???

@B0ter
Copy link

B0ter commented Jan 7, 2023

wdf

@Ssh1y
Copy link

Ssh1y commented Jan 7, 2023

f**k

@LLeeeeeeee
Copy link

???

@DexterMorgan0417
Copy link

?????

@thek0d3r
Copy link

thek0d3r commented Jan 8, 2023

????

@YGCCZWMDSJ
Copy link

6

@dengguom
Copy link

66

@J-0k3r
Copy link

J-0k3r commented Jan 31, 2023

6

@SakuraiCora
Copy link

6

@SuperFengi
Copy link

qwq

@0rangec3t
Copy link

6

@remyhuang03
Copy link

哎呦

@xirantian
Copy link

到此一游

@LuffyS93
Copy link

6

@icecliffs
Copy link

@Kee02p
Copy link

Kee02p commented Apr 21, 2023

雀食蒙

@qaq648
Copy link

qaq648 commented Apr 21, 2023

???

@ZianTT
Copy link

ZianTT commented Apr 22, 2023 via email

@ek1ng
Copy link

ek1ng commented Apr 22, 2023

???

@Hatcat123
Copy link

???

@sd0ric4
Copy link

sd0ric4 commented Apr 22, 2023

???

@GUANZH1
Copy link

GUANZH1 commented Oct 21, 2023

???wtf

@parrot409
Copy link

huh?

@AlanHaffman
Copy link

???

@liudaxiaxd
Copy link

???

@K2Yk2y
Copy link

K2Yk2y commented Jan 27, 2024

???

@Gr-1m
Copy link

Gr-1m commented Jan 27, 2024

rw666

@5ime
Copy link

5ime commented Jan 27, 2024

???

@ML-hacker
Copy link

?????

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment