pico2024 format string 0

Поділитися
Вставка
  • Опубліковано 27 лис 2024

КОМЕНТАРІ • 10

  • @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.

  • @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.

  • @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 16 днів тому

    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 16 днів тому

      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  16 днів тому

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

    • @eduardorocadas9968
      @eduardorocadas9968 16 днів тому

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