package to solve POW(proof of work) with no pain
Project description
ez2bruteforce
ez2bruteforce is a python package that allows you to bruteforce the POW(proof of the work) stage in CTF game. You can specify the char table, bruteforce length and the position and then use bruteforce to crack its hash digtest.
pypi home page:https://pypi.org/project/ez2bruteforce/
Example
If you have known the hash of the digtest, like this:
import hashlib
cipher = hashlib.sha1(b"Dear XXX:")
# cipher = b"\xf0\x1d\xb9\xe9|Xh\x84\xdb\r\xb0'\xa7\x80\xdc\x07\xbc\xca_`"
Then you can use ez2bruteforce to crack it.
BfItem(3, string.ascii_letters)
means the bruteforce length is 3, and the char table is " all ascii letter.
sha1_solver(problem,cipher)
will return the original string if the hash is correct.
from ez2bruteforce import BfItem,Problem,sha1_solver
import string
cipher = b"\xf0\x1d\xb9\xe9|Xh\x84\xdb\r\xb0'\xa7\x80\xdc\x07\xbc\xca_`"
problem = Problem(["Dear ",BfItem(3,string.ascii_letters),":"])
result = sha1_solver(problem,cipher)
# result = b'Dear abc:'
Also, you can pass your own hash function into the generic_solver
.
from ez2bruteforce import BfItem,Problem,generic_solver
from base64 import b64decode,b64encode
cipher = b64encode(b'abc')
problem = Problem([BfItem(3,"abcdefg")])
result = generic_solver(problem,cipher,b64encode)
# result = b'abc'
TODO
- tpye-stub support
- Muti-threading support
- Add
import *
support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ez2bruteforce-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e23bd02ceb6f40b29a569e8eb9f771164375f729e9f8c06069c3849eea324212 |
|
MD5 | ef6d8fe9aca0e1d2aa5d20b0bc26f2a7 |
|
BLAKE2b-256 | 0404a926211b6b6902b2a842e34069105fff5a7c7b563587f1bb5c80ee5306d0 |