Finding 0day in Apache APISIX During CTF (CVE-2022-24112)

Поделиться
HTML-код
  • Опубликовано: 7 янв 2025

Комментарии • 148

  • @quaternaryyy
    @quaternaryyy 2 года назад +218

    to me, this is a story about how timed competition and a trusted source saying "yes, it's still possible" leads to tons of people independently discovering a real 0 day, just like that.

    • @KitsuneAlex
      @KitsuneAlex 2 года назад +6

      Strongly aggree x3

    • @LB_
      @LB_ 2 года назад +28

      You'd think they would have reported it after the competition 😬

    • @Mr_Yeah
      @Mr_Yeah 2 года назад +13

      Yeah, I'm worried that the other teams might've found a different exploit and didn't report it yet.

  • @henke37
    @henke37 2 года назад +320

    The headers only working "sometimes" is a classic sign of an unsorted hashmap. Enumerating the key/value pairs will return the entries in an unpredictable order. My guess is that the code responsible for handling the header enumerates the hashmap entries and uses a switch statement to figure out what to do. The end result is that a random header ends up enumerated last and overwrites the work of the previous headers.

    • @almightyhydra
      @almightyhydra 2 года назад +9

      Yea, would be interested to know what the fix is. I doubt this is the only header manipulation code that might be vulnerable.

    • @guiorgy
      @guiorgy 2 года назад

      @@almightyhydra Is there any time when detecting more than one header is ok? What if you just terminate if more than one is found?

    • @yScribblezHD
      @yScribblezHD 2 года назад +1

      @@guiorgy Couldn't the injected header still just be read first? I feel like the real issue is that batch requests is relying on a supplied IP address that can be forged as localhost.

    • @emptylog933
      @emptylog933 2 года назад

      Idk, why would the plugin need proxy support if the host expects requests only from localhost?

    • @sknt
      @sknt 2 года назад +4

      ​@@almightyhydra Here's the pull request for the fix: github.com/apache/apisix/pull/6251/files
      All they did was call str_lower() on the "x-real-ip" header field name. If I understand it correctly overwriting the header happens in nginx. Likely due to the already mentioned reason of enumerating a hashmap in a random order.
      RFC 7230 ( www.rfc-editor.org/rfc/rfc7230#section-3.2 ): Each header field consists of a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace.

  • @saketsrv9068
    @saketsrv9068 2 года назад +77

    This man is a gem and super talented guy.

  • @ThePowerRanger
    @ThePowerRanger 2 года назад +129

    This is literally the dream.

    • @monad_tcp
      @monad_tcp 2 года назад +7

      Super useful when you want to root that pesky device. There's always a fucking webserver and it's apache running PHP.
      I love shitty technologies, it means I can always POWN my hardware.

    • @FrozenFire1997
      @FrozenFire1997 2 года назад +3

      @@monad_tcp what kinds of devices are you talking about?

    • @monad_tcp
      @monad_tcp 2 года назад +3

      @@FrozenFire1997 smart TVs for example

    • @otherkrabs
      @otherkrabs 2 года назад +1

      @@monad_tcp This isn't the apache web server though. It's APISIX, which is not the same software (and in the video it's running on nginx anyway)

    • @Stopinvadingmyhardware
      @Stopinvadingmyhardware 2 года назад

      Nope

  • @MisterL2_yt
    @MisterL2_yt 2 года назад +101

    Very interesting video, but how did this situation happen? Did the RealWorldCTF organisers find (or purchase) this vulnerability some time ago and just decided to keep it secret for the CTF and then not even report it afterwards? This seems very strange :o

    • @ThisIsTheInternet
      @ThisIsTheInternet 2 года назад +22

      Yeah that's very questionable

    • @ahmedifhaam7266
      @ahmedifhaam7266 2 года назад +5

      Man.. this got me thinking, should I stack the vulnerabilities I find before reporting, and just create a prized challenge? lol. Maybe if the service is containerised I can report it first and use the old containers for the challenge, but then hmm that's impossible since people will just look for changes in the patch. How are real world CTFs actually done?

  • @flopana5762
    @flopana5762 2 года назад +225

    What bothers me is that you had to report it and that just due to the fact that you wanted to make a video about it.
    I can understand that the organiser didn't just want you to read a couple of commits to find the vulnerability that wouldn't be a good challenge.
    But I think it was a bit unresponsible from the organiser to not report this issue immediately after the ctf has ended or contact the apache foundation in some way.
    They basically just led multiple hacker groups to a remote code execution without caring about fixing it.

    • @dennydravis8758
      @dennydravis8758 2 года назад +74

      Yeah it does violate the spirit of the ethical hacking CTFs

    • @damiannowak3811
      @damiannowak3811 2 года назад +3

      @@dennydravis8758 yeah just did a masscan and there are a lot of those not updated yet.
      executing cross-compiled botnet binary on them for monero mining.

    • @aescling
      @aescling 2 года назад +23

      @@damiannowak3811 i hope you're capping because otherwise you just admitted to a crime in public?

    • @Sina-rw3bl
      @Sina-rw3bl 2 года назад +5

      @@aescling "in public" settle down buddy, nobody is catching him 💀

    • @The_One_0_0
      @The_One_0_0 2 года назад

      @@damiannowak3811 already took skid lol

  • @ibrahimkalantn4072
    @ibrahimkalantn4072 2 года назад +4

    Man i love your channel great video as usual

  • @seif-allahhomrani2169
    @seif-allahhomrani2169 2 года назад +10

    Crazy how you make it looks like it easy to find a 0-day ! great video @liveoverflow

  • @jndlf3000
    @jndlf3000 2 года назад +6

    Great video as always! Thank you for making this awesome content for aspiring InfoSec students

  • @JaspreetSingh-qg2xp
    @JaspreetSingh-qg2xp 2 года назад +2

    Thank you so much and Congrats on solving and idetifying the issue . You're really making a valuable content and please , I request you to keep posting such a good informative as well as interesting things. You're full of knowledge and a motivation for me.

  • @aakashadhikari3752
    @aakashadhikari3752 2 года назад +1

    Dream boiiz dream..but congrats comrad for the CVE

  • @larditard
    @larditard 2 года назад +2

    Excellent video. Thank you for making!

  • @kirdow
    @kirdow 2 года назад +24

    Great video, haven't watched in a while but this title got me hooked. Will definitely watch some of your other videos to catch up :D
    Also at 12:15 in the report message, should you really have "1. " twice in Mitigation? :P
    Anyways, you surely have improved your editing and video style since the day I became a member, keep up the great work man

    • @sodiboo
      @sodiboo 2 года назад +1

      Isn't that markdown? in source files you often find numbered lists with all the points as 1. for easier reordering, because markdown rendering does NOT use the numbers in the document for the resulting list, it's simply that you have a number in front of every line, and then the marker starts at 1 and counts up for each entry. This can be somewhat confusing when viewing the document as plaintext, but it also isn't plaintext and shouldn't be viewed like that, so it's not a huge issue for most people.

  • @siddharthchhetry4218
    @siddharthchhetry4218 2 года назад +3

    You and your team are awesome

  • @SkippyDa
    @SkippyDa 2 года назад +6

    I liked your outro.

  • @patrick1020000
    @patrick1020000 2 года назад +23

    Did you hit up the other challenge solvers to make sure they found the same bug you did?

  • @atraps7882
    @atraps7882 2 года назад +6

    this shows me that being a "hacker" isnt just about using the popular tools, they got to have a lot of deep background knowledge in systems, web technologies, networking, bit manipulation, scripting, cryptography, containerization, virtualization and much more.. Im just an average software engineer focusing on backend development but man, these guys are just levels above and beyond

    • @hovnocuc4551
      @hovnocuc4551 2 года назад

      that's the difference between a hacker and a scriptkiddie.

  • @kevinwydler4405
    @kevinwydler4405 2 года назад +2

    So simple yet ingenious!

  • @generallyunimportant
    @generallyunimportant 2 года назад +49

    i find it funny that no one actually reported the vuln to apache lol-

    • @1vader
      @1vader 2 года назад +41

      Funny but also pretty sad. It's honestly pretty shocking and irresponsible that the organizers didn't do it themselves.

    • @theairaccumulator7144
      @theairaccumulator7144 Год назад

      @@1vader the organizers probably had a different vulnerability in mind, there's a chance that these guys found something entirely new.

  • @yy6u
    @yy6u 2 года назад +1

    that kind of ctfs are really great, it's all about expanding knowledge of someone's work and educating everyone else

  • @anion21
    @anion21 2 года назад +31

    Well done. So, was your solution the "correct" solution expected by the creatores of this CTF-challenge or is there any other solution which does not contain 0days?

    • @kebien6020
      @kebien6020 2 года назад +30

      I think in this setting any solution would qualify as a 0day, since the challenge involved RCE and was meant to work on the latest version.

    • @ahmedifhaam7266
      @ahmedifhaam7266 2 года назад

      pretty sure there was another exploit.

  • @thepenguin9
    @thepenguin9 2 года назад +1

    I feel like one of the organisers shares my mentality on chaos and it's current reign including a 0day

  • @Aquriez
    @Aquriez 2 года назад +1

    This is really cool, great video

  • @johnpathe
    @johnpathe 2 года назад +2

    Such a great video. Really well explained. Doing amazing work as usual LO :)
    I had to playback some parts and ended up watching it at .75x speed :)
    Gratz on the first blood! :D

  • @zekiz774
    @zekiz774 2 года назад +2

    Finally: a video I understand

  • @LukasSMF
    @LukasSMF 2 года назад +2

    I really love these videos

  • @Reichstaubenminister
    @Reichstaubenminister 2 года назад +2

    I only listened to the video while doing something else, and the entire time I though you said "bad requests plugin" and that the name was quite ironic. Turns out it was batch-requests.

  • @randomguy3784
    @randomguy3784 2 года назад +2

    Superb content!

  • @bigl9527
    @bigl9527 2 года назад +19

    Another video of Ed Sheeran explaining about security in detail

    • @31redorange08
      @31redorange08 2 года назад

      This isn't Ed Sheeran.

    • @nztpill
      @nztpill 2 года назад +2

      @@31redorange08 thats literally him check his instagram

  • @JuanBotes
    @JuanBotes 2 года назад +2

    thank you for sharing your knowledge \o/

  • @mikflores
    @mikflores 2 года назад +2

    This is amazing. Great.

  • @monad_tcp
    @monad_tcp 2 года назад +1

    This is such a good news!

  • @chiragartani
    @chiragartani 2 года назад +2

    Incredible. Do you think that the servers are using APISIX? And are vulnerable? I mean I want to see in the real life, If I can find this vulnerability in the live servers.

  • @RahulSinghInfosec
    @RahulSinghInfosec 2 года назад +1

    Thank you for sharing!

  • @AbdelrahmanRashed
    @AbdelrahmanRashed 2 года назад +3

    if it didn't work for you the first time what would you have done ?

  • @meh.7539
    @meh.7539 2 года назад

    If you check out the HTTP request smuggling attack preso from, i want to say 2019, he explains what's going on in it's most basic form. What you're showing here looks pretty similar to what he presents.

  • @bobsmithy3103
    @bobsmithy3103 2 года назад

    lmao i love it when you run the same piece of code but get different results

  • @MTRNord
    @MTRNord 2 года назад +5

    This makes me wonder: Are there other services with this exact bug or a close variation? As it seems like a fairly normal pattern to have for things like this.

    • @FlorianWendelborn
      @FlorianWendelborn 2 года назад +3

      Most security vulnerabilities aren’t unique. A lot of them even make it to OWASP top 10 list :)
      I wouldn’t be surprised at all if there’s 100 different pieces of software out there somewhere that have this exact _kind_ of vulnerability.

    • @ThisIsTheInternet
      @ThisIsTheInternet 2 года назад

      Do you know of other stupid gateways that let you dynamically create remote code execution endpoints? lol

    • @MTRNord
      @MTRNord 2 года назад

      @@ThisIsTheInternet there are countless of these api gateways yeah. It is pretty common in stuff like cloud. Serverless also kinda is a framework doing something like this. So is aws lambda kinda. Both not exactly like this but similar goals of having dynamic customer provisioned api endpoints

    • @ahmedifhaam7266
      @ahmedifhaam7266 2 года назад

      literally found something similar in a local community SAS

  • @EER0000
    @EER0000 2 года назад +1

    A bit odd that it was not reported yet, but very nice find. HTTP header capitalization can be a nightmare sometimes, not just in LUA 😅

  • @joaokoritar2141
    @joaokoritar2141 2 года назад +2

    Very cool! Btw, which VSCode theme do you use, it looks nice!

    • @aescling
      @aescling 2 года назад +1

      looks like Solarized Dark

  • @_Slaze
    @_Slaze 2 года назад +4

    After watching some of your videos I feel like I should quit learning pentesting. If you call this "not a hard challenge" what am I doing all the time? ^^

    • @nobodynoone2500
      @nobodynoone2500 2 года назад +1

      I mean, it's not super advanced stuff. I think the most technical thing was the proof of work code.

  • @mynameisrezza
    @mynameisrezza Год назад

    Just saw this and WOW!

  • @ArnaudMEURET
    @ArnaudMEURET 2 года назад +1

    Huh, I’m frustrated that you did not present the actual piece of faulty code and its fix ! 😒
    …I’ll look it up.

  • @casperes0912
    @casperes0912 2 года назад

    That was a weird Minecraft Let's Play, but I liked it

  • @HritikV
    @HritikV 2 года назад

    Checkout pateron and stuff. Lol, best ending ever

  • @alexanderwences6600
    @alexanderwences6600 2 года назад +1

    So Are you gonna help with the Cyber war?

  • @leesalmon7672
    @leesalmon7672 2 года назад +1

    how to bruteforce hash 26bits

  • @_AN203
    @_AN203 2 года назад +1

    Are you working in another CTF in the time of recording ???????

  • @odessairenikute6961
    @odessairenikute6961 2 года назад

    So it is all about just to learn how to ask smart questions. Not a rocket science but it is still tricky thing :)

  • @D0Samp
    @D0Samp 2 года назад

    I guess it's finally time to set or change some localhost-only admin passwords/tokens.

  • @DarkOverFlowOverflow
    @DarkOverFlowOverflow 2 года назад +1

    i've never seen you with glasses before, congrats on your 700k followers tho

  • @jaopredoramires
    @jaopredoramires 2 года назад +1

    what's the `(base)` at the top-left of the terminal prompt?

    • @sadhlife
      @sadhlife 2 года назад

      it could be a python virtual environment, or the name of their ssh sever / docker container, or anything really.

  • @jonathan-._.-
    @jonathan-._.- 2 года назад +1

    🤔 halfway through : maybe we can set the host header to lcoalhost

  • @allezvenga7617
    @allezvenga7617 2 года назад

    Well done 👍

  • @faizalqorni7969
    @faizalqorni7969 2 года назад

    this is the dream man

  • @necroowl3953
    @necroowl3953 2 года назад +1

    Bro, pls look into golang, I have a fast recursive hasher that you guys could write down in minutes

  • @ahmedifhaam7266
    @ahmedifhaam7266 2 года назад

    was a very engaging and fun video. I am just surprised how this Flo guy writes Lua code so fast.. I got the gist of it but I couldn't understand the Lua script that well, anyone care to explain? would appreciate, thanks

  • @raass9316
    @raass9316 2 года назад +1

    the main take away , if you want to hack it just try it ! why all new bug is like this ?

  • @stef9019
    @stef9019 2 года назад +1

    Is it me or did you recently switch to reading from a script? If it was the case already before it's a bit more obvious rn IMO.

    • @LiveOverflow
      @LiveOverflow  2 года назад +9

      I have read from a script since I started this channel hahha. There are only a handful of non-scripted videos.
      But this was the first time wearing glasses while reading of the teleprompter. Maybe I struggled a bit here? 😅

    • @stef9019
      @stef9019 2 года назад

      @@LiveOverflow Ahah could be the case, I've never noticed before!

    • @cbruegg
      @cbruegg 2 года назад

      @@LiveOverflow Completely fine IMO :)

  • @ndm13
    @ndm13 2 года назад +2

    Why, Apache? Why do you keep doing this?

  • @andyelgangster5320
    @andyelgangster5320 2 года назад

    nice
    video
    😎

  • @dev__004
    @dev__004 Год назад +1

    Now, what was the real solution or were the organizers too expecting you guys to come up with a 0day😆😆

  • @hyperdrone900
    @hyperdrone900 2 года назад +1

    nice :D

  • @Najumulsaqib
    @Najumulsaqib 2 года назад +1

    Very engaging stuff.

  • @EduardVasile5
    @EduardVasile5 2 года назад +1

    Ah, yes.
    Of course.

  • @awesomesauce804
    @awesomesauce804 2 года назад +2

    SSRS as a service, lol.

  • @ChrisBigBad
    @ChrisBigBad 2 года назад +3

    LoL. SSRP as a Service :D

    • @mikena8519
      @mikena8519 2 года назад +1

      yes that was a good punch line i thought too!

  • @karanb2067
    @karanb2067 2 года назад

    Very cool, but like realworldctf people just decided to not expose this vulnerability? kinda sketchy....

  • @xB-yg2iw
    @xB-yg2iw 2 года назад +1

    The ending had me rolling hahahaha

  • @random_guy1024
    @random_guy1024 2 года назад +1

    Can you make a video on how a script-kiddie like me can be a hacker like you... or at least try to be......

    • @tomysshadow
      @tomysshadow 2 года назад +4

      Check out his video "the secret hidden guide to hacking."

    • @casperes0912
      @casperes0912 2 года назад +1

      Rule number 1. Have fun.

  • @alwan7777
    @alwan7777 2 года назад

    Yeyyyy

  • @oeerturk
    @oeerturk 2 года назад

    IS IT JUST ME OR DOES HE LOOK LIKE MR ROBOTS FATHER GUY WITH THE GLASSES??????????????? thx for allllll the incredible content

  • @neuramancer
    @neuramancer 2 года назад +2

    How to register for RealWorldCTF?

  • @mr.guljaan7175
    @mr.guljaan7175 2 года назад +2

    🆂︎🅾︎🅾︎🅾︎🅾︎🅿︎🅴︎🆁︎

  • @gowthamanks3654
    @gowthamanks3654 2 года назад +1

    You posses lots of knowledge. Why dont you make an udemy course. Or beginner friendly youtube course's

  • @bibasbajgain1434
    @bibasbajgain1434 2 года назад +1

    🧐🧐

  • @creepychris420
    @creepychris420 2 года назад +1

    ayylmao123 😂

  • @sookmaideek
    @sookmaideek 2 года назад

    zerday guyz

  • @aziztcf
    @aziztcf 2 года назад +1

    Hey, you might want to calm down your body language a bit while explaining stuff. It can get kinda distracting, especially to people who rely on subtitles :) Other than that, great job once again!

  • @v2nd2tt44
    @v2nd2tt44 2 года назад

    69k 😶😌 lucky

  • @yeetyeet7070
    @yeetyeet7070 2 года назад +1

    he w i d e

  • @codywohlers2059
    @codywohlers2059 2 года назад

    I like the videos better when you were doing it as you filmed. I don't like these videos where someone talks over what they did after the they did it.

    • @LiveOverflow
      @LiveOverflow  2 года назад

      This is literally how I made CTF channel videos always. Only very very few are in a different style. Which videos were you thinking about?

    • @codywohlers2059
      @codywohlers2059 2 года назад

      I don't know what I mean lol. I guess when there was less full screen cam and more code. Don't get me wrong I love your videos!

  • @espero_dev
    @espero_dev 2 года назад

    Bro there is a new 0-day hack lol it’s secret because it’s just my company that found it but it’s pretty secret no one else knows about the one we do because it works with mobile and desktops and laptops

  • @echoo200
    @echoo200 2 года назад

    First

  • @evanjsx
    @evanjsx 2 года назад

    > Rust
    ...
    > redstarosx
    ...
    *subscribes*

  • @nhazittas
    @nhazittas 2 года назад +3

    ayyylmao1234

  • @shinkurt
    @shinkurt 2 года назад

    First