Skip to content

Instantly share code, notes, and snippets.

@chuckhoffmann
Last active April 3, 2024 12:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chuckhoffmann/7507915174e7ddebec15483d0f0dd572 to your computer and use it in GitHub Desktop.
Save chuckhoffmann/7507915174e7ddebec15483d0f0dd572 to your computer and use it in GitHub Desktop.
A Tampermonkey script to automatically solve ASCII art captchas on Fairfax Underground
// ==UserScript==
// @name FFXU ASCII Art Captcha Solver
// @namespace http://tampermonkey.net/
// @version 0.1
// @description A script to automatically solve ASCII art captchas on Fairfax Underground
// @author Chuck Hoffmann
// @match http://www.fairfaxunderground.com/forum/read/*
// @match http://www.fairfaxunderground.com/forum/register.php*
// @match http://www.fairfaxunderground.com/forum/posting.php*
// @match http://www.fairfaxunderground.com/forum/read.php*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let letters = {
D34D107D73D73D73D73D73D127D54:"3",
D124D124D4D4D4D4D63D63D4:"4",
D62D127D73D73D73D73D73D111D38:"6",
D96D96D71D79D88D80D96D96:"7",
D50D123D73D73D73D73D73D127D62:"9",
D127D127D73D73D73D73D73D127D54:"B",
D62D127D65D65D65D65D99D34:"C",
D127D127D65D65D65D65D65D127D62:"D",
D127D127D73D73D73D73D65D65:"E",
D127D127D72D72D72D72D64D64:"F",
D62D127D65D65D65D73D111D46D8:"G",
D127D127D8D8D8D8D8D127D127:"H",
D6D7D1D1D1D1D127D126:"J",
D127D127D8D8D28D54D99D65:"K",
D127D127D1D1D1D1D1D1:"L",
D127D127D48D24D8D24D48D127D127:"M",
D127D127D48D24D12D6D127D127:"N",
D127D127D72D72D72D72D72D120D48:"P",
D64D64D64D127D127D64D64D64:"T",
D126D127D1D1D1D1D1D127D126:"U",
D120D124D6D3D1D3D6D124D120:"V",
D126D127D1D1D62D62D1D1D127D126:"W",
D65D99D54D28D8D28D54D99D65:"X",
D64D96D48D31D31D48D96D64:"Y"
};
let captcha = document.getElementById("spamhurdles_captcha_asciiart");
let captchaString = captcha.textContent;
//console.log("\"" + captchaString + "\"");
let captchaArray = captchaString.split("\n");
let max = captchaArray[0].length;
let key = "";
let solution = "";
for(let ctr=0; ctr< max; ctr++){
let columnVal = 0;
for(let x in captchaArray){
columnVal = columnVal << 1;
if(captchaArray[x][ctr] !== " "){
columnVal = columnVal + 1;
}
}
//console.log("Column " + ctr + " value is : " + columnVal);
if(columnVal === 0){
//console.log(key);
if (letters.hasOwnProperty(key)){
//console.log(letters[key]);
solution = solution + letters[key];
}
key = "";
} else {
key = key + "D" + columnVal;
}
}
let qz = document.getElementById("spamhurdles_captcha_answer_input");
qz.value = solution;
//console.log(solution);
})();
@rajeev-tableau
Copy link

Good job brother . and need some help from you i want to learn how to decode it and how you defined letters in your code? i tried to contact you but i dont get you and i sent friend request to all the people which contains your name

@anis-dr
Copy link

anis-dr commented Mar 21, 2019

Good job brother . and need some help from you i want to learn how to decode it and how you defined letters in your code? i tried to contact you but i dont get you and i sent friend request to all the people which contains your name

I'm asking the same question, please help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment