Monster
Monster
Monster
# Made by Tarroot
# Instagram = tarroot.exe
DATABASE = r'database/btc/'
def generate_private_key():
return binascii.hexlify(os.urandom(32)).decode('utf-8').upper()
def public_key_to_address(public_key):
output = []
alphabet = '123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
var = hashlib.new('ripemd160')
encoding = binascii.unhexlify(public_key.encode())
var.update(hashlib.sha256(encoding).digest())
var_encoded = ('00' + var.hexdigest()).encode()
digest = hashlib.sha256(binascii.unhexlify(var_encoded)).digest()
var_hex = '00' + var.hexdigest() + hashlib.sha256(digest).hexdigest()[0:8]
count = [char != '0' for char in var_hex].index(True) // 2
n = int(var_hex, 16)
while n > 0:
n, remainder = divmod(n, 58)
output.append(alphabet[remainder])
for i in range(count): output.append(alphabet[0])
return ''.join(output[::-1])
def private_key_to_wif(private_key):
digest = hashlib.sha256(binascii.unhexlify('80' + private_key)).hexdigest()
var = hashlib.sha256(binascii.unhexlify(digest)).hexdigest()
var = binascii.unhexlify('80' + private_key + var[0:8])
alphabet = chars =
'123456789ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
value = pad = 0
result = ''
for i, c in enumerate(var[::-1]): value += 256**i * c
while value >= len(alphabet):
div, mod = divmod(value, len(alphabet))
result, value = chars[mod] + result, div
result = chars[value] + result
for c in var:
if c == 0: pad += 1
else: break
return chars[0] * pad + result
if args['verbose']:
print(address)
if address[-args['substring']:] in database:
for filename in os.listdir(DATABASE):
with open(DATABASE + filename) as file:
if address in file.read():
with open('Monster.txt', 'a') as monster:
monster.write('hex private key: ' + str(private_key) +
'\n' +
'WIF private key: ' +
str(private_key_to_wif(private_key)) + '\n'
'public key: ' + str(public_key) + '\n' +
'uncompressed address: ' + str(address) +
'\n\n')
break
def print_help():
print('''Monster homepage: instagram.com/tarroot.exe
Speed test:
execute 'python3 Monster.py time', the output will be the time it takes to
bruteforce a single address in seconds
substring: to make the program memory efficient, the entire bitcoin address is not
loaded from the database. Only the last <substring> characters are loaded. This
significantly reduces the amount of RAM required to run the program. if you still
get memory errors then try making this number smaller, by default it is set to 8.
This opens us up to getting false positives (empty addresses mistaken as funded)
with a probability of 1/(16^<substring>), however it does NOT leave us vulnerable
to false negatives (funded addresses being mistaken as empty) so this is an
acceptable compromise.
cpu_count: number of cores to run concurrently. More cores = more resource usage
but faster bruteforcing. Omit this parameter to run with the maximum number of
cores''')
sys.exit(0)
def timer(args):
start = time.time()
private_key = generate_private_key()
public_key = private_key_to_public_key(private_key, args['fastecdsa'])
address = public_key_to_address(public_key)
end = time.time()
print(str(end - start))
sys.exit(0)
if __name__ == '__main__':
args = {
'verbose': 0,
'substring': 8,
'fastecdsa': platform.system() in ['Linux', 'Darwin'],
'cpu_count': multiprocessing.cpu_count(),
}