Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created October 18, 2021 03:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndyNovo/e351c6346a5f9c6418c4224dd197b78c to your computer and use it in GitHub Desktop.
Save AndyNovo/e351c6346a5f9c6418c4224dd197b78c to your computer and use it in GitHub Desktop.
import os
import time
import random
def lambda_handler(event, context):
random.seed(int(time.time()))
flag=os.environ["flag"]
flagbytes = list(map(ord, flag))
randos = [random.randint(0,255) for _ in range(len(flag))]
return {
'statusCode': 200,
'body': "".join([hex(randos[i] ^ flagbytes[i])[2:].zfill(2) for i in range(len(flag))])
}
#trigger URL: https://lpfh8hh7p9.execute-api.us-east-1.amazonaws.com/default/lambdom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment