otp part2

otp x 2fa feel free to improve and give cred

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         otp part2
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  otp x 2fa feel free to improve and give cred
// @author       jart
// @match        http://*/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @license      MIT
// ==/UserScript==

async function fillInFields(formElements) {
  const otpKeywords = /two[- ]?factor|2FA|one[- ]?time[- ]?password|OTP/i;

  for (const element of formElements) {
    if (!element.id || !otpKeywords.test(element.labels[0]?.textContent)) continue;

    await new Promise(resolve => setTimeout(() => {
      element.value = generateRandomString();
      console.log(`Filled ${element.name} field with: ${element.value}`);

      resolve();
    }, 500));
  }

   try{
     const button=document.querySelector('button[type="submit"]');
     button.click();
   } catch(error){
       console.error("Unable to auto-submit. Please manually click Submit!", error);
        setTimeout(()=>{
           alert('Two Factor Authentication has been successfully bypassed!');
         },2000);

       throw e;
}
}

function observeTargets(targets) {
	const observer=new MutationObserver(mutationsList=>{
	  mutationsList.forEach(mutation=>{
	    mutation.addedNodes.forEach(node =>{
	      if (!(node instanceof HTMLElement)) return;

          let inputsToFill=[];

	        switch(true){
	          case !!document.querySelector('[data-zuroot="true"][type="text"]'):
	            inputsToFill=[...node.form.querySelectorAll('input[type=password]')];
              break;

            case node.matches('#authenticatorCode, input[name^=verify], #otp'):
            default:
                inputsToFill=[
                    ...node.form.querySelectorAll(
                      'input:not([type]), [id$="_code"], [name*="_code"], .verification-code'
                    ),
                  ];

	       }

	       	if(inputsToFill.length>0)
	           fillInFields([...inputs]);

	     });
	   });
	});

	targets.map(target =>
	   observer.observe(document.querySelector(target), { childList: true, subtree: true })
   );
}