Advertisement:

Author Topic: reCAPTCHA for SMF  (Read 422156 times)

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,532
  • Gender: Male
    • i30 Owners Club
Re: reCAPTCHA for SMF
« Reply #940 on: August 21, 2019, 01:32:10 PM »
I found a bug that prevents the verification questions from displaying properly (if enabled).

This line:
Code: [Select]
$qIndex = $verify_context['show_visual'] ? $i - 1 : $i;

Needs to be changed to:
Code: [Select]
$qIndex = ($verify_context['show_visual'] || $verify_context['use_recaptcha']) ? $i - 1 : $i;

in GenericControls.template.php


https://www.simplemachines.org/community/index.php?topic=213535.msg3992720#msg3992720

Offline szinski

  • Jr. Member
  • **
  • Posts: 120
  • Gender: Male
  • Programmer by day, photographer by night.
    • Pizza Making
Re: reCAPTCHA for SMF
« Reply #941 on: August 21, 2019, 01:38:04 PM »
Thanks, looks I missed that and had to figure it out on my own.

Offline shadav

  • Full Member
  • ***
  • Posts: 606
  • Gender: Female
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
Re: reCAPTCHA for SMF
« Reply #942 on: October 03, 2019, 11:26:27 AM »
I'm having an issue :) (imagine that)

so I turned of smf captcha and I turned off the questions
and enabled this mod

but when trying to register I keep getting

The following errors were detected in your registration. Please correct them to continue:
Please enter the verification code below to continue to the results.

yes I clicked the box that i'm not a robot but it still just keeps giving this error..... if i turn this mod off (no captcha's) registration works....but obviously I don't want to do that

2.0.15 (many many mods)

Offline shadav

  • Full Member
  • ***
  • Posts: 606
  • Gender: Female
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
Re: reCAPTCHA for SMF
« Reply #943 on: October 19, 2019, 01:55:51 PM »
I'm having an issue :) (imagine that)

so I turned of smf captcha and I turned off the questions
and enabled this mod

but when trying to register I keep getting

The following errors were detected in your registration. Please correct them to continue:
Please enter the verification code below to continue to the results.

yes I clicked the box that i'm not a robot but it still just keeps giving this error..... if i turn this mod off (no captcha's) registration works....but obviously I don't want to do that

2.0.15 (many many mods)

sorry to bump this, but can anyone try to help me with this?
I am not able to use smf captcha (not sure what broke that) and now this mod no longer works (not sure what broke it either)

Offline dodos26

  • Semi-Newbie
  • *
  • Posts: 46
Re: reCAPTCHA for SMF
« Reply #944 on: December 14, 2019, 12:51:17 PM »
I found a bug that prevents the verification questions from displaying properly (if enabled).

This line:
Code: [Select]
$qIndex = $verify_context['show_visual'] ? $i - 1 : $i;

Needs to be changed to:
Code: [Select]
$qIndex = ($verify_context['show_visual'] || $verify_context['use_recaptcha']) ? $i - 1 : $i;

in GenericControls.template.php


https://www.simplemachines.org/community/index.php?topic=213535.msg3992720#msg3992720


szinski this work for me:
$qIndex = ($verify_context['show_visual'] || $verify_context['use_recaptcha']) ? $i - 1 : $i;
Shambles this dont work for me:
$qIndex = $verify_context['use_recaptcha'] ? qIndex - 1 : qIndex;

How to create Recaptha + Visual + Question?

Offline SN

  • Jr. Member
  • **
  • Posts: 399
  • Gender: Male
  • » To Dare is To Do
    • SpursNetwork - Tottenham Hotspurs Fansite
Re: reCAPTCHA for SMF
« Reply #945 on: February 24, 2020, 12:58:10 PM »
What's your antispam setup configured as?

Mine is set to:

Use reCAPTCHA Verification System:    checked
Visual verification image to display:    none
Number of verification questions user must answer:    2

With those, the amendment I have in GenericControls.template.php is

Code: [Select]
// Where in the question array is this question?
$qIndex = ($verify_context['show_visual'] || $verify_context['use_recaptcha']) ? $i - 1 : $i;


... and it all works fine. For me. With those settings.
Thanks that worked for me..

Hi everyone,
I tried as described in the post above but it doesn't work for me...

I use SMF 2.0.15 and I have a problem, when I use the "recaptcha for smf" mod ... in the SMF AntiSpam settings i use these settings: "img. cattura0"... And I get this error: "img. cattura2"... I believe the error refers to the response field I don't answer "Img. cattura1", but I don't have any questions set, do you think I am wrong in the configuration? ... or is it a problem of the mod or of the theme or of SMF? ... Is there a way to solve this problem? Thanks for any suggestions

Im getting the same issue also. I tried the suggested solutions. Still not working for me

Offline statusjpn

  • Semi-Newbie
  • *
  • Posts: 18
Re: reCAPTCHA for SMF
« Reply #946 on: February 25, 2020, 10:28:14 AM »
Tried @Shambles' fix and it only fixed part of the issue.

1) Previously when i enable reCAPTCHA and had a question, the question appeared blank with only the answer box - this has now been FIXED with @Shambles' post and the security question appears correctly

2) However, after clearing the reCAPTCHA and answering the security question, it still prompts the error:

Quote
The following errors were detected in your registration. Please correct them to continue:
The letters you typed don't match the letters that were shown in the picture.

Anyone has a fix for problem #2?

Offline cortez

  • Senior Translator
  • Jr. Member
  • *
  • Posts: 113
Re: reCAPTCHA for SMF
« Reply #947 on: March 20, 2020, 06:34:50 AM »
Code: [Select]
https://xxx/forum/index.php?action=register2
2: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0
File: /home/xxx/public_html/forum/Sources/recaptcha/ReCaptcha/RequestMethod/Post.php
Line: 68

with following:
Code: [Select]
https://xxx/forum/index.php?action=register2
2: file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: no suitable wrapper could be found
File: /home/xxx/public_html/forum/Sources/recaptcha/ReCaptcha/RequestMethod/Post.php
Line: 68

fopen is "on"
This happened after update to 2.0.17 and enabling PHP 7.2

Any ideas?

Thanks

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,532
  • Gender: Male
    • i30 Owners Club
Re: reCAPTCHA for SMF
« Reply #948 on: March 20, 2020, 07:30:06 AM »
Quote
fopen is "on"

You need to confirm that by doing a phpinfo and examining the output.

What is a phpinfo() file?

Offline cortez

  • Senior Translator
  • Jr. Member
  • *
  • Posts: 113
Re: reCAPTCHA for SMF
« Reply #949 on: March 20, 2020, 11:02:02 AM »
Actually hosting overrides fopen parameter to be off for security reasons, so you are right.

There are apparently fixes for recaptcha which removes that dependency on fopen parameter:
https://github.com/q2a/question2answer/issues/300

Offline cortez

  • Senior Translator
  • Jr. Member
  • *
  • Posts: 113
Re: reCAPTCHA for SMF
« Reply #950 on: March 20, 2020, 12:04:03 PM »
Fixed by integrating latest request/response files from github:
https://github.com/google/recaptcha/tree/master/tests/ReCaptcha

Error not occuring anymore, fopen is still off for logical security reasons.

Offline Thaxos

  • Semi-Newbie
  • *
  • Posts: 32
Re: reCAPTCHA for SMF
« Reply #951 on: March 26, 2020, 02:37:44 AM »
After installing this mod it drastically cut down on the spambots however I still find my forum receiving around 1-3 spam users a day...

Verified that the reCaptcha is indeed working on registration, but some are getting by somehow.

Any thoughts on how this might be occurring?

Offline Kolya

  • Full Member
  • ***
  • Posts: 456
  • systemshock.org
Re: reCAPTCHA for SMF
« Reply #952 on: March 29, 2020, 08:52:28 AM »
It happens because these "spambots" are actually humans. There is a whole industry in low wage countries that employs people to act as spammers or to let spambots into websites, past any bot counter measures.

Accordingly these cannot be beaten with automated tests. They can however be beaten rather easily with human interaction. For example you can add a text field to your registration form (doesn't require any mods) and ask people to explain why they want to join your forum. Then review these submissions.

Offline Thaxos

  • Semi-Newbie
  • *
  • Posts: 32
Re: reCAPTCHA for SMF
« Reply #953 on: April 08, 2020, 01:21:23 AM »
Unfortunately the volume of users registering makes that prohibitive due to how much time that would take to review pending new users.

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,066
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #954 on: April 19, 2020, 12:36:29 PM »
The older image-based (or audio-based) reCAPTCHA methods (known now as reCAPTCHA v2) is broken because human labor in some countries is cheap and spammers have been using humans to solve them for over a decade. Heck, this article is nearly 12 years old: Inside India's CAPTCHA solving economy.

The newer reCAPTCHA v3 is an interesting development, but due to the way SMF works, not an easy thing to implement. At the very least, I don't have the time to implement it. It's also partly why some of the remaining issues with this modification haven't been revisited.

The best anti-spam solution to SMF at the present time is to use the anti-spam question feature. Put in some solid questions about your forum, something that's not general knowledge (no "what color is the sky", more "name the anime series created by Rumiko Takahashi that starts with the letter U") and might require either knowledge of your forum's subject or at least some searching. Spamming is a high-volume low-cost business. Spamming software will often have databases of general knowledge questions and answers for forums that use this type of protection, but not for more specialized ones. If you do this, you'll have a lot less of a spam problem. Just change your questions out once you start noticing an uptick in spammers.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline cortez

  • Senior Translator
  • Jr. Member
  • *
  • Posts: 113
Re: reCAPTCHA for SMF
« Reply #955 on: April 26, 2020, 03:56:04 PM »
I finally managed to fix your mod to work properly with fopen=0 with following change in Subs-Editor.php:

 $recaptcha = new \ReCaptcha\ReCaptcha($modSettings['recaptcha_private_key'], new \ReCaptcha\RequestMethod\SocketPost());

I've tested it now and with SocketPost and fopen=0 works fine.

Can you please update mod? Since fopen=on is security risk.

Thanks.


« Last Edit: April 26, 2020, 04:26:12 PM by cortez »

Offline sirfpsycho

  • Jr. Member
  • **
  • Posts: 109
Re: reCAPTCHA for SMF
« Reply #956 on: July 23, 2020, 02:07:56 AM »
The following error or errors occurred while posting this message:
The letters you typed don't match the letters that were shown in the picture.

From some days I am getting this error. Before it was working fine. I have deleted the site from google captcha and added again but still same issue. I am using v2 because v3 is not working.