Delphi Twebbrowser Validate Recaptcha

I'm accessing a website to get some information, I'm using delphi with the twebbrower component, but it has a validation with recaptcha, can anyone tell me how I can validate recaptcha programmatically?

Author: Marcos Corsato, 2019-07-26

2 answers

The reCAPTCHA/CAPTCHA function is exactly that. Prevent validation / access from being done programmatically.

CAPTCHA is one of the measures to protect restricted areas, forms and other things from bots/robots that try to access, validate or send information.

Imagine a user registration or some search with basic fields (start and end date, CPF and etc), 99% of these cases are resources that can be accessed by anyone who makes a request GET.

Without the protection of a CAPTCHA, it would be "easy" for any "hacker" to build a bot that keeps making GET requests, filling in the data and submitting the information.

Depending on the amount of bots that has been programmed, there can be a huge bottleneck of requests being made and information being written to the database. Causing a severe overload on the servers and data recorded in the bank.

The best way is to check if the service you are doing the search, provides some kind of API or WebService for developers to make the query.

If there is no API / WebService, why not show and ask the user to fill only CAPTCHA or even the entire site within your system?

Other than that, it's trying to "circumvent" validation by parsing/parsing HTML and possible CAPTCHA Images (Image Processing), or trying to find some component/lib of someone who has already done this. What is something I do not I recommend no little, because in addition to breaking a service safety rule, the work and complexity will be great.

 0
Author: Felipe Godinho, 2019-07-28 22:12:20

Currently there are services that provide the captcha solution, typically charge for each solution.

If you inspect the page you will see that just below reCaptcha there is a tag called <textarea id="g-recaptcha-response" ...>. In it it is possible to return this solution provided by the API that solves the Captcha, that is, just send the captcha data to the API, receive the solution and add in this field, then just advance on the page.

An example of a service is the Anti-Captcha. On the site from this service you can find examples of how to get the captcha and make the requests.

 0
Author: Bruno Silva, 2019-07-30 11:58:42