Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import serial
- import time
- from itertools import *
- def main():
- part1 = 'A'
- part2 = '1'
- part3 = '1'
- chars = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
- nums = ['0','1','2','3','4','5','6','7','8','9']
- com = input("Enter COM port the Chameleon is on: ")
- ser = serial.Serial(com.upper())
- ser.write(str.encode('config=MF_ULTRALIGHT\r')) #sets the config to Mifare Ultralight
- ser.write(str.encode('setting=1\r')) #sets the slot to slot 1
- for length in range(1, 3): # only do lengths of 1 + 2
- to_attempt = product(chars, repeat=length)
- for attempt in to_attempt:
- part1 = (''.join(attempt)) #The Randomly generated section
- for length in range(1, 2): # only do lengths of 1
- to_attempt = product(nums, repeat=length)
- for attempt in to_attempt:
- part2 = (''.join(attempt)) #The Randomly generated section
- for length in range(1, 2): # only do lengths of 1
- to_attempt = product(nums, repeat=length)
- for attempt in to_attempt:
- part3 = (''.join(attempt)) #The Randomly generated section
- uid = '04'+part1+'C'+part2+'1AEF2A8'+part3
- #Final step before sending generated UID to Chameleon. The hardcoded strings are the constants in my particular UID that don't change.
- #You will have to nest a new loop for each section of the UID that is randomly generated.
- print(uid)
- ser.write(str.encode('uid='+uid+'\r'))
- msg = ser.readline()
- print(msg)
- time.sleep(2)
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement