-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcrypto-hunter.py
218 lines (189 loc) · 7.22 KB
/
crypto-hunter.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# // First Install Python Libraries //
# // pip install requests colorthon cryptofuzz requests-random-user-agent//
# // Import Libraries //
import random, requests, time, os, sys
import requests_random_user_agent
from cryptofuzz import Ethereum, Dogecoin, Convertor
from colorthon import Colors
# // terminal title changed all os
def titler(text_title: str):
sys.stdout.write(f"\x1b]2;{text_title}\x07")
sys.stdout.flush()
# // terminal clear logs
def clearNow(): os.system("cls") if 'win' in sys.platform.lower() else os.system("clear")
# // ethereum rate //
def eth_rate(eth: float) -> int:
url = "https://ethbook.guarda.co/api/v2/tickers/?currency=usd"
req = requests.get(url)
res = req.json()
if req.status_code == 200:
return int(eth * res.get("rates").get("usd"))
else:
return 0
# // dogecoin rate //
def doge_rate(doge: float) -> int:
url = "https://dogecoin.atomicwallet.io/api/v2/tickers/?currency=usd"
req = requests.get(url)
res = req.json()
if req.status_code == 200:
return int(doge * res.get("rates").get("usd"))
else:
return 0
# // bnb rate //
def bnb_rate(bnb: float) -> int:
url = "https://bsc-nn.atomicwallet.io/api/v2/tickers/?currency=usd"
req = requests.get(url)
res = req.json()
if req.status_code == 200:
return int(bnb * res.get("rates").get("usd"))
else:
return 0
# // Delay Printer //
def printer(text: str):
for letter in text:
sys.stdout.write(letter)
sys.stdout.flush()
time.sleep(0.1)
# // terminal clear
clearNow()
# // Colors //
red = Colors.RED
green = Colors.GREEN
cyan = Colors.CYAN
yellow = Colors.YELLOW
reset = Colors.RESET
# // check bip39 file in directory //
if os.path.exists("bip39.txt"):
bip = True
else:
# // if False Download bip39.txt from URL,
bip = False
if not bip:
# // bip39 phrase file //
bip39_url = "https://raw.githubusercontent.com/Pymmdrza/Dumper-Mnemonic/mainx/bip39.txt"
# // bip39 file download //
printer(f"{yellow}Downloading bip39 file...{reset}\n")
titler("Downloading bip39 file...")
reqBip = requests.get(bip39_url)
content_bip = reqBip.content.decode("utf-8")
# // bip39 file write //
with open("bip39.txt", "w", encoding="utf-8") as filebip:
filebip.write(content_bip)
titler("Download bip39.txt Complete.")
printer(f"{green}Downloaded bip39 file Successfully.{reset}\n\n")
clearNow()
# // Checker Ethereum Balance From Atomic Wallet //
def CheckBalanceEthereum(address: str) -> str:
url = f"https://ethbook.guarda.co/api/v2/address/{address}"
req = requests.get(url)
if req.status_code == 200:
bal = req.json()["balance"]
return str(bal)
else:
return "0"
# // Checker Dogecoin Balance From Atomic Wallet //
def CheckBalanceDogecoin(address: str) -> str:
url = f"https://dogecoin.atomicwallet.io/api/v2/address/{address}"
req = requests.get(url)
if req.status_code == 200:
bal = req.json()["balance"]
return str(bal)
else:
return "0"
# // Checker BNB Balance From Atomic Wallet //
def CheckBalanceBNB(address: str) -> str:
url = f"https://bsc-nn.atomicwallet.io/api/v2/address/{address}"
req = requests.get(url)
if req.status_code == 200:
bal = req.json()["balance"]
return str(bal)
else:
return "0"
# // Variables //
eth = Ethereum()
doge = Dogecoin()
util = Convertor()
# // Counter //
z = 0
ff = 0
found = 0
usd = 0
# // bip39 file read //
file_bip = "bip39.txt"
b_read = open(file_bip, "r")
bip39 = b_read.read()
b_read.close()
# // bip39 words split to list //
words = bip39.split("\n")
while True:
# // Counter Total Generated and Converted Mnemonic //
z += 1
# // Counter detail to title //
titler(f"Gen: {z} / Con: {ff} / USD: {usd} $")
# // Size choice for mnemonic //
rand_num = random.choice([12, 24])
# // Random Mnemonic Generator //
mnemonic = " ".join(random.choice(words) for _ in range(rand_num))
# // Convert Mnemonic to Hex from Cryptofuzz//
convert_hex = util.mne_to_hex(mnemonic)
# // Generated Ethereum Address From Private Key Hex //
eth_addr = eth.hex_addr(convert_hex)
# // Generated Dogecoin Address From Private Key Hex //
doge_addr = doge.hex_addr(convert_hex)
# // Check Balance for Ethereum, Dogecoin, BNB //
eth_bal = CheckBalanceEthereum(eth_addr)
bnb_bal = CheckBalanceBNB(eth_addr)
doge_bal = CheckBalanceDogecoin(doge_addr)
# // Convert Balance to Decimal //
eth_balance = int(eth_bal) / 1000000000000000000
doge_balance = int(doge_bal) / 100000000
bnb_balance = int(bnb_bal) / 1000000000000000000
# // Check Ethereum Address if Balance is greater than 0 //
# // Saved Details in found.txt on current directory //
if eth_balance > 0:
ff += 1
found += eth_balance
# // Append Rate Data in Title Terminal for Total USD Found
usd += eth_rate(eth_balance)
titler(f"Gen: {z} / Con: {ff} / USD: {usd} $")
with open("found.txt", "a") as dr:
dr.write(f"ETH: {eth_addr} | Balance: {eth_balance}\n"
f"Mnemonic: {mnemonic}\n"
f"Private Key: {convert_hex}\n")
# // Check Dogecoin Address if Balance is greater than 0
# // Saved Details in found.txt on current directory
if doge_balance > 0:
ff += 1
found += doge_balance
# // Append Rate Data in Title Terminal for Total USD Found
usd += doge_rate(doge_balance)
titler(f"Gen: {z} / Con: {ff} / USD: {usd} $")
with open("found.txt", "a") as dr:
dr.write(f"DOGE: {doge_addr} | Balance: {doge_balance}\n"
f"Mnemonic: {mnemonic}\n"
f"Private Key: {convert_hex}\n")
# // Check BNB Address if Balance is greater than 0
# // Saved Details in found.txt on current directory
if bnb_balance > 0:
ff += 1
found += bnb_balance
# // Append Rate Data in Title Terminal for Total USD Found
usd += bnb_rate(bnb_balance)
titler(f"Gen: {z} / Con: {ff} / USD: {usd} $")
with open("found.txt", "a") as dr:
dr.write(f"BNB: {eth_addr} | Balance: {bnb_balance}\n"
f"Mnemonic: {mnemonic}\n"
f"Private Key: {convert_hex}\n")
else:
# // Space Mode for Output Logs
s = " "
sp = s * 16
spc_eth = sp + s * (43 - len(eth_addr))
spc_doge = sp + s * (43 - len(doge_addr))
# // Print Output Logs with Pretty Type Format
print(f"[{z} | Found:{ff}] ETH: {cyan}{eth_addr}{reset}{spc_eth}[Balance: {cyan}{eth_balance}{reset}]")
print(f"[{z} | Found:{ff}] BNB: {green}{eth_addr}{reset}{spc_eth}[Balance: {green}{bnb_balance}{reset}]")
print(f"[{z} | Found:{ff}] DOGE: {yellow}{doge_addr}{reset}{spc_doge}[Balance: {yellow}{doge_balance}{reset}]")
print(f"[{z} | Found:{ff}] Mne: {red}{mnemonic[0:64]}{reset}")
print(f"[{z} | Found:{ff}] Hex: {convert_hex}")
print(f"{'-' * 66}")