Closed lrluque closed 9 months ago
You can easily increase entrophy by setting e.g. resultMultiplier = 66
(acceted values are 1-100) - see demo. Please note that resultMultiplier
only applies to MODE_MATH
and is intentionally set to 10 by default to avoid deteriorated user experience (many users would have problem to calculate formulas like 457 + 8
).
Also from my experience almost all crawlers implement quite simple algos to decipher image and submit detected chars rather than evaluating as a formula, which would require extra programming effort. If you feel the need for greater complexity or safety you can change the to MODE_MATHVERBAL
, MODE_WORDS
, MODE_LOGICAL
or framework's MODE_DEFAULT
.
By frequently using the refresh function on a website that uses this module, I've noticed that the hashes have fixed values that repeat consistently along with their solutions. And that this hashes are actually public. For instance, for hash 98, the captchas are
30 - 10
,29 - 9
,43 - 23
, etc. All with the same solution.This is the function where
$code
is generated. By default, the variable$resultMultiplier
is set to 10. This gives us the following range:$n2
will be between 1 and 10, inclusive.$n1
will be between 11 (1 10 + 1) and 100 (9 10 + 10), inclusive.$n2
, then you subtract$n2
, resulting in values of 10, 20, 30, 40...90. With addition, it follows a similar pattern but ranging from 10 to 100 (also in increments of ten), you subtract$n2
, then add it back.This is the function that generates the hash. Essentially, it sums each character of
$result
in ASCII:10 = ord(1) + ord(0) = 49 + 48 = 97 20 = ord(2) + ord(0) = 50 + 48 = 98 . . . 100 = ord(1) + 2 * ord(0) = 49 + 2 * 48 = 145
And with this, we resolve the table we had made above.
In summary, the captcha pattern isn't difficult to identify, making it highly vulnerable. You can bypass it with a simple script.