Skip to content

Instantly share code, notes, and snippets.

@jpginc
Created September 27, 2018 16:31
Show Gist options
  • Save jpginc/f8a770db548628b6c41487f35f82f06a to your computer and use it in GitHub Desktop.
Save jpginc/f8a770db548628b6c41487f35f82f06a to your computer and use it in GitHub Desktop.
bluehat ctf regex
function checkPassword(mao)
{
var miau = [
new RegExp("^[a-z]+$"),
new RegExp(".*o.*r.*a.*"),
new RegExp(".*o.*e.*"),
new RegExp(".*d.*e.*"),
new RegExp(".*d.*r.*r.*"),
new RegExp(".*a.*a.*$"),
new RegExp(".*o.*n.*"),
new RegExp(".*n.*g.*e.*"),
new RegExp("^.*[a-z].*g.*"),
new RegExp(".*r.*o.*"),
new RegExp(".*d.*g.*e.*"),
new RegExp(".*r.*g.*"),
new RegExp(".*a.*e.*"),
new RegExp(".*g.*n.*"),
new RegExp(".*r.*g.*g.*"),
];
if (mao.length != 10)
{
alert("Access denied!");
return;
}
for (var mew=0;mew<miau.length;mew++)
{
if (!miau[mew].test(mao))
{
alert("Access denied!");
return;
}
}
window.location = mao + ".php"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment