-
-
Save WinMin/b93c7ee59a7bd0c7f2ed4aa5eed7e2d6 to your computer and use it in GitHub Desktop.
rwctf challenge Proof of work (PoW) solve script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
???
6
…---Original---
From: ***@***.***>
Date: Fri, Apr 21, 2023 21:16 PM
To: ***@***.***>;
Cc: ***@***.***>;
Subject: Re: WinMin/solve.py
@xirantian commented on this gist.
到此一游
—
Reply to this email directly, view it on GitHub or unsubscribe.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS or Android.
???
???
???
???wtf
huh?
???
???
???
rw666
???
?????
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
雀食蒙