> For the complete documentation index, see [llms.txt](https://kunalwalavalkar.gitbook.io/write-ups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kunalwalavalkar.gitbook.io/write-ups/root-me/web-client/javascript-authentication.md).

# Javascript - Authentication

<figure><img src="https://1586847736-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtSZ40gLWhBDTzPEgHsVB%2Fuploads%2F3O1yXjG2pUuTwju4oGo3%2F1.png?alt=media&amp;token=4c73aa3a-8db8-4899-aee9-9b91e8ac720f" alt=""><figcaption></figcaption></figure>

The form asks us to input the username and password.

Let's check the source code by going to `More tools > Developer tools > Elements`.

<figure><img src="https://1586847736-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtSZ40gLWhBDTzPEgHsVB%2Fuploads%2FBZ5W0vtgNuofKd4E1N7e%2F2.png?alt=media&amp;token=66d90248-332c-40b0-b498-9f48f0ec652a" alt=""><figcaption></figcaption></figure>

We can see that the `<input>` elements have the names `pseudo` and `password`.

If we go to the `Sources` tab we can see the files and resources that are being accessed.&#x20;

<figure><img src="https://1586847736-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtSZ40gLWhBDTzPEgHsVB%2Fuploads%2FTu5lQD1qyRTStgCq32XX%2F3.png?alt=media&amp;token=695a29b0-92bd-4e85-8840-57046549fb41" alt=""><figcaption></figcaption></figure>

Let's check the `login.js` file.

<figure><img src="https://1586847736-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtSZ40gLWhBDTzPEgHsVB%2Fuploads%2F9DZI1ivGGpWgrIccxhbG%2F4.png?alt=media&amp;token=1b7c1b76-cba6-47b1-b533-1b7800a53871" alt=""><figcaption></figcaption></figure>

So the script has a conditional statement that allows login if the username is `4dm1n` and the password is `sh.org`.

<figure><img src="https://1586847736-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtSZ40gLWhBDTzPEgHsVB%2Fuploads%2FpiLsGo3DtLjlwaJf41sO%2F5.png?alt=media&amp;token=06485991-a9f1-4ca0-a8b2-51721451d355" alt=""><figcaption></figcaption></figure>

## Password

```
sh.org
```
