AES-CFB Cryptography Mistakes - HackTheBox Business CTF "Domain Controller"

  Рет қаралды 41,189

John Hammond

John Hammond

2 жыл бұрын

If you would like to support the channel and I, check out Kite! Kite is a coding assistant that helps you code faster, on any IDE offer smart completions and documentation. www.kite.com/get-kite/?... (disclaimer, affiliate link) Register and play the GuidePoint Security August CTF! www.guidepointsecurity.com/re...
For more content, subscribe on Twitch! / johnhammond010
If you would like to support me, please like, comment & subscribe, and check me out on Patreon: / johnhammond010
PayPal: paypal.me/johnhammond010
E-mail: johnhammond010@gmail.com
Discord: johnhammond.org/discord
Twitter: / _johnhammond
GitHub: github.com/JohnHammond

Пікірлер: 66
@SEEN-uh7pi
@SEEN-uh7pi 2 жыл бұрын
"And I will steal the code that was written previously, because I am a man of class" - John Hammond
@pranavaraoperuvaje2089
@pranavaraoperuvaje2089 2 жыл бұрын
I liked that John from the future.
@ethiogazeta
@ethiogazeta 2 жыл бұрын
The reason I love this guy so much is because he is not a tool addict
@fkarls9282
@fkarls9282 2 жыл бұрын
Hey John, just wanna say your videos are literally the best in this sector of youtube. Its just doesn't get boring and is really informative. Thank you so much for your content!
@evtimevtimov6203
@evtimevtimov6203 2 жыл бұрын
Amazing video as always! Love to see 'em notifications when you upload a video. Thank you for these absolutely great videos John!
@07DrMaus07
@07DrMaus07 2 жыл бұрын
I don't think that this is a hacky way. It's more that it's a good way of visualizing why you should not be using the DECRYPTION function of a block cipher for ENCRYPTING anything. I am pretty sure that is the source of the incorrect behavior here. One of the special characteristics of the CFB mode of operation is that it's decryption phase can be parallelized, because the blocks do not depend on each other. They do when the encryption function is used, but not when decrypting. This means that if you can provide the IV as well as the ciphertext being decrypted, identical blocks will decrypt to identical plaintext. Essentially, what is happening here is that the whole chaining of blocks is lost, and you are essentially "encrypting" as if you used ECB as the mode of operation, which suffers from the same issue. That issue being that identical blocks of plaintext encrypt to identical blocks of ciphertext, and thus patterns in the plaintext are preserved in the ciphertext. Edit: Actually, I want to expand this explanation with an important remark. The decryption function produces identical blocks in this case, because the entire input, the 69 byte-long array of IV + token, is made up of identical bytes. This is important because decryption in CFB mode is done in the following way: 1. Feed IV into AES encryption (important!) function, with some key K. 2.a XOR the output with the first block of the ciphertext, let's call it Ci_1. 2.b Result of 2.a is first block of plaintext. 3. Feed Ci_1 into AES encryption (important!) function, with some key K. 4.a XOR the output with the second block of the ciphertext, let's call it Ci_2. 4.b Result of 4.a is the second block of the plaintext. etc. etc. These steps are repeated for each block of ciphertext, increasing the index of Ci by 1 each time, until everything is processed. However, if IV = Ci_1 = Ci_2 = Ci_3 = ... = Ci_n for n blocks of ciphertext, then we are simply doing the exact same operation over and over again, a total of n times. Let us call this special case of IV Ci_0, and keep the property that Ci_0 = Ci_1 = Ci_2 = ... = Ci_n. Then the process becomes: 1. Feed Ci_0 into AES encryption (important!) function, with some key K. 2.a XOR the output with the first block of the ciphertext, which is Ci_1. But since Ci_1 = Ci_0, we actually simply XOR with Ci_0. 2.b Result of 2.a is one block of the plaintext. Iterate n times to generate all blocks of the plaintext. Now it is easy to see that running Ci_0 through AES with the same key, which we neither know nor need, and then XOR:ing the result with the input, Ci_0, n times will give us the exact same output n times. Alas, we will get a "password", that is comprised of the exact same bytes repeated 53 times in the challenge.
@abeecee
@abeecee 2 жыл бұрын
"...so it's going to stomp over errors in a weird way... in a normal way, not weird at all, but..." - John Hammond, 2021
@4lpina
@4lpina 2 жыл бұрын
Absolutely love your content John!
@Sybrid203
@Sybrid203 2 жыл бұрын
Great video man! Was kinda hoping you'd talk about the similarities of this challenge and the ZeroLogon vulnerability, since both are vulnerable due to the use of the CFB library.
@MatteoGariglio
@MatteoGariglio 2 жыл бұрын
Hi John, I hope you will share with us all the remaining challanges in this cathegory :P Super dooper interesting! Cheers
@tayloralbrecht8362
@tayloralbrecht8362 2 жыл бұрын
So many things I didn’t understand in such a short time
@tribervirus2932
@tribervirus2932 2 жыл бұрын
its interesting and amazing.
@rysssvenne
@rysssvenne 2 жыл бұрын
Love your content! Can you make a video on how to efficiently take notes? I’m struggling to find a good way ti keep notes on commands and tactics
@with.love_u
@with.love_u 2 жыл бұрын
yes, it is
@daljeetbhati8816
@daljeetbhati8816 2 жыл бұрын
Best video
@richardlouis7125
@richardlouis7125 2 жыл бұрын
Great work I aspire to be like you in the future
@RealQoshoro
@RealQoshoro 2 жыл бұрын
More please
@liudvikasstankus
@liudvikasstankus 2 жыл бұрын
I love your content. Keep it up.
@NiteTerrors
@NiteTerrors 2 жыл бұрын
Hey John, What did you study to be well versed in these topics? Certifications or degree plans? Im just breaking into the industry, thanks!
@daljeetbhati8816
@daljeetbhati8816 2 жыл бұрын
Your fan
@logiciananimal
@logiciananimal 2 жыл бұрын
I find it interesting that brute force is even possible - many CTFs I've used explicitly set challenges so that BF is not the answer.
@proxis9980
@proxis9980 2 жыл бұрын
selecting from 256 ascci keys (to send 53times) is not considered brute force you could literally do this by hand...the trick is to reduce the possibilities down from 256^53 to 256
@daljeetbhati8816
@daljeetbhati8816 2 жыл бұрын
Love from india
@imTyp0_
@imTyp0_ 2 жыл бұрын
Hohn Jammond xD
@milanche_
@milanche_ 2 жыл бұрын
hi so umm just wanted to ask if you will be doing videos on that guidepoint august ctf
@guilherme5094
@guilherme5094 2 жыл бұрын
Like.
@LinuxJedi
@LinuxJedi 2 жыл бұрын
you’re using a live vm ?
@StevenIngram
@StevenIngram 2 жыл бұрын
Considering the processing power of modern computers, does
@11ph22il
@11ph22il 2 жыл бұрын
more like a soft and gentle force, not that brute :)
@StevenIngram
@StevenIngram 2 жыл бұрын
The only thing I could suggest is capturing the response from the host. If the string changes from one iteration to the next, halt because you found the password. Still brute force, but fewer iterations.
@bravo-6900
@bravo-6900 2 жыл бұрын
Sounds like heap overflow but data showcase at once.
@omkargadave1089
@omkargadave1089 2 жыл бұрын
Which os you are using sir.....
@b33tleosint15
@b33tleosint15 2 жыл бұрын
From where did you learned python
@7n7o
@7n7o 2 жыл бұрын
he installed a vm and transcended into india
@UmbraAtrox_
@UmbraAtrox_ 2 жыл бұрын
I hope you have a "1337 h4xx0r" Sticker somewhere on your equipment. Since, if not you, who else?
@sanspentester8506
@sanspentester8506 2 жыл бұрын
What is your Linux distro? 🚶
@atimy
@atimy 2 жыл бұрын
arch btw
@grandmakisses9973
@grandmakisses9973 2 жыл бұрын
He runs Ubuntu with xfce
@alexandrepoulin5414
@alexandrepoulin5414 2 жыл бұрын
Pretty sure this is a bug in how the crypto library they were using implemented CFB mode.
@SiyuJiang
@SiyuJiang 2 жыл бұрын
It’s not a bug. In any CFB mode with block size 1 byte (which is the default block size), if you can control IV and ciphertext, you completely control the plaintext.
@alexandrepoulin5414
@alexandrepoulin5414 2 жыл бұрын
@@SiyuJiang that's only true if you have the cipher key. The AES part still uses a 16 byte block to create the keystream and thats what the iv gets fed into. It seems to be creating a key stream of identical bytes which is not what you would expect.
@SiyuJiang
@SiyuJiang 2 жыл бұрын
@@alexandrepoulin5414 It’s true whenever the block size is 1 byte. Let me rephrase; you control the entire plaintext *except* for the first byte, which is only an 8-bit bruteforce (which is why I originally said “completely control” - an 8-bit bruteforce is trivial; in this video it was done in a matter of seconds). It doesn’t matter what the key is (beyond that 8-bit bruteforce) because of the way CFB works. You can think about it this way - by controlling IV and the ciphertext, under CFB mode, we essentially control whatever is being fed into the AES blocks. Encryption (indexed by a key) is a function: f(x) = f(y) if x = y. Since we can make x = y, we can make f(x) = f(y).
@AidinNaserifard
@AidinNaserifard 2 жыл бұрын
Please add subtitle @johnhammond
@anonymoushacker1690
@anonymoushacker1690 2 жыл бұрын
liked your tryhackme throwback T-shirt ...... keep it up sir ..... great efforts
@dholy4038
@dholy4038 2 жыл бұрын
iPhone or Android?
@nikolas8741
@nikolas8741 2 жыл бұрын
Could you create malware for a 3D printer?
@lifebarier
@lifebarier 2 жыл бұрын
Given how much you use sublime it should not be unregistered
@rstewa35
@rstewa35 2 жыл бұрын
It’s a vm
@lifebarier
@lifebarier 2 жыл бұрын
@@rstewa35 Not an excuse. Also, any evidence of him having it registered on non vm?
@seshanths419
@seshanths419 2 жыл бұрын
Discord invite not working
@ygjt76v0-----
@ygjt76v0----- 2 жыл бұрын
Ads by aws 😁
@hackingismylife2167
@hackingismylife2167 2 жыл бұрын
Please help us
@Spiceysec
@Spiceysec 2 жыл бұрын
this first comment?
@3finnian
@3finnian 2 жыл бұрын
Damn, you can really use a computer
@Jordan-hz1wr
@Jordan-hz1wr 2 жыл бұрын
"I will use a shebang line because I am a man of class" - Don't you mean you're a man IN a class??
@georgeyjung350
@georgeyjung350 2 жыл бұрын
nice vid matey, im in same boat id love to work in this area, anyone want to try creating a new UK team for some adventures and some proper learning, give me mesage ppl cheers, ex RAF with cyber quals:) subscribed matey nice work
@motivationalpujari4858
@motivationalpujari4858 2 жыл бұрын
parrot os securty ka full tutorial video banye youtube par full tutorial koey bhi nahi banaya hi sir
@garyoak4175
@garyoak4175 2 жыл бұрын
Can someone confrim this? (I'm retarded) Basically step 1: he reversed engineered and found out the output is a stream of the same character step2: he tried to login with all possibilities step3: worked
@giantnoah
@giantnoah 2 жыл бұрын
Correction for step 1. The output is only a stream of the same character when the input is a stream of the same character.
@LinuxJedi
@LinuxJedi 2 жыл бұрын
jesus christ stop typing so fast 😂
@jimcolabuchanan6579
@jimcolabuchanan6579 2 жыл бұрын
Can you show us how to hack ECC so I can hack bitcoin addresses?
Stealing Computer Passwords on Login
21:24
John Hammond
Рет қаралды 26 М.
Google CTF - BEGINNER Reverse Engineering w/ ANGR
39:47
John Hammond
Рет қаралды 280 М.
The Worlds Most Powerfull Batteries !
00:48
Woody & Kleiny
Рет қаралды 28 МЛН
Backstage 🤫 tutorial #elsarca #tiktok
00:13
Elsa Arca
Рет қаралды 34 МЛН
Reverse Engineering Loops - "Syncopation" HackTheBox Business CTF
11:18
IFrame Parent XSS - HackTheBox Cyber Apocalypse CTF
32:03
John Hammond
Рет қаралды 70 М.
AES: How to Design Secure Encryption
15:37
Spanning Tree
Рет қаралды 142 М.
AES Explained (Advanced Encryption Standard) - Computerphile
14:14
Computerphile
Рет қаралды 1,2 МЛН
Laravel CVE / PHP Deserialization - "Larablog" HTB Business CTF
34:34
XML Object Exfiltration - HackTheBox Cyber Apocalypse CTF "E. Tree"
28:13
MALWARE ANALYSIS - VBScript Decoding & Deobfuscating
42:23
John Hammond
Рет қаралды 1 МЛН
Transport Layer Security (TLS) - Computerphile
15:33
Computerphile
Рет қаралды 468 М.
HTB Business CTF 2024 - Solving the Watersnake challenge by Ippsec
25:44
TARGETED Phishing - Fake Outlook Password Harvester
47:09
John Hammond
Рет қаралды 256 М.
The Worlds Most Powerfull Batteries !
00:48
Woody & Kleiny
Рет қаралды 28 МЛН