Moon Captcha v2 Solver

Moon Captcha Captcha Solver by @satology @vikiweb @stealtosvra.

  1. // ==UserScript==
  2. // @name Moon Captcha v2 Solver
  3. // @namespace moon.captcha.v2.solver
  4. // @version 0.6
  5. // @description Moon Captcha Captcha Solver by @satology @vikiweb @stealtosvra.
  6. // @author stealtosvra
  7. // @match https://coinpayz.xyz/*
  8. // @match https://bits.re/*
  9. // @match https://claimtrx.com/*
  10. // @match https://dogepool.com/*
  11. // @match https://coinpot.in/*
  12. // @match https://feyorra.top/*
  13. // @resource hashes https://stealtosvra.github.io/udImages/hashes32.json
  14. // @require https://unpkg.com/jimp@0.5.2/browser/lib/jimp.min.js
  15. // @icon https://stealtosvra.github.io/udImages/udp.png
  16. // @grant GM_getResourceText
  17. // @license MIT
  18. // ==/UserScript==
  19.  
  20. (function () {
  21. 'use strict';
  22.  
  23. const captchaImgs = document.querySelectorAll('.rscapimg, .captchaOptions');
  24. const hashes = JSON.parse(GM_getResourceText('hashes'));
  25.  
  26. function readAsPng(base64Src) {
  27. return new Promise(resolve => {
  28. const base64Data = base64Src.replace(/^data:image\/png;base64,/, '');
  29. const buffer = Buffer.from(base64Data, 'base64');
  30. Jimp.read(buffer, (err, image) => {
  31. resolve(image);
  32. });
  33. });
  34. }
  35.  
  36. async function checkImages() {
  37. const promises = Array.from(captchaImgs).map(async (img, i) => {
  38. const image = await readAsPng(img.src);
  39. const hash = image.hash(32);
  40. console.log(`IMG Hash : ${i}: ${hash}`);
  41. const resp = hashes.filter(x => x === hash);
  42. if (resp.length > 0) {
  43. console.log(`Matched Hash : ${i}! ${resp}`);
  44. img.click()
  45. } else {
  46. console.log(`Not Upside Down! ${i}!`);
  47. }
  48. });
  49. await Promise.all(promises);
  50. console.log('end');
  51. setTimeout(function(){
  52. document.querySelector("button[type='submit']").click();}, 20000);}
  53.  
  54. checkImages();
  55. })();