Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Validation challange fails with a comment containing code #691

Open
gnieark opened this issue Feb 17, 2022 · 0 comments
Open

[BUG] Validation challange fails with a comment containing code #691

gnieark opened this issue Feb 17, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@gnieark
Copy link
Contributor

gnieark commented Feb 17, 2022

Describe the bug
Validation challange fails with a comment containing code. yes i am a troll, il like solucing it by legacy php code

To Reproduce

  1. Go to 'Mario challange and validate
  2. Type the correct passphrase (SPOIL EGwvoaKgJtxE0q)
    Put this as comment:

<?php
$baseUrl = "http://s47hok00.fr2.pathwar.net/";

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $baseUrl);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_COOKIESESSION, true);
curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookie-name'); 
curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookie-name'); 

function getCaptchaFromPageContent($content){
    preg_match('/<p>Captcha: ([^{]*)<\/p>/i', $content, $match);
    return $match[1];
}

function httpPost($curl ,$pass)
{
    curl_setopt($curl, CURLOPT_POSTFIELDS, "password=".$pass);

    $response = curl_exec($curl);
    return $response;
}

$content = "<p>Captcha: </p>";

for ($i = 0; $i < 101; $i++){
    $content = httpPost($curl, getCaptchaFromPageContent($content));
    echo $content."\n".getCaptchaFromPageContent($content)."\n";

}

It fails.
try again without the comment, it's OK

@gnieark gnieark added the bug Something isn't working label Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant