Guest User

mmmaaaccc

a guest
Jan 23rd, 2017
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. import random
  2. staticni_dio='00:1a:79'
  3. promenljivi_dio=12-len(staticni_dio.replace(':',''))
  4. try:broj_kombinacija=int(raw_input("Upisi broj kombinacija:\n"))
  5. except:broj_kombinacija=16**promenljivi_dio
  6. for i in xrange(broj_kombinacija):
  7.     s=hex(random.randrange((16**promenljivi_dio)))[2:].zfill(promenljivi_dio)
  8.     mac=':'.join([b+a for a,b in zip(s[::-1][::2], s[::-1][1::2])][::-1])
  9.     print broj_kombinacija-i
  10.     with open ('mac_random_%s.txt'%broj_kombinacija,'a')as f:f.write(("{}:{}".format(staticni_dio,mac)+'\n'))
Advertisement
Add Comment
Please, Sign In to add comment