<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Auth on s4yhii&#39;s blog</title>
    <link>https://blog.s4yhii.com/tags/auth/</link>
    <description>Recent content in Auth on s4yhii&#39;s blog</description>
    <image>
      <title>s4yhii&#39;s blog</title>
      <url>https://blog.s4yhii.com/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</url>
      <link>https://blog.s4yhii.com/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</link>
    </image>
    <generator>Hugo -- 0.155.3</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 15 Mar 2022 12:00:00 -0400</lastBuildDate>
    <atom:link href="https://blog.s4yhii.com/tags/auth/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Broken Authentication</title>
      <link>https://blog.s4yhii.com/posts/2022-03-15-broken-authentication/</link>
      <pubDate>Tue, 15 Mar 2022 12:00:00 -0400</pubDate>
      <guid>https://blog.s4yhii.com/posts/2022-03-15-broken-authentication/</guid>
      <description>&lt;p&gt;Authentication is the process of verifying the identity of a given user or client. In other words, it involves making sure that they really are who they claim to be, there are three authentication factors:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Something you &lt;strong&gt;know&lt;/strong&gt;, such as password or security question, known as &amp;ldquo;knowledge factors&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Something you &lt;strong&gt;have&lt;/strong&gt;, a physical object like a mobile phone or security token, known as &amp;ldquo;possession factors&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Something you &lt;strong&gt;are&lt;/strong&gt;, for example biometrics or patterns of behavior, known as &amp;ldquo;inherence factors&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What is the difference between authentication and authorization?&lt;/strong&gt;
Authentication is the process of verifying that a user &lt;strong&gt;is who they claim to be&lt;/strong&gt;, whereas authorization involves verifying whether a user &lt;strong&gt;is allowed to do something&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Broken Authentication Labs</title>
      <link>https://blog.s4yhii.com/posts/2022-03-15-broken-authentication-labs/</link>
      <pubDate>Tue, 15 Mar 2022 12:00:00 -0400</pubDate>
      <guid>https://blog.s4yhii.com/posts/2022-03-15-broken-authentication-labs/</guid>
      <description>&lt;h1 id=&#34;vulnerabilities-in-password-based-login&#34;&gt;Vulnerabilities in password-based login&lt;/h1&gt;
&lt;h2 id=&#34;username-enumeration-via-different-responses&#34;&gt;Username enumeration via different responses&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;With Burp running, investigate the login page and submit an invalid username and password.&lt;/li&gt;
&lt;li&gt;In Burp, go to &lt;strong&gt;Proxy &amp;gt; HTTP history&lt;/strong&gt; and find the &lt;code&gt;POST /login&lt;/code&gt; request. Send this to Burp Intruder.&lt;/li&gt;
&lt;li&gt;In Burp Intruder, go to the &lt;strong&gt;Positions&lt;/strong&gt; tab. Make sure that the &lt;strong&gt;Sniper&lt;/strong&gt; attack type is selected.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Clear §&lt;/strong&gt; to remove any automatically assigned payload positions. Highlight the value of the &lt;code&gt;username&lt;/code&gt; parameter and click &lt;strong&gt;Add §&lt;/strong&gt; to set it as a payload position. This position will be indicated by two &lt;code&gt;§&lt;/code&gt; symbols, for example: &lt;code&gt;username=§invalid-username§&lt;/code&gt;. Leave the password as any static value for now.&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Payloads&lt;/strong&gt; tab, make sure that the &lt;strong&gt;Simple list&lt;/strong&gt; payload type is selected.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Payload options&lt;/strong&gt;, paste the list of candidate usernames. Finally, click &lt;strong&gt;Start attack&lt;/strong&gt;. The attack will start in a new window.&lt;/li&gt;
&lt;li&gt;When the attack is finished, on the &lt;strong&gt;Results&lt;/strong&gt; tab, examine the &lt;strong&gt;Length&lt;/strong&gt; column. You can click on the column header to sort the results. Notice that one of the entries is longer than the others. Compare the response to this payload with the other responses. Notice that other responses contain the message &lt;code&gt;Invalid username&lt;/code&gt;, but this response says &lt;code&gt;Incorrect password&lt;/code&gt;. Make a note of the username in the &lt;strong&gt;Payload&lt;/strong&gt; column.&lt;/li&gt;
&lt;li&gt;Close the attack and go back to the &lt;strong&gt;Positions&lt;/strong&gt; tab. Click &lt;strong&gt;Clear&lt;/strong&gt;, then change the &lt;code&gt;username&lt;/code&gt; parameter to the username you just identified. Add a payload position to the &lt;code&gt;password&lt;/code&gt; parameter. The result should look something like this: &lt;code&gt;username=identified-user&amp;amp;password=§invalid-password§&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Payloads&lt;/strong&gt; tab, clear the list of usernames and replace it with the list of candidate passwords. Click &lt;strong&gt;Start attack&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;When the attack is finished, look at the &lt;strong&gt;Status&lt;/strong&gt; column. Notice that each request received a response with a &lt;code&gt;200&lt;/code&gt; status code except for one, which got a &lt;code&gt;302&lt;/code&gt; response. This suggests that the login attempt was successful - make a note of the password in the &lt;strong&gt;Payload&lt;/strong&gt; column.&lt;/li&gt;
&lt;li&gt;Log in using the username and password that you identified and access the user account page to solve the lab.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;username-enumeration-via-subtly-different-responses&#34;&gt;Username enumeration via subtly different responses&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;With Burp running, submit an invalid username and password. Send the &lt;code&gt;POST /login&lt;/code&gt; request to Burp Intruder and add a payload position to the &lt;code&gt;username&lt;/code&gt; parameter.&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Payloads&lt;/strong&gt; tab, make sure that the &lt;strong&gt;Simple list&lt;/strong&gt; payload type is selected and add the list of candidate usernames.&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Options&lt;/strong&gt; tab, under &lt;strong&gt;Grep - Extract&lt;/strong&gt;, click &lt;strong&gt;Add&lt;/strong&gt;. In the dialog that appears, scroll down through the response until you find the error message &lt;code&gt;Invalid username or password.&lt;/code&gt;. Use the mouse to highlight the text content of the message. The other settings will be automatically adjusted. Click &lt;strong&gt;OK&lt;/strong&gt; and then start the attack.&lt;/li&gt;
&lt;li&gt;When the attack is finished, notice that there is an additional column containing the error message you extracted. Sort the results using this column to notice that one of them is subtly different.&lt;/li&gt;
&lt;li&gt;Look closer at this response and notice that it contains a typo in the error message instead of a full stop/period, there is a trailing space. Make a note of this username.&lt;/li&gt;
&lt;li&gt;Close the attack and go back to the &lt;strong&gt;Positions&lt;/strong&gt; tab. Insert the username you just identified and add a payload position to the &lt;code&gt;password&lt;/code&gt; parameter: &lt;code&gt;username=identified-user&amp;amp;password=§invalid-password§&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Payloads&lt;/strong&gt; tab, clear the list of usernames and replace it with the list of passwords. Start the attack.&lt;/li&gt;
&lt;li&gt;When the attack is finished, notice that one of the requests received a &lt;code&gt;302&lt;/code&gt; response. Make a note of this password.&lt;/li&gt;
&lt;li&gt;Log in using the username and password that you identified and access the user account page to solve the lab.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;username-enumeration-via-response-timing&#34;&gt;Username enumeration via response timing&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;With Burp running, submit an invalid username and password, then send the &lt;code&gt;POST /login&lt;/code&gt; request to Burp Repeater. Experiment with different usernames and passwords. Notice that your IP will be blocked if you make too many invalid login attempts.&lt;/li&gt;
&lt;li&gt;Identify that the &lt;code&gt;X-Forwarded-For&lt;/code&gt; header is supported, which allows you to spoof your IP address and bypass the IP-based brute-force protection.&lt;/li&gt;
&lt;li&gt;Continue experimenting with usernames and passwords. Pay particular attention to the response times. Notice that when the username is invalid, the response time is roughly the same. However, when you enter a valid username (your own), the response time is increased depending on the length of the password you entered.&lt;/li&gt;
&lt;li&gt;Send this request to Burp Intruder and select the attack type to &lt;strong&gt;Pitchfork&lt;/strong&gt;. Clear the default payload positions and add the &lt;code&gt;X-Forwarded-For&lt;/code&gt; header.&lt;/li&gt;
&lt;li&gt;Add payload positions for the &lt;code&gt;X-Forwarded-For&lt;/code&gt; header and the &lt;code&gt;username&lt;/code&gt; parameter. Set the password to a very long string of characters (about 100 characters should do it).&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Payloads&lt;/strong&gt; tab, select payload set 1. Select the &lt;strong&gt;Numbers&lt;/strong&gt; payload type. Enter the range 1 - 100 and set the step to 1. Set the max fraction digits to 0. This will be used to spoof your IP.&lt;/li&gt;
&lt;li&gt;Select payload set 2 and add the list of usernames. Start the attack.&lt;/li&gt;
&lt;li&gt;When the attack finishes, at the top of the dialog, click &lt;strong&gt;Columns&lt;/strong&gt; and select the &lt;strong&gt;Response received&lt;/strong&gt; and &lt;strong&gt;Response completed&lt;/strong&gt; options. These two columns are now displayed in the results table.&lt;/li&gt;
&lt;li&gt;Notice that one of the response times was significantly longer than the others. Repeat this request a few times to make sure it consistently takes longer, then make a note of this username.&lt;/li&gt;
&lt;li&gt;Create a new Burp Intruder attack for the same request. Add the &lt;code&gt;X-Forwarded-For&lt;/code&gt; header again and add a payload position to it. Insert the username that you just identified and add a payload position to the &lt;code&gt;password&lt;/code&gt; parameter.&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Payloads&lt;/strong&gt; tab, add the list of numbers in payload set 1 and add the list of passwords to payload set 2. Start the attack.&lt;/li&gt;
&lt;li&gt;When the attack is finished, find the response with a &lt;code&gt;302&lt;/code&gt; status. Make a note of this password.&lt;/li&gt;
&lt;li&gt;Log in using the username and password that you identified and access the user account page to solve the lab.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;broken-brute-force-protection-ip-block&#34;&gt;Broken brute-force protection, IP block&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;With Burp running, investigate the login page. Observe that your IP is temporarily blocked if you submit 3 incorrect logins in a row. However, notice that you can reset the counter for the number of failed login attempts by logging in to your own account before this limit is reached.&lt;/li&gt;
&lt;li&gt;Enter an invalid username and password, then send the &lt;code&gt;POST /login&lt;/code&gt; request to Burp Intruder. Create a pitchfork attack with payload positions in both the &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt; parameters.&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Resource pool&lt;/strong&gt; tab, add the attack to a resource pool with &lt;strong&gt;Maximum concurrent requests&lt;/strong&gt; set to &lt;code&gt;1&lt;/code&gt;. By only sending one request at a time, you can ensure that your login attempts are sent to the server in the correct order.&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Payloads&lt;/strong&gt; tab, select payload set 1. Add a list of payloads that alternates between your username and &lt;code&gt;carlos&lt;/code&gt;. Make sure that your username is first and that &lt;code&gt;carlos&lt;/code&gt; is repeated at least 100 times.&lt;/li&gt;
&lt;li&gt;Edit the list of candidate passwords and add your own password before each one. Make sure that your password is aligned with your username in the other list.&lt;/li&gt;
&lt;li&gt;Add this list to payload set 2 and start the attack.&lt;/li&gt;
&lt;li&gt;When the attack finishes, filter the results to hide responses with a 200 status code. Sort the remaining results by username. There should only be a single 302 response for requests with the username &lt;code&gt;carlos&lt;/code&gt;. Make a note of the password from the &lt;strong&gt;Payload 2&lt;/strong&gt; column.&lt;/li&gt;
&lt;li&gt;Log in to Carlos&amp;rsquo;s account using the password that you identified and access his account page to solve the lab.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;username-enumeration-via-account-lock&#34;&gt;Username enumeration via account lock&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;With Burp running, investigate the login page and submit an invalid username and password. Send the &lt;code&gt;POST /login&lt;/code&gt; request to Burp Intruder.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
