Running a Buffer Overflow Attack - Computerphile

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มี.ค. 2016
  • Making yourself the all-powerful "Root" super-user on a computer using a buffer overflow attack. Assistant Professor Dr Mike Pound details how it's done.
    Formerly titled "Buffer Overflow Attack" -Aug 2021
    The Stack: • Reverse Polish Notatio...
    Botnets: • Botnets - Computerphile
    The Golden Key: iPhone Encryption: • The Golden Key: FBI vs...
    3D Stereo Vision: • Stereo 3D Vision (How ...
    Brain Scanner: • Brain Scanner - Comput...
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottscomputer
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

ความคิดเห็น • 1.2K

  • @tristant9686
    @tristant9686 7 ปีที่แล้ว +2662

    You can see he is very excited to tell this.

    • @minecraft9260
      @minecraft9260 5 ปีที่แล้ว +67

      Tristan T I'm excited to learn this.

    • @germangamingvideos6069
      @germangamingvideos6069 5 ปีที่แล้ว +9

      @@minecraft9260 Me too

    • @matze3596
      @matze3596 5 ปีที่แล้ว +24

      Frist time he can show what i spend his time on...Most people would not listen maybe cause they dont understand or maybe because they believe its something illegal.

    • @buzifalus
      @buzifalus 5 ปีที่แล้ว +7

      Because people are usually not interested or afraid of complex computer stuff

    • @iraianbu3388
      @iraianbu3388 4 ปีที่แล้ว +1

      May i know what content is on cat shell_code

  • @aadeshsalecha4951
    @aadeshsalecha4951 8 ปีที่แล้ว +2165

    This was by far the best video.....
    Normally Computerphile tries to address a wider audience, but I personally would like to see more of these kind of in-depth videos.

    • @kipchickensout
      @kipchickensout 5 ปีที่แล้ว +10

      exactly

    • @CP-hd5cj
      @CP-hd5cj 5 ปีที่แล้ว +38

      Check out liveoverflow if you like this. He has tons of similar stuff, and decently in-depth

    • @dvorak2676
      @dvorak2676 4 ปีที่แล้ว +10

      this is an introduction

    • @iraianbu3388
      @iraianbu3388 4 ปีที่แล้ว +2

      May i know what content is on cat shell_code

    • @cheesescrust5399
      @cheesescrust5399 4 ปีที่แล้ว +4

      Dvo rak yeah I learned how to do basic stack overflows and run stack overflows back in the XP days, but I never learned in depth, complex attacks. I learned enough to run a debugger, find the memory address, write a nopales, etc but I never got deep enough to learn heap spraying, etc. They can get really complex now to bypass ASLR and other measures. I am trying to revisit this and learn more!

  • @MaxJNorman
    @MaxJNorman 7 ปีที่แล้ว +3968

    I really like this guy

    • @TheCFJB
      @TheCFJB 5 ปีที่แล้ว +58

      I'd 100% agree.

    • @gregoriysharapov1936
      @gregoriysharapov1936 5 ปีที่แล้ว +15

      Absolutely, max!

    • @benchiang8235
      @benchiang8235 5 ปีที่แล้ว +19

      Me too, he's cool.

    • @GodlyOne123
      @GodlyOne123 5 ปีที่แล้ว +96

      It's refreshing to see positivity and enthusiasm towards typically dry subjects. This whole channel is great, but this guy in particular is probably their most enjoyable to watch.

    • @ashleybishton742
      @ashleybishton742 4 ปีที่แล้ว +9

      Dude can hack anything I bet lol. He could devastate a system lol

  • @ElagabalusRex
    @ElagabalusRex 8 ปีที่แล้ว +1161

    I would love to see a series on micro-architectures, machine code, and assembly

    • @TheRomichou
      @TheRomichou 8 ปีที่แล้ว +10

      +ElagabalusRex Agreed!

    • @Funderpanda
      @Funderpanda 6 ปีที่แล้ว +6

      and micro-waves!

    • @akam9919
      @akam9919 6 ปีที่แล้ว +1

      Yes!

    • @kanpitcha54
      @kanpitcha54 6 ปีที่แล้ว

      please!

    • @AbuDoujana
      @AbuDoujana 5 ปีที่แล้ว +9

      @stephen schneider it may be tricky but it is definitely not 'insanely hard'... U just need to know at least the basics of forward programming ( C programing for example) and you can start from there, i would say i love it more than any other field but everyone has an opinion

  • @edgeeffect
    @edgeeffect 8 ปีที่แล้ว +467

    The sledge/bomb animation is BRILLIANT!

    • @seanski44
      @seanski44 8 ปีที่แล้ว +55

      Thankyou! I was pleased with that one ;)

    • @FreeStuffPlease
      @FreeStuffPlease 4 ปีที่แล้ว

      It made me laugh :)

  • @ItsNotJustRice
    @ItsNotJustRice 3 ปีที่แล้ว +139

    I know this particular video was years ago, but this guy is actually fun to watch. I'm terrible at learning, but he makes sense of a lot of things without dragging on the boring part.

    • @Stopinvadingmyhardware
      @Stopinvadingmyhardware ปีที่แล้ว

      Are you that mad at someone you don’t even know?

    • @Soedmaelk
      @Soedmaelk 8 หลายเดือนก่อน

      @@Stopinvadingmyhardware You replied to the wrong guy

  • @sickerpuppies
    @sickerpuppies 4 ปีที่แล้ว +622

    "It's meant for ethical hacking, let's just make that clear" - Mike Pound, 2016

    • @ashleybishton742
      @ashleybishton742 4 ปีที่แล้ว +3

      Only if you know how to use the scripts.

    • @charlieweberlv
      @charlieweberlv 2 ปีที่แล้ว +1

      That’s like trying to say this is an ethical shot from a gun to somebody’s body, it’s a hack.

    • @thegoodkidboy7726
      @thegoodkidboy7726 ปีที่แล้ว

      @@charlieweberlv People who find exploits and report them are important to the security of many systems. Companies hire penetration testers to try to break into their systems, so these issues can be fixed. Watch the footage of L0pht testifying before the US senate in 1998.

    • @davishall
      @davishall ปีที่แล้ว +17

      @@charlieweberlv Not at all. To be able to identify bugs, one must be able to think like a malicious hacker and have the same tools as a malicious hacker. Without ethical hacking, there would be a lot more unethical hacking.

    • @slingshot99
      @slingshot99 ปีที่แล้ว +5

      @@charlieweberlv You have to be able to disassemble something to understand its flaws. That's what ethical hacking essentially does.

  • @sivalley
    @sivalley 8 ปีที่แล้ว +634

    To err is human, but to really foul things up requires the root password.
    -Unknown

    • @U014B
      @U014B 8 ปีที่แล้ว +5

      Love it.

    • @sophiacristina
      @sophiacristina 4 ปีที่แล้ว +11

      It was Aristotle!

    • @kbs1212
      @kbs1212 4 ปีที่แล้ว +2

      sivalley Stealing-no, borrowing this

    • @xBZZZZyt
      @xBZZZZyt 3 ปีที่แล้ว +4

      Or SUDOer's password.

    • @masonhunter2748
      @masonhunter2748 3 ปีที่แล้ว +4

      To err is human.
      -Grammarly

  • @ButzPunk
    @ButzPunk 8 ปีที่แล้ว +352

    This was brilliant. More like it, please!

    • @cloveramv
      @cloveramv 5 ปีที่แล้ว +1

      Powerrrrrrrrrrrrrrrrrrrrrrr
      BUHAHAHAHAHAAHAHA
      whoami
      .
      .
      I am root baby.

    • @iraianbu3388
      @iraianbu3388 4 ปีที่แล้ว

      May i know what content is on cat shell_code

  • @colossalbreacker
    @colossalbreacker 4 ปีที่แล้ว +26

    I'm a cs major, but I don't normally like watching cs related youtube channels. These videos are awesome though, some of them are things I thought I had a decent grasp on and I end up learning something. I also love how happy Dr. Pound seems when he is talking about something, you can tell he really likes what he does.

  • @Elite7555
    @Elite7555 3 ปีที่แล้ว +31

    Absolutely brilliant demonstration. All universities that I know teach C/C++, but they don't teach the essence of software security, which should be pounded into every student's head right from the beginning.

    • @NightLife094
      @NightLife094 ปีที่แล้ว +6

      In my university in germany, they taught us these. But i mean the courses are called cybersecurity and reverse engineering

    • @lawrencelim6890
      @lawrencelim6890 ปีที่แล้ว +1

      @@NightLife094same. The info was taught in an intro to cyber course which made us do a lab that required us to attain root access using buffer overflow just like in the video.

  • @Anvilshock
    @Anvilshock 8 ปีที่แล้ว +160

    Nice presentation, thanks! It would be even nicer to have the stack video segment made clickable, given TH-cam's tendency to "Suggest" everything but related videos.

    • @Computerphile
      @Computerphile  8 ปีที่แล้ว +34

      +Anvilshock I'll sort that! >Sean

    • @Anvilshock
      @Anvilshock 8 ปีที่แล้ว +2

      ***** Much obliged, thanks!

    • @zavvie809
      @zavvie809 8 ปีที่แล้ว +2

      +Computerphile I suggest heap sort for that.
      :)

    • @benjabean1
      @benjabean1 8 ปีที่แล้ว +3

      +Computerphile Still not really fixed. It's currently neither a card or an annotation.

    • @ChaimS
      @ChaimS 8 ปีที่แล้ว

      +Anvilshock Also, it would be awesome if it was mentioned where in the video he talks about them, since we may not necessarily have 10-15 minutes to watch the whole video.

  • @geonerd
    @geonerd 8 ปีที่แล้ว +80

    Mike has a certain Dr. Evil vibe in that he clearly enjoys writing "Malicious Code." :)

  • @DFX2KX
    @DFX2KX 7 ปีที่แล้ว +50

    messing with, and forcibly messing with the stack is the source of a few old school console hacks if I recall, particularly on NES games. You write memory by doing very specific things to set certain memory values in an unusual way

    • @hamstsorkxxor
      @hamstsorkxxor 7 ปีที่แล้ว +20

      Pokemon! If I remember correctly, that missingno nonsense in Pokemon Red was a stack overflow.

    • @UmVtCg
      @UmVtCg 7 ปีที่แล้ว +2

      The game genie does this

    • @ns2304
      @ns2304 2 ปีที่แล้ว

      Think its how PS1 and onwards did it as well. Gameshark and Gamemaster ripped the values off the game corresponding to a particular attribute. Then you tweak the code to get outcome like inf items, inf health etc. Never knew this was the science behind it hah

  • @JaceLansing
    @JaceLansing 3 ปีที่แล้ว +1

    Man! How am I only finding your channel now!? This was great. Thank you for taking the time to put this together.

  • @timm9301
    @timm9301 5 ปีที่แล้ว

    I have studied exploit dev for a number of years and this is by far one of the best explanations ever! Keep it up!

  • @MrJoao6697
    @MrJoao6697 8 ปีที่แล้ว +5

    What a video! Great job on explaining this attack, I'll definitely be looking forward to learn more of this as I get into assembler at University!

  • @qgysugfq3935
    @qgysugfq3935 ปีที่แล้ว +7

    This hits especially hard since I just finished my assembly and computer systems class. Great video!

  • @cyberwithtom7714
    @cyberwithtom7714 5 ปีที่แล้ว +1

    for years ive been reading and trying to work out the ins and outs of bufferoverflow i can honestly say this is one of the most simple and effective videos out there on BO well done and Kudos loved watching it (for the 100th time)

  • @shumakriss
    @shumakriss 8 ปีที่แล้ว

    Thank you! I've never seen this explained in its entirety and there are lots nuances that have always inhibited my own educational endeavors. Knowing GDB, assembler, endianness, no-op sleds, etc were all concepts I understood but could never completely tie together. Excellent video.

  • @x1g5dj7dh4
    @x1g5dj7dh4 8 ปีที่แล้ว +13

    This was amazingly informative, especially for someone not using Linux. Well done!

  • @gassnake2004
    @gassnake2004 8 ปีที่แล้ว +23

    Great video! There's a lot of virus "concept" videos that explain how they work, but not many that show the actual implementation and writing of specific attacks. More please!

  • @jonahansen
    @jonahansen 5 ปีที่แล้ว +2

    Damn! Excellent presentation on how stack overflow exploits work! No hand-waving; a complete demonstration of how it's done, down to aligning the return address and the no-op sled mitigation.

  • @dantesalighieri
    @dantesalighieri 3 หลายเดือนก่อน +1

    The way this man explains things is absolutely DIAMOND.

  • @lolbajset
    @lolbajset 8 ปีที่แล้ว +29

    I absolutely love videos on things like malware, exploits and similar stuff, feel free to upload more of it if you can :D

  • @__-xl1zi
    @__-xl1zi 4 ปีที่แล้ว +235

    Everyone else:
    *makes a 20 char buffer*
    Mike: "We allocate a buffer that's 500 characters long"

    • @username17234
      @username17234 4 ปีที่แล้ว +42

      You need the buffer to be big enough to be able to comfortably hold your machine code plus a hefty padding for memory address variations.

    • @dicksonZero
      @dicksonZero 4 ปีที่แล้ว +66

      still wondering how he is going to type all 500 characters until he pulls out his python

    • @cheesescrust5399
      @cheesescrust5399 4 ปีที่แล้ว +3

      Eduardo I didn’t think it matters. I thought even small buffers could be exploited because the exploit payload just overflows and gets thrown into the stack. As long as you nopsled is hit by the pointer it just keeps running until it hits the return address which jumps to the shell code? Is that not correct?

    • @rampage_sl
      @rampage_sl 4 ปีที่แล้ว +7

      @@dicksonZero I see what you did there

    • @mu11668B
      @mu11668B 4 ปีที่แล้ว

      Well...
      If I'm not writing codes for dev boards that has memory capped at few KBs, I usually allocate a lot more, like 4096 bytes.
      It has hardly any drawback for machines with GBs of RAM and lowers the risks of writing data beyond the buffer zone.

  • @Acid113377
    @Acid113377 7 ปีที่แล้ว

    probably one of the best computerphile videos yet. Thank you Dr. Pound!

  • @tommybenshaul3443
    @tommybenshaul3443 6 ปีที่แล้ว +2

    a very good video, explains beautifully the why stack works and how to exploit a buffer overflow

  • @eliausi9696
    @eliausi9696 7 ปีที่แล้ว +7

    Welldone on explaining this so well

  • @realeques
    @realeques 7 ปีที่แล้ว +118

    i love how he explains every topic like its the best in the world... i could use him as my personal coach !

  • @TheMagAirsoft
    @TheMagAirsoft 3 ปีที่แล้ว +1

    Dr Mike Pound, i do not know if you know this but you are saving a lot of network security students with your videos on these subjects. They are incredibly informative and makes a whole subject comprehensible in the matter of minutes. A Great thank you.

  • @mad7227
    @mad7227 5 หลายเดือนก่อน

    His best yet IMO. Love the level of detail and honesty enthusiasm of the topic 😁

  • @another-person-on-youtube
    @another-person-on-youtube 3 ปีที่แล้ว +20

    "Can't type while people are watching."
    I'm not the only one!

  • @JaisMathews
    @JaisMathews 3 ปีที่แล้ว +10

    It would have been pleasure to sit in his classes. We need more professors like this.

  • @chris_1337
    @chris_1337 8 ปีที่แล้ว +1

    This was AWESOME! More, more, more please! Dr Pound is a great teacher

  • @jurepustoslemsek7882
    @jurepustoslemsek7882 4 ปีที่แล้ว +1

    I watched this a long time ago, but after taking an Assembly class in uni, I suddenly completely understand what he did and why it works! this is an absolutely amazing video as it actually gives an incentive to continue learning low-level programming and such.

  • @xSCOOTERx2
    @xSCOOTERx2 8 ปีที่แล้ว +10

    Had this for a homework assignment. It was quite hard to understand how to manipulate the stack at first, but this video helped a lot.

  • @MiSt3300
    @MiSt3300 3 ปีที่แล้ว +14

    Apart from the attack, it's so interesting to see how the computer actually processes the programme... I mean, I never really thought about it, that all the functions and returns and variables have to be stored somewhere and that it has to know how to execute it... I really like to think of a computer as a human being XD

  • @Tithis
    @Tithis 5 ปีที่แล้ว

    Studying for a security certificate and was having a hard time understanding exactly what was going on with the way they explained it in their videos. Your video really helped me understand it better, mostly by visualizing how the memory is laid out.

  • @CryptoJones
    @CryptoJones 5 ปีที่แล้ว

    Dr. Pound, thank you for the brilliant explanation of this. I wish I had you to explain these things to me as an undergrad.

  • @HavelockBanana
    @HavelockBanana 8 ปีที่แล้ว +6

    yeah! A technical video :-) Nice to see some actual code on this channel (even though it's being explained in a simple way :) )

  • @athanoslee
    @athanoslee 7 ปีที่แล้ว +210

    I like his playful manners and smiles. I think I have a crush.

    • @nofrag25
      @nofrag25 6 ปีที่แล้ว +21

      He s married bro

    • @firstnamelastname7319
      @firstnamelastname7319 5 ปีที่แล้ว +81

      I want him to overflow my buffer 😍

    • @jscorpio1987
      @jscorpio1987 4 ปีที่แล้ว +10

      Thibaud so? Are we supposed to intensively research a person’s personal life now to make sure they’re absolutely 100% single before we’re allowed to have an innocent crush on them? It’s not as if you can control such feelings and it’s not like OP was exactly sending the guy a marriage proposal.

    • @kbs1212
      @kbs1212 4 ปีที่แล้ว +4

      J T Maybe OP isn’t but I am. Marry me Mr. Pound

    • @untilted9126
      @untilted9126 3 ปีที่แล้ว

      I do as well

  • @cup-of-char
    @cup-of-char 7 ปีที่แล้ว

    Greetings! I watched this video to help me understand buffer overflows in my binary exploitation class in university and it was really helpful. Thank you so much!

  • @lumin0l161
    @lumin0l161 ปีที่แล้ว

    Best explanation of a buffer overflow I’ve ever seen.

  • @furetosan
    @furetosan 8 ปีที่แล้ว +13

    Awesome video. Especially the bit about the no-op slope.

  • @hellterminator
    @hellterminator 8 ปีที่แล้ว +449

    And this, kids, is why you should always sanitize your inputs.

    • @michaeltorres1263
      @michaeltorres1263 8 ปีที่แล้ว

      +hellterminator HAHAHAHAAHA!

    • @SUFHolbek
      @SUFHolbek 8 ปีที่แล้ว +21

      +hellterminator Little Robby Drop Tables

    • @hellterminator
      @hellterminator 8 ปีที่แล้ว +8

      Simon WoodburyForget Interesting language. I'm probably gonna stick with C/C++, but Rust is definitely interesting.

  • @DirkArnez
    @DirkArnez 3 ปีที่แล้ว

    Very clearly explained... I have been looking for a tutorial like this for about ten years.

  • @michalski9141
    @michalski9141 2 ปีที่แล้ว +1

    this is genuinely great content, very informative and well made

  • @GenGariczek
    @GenGariczek 8 ปีที่แล้ว +16

    More on similar topics please :)

  • @user-eh5wo8re3d
    @user-eh5wo8re3d 8 ปีที่แล้ว +7

    very nice Video. would love to See more of this sort in the future

    • @gegdim9307
      @gegdim9307 8 ปีที่แล้ว +2

      Fear not my friend! Botnets and iPhone decryption coming soon!

    • @user-eh5wo8re3d
      @user-eh5wo8re3d 8 ปีที่แล้ว

      Well that is a truly marvelous thing to hear. Am looking forward to it!

  • @hypernova2906
    @hypernova2906 3 หลายเดือนก่อน

    the stack content visualization and the no-op sled animation were really awesome

  • @Aemilindore
    @Aemilindore 7 ปีที่แล้ว +1

    I truly love the method Cumputerphine explains things. These are very advanced concepts explained so simply. Hats off for your effort.
    I am a researcher in the field of WSN. But I truly love this type of work. I would love to know what research field are related to this type of work.
    Once again. Great explanation. Love your videos!

  • @34521ful
    @34521ful 5 ปีที่แล้ว +5

    Just a slight error for future viewers, at the 7:10 minute mark, he points from "a" to the start of "buffer". What he meant was that we are at "ebp" to the start of the buffer is what sub $0x1f4, %esp does :)

    • @mustafadurukan6893
      @mustafadurukan6893 4 ปีที่แล้ว

      So the buffer starts from esp minus 500 and the buffer progresses towards ebp, right?

  • @VaultRaider
    @VaultRaider 8 ปีที่แล้ว +25

    These types of videos are better than the robots/drones stuff

    • @anujmchitale
      @anujmchitale 5 ปีที่แล้ว

      Not for a person who isn't interested in SW security or programming in general.

  • @thomasip9938
    @thomasip9938 8 ปีที่แล้ว +1

    Please do more of this!!

  • @nikhilnarayanan5949
    @nikhilnarayanan5949 4 ปีที่แล้ว

    This channel is by far one of the best....I made a computer application similar to chain reaction using the swing framework of java....I got a stackOverFlow error because of infinite recursion....this video really sorted me out....thanks!!!😁😁😊

  • @saultube44
    @saultube44 7 ปีที่แล้ว +8

    The guy is quite smart and he knows his stuff

  • @Tommus1997
    @Tommus1997 5 ปีที่แล้ว +46

    "I'm assuming you know what a stack is."
    *defines function*

    • @Juasml
      @Juasml 4 ปีที่แล้ว +19

      When you know a lot about something, sometimes it's hard to tell when you're being overwhelming and when you're going too slow. I guess he just randomizes it to keep going.

    • @dderudito
      @dderudito 4 ปีที่แล้ว

      Hahaha

    • @jag831
      @jag831 3 ปีที่แล้ว +1

      Haha that's why I love this kind of videos. "Look at this ebp register, for example. B stands for base and B is the second letter of the latin alphabet. It is allocated in 0x6404whatever5A in memory"

    • @fetchstixRHD
      @fetchstixRHD 3 ปีที่แล้ว +1

      To be fair, there was the video on stacks which anyone who wasn't familiar with could go and watch, so there isn't [wasn't] much point of repeating what's been done already.

  • @supermegauberful
    @supermegauberful 8 ปีที่แล้ว

    That's actually very well explained! Keep up the good work.

  • @Piotr3kM
    @Piotr3kM 8 ปีที่แล้ว +1

    Great stuff, I love videos that actually show something working in practice, rather than just the theory. Moar pls!

  • @5upl1an
    @5upl1an 5 ปีที่แล้ว +14

    The real question is, how can someone be so damn motivated at 7 in the morning?!

    • @RonaldMcPaul
      @RonaldMcPaul 5 ปีที่แล้ว +5

      Eating healthy breakfast cereals and grains.

    • @xxxXXXCH04XXXxxx
      @xxxXXXCH04XXXxxx 2 ปีที่แล้ว

      @@RonaldMcPaul yummy

  • @Calin42
    @Calin42 8 ปีที่แล้ว +3

    when a video on the ROP chains? with ASLR on and nX :p

  • @__-to3hq
    @__-to3hq 5 ปีที่แล้ว

    I love how much this guy loves talking about all of these topics its awesome :]

  • @SaeedAlFalasi
    @SaeedAlFalasi 3 ปีที่แล้ว

    Iv seen a bunch of videos on the same topic BUT THIS BY FAR is the best explanation !

  • @tiannimyers1204
    @tiannimyers1204 4 ปีที่แล้ว +3

    The more I learn about computers, the more I realize how easy they are. Great video.

  • @timt.4040
    @timt.4040 6 ปีที่แล้ว +20

    Very helpful! What is the gdb command (not shown on screen) to list the 200 registers at the stack point of -550?

    • @jbrhsn8406
      @jbrhsn8406 4 ปีที่แล้ว

      Google it Pal!

    • @abindieflasche100
      @abindieflasche100 4 ปีที่แล้ว +1

      @@jbrhsn8406 what is it

    • @zerozone1412
      @zerozone1412 3 ปีที่แล้ว +1

      @Tim Thompson did you find out what the command was? I need it😫 ..... thanks

    • @jag831
      @jag831 3 ปีที่แล้ว +1

      Something like "x/500xw $esp -550" could work. I may be wrong

  • @Bigfootmandude
    @Bigfootmandude 8 ปีที่แล้ว +1

    That was an excellent explanation! Really interesting and nicely detailed.

  • @pierreaupeix
    @pierreaupeix 8 ปีที่แล้ว

    This was very interesting. More of this please!

  • @harleyspeedthrust4013
    @harleyspeedthrust4013 6 ปีที่แล้ว +8

    Ignorant friend: "Why would you ever use Assembly?"
    Me: "..."

  • @anirudhsarma4233
    @anirudhsarma4233 7 ปีที่แล้ว +8

    Can anyone explain why 10 duplicates of the return address was needed as "padding"?

  • @hannahwhitham3539
    @hannahwhitham3539 4 ปีที่แล้ว

    I'm so happy this channel exists

  • @Nekology87
    @Nekology87 2 ปีที่แล้ว +1

    wow! such an insightful glimpse at how computers "think" and Dr. Pound you are so charimastic ^___^ thank you Computerphile for this video!! I'm just begining my programing education and this fills my cup with drive to push through learning the basics knowing later i will be able to excecute as my will wills

  • @taubrafi
    @taubrafi 8 ปีที่แล้ว +4

    Kali!

  • @ttttt_
    @ttttt_ 7 ปีที่แล้ว +301

    "there is nothing you can't do as root"
    except makepkg on arch :(

    • @nik123true
      @nik123true 7 ปีที่แล้ว +2

      nice one xD

    • @sauron1427
      @sauron1427 7 ปีที่แล้ว +49

      but you can create a user with whatever password you like, su into that user and run makepkg. you can still get ANYTHING done if you have root access.

    • @pedro.raimundo
      @pedro.raimundo 6 ปีที่แล้ว

      I LOLed.

    • @cybrhckr
      @cybrhckr 6 ปีที่แล้ว +8

      and some programmes does not allow you to run on root :D for security reasons

    • @Reth_Hard
      @Reth_Hard 6 ปีที่แล้ว +5

      You can't run VLC on root :(
      But you can patch it easily :)

  • @darksociety8210
    @darksociety8210 7 ปีที่แล้ว

    Excellent video, helped me massively to understand how these exploits work, subscribed!

  • @jorgeleopoldocurberarodrig5315
    @jorgeleopoldocurberarodrig5315 5 ปีที่แล้ว

    I need the second part of this video so much.

  • @navalkumarshukla9447
    @navalkumarshukla9447 2 ปีที่แล้ว +3

    I really liked the way he taught, didn't get it,but liked it xD

  • @rchandraonline
    @rchandraonline 8 ปีที่แล้ว +35

    On the original diagram: Functions do not (normally) go on the stack. The stack is only data (including return addresses). With architectures having hardware support for not executing data (often called an "NX" bit), such as a lot of the Intel processors, trying to execute a function on the stack with the NX bit set would cause an exception, which in Linux in turn would generate a signal (something like SIGSEGV), and without a signal handler would kill the process. (Yay, memory protection!)
    oh...and I think you mean backslash x ninety.

    • @Computerphile
      @Computerphile  8 ปีที่แล้ว +21

      +rchandraonline I've a feeling that's what Mike was talking about at the end.... >Sean

    • @rchandraonline
      @rchandraonline 8 ปีที่แล้ว +12

      ***** , oh, yeah...
      As Mike says (paraphrasing), there are so many things which would make great videos on what goes on in GDB and assembly...simply fascinating how all that stuff was developed over the years.

    • @JAN0L
      @JAN0L 8 ปีที่แล้ว +4

      +rchandraonline Function code doesn't, but all the local variables used by the function go on stack, otherwise recursive functions wouldn't be possible.

    • @stensoft
      @stensoft 8 ปีที่แล้ว +2

      +rchandraonline For running shell (or other simple tasks), NX bit is quite easy to workaround with return-to-libc attack. But that can be hardened with address randomization.

    • @GegoXaren
      @GegoXaren 8 ปีที่แล้ว

      gcc -fstack-protector-strong -std=c11 foo.c -o foo

  • @smtkumar007
    @smtkumar007 2 ปีที่แล้ว +1

    youtube algorithms are like now this guy has just finished watching bootstrap in 1 hours & that more than enough to recommend him buffer overflow attack videos

  • @kamoroso94
    @kamoroso94 8 ปีที่แล้ว

    This was an awesome video! I remember learning about this in class but not how to exploit it and see it in action.

  • @GegoXaren
    @GegoXaren 8 ปีที่แล้ว +5

    and this, kids, is why strcpy is removed from C11.
    Many of the string functions were removed and replaced with safe versions in C11.

    • @GegoXaren
      @GegoXaren 8 ปีที่แล้ว

      also use
      -fstack-protector,
      -fstack-protector-all
      or
      -fstack-protector-strong
      with gcc for non-time-critical stuff.

    • @anujmchitale
      @anujmchitale 5 ปีที่แล้ว

      strncpy is the replacement. The n is a parameter asking how much to copy. If more than the buffer length being used, the function itself won't compile.

  • @bluekeybo
    @bluekeybo 6 ปีที่แล้ว +9

    How would the "hacker" get the correct return address? They'd have to run gdb and list the addresses like in the video? How'd they do it automatically without root access?

    • @aneeshjoshi6641
      @aneeshjoshi6641 5 ปีที่แล้ว +2

      I think:
      Since every process works assuming it has the full RAM and in C you can get the address of anything using & you can probably get it.

    • @chasehiatt5595
      @chasehiatt5595 4 ปีที่แล้ว +1

      Gdb doesn't require root access

    • @bluekeybo
      @bluekeybo 4 ปีที่แล้ว

      @@chasehiatt5595 interesting

    • @rrestoring_faith
      @rrestoring_faith 3 ปีที่แล้ว

      gdb is just a debugging tool. Can run it on any executable if you have permissions to execute that executable.

  • @johnconnor7978
    @johnconnor7978 6 ปีที่แล้ว

    The only truly knowledgeable bunch of geeks on the internet that also know how to explain what they know. You sirs earned by EIP hi5

  • @soccer7901
    @soccer7901 8 ปีที่แล้ว

    I learn more from Dr. Mike then i do from my profs at uni. You are an inspiration Sir :)

  • @ryanofarrell186
    @ryanofarrell186 7 ปีที่แล้ว +103

    Video is 17:29 long.
    Mathematicians, unite!

    • @tennicktenstyl
      @tennicktenstyl 7 ปีที่แล้ว +11

      What's so special about this? I'm not familiar with numbers and stuff

    • @Keithfert490
      @Keithfert490 7 ปีที่แล้ว +65

      It's the smallest "taxi cab number": a positive integer expressible as the sum of two positive integer cubes in two different ways (1729=12^3+1^3=9^3+10^3).

    • @tennicktenstyl
      @tennicktenstyl 7 ปีที่แล้ว +10

      Oh, that's nice.

    • @sadrien
      @sadrien 7 ปีที่แล้ว +56

      Don't worry if you don't understand why that is important, because it really isn't.

    • @Quantumoprh
      @Quantumoprh 7 ปีที่แล้ว +3

      The quotient 0.58620689655 is used 731 times in this txt document:
      ftp://ftp.sanger.ac.uk/pub/1000genomes/zd1/ctcf/chip_seq_quantitation/rel_2012-09-21/cl.txt

  • @woutervandenputte1356
    @woutervandenputte1356 5 ปีที่แล้ว +6

    at 13:40 which command exactly do you use to list those 200 registers at the stack pointer minus 550

    • @nahue345
      @nahue345 5 ปีที่แล้ว +3

      x/200xg $rsp (i think)

    • @chaoluncai4300
      @chaoluncai4300 2 หลายเดือนก่อน

      i dont get why stack ptr minus 550 but not just 508 if the program stopped at the return address, can anyone explain it please ?

  • @Zeldon567
    @Zeldon567 2 ปีที่แล้ว

    As a frequent viewer of videogame speedruns, I know quite a bit about the uses of buffer overflow/underflow. Fun stuff.

  • @JeshuranPaul
    @JeshuranPaul 6 ปีที่แล้ว

    Extremely informative! Loved every second of this

  • @Dusk-MTG
    @Dusk-MTG 4 ปีที่แล้ว +5

    *Segmentation fault*
    Me: "Oh damn, I fcked up."
    Peter Parker: "That's exactly what we wanted."

  • @marsgal42
    @marsgal42 8 ปีที่แล้ว +6

    I'm guess I'm showing my age when I mention that this was how the Morris worm back in 1988 infected systems. :-)

    • @jag831
      @jag831 3 ปีที่แล้ว

      Cool! I was wondering on actual, real cases in which this has happened

  • @emrekantar5003
    @emrekantar5003 ปีที่แล้ว

    Might be by far the best explanation i’ve ever watched

  • @MarcinKonarski
    @MarcinKonarski 8 ปีที่แล้ว

    One of the best videos on Computerphile. Mike really knows his trade.

    • @MelBrooksKA
      @MelBrooksKA 8 ปีที่แล้ว

      +Marcin Konarski *hobby

  • @riyaz4455
    @riyaz4455 7 ปีที่แล้ว +4

    +Computerphile
    What is the GDB command used here "th-cam.com/video/1S0aBV-Waeo/w-d-xo.html"
    What is the GDB command to list some blocks of memory..???
    I have a session on the same topic and I really wanna use this example.....

  • @umarsalmanrao5
    @umarsalmanrao5 4 ปีที่แล้ว +3

    13:53 which command did he use here?
    x/200x $(ebp-100)
    Was it this?

    • @pratheeps3972
      @pratheeps3972 4 ปีที่แล้ว

      Same doubt bro

    • @yuvalweber5946
      @yuvalweber5946 4 ปีที่แล้ว +3

      i think he used this : x/200x $esp - 550

  • @stephana7785
    @stephana7785 4 ปีที่แล้ว

    Best explanation of shell code injection by far!

  • @Denverse
    @Denverse 3 ปีที่แล้ว

    Today is the day I finally exploited a full buffer overflow attack to gain shell.
    Thank you Mike.
    And the animation is so helpful.

  • @supernaturalswampaids8083
    @supernaturalswampaids8083 8 ปีที่แล้ว +9

    Cover the iPhone/Apple/FBI issue!

    • @Computerphile
      @Computerphile  8 ปีที่แล้ว +24

      +Reck Tominvayed Can you wait til Friday.... :) >Sean

    • @supernaturalswampaids8083
      @supernaturalswampaids8083 8 ปีที่แล้ว +11

      +Computerphile
      Yay! Thanks for the reply as well! I'm a huge fan!
      ....but I used to be a small air conditioner.
      Had to :P

    • @jasonneu81
      @jasonneu81 7 ปีที่แล้ว +2

      +Player Name If you used to be a small air conditioner and now you're a huge fan then you must have been an intermediate ventilation system at some point, right :D ?

  • @JadarDev
    @JadarDev 8 ปีที่แล้ว +10

    zsh is an older shell that doesn't have protections?! I use zsh all the time, I prefer it over bash because it has plugins.. How is that an old shell..?

    • @framegrace1
      @framegrace1 8 ปีที่แล้ว +1

      +JadarDev Yeah, is maybe the newest one. (Is younger than bash,ksh,etc...) But lots of exploits use it, not sure why. Maybe is just a hacker preference. (Like using rar instead of zip)

    • @unforkableonion5081
      @unforkableonion5081 8 ปีที่แล้ว

      +Marc Gràcia Those who are the geeks among geeks, use zsh...is a sign of distinction!! please try 7zip and forget the rest ;)

    • @michaelpound9891
      @michaelpound9891 8 ปีที่แล้ว +1

      Sh is also fine for exploits. You can't use bash though because it drops out of root as soon as it starts. Too secure!

    • @pat5star
      @pat5star 4 ปีที่แล้ว

      Michael Pound huh? sh is is just a link to bash by default. Or you can set sh to to point to your shell of preference, but as far as I know there isn’t any shell called sh.

  • @jasonford2877
    @jasonford2877 4 ปีที่แล้ว

    This video explains it better than a $2000 course I've been doing in Cyber Security (which goes into far more than just BOF) Drawing it tremendously helped me understand it!

  • @719Burton
    @719Burton 8 ปีที่แล้ว

    That was really great. Would appreciate more videos like it.