[00:01]
or is making comments on my videos and saying hey why can't you make videos on screen and show us the process and honestly it isn't as easy as it sounds a are private I wanted to mentioned or even some of these public companies they
[00:16]
they don't want their vulnerabilities to be out there it's a crappy situation to be in it is unfortunately out of my hands but I do think that I do have a is every few weeks or maybe a few months I'll make a challenge or a room or
[00:31]
something like that and I'll make a CTF and I would publish it and I will tell you at the end of this video how you can access these but I want to make these ctfs and do a walkthrough of them on this channel so you can see what my
[00:43]
thought process was how I found it and all of these are based on actual vulnerabilities that I have found so for this one as you have seen the title it is called how I hack the casino and a couple of months ago I had the chance to
[00:56]
Europe I think this is one of my cooler interesting fun bugs that was super easy day and I've actually looked for a bunch of times so why not make a video and I'm gonna do is I'm going to try and tell you kind of what it looked like
[01:12]
what I was looking for what my thought process was but keep in mind that this application isn't going to look pretty the design is not going to be the same but the majority of the vulnerability thanks to Adam Langley one of my really
[01:25]
good friends who's helped me with this I was able to recreate the scenario so I looks like so what we're going to do is we're going to jump into this application really quickly what you see on this screen is pretty much a fake
[01:38]
version of what I saw when I found this application it was a lottery system and all I saw was this login page and it just shows a forgot password and if you Javascript file you can see also that
[01:51]
reset works so we're going to make a note of it right here put it right here just in case we need it and then we're going to look it says the username is using your name so it probably takes a parameter called username and then just
[02:03]
password resets for that user we can do things like going in here and doing maybe a password reset for admin see if there's anything there for admin they're probably not going to tell you you can try easy passwords I tried all
[02:16]
of these it didn't work but what I did work is I went back to just ripping this application apart by just looking at brute forcing for parameters and that here we're going to quickly go to FF and we're just going to tell it hey I want
[02:30]
to Brute Force for this path using this word list that I have you can get a word list from honestly somewhere like the asset node website or you can go to set ones and then I'm just going to say hey the URL is this and I want you to look
[02:46]
for anything that is pretty much within the anything that is pretty much within the 200 maybe the 300 to 305 or 307 even specifically for this because I know there's gonna be some apis I want to
[02:59]
look for 400 in case there's a bad request a 405 in case the method is wrong A4 or 3 and 401 in case I don't have access to it and we're just gonna leave 500 in there just for the fun of it and we're gonna run this really
[03:12]
quickly oops it looks like I forgot to include my fuzz into the URL this is where FF is going to look for and let's see what I said wrong comma at the end there we go and we can see right now saying hey API V1 exist login exists
[03:27]
I've built this Challenge and I know where the bugs were so I'm just going to nothing there it wasn't worth looking at it but what was interesting was this path right here that we took a note of this API V1 and the auth is what's
[03:41]
really interesting because obviously they're using this to do authentication and login and I want a Brute Force for it so you can always start with API and V1 but I already know that's not going to work the auth is what was super
[03:53]
interesting and I just made my way through it and just to the fuzz really quickly and right off the bat you can see that new is coming back with a 405 and it's telling us hey 405 was something that came up for new and we're
[04:07]
gonna copy this and once it's finished or before you even finish we can go to curl and do a curl x get which is where he's saying Hey I want you to make a get request to this parameter and it was
[04:19]
called new let's just make sure one more time we're going to go back and it looks like it was new I'm gonna make that request and it comes back and says hey method not allowed and if we do an ik it's going to show us the
[04:31]
do an I it's going to show us the entire headers and you can see here it says method not allowed so it looks like it takes something else my assumption would be to do a post or maybe a put we can do options to see if it leaks that which it
[04:45]
going to do is manually we're going to try with post and we're going to make a post request and see if it comes back and it does say that hey there is funny to think about it because even though this entire endpoint is hidden it
[05:01]
what's missing out of our request and what we can do here is we can actually send that request without the missing field so it looks like username is one of them you can do username maybe no homesick we can do password or there's
[05:15]
an email actually we can do an email we'll do it in a homesick at test.com and a password is one two three four five six seven and the other their password two is one two three four five six seven I'm assuming password two here
[05:29]
is our confirmation for that password but it comes back it says password 2 is missing so maybe we didn't give it the right and it comes back and says flag one obviously we put this in there for you
[05:42]
to try out but you can see it is telling us that the account was created and all site and we're going to use the home set with the password that I put right here with the password that I put right here and see if that works so
[05:56]
we are here and it just says that our username is awaiting verification so it looks like we've created the email but there wasn't a verification done and unfortunately for me when I created this I realized that that no email was coming
[06:10]
to me the emails weren't coming through at all and I was kind of stuck with what take a look at here is we're going to do a refresh and look at all the different background because that is what the solution was and right here if you look
[06:24]
it is making their request to API V1 users slash me which I'm assuming it's ourselves and of course right here you can see the flag too is to tell you on
[06:36]
this as a CTF quote-unquote but right here we can see there is a username there is an email and there's this verification token this is how you probably verify yourself but again I have this but I still don't know how to
[06:51]
verify myself and I know there's a verification step missing so we're gonna have to take a look here is maybe we have to fuzz this API from a perspective of being logged in and see what it does so right here we can quickly just dump
[07:05]
our cookie for example let's see if I can do that very quickly I'm gonna go to my console also you can use burp suite for but right now it's just easy to do this I'm going to say document
[07:18]
dot cookie and it's going to give us this token so obviously the token wasn't remember that this is created for the purpose of education so we have made it a little bit easier I'm gonna go back in here and we're going to do the same
[07:32]
exact search but instead this time we're going to add a header called cookie and we're going to redo this entire process comes back into this new exists and we're gonna see if it finds anything else that could be useful to us so this
[07:47]
something there but what we have to pay attention to here is that we just discovered that there's a user's endpoint under V1 so maybe the verification isn't under off and what we want is under V1 and we're going to open
[08:00]
up more access here by giving a cookie value so for example if there is a user's slash one or two or three it's not going to give us that access being an anonymous user without a ballot token but instead maybe here it's going to
[08:13]
work with and you can see right here there's a user's template that we can show us some stuff but the more important one is right here you can see talk about that in a bit but the other thing that's really interesting here is
[08:27]
thing that's really interesting here is the verify right if we do verify and we hit this endpoint with our cookie I wonder what it's going to take from us we're going to do curl and we're going to do an X get to this token and again
[08:39]
we're going to put this clicky value in our Header by giving it the h and doing cookie like this and we send this it says oh it has to be HTTP not https and it says method not allowed so one more time we're going to go back in here
[08:54]
that's what it gets it's usually post put or patch and says missing a verification token so we're going to go back to here and we're going to grab our verification token for users me
[09:07]
and right off the bat we can actually verify ourselves by saying by saying that hey here is the missing verification token and passing this to it let's start one more time I made a typo here it looks
[09:23]
like and then now here we can see this giving us another error it says hey looks like we need to have our user ID and we have that information also here so just copy it and we paste it into this
[09:38]
and it says user verified so I'm assuming now if I go back here and I refresh the page we should have access to more stuff and right here you can see that we have access there's your flag three but it looks like we have access
[09:50]
to all these users and when I go to upload it says you don't have access to this future but what's really cool is that we have access to the list of it here it's not supposed to be there so when you go to this you will not have
[10:03]
access to the list of the usernames when this is released for for you guys to try I do have access to the list of usernames and I do know which ones are usernames and I do know which ones are actually admin so all I have to do here
[10:16]
is find a way to Brute Force for one of these users just copying the username in these users just copying the username in here and pasting it into my FF or would be an easy one you can just intercept this login request copy paste
[10:30]
and then brute forcing for the password to get access to it so actually that is exactly what I did I actually went into verbs feed how to raw queue.txt or
[10:42]
or password 2 in there and a couple of them I Brute Force for it and it worked and that's how I got access to it and ended up giving me access to the upload is to show you just because there is a login page without a sign up without
[10:57]
anything without access there isn't a way to get access to so if you see these things sometimes they allow you to sign up as a partner on another website sometimes you can go to the JavaScript find an admin endpoint that could create
[11:11]
a user for you that gives you access to one of these don't give up make sure you find a way to sign up or at least try to stop the video here because I don't want to spoil the whole thing I've given you
[11:25]
admin access there's one more step is to just go in there and upload a file file there and all you can do is upload a shell and you have a shell on that system and it's easily accessible on the vulnerability that I did find in this
[11:39]
website there was also a couple other things if for example it leaked a list of all the users that were enrolled in this lottery I could also upload files you can modify users data after I got admin and so on I know I promise that I
[11:53]
was going to show you how to access this and here's how you can actually access yourself all you gotta do is go to hackinghub.io to brand new website that I've worked with a few friends to design John Hammonds on there Adam I mentions
[12:07]
from now on all these different challenges that I do create is going to live there for free for you guys to access and try on your own so all you gotta do is go to hackinghub.io look for the casino room and click it launch the
[12:21]
Hub and follow along all right that's it do me a favor drop me a comment let me this something you want to see more of does it make sense to do these videos do applications along these videos and if you haven't already do me a favor it's
[12:36]
a like of this video And subscribe to the channel and turn on that notification Bell so you get notified every Monday when I drop a brand new video alright see you all next week peace yes