Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8578787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:28:21+00:00 2026-06-11T20:28:21+00:00

I am working on maintaining some page developed by someone other. I have noticed,

  • 0

I am working on maintaining some page developed by someone other. I have noticed, that forms are secured by some kind of image CAPTCHA, which is generated every time user enters page. CAPTCHA is stored in hidden input named check, and value entered by user is compared with value from hidden input after submitting form.

I have tried to use cURL to read page and parse CAPTHA from that hidden input.

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://example.com/form/");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec($curl);

$html = str_get_html($result);
$captcha = $html->find('input[name=check]');
var_dump($captcha[0]->value);

curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, array(
    "name"      => "Joe",
    "telephone" => "1423456789",
    "message"   => "Lorem ipsum",
    "auth"      => $captcha[0]->value,
    "check"     => $captcha[0]->value,
    "submit_f1" => "Send"
));

$result = curl_exec($curl);
curl_close ($curl);

Running above script causes correct form submit. What is more, I have noticed, that I can simply overwrite auth and check values in post array:

    "auth"      => 123,
    "check"     => 123,

and form is being submitted correctly as well.

I realize that there is not 100% safe method to secure forms, but how can I protect my form a little more and make automated submitting a little harder.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:28:23+00:00Added an answer on June 11, 2026 at 8:28 pm

    The idea behind any challenge-response system is that you keep the response (the code) hidden and only show the challenge (the image).

    You would typically use session to accomplish this; you store the response in the session and show the challenge. Once the correct response is entered you can clear the response session variable to prepare the system for the next challenge.

    The following code only serves to illustrate the idea.

    Showing CAPTCHA

    session_start();
    
    // generate the string you wish to show as captcha
    $str = generate_captcha();
    // and store inside session
    $_SESSION['captcha'] = $str;
    
    // show_captcha() would generate the image
    echo show_captcha($str);
    

    Validating CAPTCHA

    session_start();
    
    if ($_POST['captcha'] === $_SESSION['captcha']) {
        unset($_SESSION['captcha']);
        // continue with form submission
    } else {
        // yikes, it doesn't match
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on maintaining someone else's code that is using multithreading, via two
I'm working on maintaining some Oracle sql statements written by someone else, and all
I have some terribly written ASP.NET code that is just not working right (go
I am working on an application that involves maintaining consistency between two local directories.
I am experiencing some weird behavior with an android app I have been working
I'm maintaining some C code that was written by the person who had my
I have a site that I'm working on, and one of the requirements is
I'm working as a developer, curently mantaining a VB6 app that desperately needs to
Working with an undisclosed API, I found a function that can set the number
Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.