├── README.md ├── axios.min.js ├── background.js ├── content.js ├── images ├── captcha.png ├── captcha_128.png ├── captcha_16.png ├── captcha_32.png └── captcha_48.png └── manifest.json /README.md: -------------------------------------------------------------------------------- 1 | # Description 2 | A chrome extension that solves TMS image based captchas in no time! 3 | 4 | # Available on chrome webstore? 5 | **Not yet!** 6 | 7 | # Exceptions 8 | Sometimes the captcha is too hard to understand, however the extension does it's best to detect the captcha. 9 | Should work most of the time. 10 | 11 | # Installation 12 | 1. Clone the repo 13 | 2. Open chrome => Navigate to url, "chrome://extensions" (Make sure to enable the chrome developer settings) 14 | 3. Click on **Load unpacked** extension and select the path to the repo. 15 | ![image](https://user-images.githubusercontent.com/39849021/146515107-81b5f41d-a766-4f63-a24b-de9a31396e5f.png) 16 | ![image](https://user-images.githubusercontent.com/39849021/146514649-f597d6ba-9370-4853-8146-3aa0b7a4726a.png) 17 | 18 | **That's it! Now goto your tms site and just see the captcha solved by itself!** 19 | ![image](https://user-images.githubusercontent.com/39849021/146515424-2b4a5f95-6f78-4c10-bf5e-44774b5a4bfc.png) 20 | 21 | -------------------------------------------------------------------------------- /axios.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(e,t,n){"use strict";var r=n(3),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(s)})),e.exports=c},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(10).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,s){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},function(e,t,n){"use strict";var r=n(2);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t { 6 | changes.forEach(async (change) => { 7 | if (change.attributeName.includes("src")) { 8 | captchaEnter.value = "Loading..."; 9 | const captchaResult = await getImageText( 10 | await convertToBase64(img.src) 11 | ); 12 | console.clear(); 13 | console.log(captchaResult); 14 | captchaEnter.value = captchaResult; 15 | captchaEnter.dispatchEvent(new Event("input")); 16 | } 17 | }); 18 | }); 19 | observer.observe(img, { attributes: true }); 20 | 21 | async function convertToBase64(src) { 22 | const res = await axios.get(img.src, { 23 | responseType: "arraybuffer", 24 | }); 25 | return imageEncode(res.data); 26 | } 27 | function imageEncode(arrayBuffer) { 28 | let u8 = new Uint8Array(arrayBuffer); 29 | let b64encoded = btoa( 30 | [].reduce.call( 31 | new Uint8Array(arrayBuffer), 32 | function (p, c) { 33 | return p + String.fromCharCode(c); 34 | }, 35 | "" 36 | ) 37 | ); 38 | let mimetype = "image/jpeg"; 39 | return b64encoded; 40 | } 41 | async function getImageText(base64img) { 42 | const res = await axios.post("https://bsite.net/samirdahal/api/captchas", { 43 | base64Image: base64img, 44 | }); 45 | return res.data.result; 46 | } 47 | -------------------------------------------------------------------------------- /images/captcha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samir-dahal/TmsCaptchaSolver/7d3077b7214746aaa281b39adc772cbe99349297/images/captcha.png -------------------------------------------------------------------------------- /images/captcha_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samir-dahal/TmsCaptchaSolver/7d3077b7214746aaa281b39adc772cbe99349297/images/captcha_128.png -------------------------------------------------------------------------------- /images/captcha_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samir-dahal/TmsCaptchaSolver/7d3077b7214746aaa281b39adc772cbe99349297/images/captcha_16.png -------------------------------------------------------------------------------- /images/captcha_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samir-dahal/TmsCaptchaSolver/7d3077b7214746aaa281b39adc772cbe99349297/images/captcha_32.png -------------------------------------------------------------------------------- /images/captcha_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samir-dahal/TmsCaptchaSolver/7d3077b7214746aaa281b39adc772cbe99349297/images/captcha_48.png -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TMS Image Captcha Solver", 3 | "description": "Solves TMS image based captchas!", 4 | "version": "1.0.0", 5 | "manifest_version": 3, 6 | "background": { 7 | "service_worker": "background.js" 8 | }, 9 | "icons": { 10 | "16": "/images/captcha_16.png", 11 | "32": "/images/captcha_32.png", 12 | "48": "/images/captcha_48.png", 13 | "128": "/images/captcha_128.png" 14 | }, 15 | "content_scripts": [ 16 | { 17 | "matches": ["*://*/*"], 18 | "include_globs": ["*://*.nepsetms*/login"], 19 | "js": ["content.js", "axios.min.js"], 20 | "run_at": "document_end" 21 | } 22 | ] 23 | } 24 | --------------------------------------------------------------------------------