DANGEROUS C Functions gets & strcpy (PicoCTF 2022 #04 buffer-overflow0)

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ก.ย. 2024
  • Help the channel grow with a Like, Comment, & Subscribe!
    ❤️ Support ➡ j-h.io/patreon ↔ j-h.io/paypal ↔ j-h.io/buymeac...
    Check out the affiliates below for more free or discounted learning!
    🖥️ Zero-Point Security ➡ Certified Red Team Operator j-h.io/crto
    💻Zero-Point Security ➡ C2 Development with C# j-h.io/c2dev
    👨🏻‍💻7aSecurity ➡ Hacking Courses & Pentesting j-h.io/7asecurity
    📗Humble Bundle ➡ j-h.io/humbleb...
    🌎Follow me! ➡ j-h.io/discord ↔ j-h.io/twitter ↔ j-h.io/linkedin ↔ j-h.io/instagram ↔ j-h.io/tiktok
    📧Contact me! (I may be very slow to respond or completely unable to)
    🤝Sponsorship Inquiries ➡ j-h.io/sponsor...
    🚩 CTF Hosting Requests ➡ j-h.io/ctf
    🎤 Speaking Requests ➡ j-h.io/speaking
    💥 Malware Submission ➡ j-h.io/malware
    ❓ Everything Else ➡ j-h.io/etc

ความคิดเห็น • 47

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

    I was at that part in my Security+ chapter about buffer-overflow and I was looking for an example of what it really did in C. Thanks man !! :)

  • @JB4lly
    @JB4lly 2 ปีที่แล้ว +15

    Maybe putting -fstack-protector when compiling would have worked? Not sure

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

    Thank you John, every time I watch one of your videos I always learn something new :)

  • @wChris_
    @wChris_ 2 ปีที่แล้ว +21

    it seems to be a kali linux thing having no stack-protector when building with gcc, as it works on my machine (ubuntu)

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

      You have to pass “fstack-protector" when compiling with gcc

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

    Dude, following along right with you, even going ahead now until I get stuck! Please keep going, this is great and I appreciate you so much!

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

    Thanks John. We appreciate how you thoroughly explain everything and keep it simple at the same time. You're a rockstar!!

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

    These videos are so awesome. Thanks so much John

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

    Great series! Keep it coming!

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

    Super cool series, always a pleasure to watch them! Keep it up!

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

    Haha I'm a noob at these CTF challenges and had troubles solving this one for some reason. Looking through it with your guidance I'm like "Wow I'm an idiot, it was so simple" lol

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

    This was fun! Please more John. :)

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

    Loving this series, John. Please finish it!

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

    3 ways to fail the computer systems course I did ~20 years ago: 1) cheat 2) do way too little adequate work 3) use gets()

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

    You the best John, thanks a lot for these material and your explanations,
    You are a master mind my friend

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

    you already know it but let me tell you one more time YOU ARE AWESOME.

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

    Enjoyed the video. Keep them coming.

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

    Done Watching Cool Thanks John

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

    I wanted to subscribe, but I've completely forgotten that I already was. Anyway, thanks for another informative video!

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

    Thank you for all the beginner-friendly content
    A question as an absolute newbie into binary: only an input of length>=20 causes the SIGSEGV, i.e. it doesn’t happen with say 17. Is there a way to know or estimate how many more bytes I need?

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

      The segfault is triggered by overwriting the return address on the stack (changing its value to some random garbage makes the program try to jump to that address and read code from there which the OS does not allow and sends the segfault signal) how many bytes you need to modify depends on the layout of the stack. You can use a debugger and look at the addresses of the local variables or look at the disassembly to see how much space is being allocated on the stack, but in this particular case the extra four bytes are the space on the stack for the local variable input. The layout of the stack is return address, then input then the buffer (though the stack grows down so these end up at decreasing addresses). When you put an input less than 16 characters it fits into the buffer. If you put 16-19 characters it starts clobbering the local variable input, and only once you put in 20 or more characters does it start touching the return address and cause the segfault.

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

      @@hedgechasing thanks for the explanation! I definitely have to look at it more

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

    Awesome

  • @anmoldeepsingh9281
    @anmoldeepsingh9281 9 หลายเดือนก่อน

    i think the stack smashing wasnt detected probably the way gcc was compiled, its default could have been -fno-stack-protector, so default build task will never include a canary

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

    sigsegv stands for signal segmentation violation

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

    Oh the days I coded in C/C++, flush of output buffer is not guaranteed without the flush

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

    I think strcpy is the most used function to demonstrate bufferoverflows.

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

    6:34 a minor correction: the char array buf1 is 100*sizeof(char) Bytes long

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

    If this is training wheels, I am still at the crawling phase XD. I'll get there one day :')

  • @stopper0203
    @stopper0203 10 หลายเดือนก่อน

    I don't understand how just adding a few extra characters causes the flag to magically appear. Is it because added the extra characters causes some specific code to execute? If so which part?

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

    This is rust will dominated the c language 😂😂 but hey nice reverse engineer 😀 😉

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

    I gave the 69th like 😁

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

    09:00 laughs in format string vulnerability and return-to-libc

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

    Nice'n'easy :)

  • @krgrief
    @krgrief 9 หลายเดือนก่อน

    you don’t explain how the buffer overflow even works though..?

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

    What is the version of Sublime text you are using?? Please answer

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

    Do you have references / explanation about the {,_COMPLETE}, i searched all day long on Shell expansion and no one say a thing about this tips :)

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

      It's a bash feature called brace expansion.

  • @Angel-Pizzaeater
    @Angel-Pizzaeater 2 ปีที่แล้ว

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

    Is overflow on this the same as overflow on Hacknet?

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

    👍

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

    you made a 64bit version, so there more buffers i think.

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

    How can this be dangerous?

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

    2nd?

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

    NVIDIA should be tried for unfair profit and hoarding...

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

    1st?