Phantom404

flag.py

Jan 16th, 2019 (edited)
142
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.50 KB | None | 0 0
  1. # coding: utf-8
  2. import base64
  3. from Crypto import Random
  4. from Crypto.Hash import SHA256
  5. from Crypto.Cipher import AES
  6. import argparse
  7. import sys
  8. import colored
  9. from colored import stylize
  10.  
  11. parser = argparse.ArgumentParser()
  12. parser.add_argument("-p", "--password", required=True, help="Give your password for decode and run the script")
  13.  
  14. print(stylize('''
  15.                  ,,__
  16.        ..  ..   / o._)                   .---.
  17.       /--'/--\ \-'||        .----.    .'     '.
  18.      /        \_/ / |      .'      '..'         '-.
  19.    .'\ \__\ __.'.'     .'          i-._
  20.      )\ |  )\ |      _.'
  21.     // \ // \
  22.    ||_  \|_  \_
  23.    '--' '--'' '--'
  24. =========== Cod3d By Md Rasel =============
  25. Github: https://github.com/Mdrasel1230/SecureScript''', colored.fg("green")))
  26. print("")
  27.  
  28. if len(sys.argv)==1:
  29.     parser.print_help(sys.stderr)
  30.     sys.exit(1)
  31. args=parser.parse_args()
  32.  
  33. def cipherAES(password, iv):
  34.     key = SHA256.new(password).digest()
  35.     return AES.new(key, AES.MODE_CFB, iv)
  36.  
  37. def decodeX(ciphertext, password):
  38.     d = base64.b64decode(ciphertext)
  39.     iv, ciphertext = d[:AES.block_size], d[AES.block_size:]
  40.     return cipherAES(password, iv).decrypt(ciphertext)
  41.  
  42. pd = args.password.encode('utf-8')
  43.  
  44. decX = decodeX(b'qPBpLnPheyOl5ONYepTrklcduqKD0n1k4D2dgdO/3W/5q0CRTLWKeaK7QImY3k+TbXRedkFYZ9GuC5GTEJt5taP2m9wu3xQ7nT+cXA==', pd)
  45. decY = base64.b64decode(decX)
  46. eval(compile(decY,'<string>','exec'))
  47. print("")
  48. print(stylize("Execution Done! [+]--(^_^)--[-]", colored.fg("green")))
  49.  
Comments
Add Comment
Please, Sign In to add comment