Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # sudo apt-get install python-ecdsa
- import ecdsa
- import binascii
- import hashlib
- import sys
- PasswordList = '/media/shark/668E01B88E018233/Data/DoNotEnter/Cracking/Exfiltrated Passwords/Passwords'
- secp256k1curve=ecdsa.ellipticcurve.CurveFp(115792089237316195423570985008687907853269984665640564039457584007908834671663,0,7)
- secp256k1point=ecdsa.ellipticcurve.Point(secp256k1curve,0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798,0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8,0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141)
- secp256k1=ecdsa.curves.Curve('secp256k1',secp256k1curve,secp256k1point,(1,3,132,0,10))
- BlockChain = []
- BlockchainFile = 'NonSegwit-Short.txt'
- charset = '0123456789qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM'
- CharSetIndex = []
- Ranges = [] # 62 Characters * 2 Start and Stop characters
- for x in range(0, 62 * 2, 2):
- CharSetIndex.append(x)
- def Crack(word):
- privatekey = (int(hashlib.sha256(word).hexdigest(),16))
- #privatekeysha = (hashlib.sha256(word)).hexdigest()
- bcaddy = addy(privatekey)
- return bcaddy
- def CheckOptimized(WalletAddress):
- CompressedAddress = WalletAddress[1:4] + WalletAddress[15:18] + WalletAddress[len(WalletAddress) - 3:len(WalletAddress)]
- # Find the correct initial character index
- for x in range(len(charset) -1):
- if(CompressedAddress[0] == charset[x]):
- break
- # Search the section of the BlockChain List that begins with the first character in the compressed address
- for y in range(Ranges[CharSetIndex[x]], Ranges[CharSetIndex[x + 1]] -1, 1):
- if(BlockChain[y] == CompressedAddress):
- return True
- def LoadOptimizedLists(directory):
- Ranges.append(0)
- TotalBlockCount = 0
- for x in range(len(charset) -1):
- # Load individual optimized address files
- Tmp = [line.rstrip('\n') for line in open(directory + 'Address-' + charset[x])]
- for i in range(len(Tmp)):
- BlockChain.append(Tmp[i])
- thisBlockCount = len(Tmp)
- Ranges.append(thisBlockCount + TotalBlockCount)
- # Keep track of the total number of blocks
- TotalBlockCount = TotalBlockCount + thisBlockCount
- # Starting Range of the next block is +1
- Ranges.append(TotalBlockCount + 1)
- # Remove all elements from the Tmp List
- Tmp = []
- def addy(pk):
- pko=ecdsa.SigningKey.from_secret_exponent(pk,secp256k1)
- pubkey=binascii.hexlify(pko.get_verifying_key().to_string())
- pubkey2=hashlib.sha256(binascii.unhexlify('04'+pubkey)).hexdigest()
- pubkey3=hashlib.new('ripemd160',binascii.unhexlify(pubkey2)).hexdigest()
- pubkey4=hashlib.sha256(binascii.unhexlify('00'+pubkey3)).hexdigest()
- pubkey5=hashlib.sha256(binascii.unhexlify(pubkey4)).hexdigest()
- pubkey6=pubkey3+pubkey5[:8]
- pubnum=int(pubkey6,16)
- pubnumlist=[]
- while pubnum!=0: pubnumlist.append(pubnum%58); pubnum/=58
- address=''
- for l in ['123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'[x] for x in pubnumlist]:
- address=l+address
- return '1'+address
- LoadOptimizedLists('./Small-Non-Segwit-List/')
- def Scan(PasswordList):
- o = open('found.txt', 'a')
- with open(PasswordList) as f:
- for line in f:
- thisAddress = Crack(line.strip())
- if(CheckOptimized(thisAddress) == True):
- print line.strip() + "," + thisAddress
- o.write(line.strip() + "," + thisAddress + "\n")
- o.close()
- Scan(sys.argv[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement