Hacking WORDLE ?! x64 "pwn" Binary Exploitation - RET2 WarGames Platform

  Рет қаралды 33,396

John Hammond

John Hammond

Жыл бұрын

You can join me and play the WORDLE pwn challenge right in your web browser!
j-h.io/ret2wordle
Check out what RET2 Systems is up to: j-h.io/ret2
Help the channel grow with a Like, Comment, & Subscribe!
❤️ Support ➡ j-h.io/patreon ↔ j-h.io/paypal ↔ j-h.io/buymeacoffee
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
🐜Zero2Automated ➡ Ultimate Malware Reverse Engineering j-h.io/zero2auto
🐜Zero2Automated ➡ MISP & Malware Sandbox j-h.io/zero2auto-sandbox
⛳Point3 ESCALATE ➡ Top-Notch Capture the Flag Training j-h.io/escalate
👨🏻‍💻7aSecurity ➡ Hacking Courses & Pentesting j-h.io/7asecurity
📗Humble Bundle ➡ j-h.io/humblebundle
🐶Snyk ➡ j-h.io/snyk
🤹‍♀️SkillShare ➡ j-h.io/skillshare
🌎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/sponsorship
🚩 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

Пікірлер: 53
@matteo1429
@matteo1429 Жыл бұрын
There are no "skip this part" parts in this great video: every given minute is useful, fun and help to understand and develop a quick thinking scheme.. I enjoyed it from beginning to the end, thanks!!
@austinchandler2629
@austinchandler2629 Жыл бұрын
This has become one of my favorite channels over the last couple of months and i feel difficult concepts have explained very well by John. I would like to extend my gratitude by teaching you how to play Wordle. Don't double guess letters John.
@natornayce2790
@natornayce2790 Жыл бұрын
Thanks John, always great content you put out. Although sometimes I have no idea what's going on, but I'm still learning and you such an inspiration.
@jruok
@jruok Жыл бұрын
John's got great eyebrows, they're naturally arched. Anyway, I'm a new follower (and new to this field) and am glad I found this channel. He's so smart. Keep up the good work!
@HopliteSecurity
@HopliteSecurity Жыл бұрын
Nicely done. John Hammond is on fire with this one. I love your mug by the way - keep up the amazing work!
@adamkadaban
@adamkadaban Жыл бұрын
love the pwn content can't wait for more 😌
@levisaxe2075
@levisaxe2075 Жыл бұрын
This was a real nice walk through. The 18 and disas for the function was all I needed at that point. Thanks, it would have taken me forever to figure it out to that point.
@levisaxe2075
@levisaxe2075 Жыл бұрын
Just finished the video and realized I sent the winning characters in a different format than you and got the shell 😆
@Sevicify
@Sevicify Жыл бұрын
Great video. I paused the video around 25 minutes when I decided I wanted to try the challenge myself, ended up taking me like 30-40 minutes to beat it but I did have that head start from what I had seen in the video prior with the overrun when copying to the state words array though I somehow missed the game over flag being set inside an "else if" so I wasted a bit of time debugging trying to figure out why that wasn't breaking the main loop. Still despite the head start it was a fun little challenge figuring out the rest. For the return address I went an easier route of looking at the stack framing at the start of the main function knowing the address will be stored on top of the stack, here we see RBP is pushed onto the stack and RSP is moved into RBP meaning RBP+8 points to the return address. From here it was a matter of figuring out where the state structure was stored which was easy looking at the attempts variable stored at RBP-30 which puts the words array at RBP-2E. So with this I could determine the words array came 54 bytes before and that the return address starts at the last byte of the 11th guess. After figuring this out I did a double check by dumping the registers and memory in the debugger after breaking at the end of the function.
@masterlanz1038
@masterlanz1038 Жыл бұрын
Hey John Nice vid! I just have a question, how do you know these wargames. Like there are many resources but....staying updated and i feel i miss so much!
@Incognito1786
@Incognito1786 Жыл бұрын
Before watching John do binary exploitation, I understood none of it. Now, after watching several of John's videos on binary exploitation, I understand....absolutely none of it. But it's fun to watch him try to figure things out.
@johanngambolputty5351
@johanngambolputty5351 Жыл бұрын
Wow, I think this is probably the first time I actually fully followed one of these (with some rewinding), probably because I've only recently starting at looking at structs since I've started learning OpenCL (and in the same time trying to make sense of the buffers being exchanged from gpu into python or c++). I'm not really into security/hacking, I just seem to enjoy trying to make sense of bits of these videos. So let me get this straight: - The loop only breaks when the right solution is given, or on (exactly) the sixth guess (but not on 7th+) but we want to stay in it (because with every guess we start writing further into the stack). - Because of this, we want to skip the check for the sixth guess by giving the right solution, in the same time this marks the game as solved, but we can overwrite this. This is because we copy the full buffer over the words grid and not just the first five characters (though for future writes, only the first five character matter as we will re-overwrite the rest on future passes). This kinda happens automatically, because a newline always gets appended to your input and this always gets replaced by 0? - Guess 7 is crucial, because trying to index into state.words actually starts to write beyond it (we were writing beyond before, but now everything we write is beyond), in this case state.words[7] which begins at the solved variable. Here if the first character of the word input is anything other than 0, state.solved evaluates as true in the while check, with the caveat that after we write the whole buffer onto the stack, we then encrypt its first five bytes. So actually, if the first character of the guess encrypts to anything other than zero on this guess, the loop breaks. The encryption is actually important here, because its how you sneak your null byte past the strlen check (otherwise you have a zero length string). - After this, we just keep writing until we touch memory the process doesn't own and we get a segfault? But the stuff we want to get to is before that, so here begins the game of trying to overwrite mains return pointer? -John ends up having to write data that encrypts to a target address, but given that we actually write 16 chars every time and only the first 5 get encrypted, would it be simpler to try to overwrite rip one or two guesses earlier by entering something like "GUESS " ( I should probably just try it myself :) ) edit: idea doesn't work, each line gets sent as separate input ( can't have in the middle :( )
@jazzpizazz2692
@jazzpizazz2692 Жыл бұрын
Great video John! The RET2 wargames look really interesting! Too bad they ask $999 for 3 months of access. This is around the same amount of money I paid a few years ago to get OSCP certified :')
@jordanmusleh6305
@jordanmusleh6305 Жыл бұрын
Good morning Mrs Hammond need a bet help so in order to play that game do we need a virtual machine..??
@booruledie3052
@booruledie3052 Жыл бұрын
Great video!
@d0m186
@d0m186 Жыл бұрын
It would have been much easier to just send the xor encrypted bytes instead of sending A's etc. and trying to figure out what the resulting rip bytes correspond to. But aside from that very interesting video!
@Sevicify
@Sevicify Жыл бұрын
As the return address is just stored on the stack an easier way is figuring out the original stack pointer when the function is called and calculating the distance beforehand that the states structure is located. For the stack pointer just need to look at the start of the function where RBP is pushed onto the stack and RSP is moved into RBP and isn't changed throughout the function, so this means RBP+8 points to the original top of the stack which just so happens to be the return address used by ret at the end. Looking through the function you can then determine states is stored at RBP-30 and specifically the words array at RBP-2E, so that basically means there's 54 bytes from the start of the words array to the return address which comes to starting at the last byte of the 11th guess.
@johanngambolputty5351
@johanngambolputty5351 Жыл бұрын
Why do we observe hex(char ^ 0x27 +2) where we write char? (e.g. "0x68 for "A")?
@nocturne5151
@nocturne5151 Жыл бұрын
Hello understanding the debugger how does he know to look at the rip line?
@logiciananimal
@logiciananimal Жыл бұрын
This is great - a starting point for learning pwntools!
@BioHack
@BioHack Жыл бұрын
Great video 😎
@sammo7877
@sammo7877 Жыл бұрын
almost Shakespeare worthy ;)
@list1726
@list1726 Жыл бұрын
Thanks for making this video
@urits3719
@urits3719 Жыл бұрын
What debugger is being used here?
@eyephpmyadmin6988
@eyephpmyadmin6988 Жыл бұрын
How did you know the xor 0x26 was the encryption byte, how could did you find that link between the source code and the disassembler?
@LilithWolf_
@LilithWolf_ Жыл бұрын
The source code was iterating over the word characters and XOR'ing the characters with ENCRYPTION_BYTE (the ^= being the XOR and assign operator), XOR happens to be a direct CPU instruction, so we know we are looking for an XOR instruction in the assembly. Since the function only does that one thing (iterate over the characters and XOR with a special value), then we know that whatever XOR instruction we find, it HAS to be the specific XOR instruction from the `input[i] ^= ENCRYPTION_BYTE`. We see that the XOR instruction takes two operands, the register ECX and the literal immediate, 0x29. Compilers will optimise code as much as possible, so rather than it putting the ENCRYPTION_BYTE somewhere in memory and making it load it out every time its needed, it will instead (because ENCRYPTION_BYTE is unchanged throughout the program) encode it directly into the assembly instruction. Thus the 1 literal immediate value _has_ to be the encryption byte.
@jimo8486
@jimo8486 Жыл бұрын
its best to watch it fully and see how u fixed the issue so u know what went wrong.
@virous360
@virous360 Жыл бұрын
hi John
@pranjalaswal8300
@pranjalaswal8300 Жыл бұрын
He is going for OSEE 😎
@dumbidiot1119
@dumbidiot1119 Жыл бұрын
I’m not gonna pretend like I know anything about binary exploitation or anything Hackery in general but before I get to the solution, I think maybe if you type in a specific string into the input it gets xor ed into a different, more dangerous byte that will screw with the code or something
@dumbidiot1119
@dumbidiot1119 Жыл бұрын
I was kinda right no way
@aaaron19
@aaaron19 Жыл бұрын
50:13 omg I died laughing. So relatable
@antimatter6728
@antimatter6728 Жыл бұрын
In the technical way, is this heap overflow? Because you overflow the variable in the object?
@BioHack
@BioHack Жыл бұрын
nope, the struct wasn't allocated in the heap but on the stack.
@guilherme5094
@guilherme5094 Жыл бұрын
👍!
@frydegz
@frydegz Жыл бұрын
shmoocon 👀
@harshitgarg8848
@harshitgarg8848 Жыл бұрын
so much. Can’t wait to start making soft.
@jenycek2222
@jenycek2222 Жыл бұрын
00:23 2 many secrets RET2 systems I want to believe took me like 5 mins btw...
@mirnaoliviamelendrezruiz2450
@mirnaoliviamelendrezruiz2450 Жыл бұрын
Can we all appreciate the fact that he destroyed a
@PatrickScheich
@PatrickScheich Жыл бұрын
Where is the point the "\x29" comes up? I rewatched but John suddenly pulls the "\x29" out of thin air.
@MizardXYT
@MizardXYT Жыл бұрын
It was the ENCRYPTION_BYTE value, which he got from disassembling encrypt_word at 18:31. The xor-line corresponds to the ^ operator, which has a 0x29 value in the disassembly.
@PatrickScheich
@PatrickScheich Жыл бұрын
@@MizardXYT Thanks
@M_IZAN
@M_IZAN Жыл бұрын
Love From Muslim 💜💜💜💜
@lunchZA
@lunchZA Жыл бұрын
6:39 the wordle game has a bug, there is no way the second E in CREED is yellow when the solution is CYBER
@hozehd8246
@hozehd8246 Жыл бұрын
3 comments?
@daudameen1916
@daudameen1916 Жыл бұрын
43:05
@thatcrockpot1530
@thatcrockpot1530 Жыл бұрын
Nice vid but binexp in a browser is haram
@bfx8185
@bfx8185 Жыл бұрын
hmmm really?
@alext5497
@alext5497 Жыл бұрын
It's in local storage Mr hacker
@madorplayeryt
@madorplayeryt Жыл бұрын
По русскому можно ? По казахский вобще каеф чтобы было понятно
@flrn84791
@flrn84791 Жыл бұрын
Such a sloppy script 🤣
@flrn84791
@flrn84791 Жыл бұрын
All it would have taken is a xor function...
He tried to hack me...
34:15
John Hammond
Рет қаралды 374 М.
Heap BINARY EXPLOITATION w/ Matt E!
1:10:24
John Hammond
Рет қаралды 22 М.
He tried to save his parking spot, instant karma
00:28
Zach King
Рет қаралды 19 МЛН
Be kind🤝
00:22
ISSEI / いっせい
Рет қаралды 22 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 27 МЛН
Pwntools ROP Binary Exploitation - DownUnderCTF
55:21
John Hammond
Рет қаралды 86 М.
POWERSHELL: Random Users & Weak Passwords (Active Directory #03)
1:02:10
WIRESHARK for CYBERSECURITY w/ Chris Greer!
49:09
John Hammond
Рет қаралды 54 М.
DANGEROUS Python Flask Debug Mode Vulnerabilities
37:21
John Hammond
Рет қаралды 56 М.
this Cybersecurity Platform is FREE
39:46
John Hammond
Рет қаралды 527 М.
1v1 Coding Lockout Championship Finals
3:37:39
Errichto Hard Algorithms
Рет қаралды 72 М.
Hack like Mr Robot // WiFi, Bluetooth and Scada hacking
45:23
David Bombal
Рет қаралды 2,1 МЛН
3D Environment MasterClass | From CONCEPT to FINAL: Submission Review
3:51:51
How Hackers Hide
20:55
John Hammond
Рет қаралды 235 М.