├── cracker.gif ├── README.md ├── LICENSE └── cracker.py /cracker.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bagherip/hack-like-print/HEAD/cracker.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hack-like-print 2 | A python code for visulizing the process of brute force cracking a key in one line. 3 | This code works fine in Unix shell. 4 | 5 | ![](cracker.gif) 6 | 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 bagherip 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cracker.py: -------------------------------------------------------------------------------- 1 | import string 2 | from random import choice 3 | from time import sleep 4 | 5 | # Gathers all ditis that should be shown while cracking 6 | digit_list = "".join((string.digits, 7 | string.ascii_lowercase, 8 | string.ascii_uppercase, 9 | string.punctuation)) 10 | 11 | # Defining the colors of the text in bash 12 | CBLINK = '\033[5m' 13 | CRED = '\33[31m' 14 | CEND = '\033[0m' 15 | GRN = '\33[92m' 16 | BOLD = ' \33[1m' 17 | WHITE = '\33[97m' 18 | 19 | # The "code" which should be cracked 20 | text = "$i5YPH0S " 21 | 22 | print("\n") 23 | for i, x in enumerate(text): 24 | for digit in digit_list: 25 | if digit != x: 26 | print("\r", 27 | (''.join(choice(digit_list) for _ in range(len(text)-1))), 28 | text[:i], end="", 29 | sep=(BOLD + 30 | CRED + 31 | CBLINK + 32 | "\r Key is being cracked: " + 33 | CEND), 34 | flush=True) 35 | sleep(0.016) 36 | 37 | sleep(1) 38 | print(WHITE+"\r Key has been cracked! ") 39 | print(BOLD + GRN + 40 | "\n [ A C C E S S G R A N T E D ]" + 41 | CEND + "\n") 42 | --------------------------------------------------------------------------------