Javascript - Authentication
![](https://kunalwalavalkar.gitbook.io/~gitbook/image?url=https%3A%2F%2F1586847736-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FtSZ40gLWhBDTzPEgHsVB%252Fuploads%252F3O1yXjG2pUuTwju4oGo3%252F1.png%3Falt%3Dmedia%26token%3D4c73aa3a-8db8-4899-aee9-9b91e8ac720f&width=768&dpr=4&quality=100&sign=142393a8&sv=2)
The form asks us to input the username and password.
Let's check the source code by going to More tools > Developer tools > Elements
.
![](https://kunalwalavalkar.gitbook.io/~gitbook/image?url=https%3A%2F%2F1586847736-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FtSZ40gLWhBDTzPEgHsVB%252Fuploads%252FBZ5W0vtgNuofKd4E1N7e%252F2.png%3Falt%3Dmedia%26token%3D66d90248-332c-40b0-b498-9f48f0ec652a&width=768&dpr=4&quality=100&sign=37539586&sv=2)
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.
![](https://kunalwalavalkar.gitbook.io/~gitbook/image?url=https%3A%2F%2F1586847736-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FtSZ40gLWhBDTzPEgHsVB%252Fuploads%252FTu5lQD1qyRTStgCq32XX%252F3.png%3Falt%3Dmedia%26token%3D695a29b0-92bd-4e85-8840-57046549fb41&width=768&dpr=4&quality=100&sign=5741fc1c&sv=2)
Let's check the login.js
file.
![](https://kunalwalavalkar.gitbook.io/~gitbook/image?url=https%3A%2F%2F1586847736-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FtSZ40gLWhBDTzPEgHsVB%252Fuploads%252F9DZI1ivGGpWgrIccxhbG%252F4.png%3Falt%3Dmedia%26token%3D1b7c1b76-cba6-47b1-b533-1b7800a53871&width=768&dpr=4&quality=100&sign=793f8529&sv=2)
So the script has a conditional statement that allows login if the username is 4dm1n
and the password is sh.org
.
![](https://kunalwalavalkar.gitbook.io/~gitbook/image?url=https%3A%2F%2F1586847736-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FtSZ40gLWhBDTzPEgHsVB%252Fuploads%252FpiLsGo3DtLjlwaJf41sO%252F5.png%3Falt%3Dmedia%26token%3D06485991-a9f1-4ca0-a8b2-51721451d355&width=768&dpr=4&quality=100&sign=c3274e52&sv=2)
Password
Last updated
Was this helpful?