javascript:var instr = document.forms[0].previousSibling;while (instr.nodeType != 1) instr = instr.previousSibling; var choices = instr.textContent.replace(/.*?select\s+/, '').replace(/one/g, '1').replace(/two/g, '2').replace(/three/g, '3').split(/,\s+/);for (var i = 0; i < choices.length; i++) choices[choices] = true;for (i = 0; i < document.forms[0].elements.length; i++) if (document.forms[0].elements.type == "checkbox" && document.forms[0].elements.previousSibling.textContent.toLowerCase() in choices) document.forms[0].elements.checked = true; document.forms[0].submit();
var instr = document.forms[0].previousSibling;
while (instr.nodeType != 1)
instr = instr.previousSibling;
var choices = instr.textContent
.replace(/.*?select\s+/, '')
.replace(/one/g, '1')
.replace(/two/g, '2')
.replace(/three/g, '3')
.split(/,\s+/);
for (var i = 0; i < choices.length; i++)
choices[choices] = true;
for (i = 0; i < document.forms[0].elements.length; i++)
if (document.forms[0].elements.type == "checkbox" &&
document.forms[0].elements.previousSibling.textContent.toLowerCase() in choices)
document.forms[0].elements.checked = true;
document.forms[0].submit();
var ps = document.getElementsByTagName ('p');
for (var i = 0;i<ps.length;i++) {
if (ps.className == "passphrase") {
var text = ps.innerHTML;
}
}
text = text.substr(56);
elements = text.split (", ");
var nums = new Object();
nums['one'] = 1;
nums['two'] = 2;
nums['three'] = 3;
for (i = 0;i<elements.length;i++) {
var tmp = elements.split(" ");
var name = tmp[1];
if (name == 'strawberries') {
name = 'strawberry';
}
if (name == 'oranges') {
name = 'orange';
}
if (name == 'melons') {
name = 'melon';
}
if (name == 'cherries') {
name = 'cherry';
}
if (name == 'lemons') {
name = 'lemon';
}
if (name == 'apples') {
name = 'apple';
}
var needed = nums[tmp[0]];
var curr = 1;
var cs = document.getElementsByTagName ('input');
for (var k = 0;k<cs.length;k++) {
if (cs.id == name) {
if (curr == needed) {
cs.click();
} else {
curr++;
}
}
}
}
document.forms[0].submit();
document.forms[0].elements.checked = true;Should probably be changed to
document.forms[0].elements.click();
Quote
Ronald, There's a ton of extra security features I could add to it but I
guess I just wanted to get it out there and see if anyone can break
it.
The weakness of this captcha is the passphrase, because if you
wrote a script which read the phrase and then decided which boxes
to get based on the words then you could gain the key. This could
be prevented by assigning random id's to the input boxes but then
screen readers wouldn't know which label went to which checkbox.
<?php
$data = file_get_contents('http://www.jungsonnstudios.com/blog/heyes/heyes_captcha_test.php');
preg_match_all('/\.([a-z\d_-]+)\s*\{background-image:url\(images\/([a-z]+)\.gif/i', $data, $matchs);
print_r($matchs);
?>
javascript:var choices = {};var spans = document.getElementsByTagName("span"); for (var i = 0; i < spans.length; i++) if (getComputedStyle(spans,'').display != "none") choices[spans.innerHTML.substr(0,6)] = true;var elements = document.forms[0].elements; var n = 0; for (i = 0; i < elements.length; i++) {if (elements.type == "checkbox") {var id = (n++ % 3) + 1 + " " + getComputedStyle(elements.parentNode, '').backgroundImage.replace(/.*\//, '').substr(0, 4); if (id in choices) elements.checked = true;}} document.forms[0].submit();
var choices = {};
var spans = document.getElementsByTagName("span");
for (var i = 0; i < spans.length; i++)
if (getComputedStyle(spans, '').display != "none")
choices[spans.innerHTML.substr(0,6)] = true;
var elements = document.forms[0].elements;
var n = 0;
for (i = 0; i < elements.length; i++) {
if (elements.type == "checkbox") {
var id = (n++ % 3) + 1 + " " +
getComputedStyle(elements.parentNode, '')
.backgroundImage
.replace(/.*\//, '')
.substr(0, 4);
if (id in choices)
elements.checked = true;
}
}
document.forms[0].submit();