GET
request is the default request to obtain the remote resource hosted at that URL.
Using browser devtool’s Network tab to understand how a web app interacts with its backend is an essential exercise for any web app assessment or bug bounty exercise.
HTTP Basic Auth
Let’s say there is a web app with basic HTTP authentication
running on it.
If we try yo access the page with cURL
, we won’t be able to, without credentials.
We can provide credentials through cURL using -u
flag:
We can authenticate without using -u
flag by directly providing basic HTTP auth
credentials as such:
HTTP Authorization Header
If we add -v
flag to the same web app being used above, we can see the line Authorization: Basic YWRtaW46YWRtaW4=
.
YWRtaW46YWRtaW4=
decodes as admin:admin
yoon@yoon-XH695R:/var/www/html$ echo "YWRtaW46YWRtaW4=" | base64 -d
admin:admin
Instead of providing credentials, we can just specify authorization header as such and it would still work:
jadu101@htb[/htb]$ curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' http://<SERVER_IP>:<PORT>/
<!DOCTYPE html
<html lang="en">
<head>
...SNIP...