vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - reCAPTCHA!vB (https://vborg.vbsupport.ru/showthread.php?t=151824)

yoyoyoyo 09-16-2007 01:50 AM

When replying to a message in my forum (http://mysite.com/forum/newreply.php?do=newreply&p=563) I got this error:

Quote:

Warning: pack() [function.pack]: Type H: illegal hex digit L in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit n in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit X in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit g in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit k in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit z in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit S in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit y in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit y in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit x in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit o in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit V in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit q in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit u in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit m in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit O in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit S in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit U in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit h in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit w in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit i in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit L in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit n in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit X in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit g in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit k in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit z in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit S in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit y in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit y in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit x in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit o in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit V in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit q in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit u in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit m in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit O in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit S in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit U in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit h in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit w in /includes/functions_recaptcha.php on line 235

Warning: pack() [function.pack]: Type H: illegal hex digit i in /includes/functions_recaptcha.php on line 235
this is line 235 in /includes/functions_recaptcha.php:

PHP Code:

$ky pack('H*'$privkey); 


yoyoyoyo 09-17-2007 02:13 AM

Any idea what is causing that error? I would love to turn this back on in my forum, but can't with that message popping up all the time.

magnus 09-17-2007 11:21 AM

Quote:

Originally Posted by yoyoyoyo (Post 1340579)
Any idea what is causing that error? I would love to turn this back on in my forum, but can't with that message popping up all the time.

It appears you do not have mcrypt(); support enabled within PHP.

To be sure, check AdminCP > Maintenance > View PHP Info. Now look for a section titled mcrypt. If it's not there, that's your answer. :)

yoyoyoyo 09-17-2007 12:02 PM

Quote:

Originally Posted by magnus (Post 1340767)
It appears you do not have mcrypt(); support enabled within PHP.

To be sure, check AdminCP > Maintenance > View PHP Info. Now look for a section titled mcrypt. If it's not there, that's your answer. :)

I have mcrypt enabled:

https://vborg.vbsupport.ru/external/2007/09/17.jpg

any other suggestions?

bazzup 09-18-2007 10:49 AM

Installed works great had a mass of bots registering lately and not confirming their emails so hopefully should stop now


Quote:

Originally Posted by yoyoyoyo (Post 1340579)
Any idea what is causing that error? I would love to turn this back on in my forum, but can't with that message popping up all the time.

thats the second key your private one is'nt it?

yoyoyoyo 09-18-2007 12:25 PM

Quote:

Originally Posted by bazzup (Post 1341623)
thats the second key your private one is'nt it?

why, yes it is! :D maybe that info will help to point out the error I am receiving to magnus. thanks!

GameWizard 09-23-2007 06:42 AM

Either I'm missing something, or this script is messed up?

After installing the script, and using Method B. I attempted to register on my board a few times to see how it would react, and it appears to allow the registration if the first few characters of the first word are correct, or simply resemble that of the first word.

It seems to not care what the rest looks like. Although it doesn't let me pass if the first 3-4 characters are completely different. What the hell? lol. :rolleyes:

magnus 09-27-2007 01:47 AM

Quote:

Originally Posted by GameWizard (Post 1345004)
Either I'm missing something, or this script is messed up?

After installing the script, and using Method B. I attempted to register on my board a few times to see how it would react, and it appears to allow the registration if the first few characters of the first word are correct, or simply resemble that of the first word.

It seems to not care what the rest looks like. Although it doesn't let me pass if the first 3-4 characters are completely different. What the hell? lol. :rolleyes:

There are 2 words. One of which the system knows, the other which the system is unsure of. The entire point is to present multiple words that are readable to humans, but proven unreadable by bots. So as long as you answer the actual key word correctly, you could technically input whatever you wanted for the variable word.

Again, this is something you, as a human, can logically determine. A bot will see a mass of letters an be unable to differentiate them. The main goal of reCAPTCHA is to provide a next level of spam bot prevention while using wasted human cycles (re: distributed human computing) to help translate books to digital text.

GameWizard 09-27-2007 04:32 AM

But i find it confusing how yes, it makes it easier for humans, but at the same time could potentially make it easier for bots as well, could it not? All the bot would need to do is identify that your script is being used then attempt to read the word(s) which don't even need to be typed correctly! The first 3 letters or so seem to be the only requirement, the rest can be neglected or mistyped and the script still allows the user to continue...

bazzup 09-27-2007 07:11 AM

Quote:

Originally Posted by GameWizard (Post 1347953)
But i find it confusing how yes, it makes it easier for humans, but at the same time could potentially make it easier for bots as well, could it not? All the bot would need to do is identify that your script is being used then attempt to read the word(s) which don't even need to be typed correctly! The first 3 letters or so seem to be the only requirement, the rest can be neglected or mistyped and the script still allows the user to continue...

well i have had this for over a week now i think and i was having 20+ bots a day registering and not confirming their emails and all this has stopped.

yes they will learn the script but until then this is working mighty fine for me

magnus 09-27-2007 02:45 PM

Quote:

Originally Posted by GameWizard (Post 1347953)
But i find it confusing how yes, it makes it easier for humans, but at the same time could potentially make it easier for bots as well, could it not? All the bot would need to do is identify that your script is being used then attempt to read the word(s) which don't even need to be typed correctly! The first 3 letters or so seem to be the only requirement, the rest can be neglected or mistyped and the script still allows the user to continue...

There are 2 words. The challenge word and the variable word. The variable word can be anything. The challenge word must be typed 100% correctly. There's no 1, 2 or 3 letter minimum. Each challenge word must be 100% accurate.

Regardless of the variable word, this system, at worst, is no less secure than the default CAPTCHA. So there's no concern in that department.

The following is pure speculation, as the exact algorithim is intentionally not divulged:

It's possible that the variable word may have a minimum character requirement as the system may be able to determine the word length while not being able to exactly decipher the actual letters. Again, this is pure speculation on my part.

Godders 10-29-2007 10:07 PM

Hi there.
I am having some trouble using this.

I have made the changes as directed and placed the private and public keys where requested.
I get the following error
"To use reCAPTCHA you must get an API key from http://recaptcha.net/api/getkey"

Am i missing something? Fantastic script btw I cant wait to use it!

TheInsaneManiac 02-03-2008 12:50 AM

I like this, but what if I want the Image Verification border to stay there

HP10T 02-11-2008 07:14 PM

I get an error while importing via the product manager...
Database error in vBulletin 3.5.4:

Invalid SQL:

### INSERT QUERY GENERATED BY fetch_query_sql() ###
INSERT INTO plugin
(`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`)
VALUES
('1', '5', 'Automatically modify register template', 'parse_templates', 'if (isset($vbulletin->templatecache[\'register\']))\r\n{\r\n $find = \' $imagereg\';\r\n \r\n $append = \" <script type=\'text/javascript\'>\r\n var RecaptchaOptions = {\r\n theme : \'\" . $GLOBALS[\'vbulletin\']->options[\'recaptcha_theme\'] . \"\',\r\n tabindex : \" . $GLOBALS[\'vbulletin\']->options[\'recaptcha_tabindex\'] . \"\r\n };\r\n </script>\";\r\n\r\n $vbulletin->templatecache[\'register\'] = str_replace($find, $append . \"\\n\" . $find, $vbulletin->templatecache[\'register\']);\r\n\r\n unset($find, $append);\r\n}', 'recaptcha');

MySQL Error : Unknown column 'executionorder' in 'field list'
Error Number : 1054
Date : Monday, February 11th 2008 @ 02:13:16 PM
Script : http://utahnissans.com/forums/admincp/plugin.php
Referrer : http://utahnissans.com/forums/adminc...?do=productadd

magnus 02-11-2008 08:49 PM

Quote:

Originally Posted by HP10T (Post 1440986)
I get an error while importing via the product manager...
Database error in vBulletin 3.5.4:

Invalid SQL:

### INSERT QUERY GENERATED BY fetch_query_sql() ###
INSERT INTO plugin
(`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`)
VALUES
('1', '5', 'Automatically modify register template', 'parse_templates', 'if (isset($vbulletin->templatecache[\'register\']))\r\n{\r\n $find = \' $imagereg\';\r\n \r\n $append = \" <script type=\'text/javascript\'>\r\n var RecaptchaOptions = {\r\n theme : \'\" . $GLOBALS[\'vbulletin\']->options[\'recaptcha_theme\'] . \"\',\r\n tabindex : \" . $GLOBALS[\'vbulletin\']->options[\'recaptcha_tabindex\'] . \"\r\n };\r\n </script>\";\r\n\r\n $vbulletin->templatecache[\'register\'] = str_replace($find, $append . \"\\n\" . $find, $vbulletin->templatecache[\'register\']);\r\n\r\n unset($find, $append);\r\n}', 'recaptcha');

MySQL Error : Unknown column 'executionorder' in 'field list'
Error Number : 1054
Date : Monday, February 11th 2008 @ 02:13:16 PM
Script : http://utahnissans.com/forums/admincp/plugin.php
Referrer : http://utahnissans.com/forums/adminc...?do=productadd

Well, you're trying to run a hack developed for vB3.6 on vB3.5 -- that's what happens. :)

If you're feeling frisky, you can edit the .xml and remove references to executionorder. This in no way guaranteed to work. It shouldn't break anything, however, you should always make backups just in case.

If you don't want to edit the file yourself, I've attached a modified .xml. Simply replace the on in the original archive with this.

HP10T 02-12-2008 05:06 PM

Thanks for the quick reply, I think I am going to upgrade to 3.6 first :).

Doctor Dan 02-13-2008 02:49 AM

For those who would like to use "Method A" (the register.patch file) to modify their register.php file but do not have shell access (e.g. hosting services that only provide cPanel access), you may find this "trick" useful:

1. Upload the register.patch file to your forum's root directory.

2. Create a plain text file called runpatch.pl with the following contents:

Code:

#!/usr/bin/perl
print "content-type:text/html\n\n";
system('patch -b register.php < register.patch');


save it, and upload it to your forum's root directory.

3. Change the permissions on the runpatch.pl file that you just uploaded to 0755 so that you can execute the script.

4. In a web browser, type:

http://yourdomain/yourforum/runpatch.pl

The perl script will run, which in turn runs the patch command.

5. Delete the runpatch.pl file from your forum's root directory.

N.B.: This technique assumes that you can run perl scripts with system calls on the server where your forum resides, which is usually the case.

- Dan

Doctor Dan 02-13-2008 03:05 AM

A quick mod if you want to restore the "image verification" frame around the reCAPTCHA panel, just like how vBulletin's standard CAPTCHA panel appears:

In the template register find:

Code:

$imagereg

and replace it with:

Code:

<fieldset class="fieldset">
        <legend> $vbphrase[image_verification] </legend>
        $imagereg
</fieldset>


You can also center the reCAPTCHA panel within the frame by adding a "<center>" tag:

Code:

<fieldset class="fieldset">
        <legend> $vbphrase[image_verification] </legend>
        <center> $imagereg </center>
</fieldset>


- Dan

magnus 02-13-2008 01:52 PM

Thanks, Dan! I've linked your tips in the first post. :)

Boofo 02-13-2008 04:27 PM

Quote:

Originally Posted by magnus (Post 1334161)
You're missing a close bracket ')' in the following block (highlighted in red):
Code:

// Check Reg Image
    if ($vbulletin->options['regimagecheck'] AND $vbulletin->options['regimagetype'])
    {
        $resp = recaptcha_check_answer ($vbulletin->options['recaptcha_privatekey'],
        $_SERVER["REMOTE_ADDR"],
        $_POST["recaptcha_challenge_field"],
        $_POST["recaptcha_response_field"]);
 
        if (!$resp->is_valid)
        {
        $userdata->error('register_imagecheck');
        }
    }

Also, why are you typing out the code changes manually? Just copy and paste them from the original post to make sure there are no typo's and to retain proper formatting.

You mean it's missing in this line, not the other one:

Code:

$resp = recaptcha_check_answer ($vbulletin->options['recaptcha_privatekey'],

magnus 02-13-2008 04:51 PM

Quote:

Originally Posted by Boofo (Post 1442298)
You mean it's missing in this line, not the other one:

Code:

$resp = recaptcha_check_answer ($vbulletin->options['recaptcha_privatekey'],

No, I mean it's missing from the line I originally mentioned. I highlighted the missing bracket in red.

On a side note, this was months ago and the user found and corrected the problem immediately following. I see no reason to bring it back up. :confused:

Boofo 02-13-2008 05:25 PM

The only reason I commented was I didn't see a beginning bracket on that line you highlighted the bracket in, in case someone runs in to the same problem later. Since it is your thread, I will let your attitude slide this time and be on my way.

magnus 02-14-2008 01:54 PM

Uh, excuse me?

I don't see what you're letting me "slide" on -- you posted up information implied as a correction to a post of mine, which helped the user solve his problem, that didn't need any correction. Nevermind the fact that the post was 5+ months old and hasn't had a single question, clarification or comment made towards it until you brought it up.

Why couldn't you have simply hit the post button after your first sentence? Was the second sentence really necessary? What does it add to the topic? How does it benefit the conversation or thread? I don't understand, instead of simply stating you only skimmed and overlooked the detail in question you become defensive and act as if you were going to drop the wrath of God on me but instead decided to grant me a reprieve.

I'm not trying to pick a fight. I'm simply trying to figure out what rule I've broken that you're going to let me slide on "this time". I try to keep the information in my threads factual, so when someone has a problem they can find a fix easily (if available).

Feel free to delete this post as well as the 3 before it.

Doctor Dan 02-14-2008 08:50 PM

Quote:

Originally Posted by magnus (Post 1442176)
Thanks, Dan! I've linked your tips in the first post. :)


My pleasure. :)

Thank YOU for this very useful vBulletin reCAPTCHA integration! The problem with the standard vB CAPTCHA is that with all the options activated, it frequently generates images which people can't even read.

I think that the most intriguing aspect of reCAPTCHA is that if an automated crack for the obfuscation technique emerges, the reCAPTCHA team at CMU designs a new one, and all sites which use reCAPTCHA are automatically updated.

- Dan

zagman76 02-16-2008 02:24 AM

Thanks magnus - this is an awesome mod! :)

ChaosBurnt 02-16-2008 12:00 PM

Thank you very very much magnus, your efforts are greatly appreciated.

*installed very happily*

airaffair 02-16-2008 02:28 PM

you guys should just do what I did and get rid of captcha all together by going with a session token ....only humans get in and they don't have to do the captcha interpretations ...which is always a negative requirement if you ask me..... just google this "session token instead of captcha" and you guys may find what you want....the down side of what I use is that it requires the users to have java script enabled....but hey, what site doesn't have some sort of java script in it these days right? =)

magnus 02-16-2008 05:49 PM

Session tokens aren't 100% secure. They're just an alternative method, it all boils down to preference. Either way, if you've already implemented session tokens in place of vB's CAPTCHA -- why not release it here on vB.org for the rest of the community?

rsuplido 02-18-2008 12:07 AM

Anyone modified search.php too? TIA.

magnus 02-18-2008 02:12 PM

Replacing any of vB's CAPTCHA with reCAPTCHA is pretty much the same across the board. By looking at the code changes for registration and contact us, you'll see the similarities.

I'll go ahead and whip up a search replacement in my free time and post it up here.

Bloom21 02-20-2008 04:17 PM

Quote:

Originally Posted by magnus (Post 1445937)
Replacing any of vB's CAPTCHA with reCAPTCHA is pretty much the same across the board. By looking at the code changes for registration and contact us, you'll see the similarities.

I'll go ahead and whip up a search replacement in my free time and post it up here.

Looking forward to this added feature for sure thank you for your efforts magnus!

Martell 02-26-2008 10:25 AM

Has established on Method B: but nothing is displayed at registration. vBulletin ? v3.6.8 Patch Level 2:confused:
Has returned all back. And standard CAPTCHA was gone.:(

magnus 02-26-2008 12:52 PM

Quote:

Originally Posted by Martell (Post 1451303)
Has established on Method B: but nothing is displayed at registration. vBulletin ? v3.6.8 Patch Level 2:confused:
Has returned all back. And standard CAPTCHA was gone.:(

This can obviously be attributed to a botched file edit. By "return[ing] all back", I assumed you restored the back-up file?

Martell 02-26-2008 05:30 PM

magnus, all has understood, Thanks for fashions...

Martell 02-27-2008 07:20 AM

magnus prompt, whether it is possible as that to translate a window reCAPTCHA on Russian??? :)

magnus 02-27-2008 05:50 PM

I'm sorry, but I don't exactly understand what you're trying to say. I've gathered that you've got it working, but your last post has me confused.

Selrion 02-27-2008 06:09 PM

He's trying to know how can he translate the reCAPCHA panel registration interface into Russian... ;)

magnus 02-27-2008 08:56 PM

Ah! Sure thing. I've updated the modification. Simply download version 1.1.0 above and import the new product xml. There will now be an option in the reCAPTCHA AdminCP settings to select a support language (yes, Russian is supported).

When upgrading from previous versions, you do NOT need to edit any files. Simply import and overwrite.

Enjoy!

Martell 02-28-2008 05:06 AM

magnus, Thanks:)

CeesT 02-28-2008 08:17 PM

Thanks Magnus, have just installed it and it works fine.

Only the local-language and color does not work in the 'sendmessage.php' (in register.php this works fine), it has default red-color and english language in sendmessage.php, can I change this somewhere in the code ?

And could you give a recipe what to change for implementing this in 'search.php' ?


All times are GMT. The time now is 04:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01507 seconds
  • Memory Usage 1,868KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (1)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete