Skip to content

Instantly share code, notes, and snippets.

@dhyegocalota
Created March 19, 2017 21:01
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 dhyegocalota/b8710b799eba08d5b170aacc6456131d to your computer and use it in GitHub Desktop.
Save dhyegocalota/b8710b799eba08d5b170aacc6456131d to your computer and use it in GitHub Desktop.
[Hackflag] Web server
var wrongContent = 'nadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaanadanadaaaannaannaanndnna';
var filesToTest = Array.from(document.querySelectorAll('td a')).filter(x => x.href.match(/\.php$/));
const testContent = (file) => {
return (response) => {
response.text()
.then(text => {
if (text.trim() != wrongContent) {
console.log(`O arquivo '${file.href}' tem o content: '${text}'`);
filesToTest = [];
}
});
};
};
while (filesToTest.length > 0) {
var file = filesToTest.shift();
fetch(file.href)
.then(testContent(file));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment