skip420

blockchain_wallet_scan

Jun 11th, 2020
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.85 KB | None | 0 0
  1. #!/usr/bin/python
  2. # python rscan.py
  3. # hit enter then add wallet_address
  4.  
  5. #################################################################################
  6. #                                                                               #
  7. #.______               _______.  ______     ___      .__   __.                  #
  8. #|   _  \             /       | /      |   /   \     |  \ |  |                  #
  9. #|  |_)  |    ______ |   (----`|  ,----'  /  ^  \    |   \|  |                  #
  10. #|      /    |______| \   \    |  |      /  /_\  \   |  . `  |                  #
  11. #|  |\  \----.    .----)   |   |  `----./  _____  \  |  |\   |                  #
  12. #| _| `._____|    |_______/     \______/__/     \__\ |__| \__|                  #
  13. #                                                                               #
  14. #                                                                               #
  15. #                                                                               #        
  16. #USE AT OWN RISK!                                                               #
  17. #################################################################################
  18.  
  19. import json
  20. import urllib2
  21. import time
  22. import sys
  23.  
  24. #for some reason blockchain.info api-chain is 59711 blocks short..
  25. blockstart = 170399
  26. blockstart += 59711
  27. blockcount = urllib2.urlopen("https://blockchain.info/de/q/getblockcount").read()
  28.  
  29. print "WELCOME TO R-scan v0.1.2!"
  30.  
  31. print "ADDRESS-R-SCAN: "
  32. addr = raw_input("type address:  ")
  33. urladdr = "https://blockchain.info/de/rawaddr/" + str(addr)
  34. #control api-url
  35. print urladdr
  36. addrdata = json.load(urllib2.urlopen(urladdr))
  37. print "Data for pubkey: " + str(addr)
  38. print "number of txs: " + str(addrdata['n_tx'])
  39. #tx-details:
  40. y = 0
  41. inputs = []
  42. while y < addrdata['n_tx']:
  43.     print "#################################################################################"
  44.     print "TX nr :" + str(y+1)
  45.     print "hash: " + str(addrdata['txs'][y]['hash'])
  46.     print "number of inputs: " + str(addrdata['txs'][y]['vin_sz'])
  47.     #only if
  48.     #if addrdata['txs'][y]['vin_sz'] > 1:
  49.     zy = 0
  50.     while zy < addrdata['txs'][y]['vin_sz']:
  51.         print "Input-ScriptNR " + str(zy+1) + " :" + str(addrdata['txs'][y]['inputs'][zy]['script'])
  52.         inputs.append(addrdata['txs'][y]['inputs'][zy]['script'])
  53.         zy += 1
  54.    
  55.     y += 1
  56.    
  57. print "compare: "
  58.  
  59. xi = 0
  60. zi = 1
  61. lenx = len(inputs)
  62. alert = 0
  63.  
  64. #compare the sig values in each input script
  65. while xi < lenx-1:
  66.     x = 0
  67.     while x < lenx-zi:
  68.         if inputs[xi][10:74] == inputs[x+zi][10:74]:
  69.             print "In Input NR: " + str(xi) + "[global increment] " + str(inputs[xi])
  70.             print('\a')
  71.                         print "Resued R-Value: "
  72.             print inputs[x+zi][10:74]
  73.                         alert += 1
  74.  
  75.         x += 1
  76.        
  77.     zi += 1
  78.     xi += 1
  79.  
  80. #check duplicates
  81. #alert when everything ok
  82.  
  83. if alert < 1:
  84.     print "Good pubKey. No problems."
  85.  
  86.  
  87. sys.exit()
Add Comment
Please, Sign In to add comment