Skip to content

Instantly share code, notes, and snippets.

@acuros
Created July 10, 2013 20:40
Show Gist options
  • Save acuros/5970118 to your computer and use it in GitHub Desktop.
Save acuros/5970118 to your computer and use it in GitHub Desktop.
import PyV8
FLAG = 'dpdjzjsWkd'
ctx = PyV8.JSContext()
ctx.enter()
script = """
check =
function(_password, _flag)
{
var password = _password;
var flag = _flag;
return function(_password)
{
if (password != _password)
flag = 'Nope~';
return flag;
}
}(Math.floor(Math.random() * 10000), FLAG);
"""
print 'task from PHD CTF Final'
print script
ctx.eval(script.replace('FLAG', '\x27%s\x27' % FLAG))
while True :
try :
print ctx.eval(raw_input('> '))
except Exception, e :
print e.message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment