Attacking Password Resets with Host Header Injection

Поділитися
Вставка
  • Опубліковано 1 жов 2024

КОМЕНТАРІ • 94

  • @sairahul14
    @sairahul14 Рік тому +30

    Ippsec always Rocks

  • @RespectableMan-ci2jb
    @RespectableMan-ci2jb Рік тому +18

    Great stuff thanks Ipp. Another thing I come across fairly frequently is Host headers being reflected in 302 redirect responses, sometimes there is a reflected XSS vector although it can be difficult to actually exploit.

  • @RespectableMan-ci2jb
    @RespectableMan-ci2jb Рік тому +60

    Would be another cool video idea on explaining some tips on how to find the origin IP address for a server behind cloud flare. Like what OSINT sources you can try, etc.

    • @ippsec
      @ippsec  Рік тому +33

      I don't know a way to do that without pointing out sites that incorrectly configured cloudflare. Without spending the money setting up a bunch of examples myself, which I don't really want to do right now. If my channel gets more members, I may consider it in the future.

    • @texastitan6567
      @texastitan6567 Рік тому +1

      @@ippsec dude I wish you channel would get more members. I’ve been subbed to you for years and how you don’t have more recognition truly amazes me. I guess the pen testing scene is relatively small but you’re so good at what you do. I genuinely appreciate you keeping your content genuine and not selling out by only doing entry level videos with big named guests and flashy clickbait thumbnails and titles like network chuck and other UA-camrs. You, cyber mentor, and John Hammond are my favorite UA-camrs. I even play your videos some nights when I’m going to bed because cyber security and programming are my favorite things to listen to when going to sleep. 😂

    • @briancarson3052
      @briancarson3052 Рік тому +1

      @@ippsec Greetings IppSec, I got a question. How does the backend IP of a website leak if the cloudflare is misconfigured? I mean how would someone setup it correctly to avoid getting his webserver IP?

    • @jordansmall5942
      @jordansmall5942 Рік тому +5

      @@briancarson3052 Make sure that your DNS records are set to "Proxied" instead of "DNS only" to hide your webserver's IP address.
      Make sure that you have set up firewall rules correctly to block all traffic except traffic coming from Cloudflare IP addresses.
      Make sure that your SSL certificate is set up correctly and is using the "Full (Strict)" mode.
      You can use Cloudflare's diagnostic tools to verify that your configuration is correct and that your webserver's IP address is not leaking.

    • @spooky4655
      @spooky4655 Рік тому +4

      The easiest way to do this is by using Censys and searching for information such as the website's HTML code, title, or any other information that you can use to pinpoint the website. Censys will show you the website's backend IP if it has scanned it in the past. The harder way is to set up your own server that scans the entire internet 24/7, including storing the website response.

  • @Cossaw
    @Cossaw Рік тому +4

    How could you figure out the IP of website behind cloudflare? Lovely talk!

  • @SimplyCyber
    @SimplyCyber Рік тому +1

    Great video. Clear, concise, and actionable. Thanks IppSec!

  • @ripmeep
    @ripmeep Рік тому +20

    Lovely stuff! The face cam is a really nice touch - really cool for these types of videos! Especially from such a handsome cyber sec guy haha

    • @ash_tray_6
      @ash_tray_6 7 місяців тому

      Hi fellow slow magic fan 🙂‍↕️ agreed though, it helps to make it more engaging hahah

    • @ripmeep
      @ripmeep 7 місяців тому

      @@ash_tray_6 WHAT??!!!!!!!!!!!!

  • @Free.Education786
    @Free.Education786 Місяць тому +1

    How to test different custom http request response headers for BSQLI XSS LFI RFI RCE ? Thanks

  • @Rhyl4x
    @Rhyl4x Рік тому +7

    Please could you do more videos like this especially after the video on the box that showcases the vulnerability, it's really helpful.

  • @_chappie_
    @_chappie_ Рік тому +4

    Interesting. Never knew about this. Makes me wonder how many websites I'm logged into that has this vulnerability.

  • @ThomasTomiczek
    @ThomasTomiczek Рік тому +3

    Just as a note for cloudflare: You can now publish websites NOT exposed to the internet iirc using their relay agent. Basically your agent connects o cloudflare and then forwards requests. That fixes hat issue.

  • @ringishpil
    @ringishpil Рік тому +4

    Hey I am new to this channel and to be frank this video is very hard to follow. I have a lot of backend experience, but as a newcomer to this channel I am new to many tools you are using, but you just glimpse through them. Also as a mobile heavy user I kept zooming in most of the time. Just a couple of tips that might or might not help. Peace ✌🏼

    • @DJcyberslash
      @DJcyberslash Рік тому +3

      Same. This dude is ridiculous to follow

    • @jc.baptiste
      @jc.baptiste Рік тому

      Same, the problem is that he does not explain well the big picture, like directions of requests.

  • @firosiam7786
    @firosiam7786 Рік тому +3

    This is a different type of vedio from your side its always solving htb boxes well this is a fresh sight to the eyes😇

  • @rumfordc
    @rumfordc Рік тому +4

    Are there really websites that allow user-defined headers to generate their password reset links? or am i misunderstanding what causes this? that seems beyond insane. what is the motive to design it this way?

    • @ippsec
      @ippsec  Рік тому +2

      You would be surprised. There are a lot of developers out there that don't look at how that variable is created, and just see it when trying to do something. Or copy off a bad stack overflow. I want to say Wordpress was also affected for a long time, you could find tons of examples with a google like:
      site:hackerone.com Host Header Injection

  • @JackBond1234
    @JackBond1234 Рік тому +2

    I made my site's password reset logic from total scratch, and luckily I already use an environment variable to get the domain.

  • @damuffinman6895
    @damuffinman6895 Рік тому +1

    Howdy Ippsec!
    What's your opinion on ChatGPT and it's impact on the security industry, if any at all. Do you use it to learn? As a programming aid?
    Thanks

  • @Dahlah.FightMe
    @Dahlah.FightMe Рік тому +1

    Nice Ipp :D

  • @akimbocs
    @akimbocs Рік тому +1

    are you using the Nvidia eye contact software?

    • @ippsec
      @ippsec  Рік тому +1

      Yes

    • @akimbocs
      @akimbocs Рік тому

      nice man, tripped me out for a bit :D

  • @prudhvikonakalla9605
    @prudhvikonakalla9605 Рік тому +2

    ♥️ from india

  • @lazarep1
    @lazarep1 Рік тому +7

    Hey ippsec, just a question, how would you actually exploit another person with this, as it requires intercepting the request and changing the headers, so isn't this just a self attack?

    • @0xdf
      @0xdf Рік тому +18

      The idea is that I reset your password with the modified header. Now when you get the email, you click the link, and the token arrives at my server. Now I can reset your password and access your account.

    • @lazarep1
      @lazarep1 Рік тому +6

      @@0xdf ah i see,thank you :D

    • @ward7576
      @ward7576 Рік тому +2

      @@0xdf thank you for explanation! Had the same confusion as to how this would even work without someone being in your network.

  • @Reelix
    @Reelix Рік тому +1

    Which brings up the question - Did you try to find the HTB IP without cloudflare, and try that? :)

    • @ippsec
      @ippsec  Рік тому +4

      I did not, the HTB Webserver only allows cloudflare to talk to it. Either through mutual ssl and/or iptables.

  • @chrismcknight7164
    @chrismcknight7164 Рік тому

    Ooh when did you start showing your face?

  • @ankanroy2
    @ankanroy2 Рік тому +1

    Environment variable is must efficient way

    • @berndeckenfels
      @berndeckenfels Рік тому

      Only if the app is reachable only via one url (for example intranet alternative). Then the env or config bar must have a accept-list or RE

    • @ankanroy2
      @ankanroy2 Рік тому +1

      Yeah

  • @manfredheinz3066
    @manfredheinz3066 Рік тому +1

    what i came across a few times is that it also is worth checking how it behaves when using the X-Forwarded-Host header. Often links will be crafted by the value provided in this header instead of host-header.

    • @ippsec
      @ippsec  Рік тому +1

      I thought about adding that, but no webserver (PHP/Python/Ruby) that I found would prefer the X-FORWARDED headers without some intentionally created thing, which means the developer really has to go out of their way to do that. So in my opinion, it is an extreme edge case.

  • @TimmyTSENGKaliOSCPpentest
    @TimmyTSENGKaliOSCPpentest Рік тому +1

    nice video

  • @ThisIsJustADrillBit
    @ThisIsJustADrillBit 11 місяців тому

    Wow. Just hearing how you think through things is amazing and eye opening. Thank you for such consistent high quality content ❤

  • @tousifgame
    @tousifgame Рік тому

    Stackoverall of 21st century... ChatGPT😂

  • @stash2823
    @stash2823 Рік тому

    2:36 wow that was really scarry 😰

  • @mouthofpower8492
    @mouthofpower8492 Рік тому

    ippschads, rise up

  • @FMisi
    @FMisi Рік тому

    Doesn't work for sites with HSTS enabled, of course

  • @Ms.Robot.
    @Ms.Robot. Рік тому

    It's hard to believe it's already been 3 years since I started watching you. Soon, it will be 4.❤️
    Thanks.

  • @ggnova8581
    @ggnova8581 Рік тому

    I never trust anything come from user I get the domain with my env :) hopefully I am safe

  • @alh4zr3d3
    @alh4zr3d3 Рік тому

    Holy shit a facecam. How long has this been a thing??

  • @ĐạiLươngTriều
    @ĐạiLươngTriều Рік тому

    Master!!!!!

  • @Croissinate
    @Croissinate Рік тому +10

    As a web designer, developer, solutions architect and security researcher, it seems very strange to me that someone would choose to build a system in a way which uses the host header value to determine what domain to use in the password reset link - rather than using an environment variable or hardcoding it.
    Is this actually a thing people do?
    Will keep this in mind to test on my next bug hunt anyhow. Thanks! Great video.

    • @ippsec
      @ippsec  Рік тому

      It just comes down to the developers not knowing exactly where that information is coming from and copy/pasting code to get something working.

    • @Croissinate
      @Croissinate Рік тому +2

      @@ippsec I guess so, but still strikes me as really weird because the kind of developer who would do that surely would be more likely to just hardcode the domain or something instead - since it would take more effort for them to code it to fetch the host header value. And that kind of developer potentially may not even be aware of the host header's existence 🤔

    • @takeiteasyeh
      @takeiteasyeh Рік тому +1

      I would also assume that if you have domains served by virtual host, this would also remove this vector

    • @madghostek3026
      @madghostek3026 Рік тому

      I can see a scenario where the same server code is shared for different applications, or there are private user projects running under subdomains, and there is a built in password reset... somehow. For example, some kind of "make your own forum from template". Then using host header to differentiate between the forums is a solution that comes to mind

    • @onochieanyanetu6213
      @onochieanyanetu6213 Рік тому

      To answer your question, yes this is a thing people do. Vulnerabilities resulting from misconfigured CORS work in a similar way and is basically header injection.

  • @savire.ergheiz
    @savire.ergheiz Рік тому

    Why would dev use host info from user lol 😂
    At least they usually use info provided by the server it self.

  • @alientec258
    @alientec258 Рік тому

    thanks ippsec, very good Tutorial 😎

  • @berndeckenfels
    @berndeckenfels Рік тому

    Holy cow azure scanner even sends the full request with parameters as referer header to the favicon.

  • @lordcarl3374
    @lordcarl3374 Рік тому

    So that's what he looks like. I was way off on how i imagined he would look like.

  • @mindaugas847
    @mindaugas847 Рік тому

    can someone explain to me how changing the host the request is sent to still somehow gets to the server?

  • @AzZaph
    @AzZaph Рік тому

    wow first time I saw your face ippsec and thanks for this

  • @tony5226
    @tony5226 Рік тому

    things are definitely getting out of hands

  • @DJcyberslash
    @DJcyberslash Рік тому

    I have NO CLUE what this video is about because you go soooooooooooooool fast

  • @bojom
    @bojom Рік тому

    bro is staring at my soul ong nvidia gotta make this more human like

  • @jesuscmdev1770
    @jesuscmdev1770 Рік тому

    Amazing!! Thanks for share!

  • @sinz6th
    @sinz6th Рік тому

    You randomly popped up on my youtube feed but here's some constructive criticism:
    With the way you have your webcam setup or be it your monitor it constantly feels like someone is watching me or my soul is being hard starred at.
    perhaps you could try moving the camera just a tiny bit to the side and take a glance at it here and there while you describe something, i feel like that could help bring points across clearer since you divert your attention to the webcam for that time being even if it's just looking at it from a slight angle and feels less robot-like :D

    • @ippsec
      @ippsec  Рік тому

      Thanks for the comment, don't use webcam stuff much. I had accidentally left the nvidia eye track on so that may be the issue.

  • @adishinde
    @adishinde Рік тому

    THE FACE!!!!!!!!!!!!!!!!!!!!!!!!! IPPSEC u rocks. :)

  • @triplem3224
    @triplem3224 Рік тому

    Great content as always
    Nice new hair

  • @modguy9894
    @modguy9894 Рік тому

    This is why we should have MFA

  • @MrCipek1221
    @MrCipek1221 Рік тому

    Yo Ipp, it is nice to see you:)

  • @MrChrisLia
    @MrChrisLia Рік тому

    you look like a friendly person lol

  • @dcrash_
    @dcrash_ Рік тому

    Great info. You're amazing

  • @hydr0nium_
    @hydr0nium_ Рік тому

    Is hardcoding the domain into the code a bad idea? If so why?

    • @ippsec
      @ippsec  Рік тому +3

      I think it’s better as an environment variable, just so you can easily change between dev/staging/production. Environment variables changes can be live so if you need to make a tweak it’s intuitive and easy. If the domains hard coded I don’t think it is intuitive to change

    • @x.plorer
      @x.plorer Рік тому

      ​if env var is changed, application still needs to be restarted

    • @ippsec
      @ippsec  Рік тому

      @@x.plorer It really depends on the applicaiton. Some will monitor the .env file and autoload any changes. I want to say Laravel does this by default, I would guess fastapi/flask does not, but no reason you couldn't do it. Also you could probably reload the service vs restart to load it without interruption.

  • @arupsen121
    @arupsen121 Рік тому

    Can I request a hacking video?

    • @x.plorer
      @x.plorer Рік тому +2

      Don't ask to ask😂

  • @germas369
    @germas369 Рік тому

    your eyes are creepy

    • @ippsec
      @ippsec  Рік тому +2

      Tried the nvidia eye tracking thing 😂

    • @abdirahmann
      @abdirahmann Рік тому

      @@ippsec 🤣🤣