← All talks

Armend Gashi - What do OAuth and Football Clubs have in common? - BSides Prishtina 2022

BSides Prishtina · 20228:50156 viewsPublished 2022-05Watch on YouTube ↗
Speakers
Tags
CategoryTechnical
DifficultyAdvanced
TeamRed
StyleTalk
Mentioned in this talk
About this talk
"What do OAuth and Football Clubs have in common?" presentation will cover numerous attacking vectors that include but are not limited to OAuth, Cloud, Cosmos DB, and KIOSK Escape to compromise an application used by the majority of the most prominent football clubs. Prior to the main topic of this presentation, the presenter will highlight career challenges, burnout avoidance, and guidance for everyone who intends to pursue a career in cyber security. As per the technical part of the talk, the presenter will elaborate on the advanced exploitation of the following topics: OAuth Protocol - What is OAuth, how does OAuth work, and what does it mean to an adversary? OAuth Scope and Audience - What is the Scope of OAuth, and what is the Audience? OAuth API - Our point of reference and how can we take advantage of OAuth? OpenID - What is OpenID, and what risks can it pose? Cloud Penetration Testing - What does an SSRF mean in a cloud-based application, and what is the impact of the identified SSRF? Forged authentication requests via OAuth - How can an attacker take advantage of OAuth? BONUS: The audience is not always remote! Cosmos NoSQL Database - What is the CosmosDB, what does it mean to an adversary, and how can it be exploited? KIOSK escapes - What is KIOSK mode, and how can we take advantage of it? What do these topics mean for the majority of the most prominent football clubs?
Show transcript [en]

uh so who's ready to have some football um all right a short video i'm arnold gauschi i'm a senior penetration tester at century and prior to being part of century i attended the ciacp program at cyber academy guided by dre north monae throughout this time in century i had the opportunity to participate in a lot of engagements that included but were not limited to application penetration testing such as web mobile or uh say clients they included also cloud infrastructures in uh aws azure and google cloud platform apis internal external penetration testing real team and engagements and social engineering what i also define crucial for for our career as uh penetration testers is taking care of of of your burnouts as

it's so easy to get burned out in this career so what i do i try to enjoy my my free time which mainly include playing drums but of course i'm listening to some cool heavy metal music so uh the outline for this presentation will be how to hack uh a lot of football clubs so i have a question for our audience do you have any ideas what do oauth and football clubs have in common

all right so um what they do have in common is the audience and i'm going to tell you why in a few minutes so the the outline will cover of open id connect which will cover a general overview on how they work and what they are and some of their features such as dynamic client registration they're uh the risks that they pose and the hard-coded secrets and the risks that they pose and how did we compromise the majority of the most prominent football clubs apart from it we also have a bonus outline that includes cosmos databases and how to escape the kiosk so what is the walls and open id so basically oauth is an authorization

protocol that allows uh users to sign in using their google account or their facebook account today to the uh to the application meanwhile open id is a protocol that is mainly focused on uh it is mainly focused on the authentication process so the main difference between authentication and authorization is that with authentication the application tries to uh to know who you are and with authorization basically it restricts the scope on which data or which files you have uh access to throughout this talk some of the terminologies that we might need are the client credentials which include client id and client secret which are similar to username and password uh we might also need the the scope which is basically

your limitation towards those credentials within the application and the audience which is the intended recipient of the token so merchandiser information will be able to hack the majority of the most football clubs so the methodology for this engagement was uh since it was using the openid connect we tried to grab the open id configuration which led to the dynamic client registration endpoint which led to a failed attempt to perform uh dynamic client registration so initially then we proceeded to uh with a initial authentication request which generated the following scope highlighted in red and we also got an access token which was limited only to our our set of data and we could not really really escape that apart from an

insecure direct object reference that we identified in the application but it was very limited as you can see down here the the id uh highlighted in red is a unique identifier in the hex format not easily resourceable and the attacking surface was very limited even though they retrieved data include uh passwords of their database that were hosted locally in the in the targeted infrastructure but again the attacking surface is limited and we could not really do anything with that next we have also identified a another uh insecure direct logic reference which was uh read only access control flow by supplying the administrator's email address we were able to retrieve a lot of sensitive information that included

all the football players some of the most prominent football clubs and it included their name their last name their date of birth they unique identifier that we might be using later what is their max heart rate when they are running and their resting heart rate so on and so forth and initially then we will try to to see if there is any any sensitive information stored in the applications configuration files this this was also a sc client so this led to some very sensitive information that was the client id and the client secret and performing the authentication request with the client credentials grant type led to the to the following scope that would allow us to read all of the users update any

of the users and delete any of the users which could lead to a potential denial of service for the for the application and they could they could not offer uh their service anymore so now that we have this scope and we have this json web token what is our next step the next step is that we might we might want to to view at the official api documentation of oauth and see how we can abuse all of these legitimate uh functionalities within the application so i've navigated to the to the official documentation and uh and noticed that all of these actions are legitimate and we can perform uh any of that action moving forward this is the uh the attacking scenario

that uh that we have come up for so firstly we have registered the we have listed the registered users and then we have grabbed the administrator's email address and then we could also change that password and then you could take over the football club you name it uh proceeding with that to list these users i've listed here some endpoints but i don't think you can see them but it's okay so it's the api slash v2 slash users which lists all the available users then we could list the users by their id or list their roles or list them by their email address moving forward to compromise the football club you name it we would need to send a patch

request to this uh end point which is all zero pipe the unique identifier that we could have grabbed from the uh from the listing uh request that we have initiated uh previously and then as as a penetration tester we all know that it's it's never enough to to perform hacking so we have we have proceeded to hack even more so in this case we have the penalty round where there's a bonus outline and the bonus outline is that the application was throwing even more hard-coded secrets that included the application's connection strength to their cosmos database and using that connection string then we were we were able to to perform a lot of actions such as connect to

their database and then view all of the players information in this list we could we could name some of the best football teams like chelsea or paris and german so on and so forth and all of their players their data and we could read them modify them and also we could delete them um so as the last bonus outline we had the the kiosk escape so basically the applications uh browser render engine was not properly configured which allowed us to navigate to to the settings and then after navigating to the settings we were able to uh to pop that cmd with the anti-authority uh permissions so using this way we were able to uh to

play we are the championship queen so yeah that's the way how how we hacked uh the most of the football clubs in the in the world so thank you for your attention any questions