Basic Windows Reversing and Attacking Weak Crypto - FLARE-On 2018

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

КОМЕНТАРІ • 259

  • @love-hammer
    @love-hammer 6 років тому +655

    Pretty sure my coworkers wrote those function names.

  • @samuel7998
    @samuel7998 6 років тому +320

    This video is an exact representation of a programmer's life. Comitting mistakes, realizing where was the mistake 2 days later...

    • @Wilker_uwu
      @Wilker_uwu 5 років тому +2

      committing and commiting lots of mistakes

    • @TremereTT
      @TremereTT 5 років тому +7

      @@Wilker_uwu it's marketing. Commit a lot of mistakes and create a after sales market for support plans and update plans and off course extended warranty plans...

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

      @@TremereTT this is why FOSS is important

  • @110110010
    @110110010 6 років тому +571

    And this, children, is why you always write unit tests.

    • @lukasriemer8038
      @lukasriemer8038 6 років тому +9

      This is so true. Save my life every day.

    • @dantenotavailable
      @dantenotavailable 6 років тому +32

      And why you really should run those unit tests to make sure they fail.

    • @NicolaiSyvertsen
      @NicolaiSyvertsen 6 років тому +5

      The important thing about doing unit testing is that it forces you to break down your code into small units that can run standalone. How would you apply this to all the nested for loops that depend on each other?

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

      And go functional to avoid nested if statements

  • @NtQueryInformationProcess
    @NtQueryInformationProcess 6 років тому +254

    He uses 7-Zip instead of WinRAR. Best UA-camr ever.

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

      WinRAR can open 7z nowadays?

    • @NtQueryInformationProcess
      @NtQueryInformationProcess 6 років тому +5

      Yep.

    • @ac130kz
      @ac130kz 6 років тому +8

      WinRAR should be used only to compress RAR. In all other use cases it sucks a big one

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

      Izarc

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

      @@ac130kz i use winrar all my life, no problems so far and its fast

  • @thomapple
    @thomapple 6 років тому +81

    I used a simpler approach (in my opinion); I patched the function that prints the cells and inverted the behavior. I modified the "if" conditions so that all cells were revealed by default instead of hidden. Your solution is more elegant though!

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

      Thought about that too! What did you use to modify the code?

    • @dirtbikersteve
      @dirtbikersteve 6 років тому +19

      @@LiveOverflow dnSpy probably

    • @thomapple
      @thomapple 6 років тому +57

      I used dnSpy. By the way, a colleague of mine was in your team at DEFCON and I asked him to bring me back some LiveOverflow goodies, and you gave him like dozens of stickers, thanks a lot :) maybe next time I can see you in person.

    • @craftyle
      @craftyle 6 років тому +28

      Wait, wait, wait... thete are liveoverflow stickers???

    • @dafzu
      @dafzu 6 років тому +2

      @LiveOverflow you can also use Reflexil plugin for ILSpy to manipulate IL code

  • @dm4uz3
    @dm4uz3 6 років тому +310

    I think it'd pretty funny how flare-on's website has no working https

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

      Same here xD

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

      LetsEncrypt.org

    • @GalaxyCatz
      @GalaxyCatz 6 років тому +29

      It’s probably intentional so that a future flag can be extracted from their website or something

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

      @@GalaxyCatz hmm didn't think about that

    • @DanielSimon1995
      @DanielSimon1995 6 років тому +10

      @@GalaxyCatz in that case they could have added a challange.flare-on.com domain without ssl.

  • @ckennedy0323
    @ckennedy0323 6 років тому +22

    I don't know why but I decided to do this in python. I had gotten the result similar to how you did, but no matter the combinations (where I started the count for rows and columns), I couldn't get it to work. I imported ctypes, attempted to run my found cells into a generate key function I converted from C# to python, and even fruitlessly trying to rewrite all of the logic of the game into python.
    Turns out, I am better at programming than I am counting. I saw your video, saw that I got the same coordinates as you, and tried again, this time counting carefully. CTFs are really hard man.

  • @VLS-Why
    @VLS-Why 6 років тому +29

    Oof, I hate when I make a silly mistake and end up with a convoluted work around. At least you learned more about the challenge

    • @AmauryOrtega
      @AmauryOrtega 6 років тому +5

      yeah, keep trying was the key here. this bug could've been found by someone else working as a team, that's why team work is so important

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

    "I'm so dumb" hey man, dont be so hard on yourself. You're doing amazing :)

  • @DSAhmed
    @DSAhmed 2 роки тому

    You're not dumb. You're a human being. And the fact that you saw it at all means you're smart.

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

    actually met some of the lead fire-eye people, and they are so cool and get to do amazing stuff in terms of RE

  • @jaredmeit6127
    @jaredmeit6127 6 років тому +14

    The first challenge had obfuscated function names?! I would have been stuck on that. You rock!

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

      @@xorxpert I don't think you know what obfuscation is.

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

      Fireboltofdeath apparently you don’t know what obfuscation is. -_-. There was no obfuscation in this video period. It’s decompilations, reverse engineering. There was no obfuscated function names. Everything was plain visible as day. If it was obfuscated, it’ll be hard and challenging to read it.

    • @xorxpert
      @xorxpert 6 років тому +2

      Fireboltofdeath that just shows you both don’t know nothing. That’s sad. Go continue with your daily life and don’t bother mines. I am a software engineer.

    • @fireboltofdeath
      @fireboltofdeath 6 років тому +2

      @@xorxpert
      Obscure: not clearly expressed or easily understood.
      The function names were obfuscated, because they had names to mislead the user that doesn't do what the name implies.
      And, I'm a programmer also, so I really don't care. Obfuscation isn't only making your code hard to read,.

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

      obfuscate verb
      ob·​fus·​cate | \ˈäb-fə-ˌskāt;
      äb-ˈfə-ˌskāt, əb-\
      obfuscated; obfuscating
      Definition of obfuscate
      2 : CONFUSE:
      obfuscate the reader.

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

    Thumbs up for leaving the bug in there! Greatly underlines the constant try and error of hacking!

  • @Bar3ttGameplay
    @Bar3ttGameplay 6 років тому +2

    My god, im so glad that i found your channel.

  • @iliyass
    @iliyass 6 років тому +2

    Awesome job man, keep these videos coming.

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

    I used dnSpy which acts kind of like IDE so you can patch, run, etc dotnet.
    I looked up the data structure that contained the minefield matrix. Looked up the positions of the no-bomb cells. But counting the tiny row colmns was tough. Also not knowing if the colms are 0-based or 1-based index added to the trouble, so I patched the exe to not exit the game on bomb reveal. Then clicked open all the cells in the vicinity of the empty cells untill I found the right one. Then in another window I open the non-patched exe. Aligned the two fields to see where the empty-cells are. :P
    I was happy with my approach untill I saw yours.
    I loved that you could do it statically and still make it look so easy. Waiting for more videos

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

    I've had a harder time reading c++ and binary. I usually write C#. Thank you for this video!

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

    Nice solution for the second challenge, I just inverted the condition that decides what image is displayed on the field so i could see all bombs.

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

    Holy fuck, that went from 0 to 100000 real quick, i can't even imagine what the third challenge will be like.

  • @kimbol496
    @kimbol496 6 років тому +5

    Great vid as always!

  • @jean-baptistelasselle4562
    @jean-baptistelasselle4562 5 років тому

    ILSpy : The "IL" stands for "Intermediate Language", cf. "Intermediate Representation" (just love ur videos btw, hevin so much fun hackin on ur hax)

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

    That ending is one reason why I prefer langs where things are immutable by default :^)

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

    What kind of reason that may make some one press dislike for such great video ?

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

    Lol, I burst out laughing at the end. Atleast you caught it in the end before a youtube comment could ruin your day. Thanks for the video liveoverflow. I loved this one!

  • @lacno29
    @lacno29 6 років тому +2

    3:38 The InitializeComponent initializes those ughh..... components! Hahahahaha

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

    i don't even understand what you say , but i love to watch this videos xD

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

    I dont like Fridays cause its gonna be weekend, i like them cause i get high quality content to watch!

  • @mads7401
    @mads7401 6 років тому +14

    In the allocate memory class, you could create a string containing the flags and then just Messagebox.Show all the flags :)
    I did it like this in dnspy, displays all the flags:
    private void AllocateMemory(MineField mf)
    {
    // Initialize our string containing the flags information
    string flags = "";
    for (uint num = 0u; num < MainForm.VALLOC_NODE_LIMIT; num += 1u)
    {
    for (uint num2 = 0u; num2 < MainForm.VALLOC_NODE_LIMIT; num2 += 1u)
    {
    bool flag = true;
    uint r = num + 1u;
    uint c = num2 + 1u;
    if (this.VALLOC_TYPES.Contains(this.DeriveVallocType(r, c)))
    {
    flag = false;
    // Save the flag x,y coordinate in the string
    flags += string.Format("({0}, {1}) ", c, r);
    }
    mf.GarbageCollect[(int)num2, (int)num] = flag;
    }
    }
    // Display our flags string
    MessageBox.Show(flags);
    }

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

    Quality content as always and this one is hilarious!

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

    Jesus Christ you’re good as fuck, and these vids are so needed.
    Why no patreon or BTC donations? Whatever I can do to make sure you keep this up.

  • @T3sl4
    @T3sl4 6 років тому +4

    When you showed the brute force code, I immediately said to myself, "but wait, where is the copy from constants back to array2?... uh, if you say so?"
    D'OH! :D

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

    Man i strive to be as smart as you one day. Keep up the amazing videos!

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

    This. Is. High quality!

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

    Like always another great video

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

    I didn't figure the RNG thing. Thanks for the video.
    I solved it the same way haha :) I just inserted the row and col I found from debugging to the input. (Click randomly and change the index calculation). I also tried to find the real safe slots but was too lazy :)

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

    Actually the video end up being quite exciting even for a standard user

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

    I love doing windows reversing, I wish I knew this was happening!

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

    holy shit, 1st time I understand and saw your mistake init array outside the loop. That a big step, lol

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

    Wish I could do anything of that, but I'm just an electrician knowing the basics

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

    windows "NOT MY WORLD" same here. thats i reverse elf binaries and use rader2 for reversing mostly everything :)

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

    Love listening to stuff I know absolutely nothing about xD

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

    The "Ohhhhhhhh" was extensively cute.

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

    very good ! For me as a beginner this was really helpfull and I understood all of it , thanks!

  • @arcticcat3040
    @arcticcat3040 6 років тому +2

    Vert nice drawing of the Eevee evolution ^.^

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

    These are boss, slow learner these help so much.

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

    1:48 finally something i understand! 2:50 finally some c#/ .net $#!t that i know. this is going to be my episode! :D then this happens: 7:07
    like wuuuuuut? XD im still 2 fuckin' young i guess lol.. :D

    • @epictech1472
      @epictech1472 6 років тому +9

      What is basically happening is that the program is using a random integer as an XOR decryption key to an array of bytes, which contains the flag.
      Although, a seed is set, determined by cell values which are the same every time the program is started. That's what makes this weak. If you can find the cell values somehow, you can determine the seed, which then allows you to get the XOR key by generating random numbers using the seed and running an XOR decrypt operation on the array bytes.

    • @morsiskoPC
      @morsiskoPC 6 років тому +4

      If you are over 12 years old I doubt you are too young

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

    You know this man has been in the game for a while if he uses ILspy

  • @th3.Revenant
    @th3.Revenant 6 років тому +41

    Brain.exe has stopped working

    • @Wilker_uwu
      @Wilker_uwu 5 років тому +3

      it is easy to understand how programming works, it's like learning to play the piano or your favorite competitive game:
      //i say that if you press(aButton), you get...
      press(Button aButton) {
      //the note played by this button which is the note of this button.
      return notePlayed = note[aButton];
      }
      //then you define that the keyword "response" is the response of pressing this button on this position.
      response = press(thisButton[onThisPosition]);
      it is really easy to understand stuff by looking at simple mechanics, but the fun is about finding out what you can do with combinations and sequences of those mechanics used here.

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

      @@Wilker_uwu You just Made his Entire OS go offline he is not responding.
      System Error;

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

      @@asandax6 throw new Error(string? message) || throw new RuntimeError(String? msg) ?

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

      @@Wilker_uwu Ok I wrote Error String on a piece of paper and I threw it 😁. Now I am Grounded thanks to the message hitting my Mom🙁. So uh thanks.

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

      @@asandax6 what? XD

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

    If you think you are dumb what's left for the rest of us?! lol. Thanks for sharing!

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

    the 1st channel to which i pressed bell icon

  • @270jonp
    @270jonp 6 років тому

    Great videos, I really enjoyed flare-on challenges and am happy to see you covering them. I do think, however, that you should revisit this problem with one of the simpler approaches for people still learning. anything that can edit a .net binary could be used to easily solve this problem. I actually ended up using Cheat engine for this as i was familiar with the tool. that said i loved seeing a more static approach to this problem, though i cant say i would want to do it myself.

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

      How did you approach this with Cheat Engine?

    • @270jonp
      @270jonp 6 років тому

      @@LiveOverflow Cheat Engine has a .net dissembler built into it. (or at least can pull the symbols and function names out) from there i searched for the function that triggered when i clicked on one of the tiles and found that they were all set to either 0 or 1, however the function to close the program only ran when it got a click event. So i changed all the values to positive and saw where the correct tiles were. took a picture with the snipping tool and then clicked them and got the flag.
      Honestly its a kinda weird way to do it and www.reddit.com/r/ReverseEngineering/ posted some much more efficient ways to do it but it was a lot of fun regardless.
      Also, i post a lot of criticism, but i love your work. Keep it up :) .

    • @angryman9333
      @angryman9333 Рік тому

      @@270jonp you should've shared a video doing that, but that's too late now :) regardless great work

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

    Huh, nice bruteforce approach, I hadn't even thought about that :D Just found all this stuff about cells with no bombs (done that using calculator... I'm too dumb to copypaste the code, yep xD)
    Looking forward to see you working on next challenges, I'm so excited :)

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

    hahahahaha that ending man, all too familiar

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

    Great video, thanks !

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

    degga du bist so toll

  • @RogueWizard-v9r
    @RogueWizard-v9r 6 років тому

    I can RE better than anyone you know. I RE so well you cant ever get to me... Its the worst but kinda the best. comforting in a way.

  • @hermanheinz33
    @hermanheinz33 3 місяці тому

    Very good video!

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

    WOW I wish I could do that thatlooks like so much fun

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

    12:07 is priceless!

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

    12:10 Man, if you are dumb, then I am bubbling mad comparing to you. Awesome vids!

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

    Hi!
    For .NET i recommend DnSpy, it's Open Source of Github.

  • @Gary-tp9dk
    @Gary-tp9dk 3 роки тому

    Mind blowing..!!

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

    You need a rubber duck!

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

    Now I believe that even pros can make trivial mistakes.

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

    CTF 1: Open the disclosed program and copy some text
    CTF 2: literally run your brain around this significantly larger program for 10 hours just to realize that had you not of made one small mistake early on, you would of been done hours ago.

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

    Always debug the first few loop cycles ..and watch the state of variables

  • @olivert.7192
    @olivert.7192 6 років тому

    interesting for sure, cool video

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

    Great channel.. keep up

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

    awesome content!

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

    4:04 "...also, the other pictures do not have a flag" *shows a picture of a flag* ;)

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

    Smashed the like

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

    what an alien!!!

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

    "Many of the challenges are based on Windows, which is not really my world"
    but LiveOverflow.. in your Google CTF 2019 qualifier video, you used Windows to run minetest!
    perhaps... having some problems, with hardware-accelerated 3d rendering, on your unspecified non-Windows platform? ;)

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

    749 likes so far, 0 dislikes, what an absolute record

  • @EugeneKolo
    @EugeneKolo 6 років тому +11

    You'd also run into a bug in the brute force if the sorted array contained multiples of the same number. You assume the next number is greater, but it can be greater or equal than.

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

      Doesn't that imply the same cell is there twice? I thought it must be greater than, and that there'd be no duplicates.

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

      @@Flare03l Yeah that may be true, didn't examine it too closely/attempt the challenge myself. So I may be wrong in there being a bug :).

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

      @@EugeneKolo there is no bug, for exactly the reason flare stated. But in another program it might have been an issue.

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

    That just shows me how far im away of being an good dev. Just the slightest obfuscation shreddes me

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

    watched this a couple times, just realized that the cell number grid example he drew i missing 20
    5:20

  • @ムワ-d7n
    @ムワ-d7n 6 років тому

    need more flareon ctf :3

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

    Sometimes its just one line of code that screws the hole program.. nice video!

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

    I took VALLOC_NODE_LIMIT to mean the maximal amount of nodes allocated in the vertical.

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

    "only 4 billion options"
    *it took me one f-ing year to fix a typo*

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

    I find CSharp really similar to java with a hint of c++.

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

    Dn Spy, or .net reflector would have been a much easier tool to use. You did not even have to brute force the key, that's the over complicated way to do it. Nice for content though, good stuff.

  • @P-G-77
    @P-G-77 Рік тому

    "Give me a second..." any time i ear this message... my brain in automatic mode has the right response... NO RESPONSE AT ALL.

  • @kice
    @kice 2 роки тому

    I always define variables const if they are not suppose to change. So I have never encountered this kind of things after I switch to python XD.

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

    the second one would have been easier with dnspy. you can edit the code with it

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

    How about the rest of the flag...are you gonna do a walkthrough video for that?

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

    you use a wacom tablet? Cool every thing else not really XD
    just kidding keep doing what your doing man

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

    Hi, I'd like to Start With ctfs But cant find a easy one to Start With. Do you have an idea? Thank you!

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

    "Produces the same random values", despite being technically correct, sounds like an oxymoron tbh

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

    Why use ilspy instead of the better dnspy?

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

    "It's only 32 bit so it's not too big, you go from -2bil to 2bil *OnLy 4 biLliOn oPtiOns* " Yes. Not that much

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

    I’m feeling a bit like a dumb dumb since I really only know BASICS of C++, have only gone more in depth into front end languages. What language were you coding in for your own Bruteforce/your application to print out the results?

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

      we copied the recompiled C# code, and we just added some loops for the bruteforce around it. so in this case we used C#, because that was our target ;)

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

      LiveOverflow ah, thanks!

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

    1:04
    what is that song?

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

    Bro great video as always but if you are under windows and you need to reverse .net file , please use DnSpy next time :)

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

    it gets confusing when u dont know certain concepts or tools ... ill hav to learn a lot

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

    I literally did the same thing and made the same mistake :o

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

    My dll file coded in c++, what can i do to get all c++ code ?

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

    is it possible to decompile c++ native code?

  • @p-196
    @p-196 3 роки тому

    Ich will Flamara kuscheln
    UwU
    und die Leute in den Kommentaren verwirren. XD