pico2024 format string 0

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

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

  • @PhamThanh-s2q
    @PhamThanh-s2q 2 หลายเดือนก่อน

    Sorry, but i don't know why printf(choice1) doesn't have format string error?

    • @carlislemc
      @carlislemc  2 หลายเดือนก่อน +1

      Because you aren't allowed to put in an arbitrary string, but only one on the menu.

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

    Okay, after seeing this video, I think it was straightforward.
    When I was trying, I got to the point that I had to give some input greater than that mentioned (2*BUF_SIZE). I overlooked the %114d in one of the choices. I wrote Breakf@st_Burger 5 times in the input without spaces. I did get the message "There is no such burger yet", but I also got the flag. Is it because of some overflow?

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

      This problem prints the flag if you make it crash for any reason.

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

    I didnt really understand the working im kinda like a noob in this but could you explain how it works ?like my only doubt is why it segfaults for Cla%sic_Che%s%steak and not for any other combination of %s

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

      You might want to read more about format string specifiers, e.g. cplusplus.com/reference/cstdio/printf/.

  • @eduardorocadas9968
    @eduardorocadas9968 14 วันที่ผ่านมา

    So i tried this ctf just now and I got the flag by inputting aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, was messing around after not paying attention to the code.....idk how and why it gave me the flag. Any possible explanation?

    • @eduardorocadas9968
      @eduardorocadas9968 14 วันที่ผ่านมา

      And nvm just read the comments, apparently as long as it crashes it gives u the flag. How do we know that tho? any line I code that indicates that?

    • @carlislemc
      @carlislemc  13 วันที่ผ่านมา

      @@eduardorocadas9968 The call to signal(SIGSEGV,sigsegv_handler) makes it call the function sigsegv_handler (which prints the flag) whenever it crashes.

    • @eduardorocadas9968
      @eduardorocadas9968 13 วันที่ผ่านมา

      @@carlislemc thank you so much, i was so confused on why my solution worked