{"id":886,"date":"2020-05-09T04:12:29","date_gmt":"2020-05-09T03:12:29","guid":{"rendered":"http:\/\/zerothcode.com\/blog\/?p=886"},"modified":"2020-09-28T18:05:03","modified_gmt":"2020-09-28T17:05:03","slug":"otp-bypass-developers-check","status":"publish","type":"post","link":"https:\/\/zerothcode.com\/blog\/otp-bypass-developers-check\/","title":{"rendered":"OTP Bypass &#8211; Developer\u2019s Check"},"content":{"rendered":"<p id=\"f71b\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\"><strong class=\"ft gl\">Summary :<\/strong><\/p>\n<p id=\"38af\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\">OTP\u200b is a string of characters or numbers automatically generated to be used for one single login attempt. OTP, One Time Passwords in full, can be sent to the user\u2019s phone via SMS or Push messaging and is used to protect web-based services, private credentials and data.<\/p>\n<p id=\"cd14\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\">I was checking for some bypasses of an OTP and I tried this thing to bypass the OTP and was successful. I call it\u00a0<strong class=\"ft gl\">Developer\u2019s Check\u00a0<\/strong>because I found it when I was reviewing the code of the application and some of the buttons. The mistake here was that the application was having the OTP check on the client side and was easily identifiable. Due to this mistake anyone can bypass the OTP very easily.<\/p>\n<p id=\"c593\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\"><strong class=\"ft gl\">How to find this vulnerability ?<\/strong><\/p>\n<ol class=\"\">\n<li id=\"8001\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge gm gn go\" data-selectable-paragraph=\"\">Go to your target website<\/li>\n<\/ol>\n<figure class=\"gq gr gs gt gu gv co cp paragraph-image\">\n<div class=\"gw gx gy gz ai\">\n<div class=\"co cp gp\">\n<div class=\"hf r gy hg\">\n<div class=\"hh hi r\">\n<div class=\"ha hb s t u hc ai av hd he\"><img loading=\"lazy\" decoding=\"async\" class=\"s t u hc ai hj hk bc rc\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/60\/1*CbleSAJbnDfISy3yISHJnA.png?q=20\" width=\"1330\" height=\"723\" \/><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"lz rb s t u hc ai hm\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/1330\/1*CbleSAJbnDfISy3yISHJnA.png\" sizes=\"auto, 700px\" srcset=\"https:\/\/miro.medium.com\/max\/552\/1*CbleSAJbnDfISy3yISHJnA.png 276w, https:\/\/miro.medium.com\/max\/1104\/1*CbleSAJbnDfISy3yISHJnA.png 552w, https:\/\/miro.medium.com\/max\/1280\/1*CbleSAJbnDfISy3yISHJnA.png 640w, https:\/\/miro.medium.com\/max\/1400\/1*CbleSAJbnDfISy3yISHJnA.png 700w\" width=\"1330\" height=\"723\" \/><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div><figcaption class=\"hn ho cq co cp hp hq cd eh ei cf ci\" data-selectable-paragraph=\"\">Registration<\/figcaption><\/figure>\n<p id=\"69dd\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\">2. Here I had an option to register and they will send me an OTP for login<\/p>\n<figure class=\"gq gr gs gt gu gv co cp paragraph-image\">\n<div class=\"gw gx gy gz ai\">\n<div class=\"co cp gp\">\n<div class=\"hf r gy hg\">\n<div class=\"hh hi r\">\n<div class=\"ha hb s t u hc ai av hd he\"><img loading=\"lazy\" decoding=\"async\" class=\"s t u hc ai hj hk bc rc\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/60\/1*kT7MHYoIXzngIfpMKrEgEA.png?q=20\" width=\"1330\" height=\"723\" \/><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"lz rb s t u hc ai hm\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/1330\/1*kT7MHYoIXzngIfpMKrEgEA.png\" sizes=\"auto, 700px\" srcset=\"https:\/\/miro.medium.com\/max\/552\/1*kT7MHYoIXzngIfpMKrEgEA.png 276w, https:\/\/miro.medium.com\/max\/1104\/1*kT7MHYoIXzngIfpMKrEgEA.png 552w, https:\/\/miro.medium.com\/max\/1280\/1*kT7MHYoIXzngIfpMKrEgEA.png 640w, https:\/\/miro.medium.com\/max\/1400\/1*kT7MHYoIXzngIfpMKrEgEA.png 700w\" width=\"1330\" height=\"723\" \/><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div><figcaption class=\"hn ho cq co cp hp hq cd eh ei cf ci\" data-selectable-paragraph=\"\">OTP received<\/figcaption><\/figure>\n<p id=\"757a\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\">3. Right-click on the \u201c<em class=\"hr\">Continue\u201d\u00a0<\/em>button and click on inspect element to check for some functions that validates the OTP check<\/p>\n<figure class=\"gq gr gs gt gu gv co cp paragraph-image\">\n<div class=\"gw gx gy gz ai\">\n<div class=\"co cp gp\">\n<div class=\"hf r gy hg\">\n<div class=\"hh hi r\">\n<div class=\"ha hb s t u hc ai av hd he\"><img loading=\"lazy\" decoding=\"async\" class=\"s t u hc ai hj hk bc rc\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/60\/1*WZXho_XjWDt5CcwS-E8Ybg.png?q=20\" width=\"1330\" height=\"723\" \/><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"lz rb s t u hc ai hm\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/1330\/1*WZXho_XjWDt5CcwS-E8Ybg.png\" sizes=\"auto, 700px\" srcset=\"https:\/\/miro.medium.com\/max\/552\/1*WZXho_XjWDt5CcwS-E8Ybg.png 276w, https:\/\/miro.medium.com\/max\/1104\/1*WZXho_XjWDt5CcwS-E8Ybg.png 552w, https:\/\/miro.medium.com\/max\/1280\/1*WZXho_XjWDt5CcwS-E8Ybg.png 640w, https:\/\/miro.medium.com\/max\/1400\/1*WZXho_XjWDt5CcwS-E8Ybg.png 700w\" width=\"1330\" height=\"723\" \/><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div><figcaption class=\"hn ho cq co cp hp hq cd eh ei cf ci\" data-selectable-paragraph=\"\">Inspect Element<\/figcaption><\/figure>\n<p id=\"a356\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\">4. Here you can see in the below screenshot that their is an event called\u00a0<em class=\"hr\">\u201ccheckOTP(event)\u201d<\/em><\/p>\n<figure class=\"gq gr gs gt gu gv co cp paragraph-image\">\n<div class=\"gw gx gy gz ai\">\n<div class=\"co cp hs\">\n<div class=\"hf r gy hg\">\n<div class=\"ht hi r\">\n<div class=\"ha hb s t u hc ai av hd he\">\n<figure style=\"width: 1421px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"s t u hc ai hj hk bc rc\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/60\/1*qyNZy1icnDD2o2fnyvZjbg.png?q=20\" alt=\"OTP\" width=\"1421\" height=\"723\" \/><figcaption class=\"wp-caption-text\">OTP<\/figcaption><\/figure>\n<\/div>\n<figure style=\"width: 1421px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"lz rb s t u hc ai hm\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/1421\/1*qyNZy1icnDD2o2fnyvZjbg.png\" alt=\"OTP\" width=\"1421\" height=\"723\" \/><figcaption class=\"wp-caption-text\">OTP<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/div><figcaption class=\"hn ho cq co cp hp hq cd eh ei cf ci\" data-selectable-paragraph=\"\">checkOTP(event) function<\/figcaption><\/figure>\n<p id=\"f969\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\">5. Simply type the event in the console of the browser<\/p>\n<figure class=\"gq gr gs gt gu gv co cp paragraph-image\">\n<div class=\"gw gx gy gz ai\">\n<div class=\"co cp gp\">\n<div class=\"hf r gy hg\">\n<div class=\"hh hi r\">\n<div class=\"ha hb s t u hc ai av hd he\">\n<figure style=\"width: 1330px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"s t u hc ai hj hk bc rc\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/60\/1*qPMVPREtX55aqqxeAAipyg.png?q=20\" alt=\"OTP\" width=\"1330\" height=\"723\" \/><figcaption class=\"wp-caption-text\">OTP<\/figcaption><\/figure>\n<\/div>\n<figure style=\"width: 1330px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"lz rb s t u hc ai hm\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/1330\/1*qPMVPREtX55aqqxeAAipyg.png\" alt=\"OTP\" width=\"1330\" height=\"723\" \/><figcaption class=\"wp-caption-text\">OTP<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/div><figcaption class=\"hn ho cq co cp hp hq cd eh ei cf ci\" data-selectable-paragraph=\"\">Click on the arrow<\/figcaption><\/figure>\n<p id=\"66a7\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\">6. After clicking on the arrow it will open a file in the debugger where you will an OTP that was send to the mobile<\/p>\n<figure class=\"gq gr gs gt gu gv co cp paragraph-image\">\n<div class=\"gw gx gy gz ai\">\n<div class=\"co cp hu\">\n<div class=\"hf r gy hg\">\n<div class=\"hv hi r\">\n<div class=\"ha hb s t u hc ai av hd he\">\n<figure style=\"width: 1617px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"s t u hc ai hj hk bc rc\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/60\/1*UtpX5kJKV2TLwdlmPLS5nw.png?q=20\" alt=\"OTP\" width=\"1617\" height=\"723\" \/><figcaption class=\"wp-caption-text\">OTP<\/figcaption><\/figure>\n<\/div>\n<figure style=\"width: 1617px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"lz rb s t u hc ai hm\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/1617\/1*UtpX5kJKV2TLwdlmPLS5nw.png\" alt=\"OTP\" width=\"1617\" height=\"723\" \/><figcaption class=\"wp-caption-text\">OTP<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/div><figcaption class=\"hn ho cq co cp hp hq cd eh ei cf ci\" data-selectable-paragraph=\"\">OTP<\/figcaption><\/figure>\n<p id=\"b18d\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\"><strong class=\"ft gl\">Logic Code :<\/strong><\/p>\n<p id=\"7059\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\">&lt;script type=\u2019text\/javascript\u2019&gt;<br \/>\nfunction checkOTP(e)<br \/>\n{<br \/>\n<strong class=\"ft gl\">if (document.getElementById(\u201ctxtOtp\u201d).value == 8951)<\/strong><br \/>\n{<br \/>\nvar formSignUp = document.getElementById(\u201cformSignUp\u201d);<br \/>\nformSignUp.submit();<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\nvar divWrongOTP = document.getElementById(\u2018divWrongOTP\u2019);<br \/>\ndivWrongOTP.style.display = \u2018inline\u2019;<br \/>\ne.preventDefault();<br \/>\nreturn;<br \/>\n}<br \/>\n}<br \/>\nfunction resubmitOtp()<br \/>\n{<br \/>\nlocation.reload();<br \/>\n}<br \/>\n&lt;\/script&gt;<\/p>\n<p id=\"082d\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\">As here you can see if \u201c<strong class=\"ft gl\">(document.getElementById(\u201ctxtOtp\u201d).value == 8951)\u201d<\/strong>\u00a0which means if the OTP that you entered matches\u00a0<em class=\"hr\">\u201c8951\u201d\u00a0<\/em>then only you will get a successful login which also means that\u00a0<em class=\"hr\">\u201c8951\u201d\u00a0<\/em>is your OTP.<\/p>\n<p id=\"5fd7\" class=\"fr gf ap ce ft b fu fv gg fw fx gh fy fz gi ga gb gj gc gd gk ge cx\" data-selectable-paragraph=\"\">Thank You \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary : OTP\u200b is a string of characters or numbers automatically generated to be used for one single login attempt.<\/p>\n","protected":false},"author":1,"featured_media":887,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[51],"tags":[],"yst_prominent_words":[1299,1300,1305,1303,1295,1301,200,65,1298,1294,1308,1302,1307,1297,1192,1306,1296,1309,115,1304],"class_list":["post-886","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/posts\/886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/comments?post=886"}],"version-history":[{"count":0,"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/posts\/886\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/media\/887"}],"wp:attachment":[{"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/media?parent=886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/categories?post=886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/tags?post=886"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/zerothcode.com\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}