Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
879
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. #!/usr/bin/env python
  2. from hashlib import md5
  3. from base64 import b64encode
  4.  
  5. # Type in the real parameters here
  6. MODEL  = "DSOX0000Y"
  7. SERIAL = "AB12345678"
  8. MAC    = "00-01-02-03-04-05"
  9.  
  10. def makepwd( model, serial, mac ):
  11.     mac  = mac.translate( None, ':- ' ).upper()
  12.     hstr = md5( model + serial + mac ).digest()
  13.     pwd  = b64encode( hstr, 'a1' )[7::-1]
  14.     print 'Model : {0}\nSerial: {1}\nMAC   : {2}\nPasswd: {3}'.format(model, serial, mac, pwd)
  15.     return pwd
  16.  
  17. def main():
  18.     makepwd( MODEL, SERIAL, MAC )
  19.  
  20. if __name__ == '__main__':
  21.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement