Created
February 4, 2016 22:47
-
-
Save ryan-lane/5ed3f4b83e5f13a70d17 to your computer and use it in GitHub Desktop.
Example of secrets in source code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shady looking variables, with high entropy values | |
ACCESS_TOKEN = 'lWxxtmzKD78tmCP8tIcQ' | |
ACCESS_TOKEN_SECRET = 'l6q3ztS5pMz5i62WvovPyrAAjRfczKIHtmv' | |
# Innocent looking variable, but shady looking dict key with a high | |
# entropy value. | |
INNOCENT_DICT = {'secret1': 'O80NhqsbKahKnqioQdv7'} | |
def check_password(password): | |
# Comparison with a high entropy string | |
if password == 'FMwoP5Bg0FZiIkLRgoaj': | |
return True | |
# List with high entropy strings | |
elif password in ['ZzjpTWRe9SnidDb7d2MR', 'pmHFdYrNYvOVQWqYjDgL']: | |
return True | |
return False | |
# Function definition with a shady looking kwarg and a high | |
# entropy value. | |
def call_api(api_key='o7fopdjCQ8uoXbpaVEax'): | |
# function call with an argument with high entropy. | |
expiration = api.call(api_key,'Mqgk65osbzRYESUD47hd') | |
# function call with a high entropy string, but a safe | |
# looking caller and a safe looking variable target | |
expiration = expiration.strftime('%Y%m%dT%H%M%SZ') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment