-
Notifications
You must be signed in to change notification settings - Fork 0
/
ethcollider.py
83 lines (72 loc) · 2.45 KB
/
ethcollider.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
#!/usr/bin/env python
# coding=utf8
from lib.ECDSA_BTC import *
import lib.python_sha3
import requests
import json
import os
import sys
def hexa(cha):
hexas=hex(cha)[2:-1]
while len(hexas)<64:
hexas="0"+hexas
return hexas
def hashrand(num):
#return sha256 of num times 256bits random data
rng_data=''
for idat in xrange(num):
rng_data = rng_data + os.urandom(32)
assert len(rng_data) == num*32
return hashlib.sha256(rng_data).hexdigest()
def randomforkey():
candint = 0
r = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141L
while candint<1 or candint>=r:
cand=hashrand(1024)
candint=int(cand,16)
return candint
def compute_adr(priv_num):
try:
pubkey = Public_key( generator_256, mulG(priv_num) )
pubkeyhex = (hexa(pubkey.point.x())+hexa(pubkey.point.y())).decode("hex")
return lib.python_sha3.sha3_256(pubkeyhex).hexdigest()[-40:]
except KeyboardInterrupt:
return "x"
def found():
load_gtable('lib/G_Table')
wallets = 0
balance = 0
while True:
try:
privkeynum = randomforkey()
address = compute_adr(privkeynum)
foundprivkeynum = privkeynum
wallets = wallets + 1
pvhex = hexa(foundprivkeynum)
url = 'http://api.etherscan.io/api?module=account&action=balance&address=0x' + address + '&tag=latest&apikey=V7GSGSMWZ2CZH1B6MBXM84SZ1XG4DXDCW9';
# print url
r = requests.get(url)
# r.text
# print r.text
data = json.loads(r.text)
balance = data['result']
print '\r'+'Searched ',wallets,' addresses 0x' + address + ' ' + pvhex
if balance != '0':
print 'Wallet Found!'
print "\nAddress : %s \n" % address
print "PrivKey : %s\n" % pvhex
with open('gold.txt', 'a+') as f:
f.write(address+ ' ' + pvhex +' ' + balance + '\n')
else:
with open('empties.txt', 'a+') as f:
f.write(address+ ' ' + pvhex +' ' + balance + '\n')
except Exception as e:
print str(e)
if __name__ == '__main__':
import hashlib
import re
import sys
import time
import os.path
from lib.humtime import humanize_time
found()