A python based compressed file cracker
-
generate password from ASCII charset or custom charset using
charset
param -
multi-thread
-
git clone https://github.com/hanerx/rarCracker.git
-
run
pip install -r requirements.txt
-
make sure you have installed
winrar
orunar
orbsdstar
-
run
python -m rarCracker
- download file from release
- run
pip install rarCracker-0.0.1.tar.gz
- run
python -m rarCracker
- run
pip install rarCracker
from rarCracker import RarCracker
if __name__ == '__main__':
cracker = RarCracker('file_path', 3, 3, workers=2, charset='1234567890')
cracker.crack()
from rarCracker import RarCracker, LocalProvider
if __name__ == '__main__':
cracker = RarCracker('./test.rar', provider=LocalProvider('./dict.txt'), unrar_tool='unrar')
print(cracker.crack())
from rarCracker import RarCracker, NetworkProvider
if __name__ == '__main__':
cracker = RarCracker('./test.rar', provider=NetworkProvider('https://hanerx.top/rarCracker/dict.json',
method=NetworkProvider.GET))
print(cracker.crack())
from rarCracker import RarCracker, LocalProvider, LocalBreakPoint
if __name__ == '__main__':
cracker = RarCracker('./test.rar', provider=LocalProvider('./dict.txt'), unrar_tool='unrar',
break_point=LocalBreakPoint(breakpoint_count=1))
print(cracker.crack())
The main class for module
name | type | desc | default | required |
---|---|---|---|---|
file_path | str | the compressed file path, if file does not exist raise FileNotFoundError , if file is not .rar or .zip raise TypeError |
None | True |
start | int | the minimum password length | 1 | False |
stop | int | the maximum password length | 10 | False |
charset | str | the password charset | digits + ascii_letters + punctuation | False |
output | str | the output folder | './output' | False |
workers | int | the number of multi thread | 8 | False |
level | int | the logging display level | logging.INFO | False |
unrar_tool | str | the decompressing tool, support unrar \ unar \ bsdtar |
'unrar' | False |
provider | Provider | the password provider, if provider is not None it will replace original password generator and start \ stop \ charset will not work |
None | False |
-
The method which start cracking, will block until all threads done or password found, if crack failed it will return
None
-
return
None
orstr
-
The method which will return an iterator for password
-
return
iter
The abstract class for provider param
- The method which will return an iterator for password
- return
iter
The default password provider
name | type | desc | default | required |
---|---|---|---|---|
start | int | the minimum password length | 1 | False |
stop | int | the maximum password length | 10 | False |
charset | str | the password charset | digits + ascii_letters + punctuation | False |
- The method which will return an iterator for password
- return
iter
The class allows to get password from local dictionary
name | type | desc | default | required |
---|---|---|---|---|
path | str | the dictionary file path, if file does not exist raise FileNotFoundError |
None | True |
- The method which will return an iterator for password
- return
iter
The class allows to get password from network dictionary
name | type | desc | default | required |
---|---|---|---|---|
url | str | the url of the dictionary | None | True |
method | method | the method of request, support GET \ POST \ PUT \ DELETE \ OPTION \ HEAD |
NetworkProvider.GET | False |
on_decode | method | the decode method for response | self.default_decode(result) | False |
**kwargs | support params for requests module |
None | False |
- The method which will decode the response by default
- accept json format array, for example
["123","124","125"]
- return
list
- The method which will return an iterator for password
- return
iter
The abstract class for break_point param
- The method which will return a iterator for password with breakpoint supported
- return
iter
The default breakpoint when break_point param is None
- The method which will return a iterator for password with breakpoint supported
- return
iter
The breakpoint will save cracking count number into local file and recover the progress from local file
name | type | desc | default | required |
---|---|---|---|---|
breakpoint_path | str | the breakpoint file path, if file does not exist counter will start at 0 | './breakpoint.txt' | False |
breakpoint_count | int | the interval between two breakpoint | 1000 | False |