> For the complete documentation index, see [llms.txt](https://unsbotch.gitbook.io/unsbotch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsbotch.gitbook.io/unsbotch/my-writeups/twitter-challs/login-as-a-user-2.md).

# Login as a User #2

PinkDraconian just published new task on twitter with 20 solves.

<figure><img src="/files/fR46EpqM69xbfv8HXHVy" alt="" width="563"><figcaption></figcaption></figure>

A basic sql injection web challenge with provided source code.

While visiting web-site we can look at main page:

<figure><img src="/files/6qtGHQRmQhXKXHafTurt" alt=""><figcaption></figcaption></figure>

we can see the basic form of login and first we try is sqli bypass:

<figure><img src="/files/vTtoZ44PFzk1ZPbTghHH" alt=""><figcaption></figcaption></figure>

there is 500 which talking about sqli but if we look at code:

<figure><img src="/files/PQuTHVrgsP8j2Habgfzo" alt=""><figcaption></figcaption></figure>

There is a filter on `=` sign. Also we can not use username bigger than 20 chars and less than 3, keywords "true", i noticed that there is .toLowerCase() function using and thought about overflow of database, like char as `İ` converted to lowercase will used as ii. After some attempts i found that it s not right vector because just we don't have any profit parameter to overflow.

Then i just tried to experiment with query code:

<figure><img src="/files/SazSlAD1tVQp1NN6Jdvp" alt=""><figcaption></figcaption></figure>

But similar attempts was failed

<figure><img src="/files/vZsK85Tb1fxDFXl2d0cS" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ovdb6WYbDJSDA2iibE80" alt=""><figcaption></figcaption></figure>

So error triggering because of there is additional comma in the password field, if we add plus one quotation mark in the password field:

<figure><img src="/files/3MQytvueyBqOcfPIbAvZ" alt=""><figcaption></figcaption></figure>

We don't have error:

<figure><img src="/files/iP7qsHgeKtGsSPd0WPbd" alt=""><figcaption></figcaption></figure>

So the password  has evenly quantity q.m, so we can just comments after username and bypass authorization:

<figure><img src="/files/LL08PJaDyRX8LWQUZFgk" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/3SZtXWi6knfElRBHeuAl" alt=""><figcaption></figcaption></figure>
