Skip to main content

package to solve POW(proof of work) with no pain

Project description

ez2bruteforce codecov

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ez2bruteforce-0.0.2.tar.gz (8.9 kB view hashes)

Uploaded Source

Built Distribution

ez2bruteforce-0.0.2-py3-none-any.whl (9.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page