Playing around with a Format String vulnerability and ASLR. format0 - bin 0x24

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

КОМЕНТАРІ • 45

  • @cyancoyote7366
    @cyancoyote7366 6 років тому +53

    I love this modern "refresh" series with the programs from protostar being compiled and exploited on modern systems! Thank you for this amazing video once again! :)

    • @marcovalentinoalvarado3290
      @marcovalentinoalvarado3290 3 роки тому

      You dont really know how many headaches i got trying to exploit on Windows 10 64 Bits with Assembly AMD64 lmaooooooo, ASLR, NX ant stuff that kicked me in the face xD

    • @selimeneskaraduman6935
      @selimeneskaraduman6935 3 роки тому

      @@marcovalentinoalvarado3290 ASLR and NX have friends named Stack Canary,PIE,RelRO. They don't like you too :D

    • @marcovalentinoalvarado3290
      @marcovalentinoalvarado3290 3 роки тому

      @@selimeneskaraduman6935 exactly men, i recently discovered RelRO and i was kinda sad :( One more level in the game :( Thanks for your comment! How are you going on this topic? Are you advancing?

    • @selimeneskaraduman6935
      @selimeneskaraduman6935 3 роки тому

      @@marcovalentinoalvarado3290 There are even more kinda stuff (e.g for windows kernel CFG SMAP) but nowadays still even high end products are being exploited;
      browsers, virtualizations, and kernels.
      The important point is to gain arbitrary READ/WRITE primitive in the memory. If you read some blogs about these exploits you will see READ/WRITE primitive because this allows us to bypass mitigations and create attacks for target specific

    • @marcovalentinoalvarado3290
      @marcovalentinoalvarado3290 3 роки тому

      @@selimeneskaraduman6935 Is there any way i can contact you in order to ask you for some blogs to read? :D

  • @MaxPicAxe
    @MaxPicAxe 5 років тому +9

    6:18 I'm glad you said "if this were an application which took longer to start or a remote service, then you couldn't do it"

  • @antricks2546
    @antricks2546 5 років тому +8

    Hi, just to let you know, there's a trick to write 0xdeadbeef to target. You can write several 2-byte packs of data to finally write 0xdeadbeef. For that you need the original adress and the same adress with an offset of two in the beginning of your string. If the second 2 byte value is less than the first one you can cound to 0x1dead instead of 0xdead (in case of deadbeef this is not necessary but if you're in need of doing so...) and overwrite one half byte of the next data word.

    • @jamilhneini1002
      @jamilhneini1002 5 років тому +1

      But that would take even longer time for the "magical" match to happen right?

    • @antricks2546
      @antricks2546 5 років тому +1

      Not the amount of output characters shifts the stack around but the amount of input characters. Of course you need to get the padding right to hit the two adresses to write to. But as the second adress is a known amount of bytes after the first one, you can easily write to the second one as well. It's basically the same as in the video but with two writes and two adresses.

    • @jamilhneini1002
      @jamilhneini1002 5 років тому +1

      @@antricks2546 Ohhhh i see that's definitely intresting

    • @HackingIsDope
      @HackingIsDope 3 роки тому

      Yes this trick was also explained in a book "Hacking : The art of Exploitation"

    • @antricks2546
      @antricks2546 3 роки тому

      @@HackingIsDope Actually, that's where I've got it from ^^

  • @JustCallMeKoko
    @JustCallMeKoko 6 років тому

    I got to the point at 9:40 where my target addr will be 1 nibble off from the address I partially overwrite.
    Example:
    Target addr = 7fff659c8c4c
    Overwritten addr = 7fff659c8d4c
    It is always the digit right before 4c and it is always 1 hex digit greater. It never matches.
    Why would this be?

  • @l42y_
    @l42y_ 6 років тому +7

    Amazing video. But your editing skills have greatlyyyyy upgraded. Videos feel fuckin smooth. Great job mahn. And amazing Hacking skills you got there. :D

  • @TheAmzuk
    @TheAmzuk 4 роки тому

    Thanks for the tutorial. Somehow modern iteration (x64, libc-2.29) compiles with $rax which lays after the string and technique explained in the very beginning works

  • @FalcoGer
    @FalcoGer 4 роки тому +1

    I don't think ALSR is the problem here. I mean I'm a noob, but if you want to write 0xdeadbeef by using %n you would have to have written 3735928559 characters (3.7 GB!!) into buffer. the stack segment on my machine is 0x21000 bytes long (~ 135kB). You'd run into a segfault before you even get to 1 MB written to buffer.

    • @LiveOverflow
      @LiveOverflow  4 роки тому +2

      you can also use multiple %n that overlap eachother (I have done that in some video too). You could also write only one or two bytes with %hn etc.

  • @Alex-ffeeb2
    @Alex-ffeeb2 6 років тому +6

    Did you hear about how all windows versions from 8 till now haven't been applying ASLR properly?

    • @LiveOverflow
      @LiveOverflow  6 років тому +1

      what do you mean?

    • @Alex-ffeeb2
      @Alex-ffeeb2 6 років тому +1

      Apparently they fail to generate enough entropy and end up with the same base addresses each time. there was an article on bleepingcomputer about it

    • @xandercage740
      @xandercage740 6 років тому

      Alexander Anderson could you share the link to that article here?

    • @Alex-ffeeb2
      @Alex-ffeeb2 6 років тому +2

      Sure www.bleepingcomputer.com/news/security/windows-8-and-later-fail-to-properly-apply-aslr-heres-how-to-fix/

    • @kenji8763
      @kenji8763 6 років тому

      I couldn't believe it so i found another source, and yep, it's true.
      www.kb.cert.org/vuls/id/817544

  • @odpadkowy
    @odpadkowy 3 роки тому

    Why "eventualy" you could get the correct address? I woudl guess that value on the stack is address of some other variable, each execution it would be diferent, but offset would be the same. So it would shift back and forth as the target is... Why are we able to hit it just updating the last nibble and not other bytes?

  • @jerryfei5389
    @jerryfei5389 5 років тому +1

    try override &target with 0xde and &target+1 with 0xad and so on... so that you don't have to print billions of char before %n

  • @matony8229
    @matony8229 5 років тому +1

    sprintf will add a null byte at the end of the string..

  • @rishibhatt9595
    @rishibhatt9595 6 років тому +1

    Thanks for the amazing video, i was also trying to do this on aslr.. But still cant able to exploit.

  • @user-ts2ig9db6d
    @user-ts2ig9db6d 5 років тому

    Amazing video!

  • @lightarmanov6266
    @lightarmanov6266 6 років тому

    I think you could also use brop to stack read if your program didn't rerandomize

  • @peterforthewin
    @peterforthewin 6 років тому

    Good video as always

  • @cinest5170
    @cinest5170 6 років тому

    I wonder if shifting bits to left or right would do anything

  • @lightarmanov6266
    @lightarmanov6266 6 років тому

    I think you could also use the format string to leak the address of target

    • @gameglitcher
      @gameglitcher 5 років тому

      How would you utilize the leaked value in an input string? Can you maintain an open input stream to the program whilst executing the program? Can you by chance hook it to something with input stream and have it get stored in the stack?

  • @GamingClubGermany
    @GamingClubGermany 6 років тому +3

    255 likes :) coincidence ? i dont think so :D

  • @GRBtutorials
    @GRBtutorials 6 років тому

    Why do you rent a server which costs you money instead of using something like Vagrant? You could even use an Orange/Raspberry Pi if you wanted.

    • @LiveOverflow
      @LiveOverflow  6 років тому

      +GRBTutorials laziness. Starting a VM takes longer than renting it for a minute :P

    • @GRBtutorials
      @GRBtutorials 6 років тому

      Sorry for my delayed response (UA-cam didn't notify me). Vagrant actually starts pretty fast, in about 1 minute, at least in my Late 2015 iMac with an i5.

  • @stpauli20537
    @stpauli20537 6 років тому +1

    Hey, ich hab gerade ein interesantes Video über ASLR bypass gefunden, in der Technik umgehen sie die ASLR indem sie nach einer verzögerung in der CPU-Cache suchen und somit die Map der MMU finde..besser und detaillierter beschrieben ist es im Video, ich hoffe es hilft weiter.
    ua-cam.com/video/c8aRHLhQGBc/v-deo.html

  • @mohitvaishnav7283
    @mohitvaishnav7283 6 років тому +1

    please make a video on how to hack car remote please

  • @HXMCPP
    @HXMCPP 5 років тому

    i didn't understand a shit . aslr is crape in CTFs/challenges