Log4j (CVE-2021-44228) RCE Vulnerability Explained

Sdílet
Vložit
  • čas přidán 12. 12. 2021
  • Walking through how the log4j CVE-2021-44228 remote code execution vulnerability works and how it's exploited.
  • Věda a technologie

Komentáře • 257

  • @mint530
    @mint530 Před 2 lety +402

    You saying "just came out a few days ago" makes it sound like a fun new game just got released haha

  • @_JohnHammond
    @_JohnHammond Před 2 lety +421

    Great demonstration, Marcus!

    • @anuzravat
      @anuzravat Před 2 lety

      U got 1 subscriber

    • @seppy624
      @seppy624 Před 2 lety +1

      hey john

    • @Clytax
      @Clytax Před 4 měsíci +2

      @@anuzravatMore like 1.2million

  • @devinmagee1948
    @devinmagee1948 Před 2 lety +375

    It's my first week working in cyber security environment professionally. Trying to get a grasp on my organization's infrastructure while trying to help with the log4j vuln has been a real trial by fire lol. Always enjoy your content!

    • @complexedone
      @complexedone Před 2 lety +5

      I understand. I just joined a new org as part of the infrastructure team. I still don't know all our systems, but I'm learning fast as I help to find and patch systems as needed/available.

    • @jasrid04
      @jasrid04 Před 2 lety +10

      Welcome to the industry and good luck!

    • @devinmagee1948
      @devinmagee1948 Před 2 lety +5

      @@complexedone Good Luck. We will get there eventually!

    • @manfrombritain6816
      @manfrombritain6816 Před 2 lety

      what have you been doing to help? what's your role? i'm looking to start in security soon!

    • @jdemuro1
      @jdemuro1 Před 2 lety +1

      Best way to learn quickly though. This is a blessing in disguise for you!

  • @ltsmash9544
    @ltsmash9544 Před 2 lety +182

    I love how you actually demonstrate the vulnerability and not just talk about it, like what most others are doing. Keep it up mate, you've got my Subscribe!

    • @zedzpan
      @zedzpan Před 2 lety +2

      Yup, learnt more from this than the over engineered blogs I've been tracking!

    • @slaloulin8289
      @slaloulin8289 Před 2 lety +5

      not to mention how he only did it in ~3 mins, saves a lot of times for such a great explanation

  • @brianrdetweiler
    @brianrdetweiler Před 2 lety +48

    Clicking various links for 30 minutes, trying to understand the issue, and you explain it in less than 4. Thank you!

  • @AlphaZeroOmega
    @AlphaZeroOmega Před 2 lety +31

    Thanks Marcus. I appreciate your ability to explain a vulnerability like this and demo it in a really understandable way.

  • @romanxyz7248
    @romanxyz7248 Před 2 lety +15

    I had problem understand this from days and you explained it under 4 mins. You're amazing Marcus 👏❤️

  • @badashgr8
    @badashgr8 Před 2 lety +2

    With videos out there in 20+ mins and you here with less than 4 mins explaining it so clearly, I know which video to click from next time.

  • @masettyvivek8155
    @masettyvivek8155 Před 2 lety +1

    This is one of the great demonstrations I have listened on CZcams. You are amazing!!

  • @andresromerodev
    @andresromerodev Před 2 lety

    This explanation is so cool! I’ve been hearing about the vulnerability but nobody took the time to explain it this way. Thank you! :)

  • @abhilpnYT
    @abhilpnYT Před 2 lety +1

    One of the best explanations with practical demo. Thank you ..

  • @BSwitchGTG
    @BSwitchGTG Před 2 lety

    Just started a new job, and moved my support area from networking to applications. Day 1 of the new gig and I was hearing it was an all-hands to deal with the "new vulnerability". Thankfully new enough that there was no headache for me to deal with, but oof, glad to see what they were up against!

  • @Swing17
    @Swing17 Před 2 lety +14

    Very well explained. Good video Marcus!

  • @Svalbaz
    @Svalbaz Před 2 lety

    I work in IT and the last week or two has been absolutely mental thanks to this

  • @AM-og2oi
    @AM-og2oi Před 2 lety

    thank you for this video marcus!!! alot of news on this and this has helped me out get a better understanding of how the vulnerability functions

  • @DavisTibbz
    @DavisTibbz Před 2 lety +1

    First time understanding what this means. Thanks.

  • @calmeidazim
    @calmeidazim Před 2 lety +1

    Thank You Marcus, simple but quiet clear to understand

  • @lofman
    @lofman Před 2 lety +2

    "versatile" is the key word for this vulnerability.
    thanks for explaining! :)

  • @53kt0r
    @53kt0r Před 2 lety

    Great video! plain, simple and without bias.

  • @strato_5459
    @strato_5459 Před 2 lety

    good explination. told exactly what it is and how it works. yeah i know what im looking at already but for anyone else that has no idea, this is the video they should watch

  • @kosmonautofficial296
    @kosmonautofficial296 Před 2 lety +7

    Always cool to see a Marcus video out on a new vuln!

  • @FloresMenyapa
    @FloresMenyapa Před rokem

    Greetings from Indonesia, I really admire you, and you are great. I'm just a beginner who wants to learn like you from the bottom

  • @Burgundy_towel
    @Burgundy_towel Před 2 lety +1

    Thanks for such layman explanation, I was able to grasp it..

  • @zaitarh
    @zaitarh Před 2 lety +212

    The ${…} syntax is not part of Java - it’s solely a Log4j syntax. (If it were part of java there would have been no problem, as it would have been evaluated at compile-time, not run-time)

    • @marcellkovacs5452
      @marcellkovacs5452 Před 2 lety +18

      @@kpaxxapk6397 the logger should sanitise the input the same way an ORM sanitises model insance lookups to avoid SQL injection.

    • @zaitarh
      @zaitarh Před 2 lety +17

      ​@@kpaxxapk6397 In theory, it's a fair point - it certainly would be possible to sanitize it. But 1) the documentation did not state this anywhere afaik and 2) no one is interested in having a logging framework where you have to sanitize everything. People just want to do "log.error("My error: {}", error)" and be done with it.
      I've used Log4j before some years ago, and never knew about that "Lookup" feature - and aparently i was not the only one. :) Imho, it was a very annoying feature, security flaw or not, as i don't want the text i log to sometimes be transformed into something else, just because it happens to contain "${" and "}"... And this undesirable feature was enabled by default...

    • @zaitarh
      @zaitarh Před 2 lety +2

      @@kpaxxapk6397 Note: It would kind of be possible for Log4j to sanitize it itself... If they forced you to use it in a specific way... You CAN (but don't have to) use the logger as having a format string as first param, and then data-values for the rest of the params (similar to printf, etc)..: log.info("This is the format string. Data is {} and {}", data1, data2);

    • @fox2code
      @fox2code Před 2 lety +6

      @@zaitarh This RCE was a feature, not a bug, I saw the code, it was done intentionally, I'm sure someone added this feature on purpose to use it for what the video showed us.

    • @reemontel8036
      @reemontel8036 Před 2 lety

      No idea why I always assume the ${...} syntax is Spel from the spring spell syntax but I'm not 100% sure if that's correct or not

  • @YourWaifu0
    @YourWaifu0 Před 2 lety

    Nice explanation, I believe showing how easy it is to do is the scary part more than anything since a lot of applications use log4j.

  • @sniGGandBaShoR
    @sniGGandBaShoR Před 2 lety +16

    the variable thing in a string is called string interpolation my dude!

  • @GGdevelopment
    @GGdevelopment Před 2 lety

    Great job at presenting the vulnerability!

  • @razzeeee
    @razzeeee Před 2 lety

    Best summary yet

  • @pjj1947
    @pjj1947 Před 2 lety

    Thanks Marcus! Sweet and clean explanation!

  • @DaraulHarris
    @DaraulHarris Před 2 lety

    Subbed. That was an excellent explanation.

  • @yodamaxwell
    @yodamaxwell Před 2 lety

    Fantastic demonstration!

  • @kotiwa
    @kotiwa Před 2 lety

    You made this very easy to understand. thanks!

  • @TheBenJiles
    @TheBenJiles Před 2 lety

    Simple. To the point. Thanks man

  • @imkir4n
    @imkir4n Před 2 lety

    clean explanation marcus!

  • @chess598
    @chess598 Před 2 lety

    Concise and to the point, thanks!

  • @edgay
    @edgay Před 2 lety

    This 4 minute video was more clear and valuable then the 30minute one i just watched on this rce

    • @edgay
      @edgay Před 2 lety

      cough johnhammond cough

  • @TheGameIsOverCy
    @TheGameIsOverCy Před 2 lety

    Nice explanation ! Thank you :)

  • @DalBileAbas
    @DalBileAbas Před 5 měsíci

    Thanks for simplifying the vulnerability

  • @das_evoli
    @das_evoli Před 2 lety

    Finally no bullshitting around. Straight to the point and understandable for every novice programmer

  • @jasonOfTheHills
    @jasonOfTheHills Před 2 lety

    Great explanation. And wow.

  • @anonymous6666
    @anonymous6666 Před 2 lety

    great explanation and demo

  • @xl8373
    @xl8373 Před 2 lety

    Great demonstration , thank you !

  • @mdzen22e
    @mdzen22e Před rokem

    just what am looking for....thx dude

  • @wcsoutdoors1393
    @wcsoutdoors1393 Před 2 lety

    I love your videos

  • @TreeFrogOnATree
    @TreeFrogOnATree Před 2 lety

    well, well
    that's really interesting
    thanks for uploading!

  • @01071985hh
    @01071985hh Před 2 lety

    impactful explanation thanks

  • @willemachternaam690
    @willemachternaam690 Před 2 lety

    'Drop bobby tables' for Java. Nice! Thank you for this.

  • @andreasMou123
    @andreasMou123 Před 2 lety

    nice demo, thanks!

  • @freekdeman
    @freekdeman Před 2 lety

    Thanks, really helpful.

  • @EnglishRain
    @EnglishRain Před 2 lety

    Thank you for this!

  • @tinkleondabeach
    @tinkleondabeach Před 2 lety

    Thx daddy great explanation

  • @metrixc
    @metrixc Před 2 lety +3

    Hi Marc, great video. If I see it right, the outbound connections to e.g. a LDAP server is always unencrypted since JNDI does regular (unencrypted) lookups. That means that companies could look for unexpected outbound LDAP requests to servers on the internet right? Just curious. Would there be a way to make these outbound requests encrypted? Thank you!

  • @kingKabali
    @kingKabali Před 2 lety

    Right to the point. Thanks man.

  • @BirgerBurgerBargir
    @BirgerBurgerBargir Před 2 lety

    Great video

  • @tapion1998
    @tapion1998 Před 2 lety +3

    I can't believe that it is that simple. The first thing you learn is always to control the input that is given. That is why you wont just take the given SQL command and execute it. To think that log4j didn't sanitise their input ist just CRAZY. That's a one liner, my god...

  • @victorburnett6329
    @victorburnett6329 Před 2 lety +1

    Wow, that is a pretty glaring vulnerability. Amazing it's only just been discovered.

  • @manideepkumar959
    @manideepkumar959 Před 2 lety

    Better than java brains log4j explanation,now i understand

  • @tuananhtass3693
    @tuananhtass3693 Před 2 lety

    tks,
    Marcus!

  • @patco258
    @patco258 Před 2 lety

    Great great great video

  • @thexlr8rkid
    @thexlr8rkid Před 2 lety

    This video is perfect

  • @ndenkha
    @ndenkha Před 2 lety

    Great video. Question, so is the problem that even though log4j stores that command string in a log file it gets executed while being written to the file?

  • @djvex6180
    @djvex6180 Před 2 lety

    Thank you so much.

  • @WhiteSiroi
    @WhiteSiroi Před 8 měsíci

    thank you, very heplful

  • @melkileo
    @melkileo Před 2 lety +1

    It's quite a good video but I think you should have talken about the jndi/ldap breach that enable rce. Jndi/ldap basically doesn't allow to inject malicious code, but a breach form 2017 make it possible to inject and initialize a custom Java class the ldap server redirects to

  • @krizanand
    @krizanand Před 2 lety +3

    Pretty much every security team in an organization is stuck on log4j meeting 😜 Wonderful explanation though of the exploit.

  • @florian538
    @florian538 Před 2 lety

    Could you solve this issue by looking for an outcommenting the feature in the log4j library?

  •  Před 2 lety +5

    thanks for the explanation, going to make a documentary on this!

    • @tansanwastaken
      @tansanwastaken Před 2 lety +6

      Purchased botted sub account, ratio

    • @mandokir
      @mandokir Před 2 lety

      Great, a whole documentary nobody asked for.

  • @cool-aquarian
    @cool-aquarian Před 2 lety

    when I try to do same thing in my eclipse using log4j < 2.16, the jndi url is not getting invoked.
    It is simply printing in log message.. Any clue why ?

  • @EdwardInTX
    @EdwardInTX Před rokem

    thank you!

  • @PietroCornelio
    @PietroCornelio Před 2 lety

    Well done ;-)

  • @MemesandLeague
    @MemesandLeague Před 2 lety

    @marcus Hutchins, I recently used your strategies from the pd64.exe video to dump some embedded dlls from a Trojan google chrome installer. Thanks for all the guidance!

  • @redwaller1
    @redwaller1 Před 2 lety +19

    Words cannot describe- how did this slip unnoticed? I cannot imagine writing code that would result in behavior like this, and yet it must surely be a trap even experienced developers might fall into.

    • @maxwellmapako3820
      @maxwellmapako3820 Před 2 lety

      I honestly believe that you cannot cater for what you don't expect 🤣

    • @jayit6851
      @jayit6851 Před 2 lety +3

      @@maxwellmapako3820 This is like a classic example of unsanitized input. Idk how any experienced developer like those working with the Apache Foundation couldn't expect that.

    • @user-do6gr5ww5e
      @user-do6gr5ww5e Před 2 lety +7

      I was just thinking - this seems adjacent to our classic case of SQL injection. Crazy

  • @logicfirst7959
    @logicfirst7959 Před 2 lety

    You are the man Marcus, one thing though, how can i emulate this into my environment, I tried your commands and getting Error: Could not find or load main class Main error.

  • @bojorquezja
    @bojorquezja Před 2 lety

    thanks man

  • @thelineidk
    @thelineidk Před 2 lety

    And if I go to 2b2t from my phone, for example, will the exploit work on me?
    (I play java minecraft on my phone)

  • @paulkelly5618
    @paulkelly5618 Před 2 lety +3

    Awesome video! Quick question: What is the symbol you have on line 11 of your code just after "logger.error(" but before "Hello..."

    • @corv882002
      @corv882002 Před 2 lety

      It says "s:" and is inserted by the ide to let you know what the parameter's called

    • @philipjfry4465
      @philipjfry4465 Před 2 lety

      parameter hinting

  • @valentinpopescu6704
    @valentinpopescu6704 Před 2 lety

    How can you set up the LDAP server on localhost and which port to choose?

  • @Sebastian-sl4hv
    @Sebastian-sl4hv Před 2 lety

    Thanks!

  • @susulemons
    @susulemons Před 2 lety +1

    how does an attacker make the call in the first place though? (have access to call the function with the string

    • @MalwareTechBlog
      @MalwareTechBlog  Před 2 lety +1

      By controlling some input that gets logged by the application

  • @bagzhansadvakassov1093

    I wonder how many 0-day expoits out there in the open software.

  • @TeamEmperor
    @TeamEmperor Před 2 lety

    Thank you

  • @pauberrymon5892
    @pauberrymon5892 Před 6 měsíci

    You just caught another Sub Bub, that was 🐸 toadly 🐸 understandable 😎, in just a couple of minutes.

  • @Glitchflim
    @Glitchflim Před 2 lety

    How to fix the issue any steps are there

  • @peter11256
    @peter11256 Před 2 lety

    Great explanation.
    I just didn't quite understand one thing. Is it necessary for the object you are loading to exist in the ldap server ?

    • @isomeme
      @isomeme Před 2 lety +3

      Yes, but as the attacker can point the lookup to an ldap server they control, that's easy to arrange.

  • @CriticSimon
    @CriticSimon Před 2 lety

    Nice!

  • @majorassault5074
    @majorassault5074 Před 2 lety

    I have to ask, what happens if you are running a VPN? Will the VPNs server get infected with whatever malware/ransomware/trojan/ddos/worm a black hat sends their way?

  • @hellboykuro
    @hellboykuro Před 2 lety

    hi can anyone help me
    when i try to inject any executor in any game it says
    "This exploit is down while critical ace/rce vuln is fixed"
    this is on roblox btw

  • @ewerybody
    @ewerybody Před 2 lety

    Wasn't the base64 an extra indirection?
    The class you're loading can't pop Calc.exe directly? 🙄

  • @losthedgehog3922
    @losthedgehog3922 Před 2 lety +6

    Great. Now show the LDAP server configuration and how exactly it serves the java object payload. None of the videos seem to explain how that works. They either evade it or use marshalsec LDAP server also never explaining how it works.

  • @ImStian
    @ImStian Před 2 lety

    This is terrifying.

  • @vadiks20032
    @vadiks20032 Před 2 lety

    i am somewhat of a beginner programmer but i am so glad i'm able to understand so much words. back when i didnt know anything about programming, this entire video would make no sense to me at all
    but now, instead of simply not understanding what he says, i just... just fucking feel bored
    i mean like it's awesome vulneratbility which i could use to run rick astley video on somebodys PC or something, but i am not programming such stuff. . . i am simply not programming at all, the only experience i had was in unity

  • @danielblanchette8593
    @danielblanchette8593 Před 2 lety +1

    So you're telling me that the Log4j vulnerability is roughly the same as there was with linux a while ago where if you put something like [{:}};} (don't remember the exact spelling) you can then enter a command that can be executed from an app or the other thing that happened to twitter where you could send a tweet that would retweet itself in your browser...
    Why is it always the same vulnerability that is found?

  • @jackofnotrades15
    @jackofnotrades15 Před 2 lety +1

    Its not a part of java as somebody mentioned before. The syntax is kind of string interpolation though.

  • @chickendumpling9595
    @chickendumpling9595 Před 2 lety

    I know I’m late to the party but I would greatly appreciate it of someone could clarify some things for me:
    1) that error at the end, I cant quite catch it but I figure it must be due to the fact that the downloaded object cannot be concatenated without a toString method or something like that?
    2) Isnt that base64 ‘calculator.exe’ just a directory on your server, not part of the actual object?
    3) what is that on line 8? Is setting that property necessary for this exploit to work?
    Again, I appreciate highly any response :)

  • @rommeljoven1046
    @rommeljoven1046 Před 2 lety

    Thanks for the demo. May i know what will be the parent process of "calc.exe"? would it be "java.exe"?

  • @BruceDuncan
    @BruceDuncan Před 2 lety

    I still don't get it. What is it that is being returned over LDAP? Is it the base64-encoded string "calc.exe"? Is it a Java object which is doing Runtime.getRuntime().exec("calc.exe")? It's been nearly a week and I still don't get it!

  • @aja749
    @aja749 Před 2 lety

    Thanks for explaining this

  • @freddyfozzyfilms2688
    @freddyfozzyfilms2688 Před rokem

    Can u also input a lambda?

  • @WildWestPros
    @WildWestPros Před 2 lety

    In short, Log4j is a Java library that is used for logging errors and other software activities. ... The exploit lets an attacker load arbitrary Java code on a server, allowing them to take control.

  • @sonalita_
    @sonalita_ Před 2 lety +1

    I'm still confused about how the jndi payload gets executed (i.e. calc.exe) in this case - isn't the jndi lookup just returning data? what is it that makes it actually execute calc.exe??? nobody seems to be able to explain this.

    • @arvidmildner6274
      @arvidmildner6274 Před 2 lety

      As I've understood it, it's basically a "hook" and the intended functionality of log4j which says: take this url, load the object/function there and run it. So the reason it is run is because that's how it was supposed to be. It's not the malicious code itself that says that it should be run. But I may be wrong here.

    • @53kt0r
      @53kt0r Před 2 lety

      To answer your question: yes. everything in here is data (even this video itself), eg: Y2FsYy5leGU= is calc.exe in base64, that is the resource is loading thru JNDI and passed it to the log4j logguer as a variable to be logged. I think that is clear enough, hopefully for you too. Cheers!