Latest / Blue Security / Password Cracking
Transcript
- 0:06Welcome to the blue security podcast, a weekly podcast for
- 0:10information security Defenders, where we bring you two sessions
- 0:13on best practices, tools and implementation for Enterprise
- 0:17security. Now here are your hosts for
- 0:19today's show, Andy jaw, and Adam Brewer.
- 0:22Welcome to this week's episode of the blue security podcast.
- 0:24I'm Andy your host. I'm Adam your co-host tonight.
- 0:27We're going to talk a little bit about password cracking.
- 0:30And how that works. I think having an understanding
- 0:32and some Basics around how passwords are cracked, will help
- 0:37you Scope different password policies and just understand how
- 0:42password crackers think and that will help you think about how to
- 0:45keep your users at your organization safe.
- 0:47Some of the stuff is pretty basic.
- 0:48So if you already know it, feel free to listen and maybe you'll
- 0:51learn something new, a lot of the stuff is always good to
- 0:53review. Just in case to understand what
- 0:56makes a better password even though we want to move into more
- 0:59past. Us environment.
- 1:00We understand that passwords are still very very much a part of
- 1:04our everyday information security posture.
- 1:06So if you ever watch like a TV show Adam and and watch people
- 1:10like crack passwords and they just get like super easily.
- 1:13Like they just guess a couple of things.
- 1:14That's not how most passwords are cracked.
- 1:17Surprisingly, right? So in reality, it's not just
- 1:21guessing passwords. It's sometimes, you can do that,
- 1:24but it's definitely not just knowing a little bit about like
- 1:27your adversary or your target, like if I knew Adam and I knew
- 1:31he graduated from Iowa State. I could guess.
- 1:34What is it Hawkeyes? Hey Cyclops.
- 1:36Sorry cycle. That was my mistake.
- 1:39My mistake. So I couldn't just guess the
- 1:41mascot of Iowa State. So what happens generally is a
- 1:45site is breached and their database is breached and those
- 1:49credentials and user names and email addresses are taken.
- 1:52Sometimes. It's in the clear, but this day
- 1:55and age, most of the time the passwords are stored in what are
- 1:57called hashes and those users. Names, email, addresses
- 2:01password, hashes are, then posted to dark web, forums and
- 2:05hacking forums. And then the race is on to,
- 2:08like, figure out what the passwords are from these hashes.
- 2:12Adam. Can you tell our listeners what
- 2:14it means to have a password as a hash sure.
- 2:18So if you're familiar with encryption, it's that process of
- 2:21taking information and then scrambling it.
- 2:24So it's unreadable. But the thing about encryption
- 2:26is, it's then reversible so I can unencrypted I can.
- 2:29Change it back to its original data.
- 2:32Hashing is different than Christian in the sense that it's
- 2:34one way. It's non reversible.
- 2:36So, like encryption there's a lot of math involved, but
- 2:39differently, there's no way to reassemble it back to its
- 2:42original format. So, by the way, if you've ever
- 2:44been in, like, Windows server, and you've seen user passwords
- 2:48and you've ever seen that checkbox for a user and like
- 2:50Store password in a reversible format.
- 2:52This is why you don't want to do that because hashes are secure
- 2:56in the sense that I can have a hash and there's no way to put
- 2:58it back to the original password.
- 3:00So it's basically I have data do a whole bunch of math to it.
- 3:03Spit out a string of characters that always returns that same
- 3:07result. So if I start with this password
- 3:09and I run it through this hashing algorithm, this set of
- 3:12math, then I get the same hash as a result, every time.
- 3:16That's how passwords are actually.
- 3:17Stored in something like, active directory for Windows.
- 3:20When you type in your password active, directory runs it
- 3:23through the md5 or message digest, 5 hashing algorithm and
- 3:27it takes the password you typed, and it Gets a hash and it stores
- 3:31the hash in your user object. Essentially.
- 3:33I'm simplifying some of this. But this is the basic idea.
- 3:36And so that next time I go to sign in again, again, there's
- 3:38there's no way for admins or anybody else to like dump the
- 3:41database and view my password, but they could view my hash.
- 3:44And so the next time I go to sign-in, I type in my same
- 3:47password, it runs it through that same hashing algorithm and
- 3:50it returns that same hash over again.
- 3:52So then it does it. Compare does this hash match the
- 3:55hash in the database? If yes, the user typed your
- 3:57password correctly and let them sign in if not, They didn't do
- 4:00it right and they need to try again.
- 4:01So that's how any good system at a minimum stores passwords as
- 4:06in, you know, that hash formats. So, just the key concept here,
- 4:09non-reversible and the other concept is that it's just math.
- 4:12It's just a set of algorithms and the idea to a good hashing
- 4:15algorithm. The one other thing I'll say
- 4:17should never return the same, hash for two different inputs,
- 4:21that's called a collision where if I put in this way, I get this
- 4:24hash and if I put in something totally different, I could
- 4:27potentially get that same. Hash that's called a collision
- 4:29and that's bad. Bad, we don't want those.
- 4:31So, as hashing algorithms have improved over time.
- 4:34One of their goals is to reduce the number of collisions.
- 4:36They get where different input data can return the same hash as
- 4:39a result. So that's your kind of 30 60
- 4:41second Pitch on what a hash is and a little bit on the hashing
- 4:46algorithm that I think is going to be most relevant to today's
- 4:48discussion, which is message digest 5 or md5 for short.
- 4:51So once the hacker has the hash what they did was they would
- 4:56compare the hashes to a list of known plaintext.
- 5:00Words or passwords and a list of associated hashes.
- 5:03And if you have the hash in the matches, then, you know, the
- 5:07associated plaintext again, this was more in the early days and
- 5:10crackers, used to even have rainbow tables.
- 5:12A rainbow table was just a large database of known hashes along
- 5:17with their Associated passwords. And you could compare these very
- 5:19very quickly just do a dip or something like that and compare
- 5:23the hash that you have to a large table and if you find one
- 5:27that matches likes a password 123, With a capital P.
- 5:30Of course, then you would know the password because you have
- 5:33the hash is matched. So rainbow tables, you know, one
- 5:36of the benefits of them were they could still potentially be
- 5:38used today by attackers, is that their precomputed.
- 5:41You've already done all that hashing work ahead of time.
- 5:44So then it's really, really easy.
- 5:45So, if I know a lot about your password policy, and I know a
- 5:50lot about the user, I'm attempting to compromise and
- 5:52maybe whatever attack I'm doing. I expect to have very limited
- 5:55amount of time to compare. I could pre-compute a rainbow
- 5:58table, that knows. The password policy is minimum 8
- 6:01characters this that and this and that here's the name of
- 6:03Andy's dogs and favorite sports teams.
- 6:05So I'm going to generate a whole bunch of combinations that use
- 6:08those and different numbers and symbols to try to crack any
- 6:11password when I do gain access to the database.
- 6:14So there are still some uses for attackers today with rainbow
- 6:16tables, where the idea is, you pre compute, and you're ready to
- 6:20go. So that when you gain access to
- 6:22the hash, you can do that comparison really quickly.
- 6:24There are some disadvantages, especially if you're doing like
- 6:26a large large rainbow table. They take up a lot of space, but
- 6:29But it doesn't take a lot of time to run these comparisons.
- 6:32It's very, very quick. And so there are benefits.
- 6:35I think of it a lot like a signature-based antivirus,
- 6:38right? Even matches its quick.
- 6:40It's kind of like table Stakes. You can still run a rainbow
- 6:42table, on a known list of hashes that you have, and it doesn't
- 6:46take a lot of time. It's not like it's going to take
- 6:47days to do this comparison, so still some benefits, but it was
- 6:51mostly a technique that was used in the past.
- 6:54Now, rainbow tables are susceptible to some defenses
- 6:58that have been applied to Two hashes over the years.
- 7:01One of them is called assault. Assault is basically a
- 7:04additional characters that are either placed at the beginning
- 7:07or at the end of a password before.
- 7:10It's hashed and typically what most Defenders or web developers
- 7:14or whoever is programming this, they design a salt algorithm
- 7:18that will salt a password based on the user.
- 7:21So even if Adam and I had the same password, our salt
- 7:25algorithm would be different. And so the generated hash Ash
- 7:30would be different even though we had the same password.
- 7:32That's obviously, we're is able to be cracked.
- 7:34If you know what the salt is for, that particular site.
- 7:37There's also something called a pepper which puts random bits of
- 7:40data into the password, prior to hashing and salt and peppers are
- 7:44different. In the fact that Peppers aren't
- 7:46stored with the database with the hash are hard-coded into the
- 7:49website's source code. But even if the password is
- 7:53salted or peppered, it still can be cracked because really just
- 7:56comes down to time and the computational power of the
- 7:59machine. Gene that they're using the
- 8:00crack the password. So I think one of the takeaways
- 8:03is no matter how complex or long, your password is what the
- 8:07right amount of time. And with the right amount of
- 8:09computational power every password, eventually can be
- 8:13cracked. And that kind of brings us to
- 8:15how most passwords are cracked today.
- 8:17And that is mainly with brute force, and brute force is just
- 8:20trying every single known character.
- 8:23In sequence to try to figure out the combinations.
- 8:26Let's say we have 96 some possible characters, and
- 8:29Including all the letters numbers, uppercase lowercase,
- 8:33special symbols, all that. And I just start from the
- 8:35beginning, right? Capital a capital B and then
- 8:38going to two characters, right? Capital, A with another capital,
- 8:41a capital A, with another capital B, and so on, and so
- 8:44forth, and trying every single combination and moving on.
- 8:47And so that's how most passwords are cracked today.
- 8:50And most of the crackers use gpus and graphic cards, which
- 8:54have gotten very, very powerful. And the reason why they do that
- 8:57is because they can run a lot of simple.
- 8:59Actions at scale gpus are very popular with Bitcoin miners.
- 9:03They're very popular with password crackers.
- 9:05And so most gpus can do up to like 6 million or more
- 9:11computations per second. Whereas like if you're just
- 9:13doing it off of the CPU, which is limited by cores and
- 9:16processors and threads, most CPUs can only do maybe like
- 9:1920,000. So, you're greatly exponentially
- 9:22increasing the number of guesses and computations, you can do for
- 9:26Brute Force, if you're moving to a GPU and great call out there
- 9:29that All of the cryptography crypto coins, NF T's all that
- 9:35stuff. Blockchain has really
- 9:37accelerated. The availability of the tools
- 9:40needed to build a password cracking rig.
- 9:42It doesn't take that much money for twenty thousand dollars.
- 9:44You can build a really Advanced cracking rig that can do a very
- 9:48large number of guesses per second and all that stuff is
- 9:50readily available because again, all of the crypto mining that's
- 9:54been going on today. Yeah, Alex, White Hart, wrote a
- 9:57really great blog article that Titled your password doesn't
- 10:01matter. I think we've referred to this
- 10:03article in the past. It's been out there for a while.
- 10:06It's the gift that keeps on giving man.
- 10:08It's such a good blog post. I highly recommend giving this a
- 10:12read will put the link in the show notes, of course, but it
- 10:15goes through a bunch of different bunch of different
- 10:18types of attacks, which is also good to know because there's
- 10:21credential stuffing. There's password spraying and
- 10:24those are different types of password attacks and fishing or
- 10:29So clogging, so he goes through every type of different attack
- 10:32that are that's out there as far as passwords, but then he also
- 10:36has specifically in this conversation here, the benefits
- 10:40of having longer passwords and what that really equates to
- 10:44because as Adam said, I mean you can get a pretty good rig these
- 10:48days for password cracking with just a key.
- 10:50Honestly, you could probably do it with 56 thousand dollars and
- 10:54get a pretty decent rig. You put in twenty thousand
- 10:56dollars and get a bunch of gpus drunk together.
- 10:58And you have a very powerful For password cracking rig, that can
- 11:01probably crack most passwords pretty quickly if they're not
- 11:04very long. So he has this table here, which
- 11:07is kind of eye-opening. If your password is only six
- 11:10characters. It will only take eight seconds
- 11:13for a 20 thousand dollar rig to crack that password in brute
- 11:17force. And then as you increase the
- 11:19amount of characters that you have, the time that it takes to
- 11:23crack, it gets exponentially greater and Adam.
- 11:26And I were talking before the show and we kind of noted that.
- 11:29That the breaking point is really between roughly 8 to 10
- 11:33characters because at eight characters, it takes 20 hours to
- 11:37crack a password with this twenty thousand dollar rig at
- 11:40nine characters, it takes three months, but then at ten
- 11:43characters, it takes 21 years. So I mean like the difference
- 11:47between 8 to 10 characters is massive.
- 11:49I mean who's going to sit and let something around for 21
- 11:52years to crack a single password?
- 11:53No one, right? So that was really interesting.
- 11:56And so really, I think one of the lessons is length over.
- 12:00If you're trying to have a better password, just put an
- 12:03extra character at the end, you know, make it 10 characters.
- 12:06And right there you're looking at roughly 21 years in order to
- 12:10brute force that particular password.
- 12:12I still see a lot of password guidance.
- 12:13And in fact, Microsoft's password, guidance is still
- 12:16eight characters or higher, which I think is interesting,
- 12:18because you get so much longer by going to that 9th character.
- 12:22And so, it is again, that, that major balance of sensitivity of
- 12:25the user, I think, as well, for a non VIP and you have to think
- 12:29of Most attacks today are all built around return on
- 12:32investment and 20 hours is really long time to try to crack
- 12:35an individual password. When something like password,
- 12:38spray may be more effective anyway, and may return results,
- 12:42you know, in a more timely fashion across multiple
- 12:45organizations or something, or I could just fish you and you'll
- 12:47just give it to me. Anyway, you know, there's
- 12:49there's so many other methods to acquire passwords that even
- 12:52brute forcing a single password for 20 hours outside of a VIP.
- 12:56I think for most attackers is unlikely.
- 12:58Again, this is a A thousand dollar rig and it's pegged.
- 13:01That's all it's doing is trying to crack passwords.
- 13:04You can't do anything else on that machine.
- 13:05And so, I think for most attackers so I think have
- 13:07actually pretty humble equipment.
- 13:09That's probably beyond their reach for even a less expensive
- 13:12machine. So this is, this is kind of
- 13:14worst-case scenario is what's being highlighted here.
- 13:17So that's why it's interesting to me that guidance still is 8
- 13:20passwords, even when you have that huge jump up, but you could
- 13:23see right here for your VIPs for anybody in your c-suite.
- 13:26You don't need 12, 13, 14. I mean 10 is literally in years
- 13:30like we're good. We are so good at that point,
- 13:32that passwords not getting cracked, you know, it could be
- 13:34acquired through other means and way more likely to be acquired
- 13:37through something like a phishing attack anyway, but from
- 13:39a cracking perspective, I mean, 10 is absolutely the upper bound
- 13:42where we're just the boogeyman of quantum.
- 13:45It's really the only thing we really have to fear, and again,
- 13:47maybe nation-states who could put together literally
- 13:49supercomputers to do this. But otherwise, you know, for the
- 13:53realm of any normal commodity attack, you are well protected
- 13:56at that point. I also think just important to
- 13:58note length is important. Fine, but again, those rainbow
- 14:01tables are still being used. So if you're using like,
- 14:03password 1234 5, or something like that, to get to 10
- 14:06characters, like that's going to be discovered on a rainbow
- 14:09table. Right?
- 14:09Like attackers are still going to run them, through known
- 14:12hashes of plaintext, common passwords that are being used.
- 14:16That's such a good comparison. You gave when you compared it to
- 14:18signature-based, antivirus, that's such a good comparison
- 14:21because that's exactly it. It's hey, let's try this.
- 14:23Super computationally. Cheap and easy thing.
- 14:26First and see what we come up with.
- 14:27And, by the way, like there aren't a lot of Scenarios where
- 14:30I'm stealing like one user. Hash.
- 14:31Like, if I have one user hash I have all of them.
- 14:34And so, I'm not really concerned with anyone user.
- 14:36I just want to find some user password so that I can get
- 14:39started, moving around your environment.
- 14:41If I manage to dump your active directory database, where all
- 14:43the hashes are stored or something, right?
- 14:45Or our website database or whatever.
- 14:47There are methods to steal a single hash.
- 14:49And those are interesting. I remember in my certified
- 14:51ethical hacker training. We talked about stealing like
- 14:54different ntlm hashes as users were trying to authenticate to
- 14:57like file shares. Now, those are different than
- 14:59like the Be 5 hash for passwords because those are salted so you
- 15:02can't use a rainbow table on them.
- 15:04And I remember, you know, some of the interesting conversation
- 15:06around them of you have to do like either you have to pretend
- 15:10to be a malicious file server, or you have to do some sort of
- 15:13network-based attacks. So you see the packets come back
- 15:15to you with the hashes. So like it's much, it's very,
- 15:18very tricky. It's possible for sure to steal
- 15:21an individual like single hash floating around.
- 15:23But in most of these scenarios where we're talking about all
- 15:25this cracking, you have an entire database of hashes.
- 15:28And so Or less focused on. I want to get Andy Jaws, hash.
- 15:32It's I want to find some hashes that I can, you know, get
- 15:34started with moving around. It's a really fun exercise as
- 15:37well. If you want to try this I
- 15:39recommend doing it in a lab or if you plan on doing it.
- 15:42In your production environment, you want to pull it off of like
- 15:46a backup of your domain controller, but you can use
- 15:50John, the Ripper, which is a very common, password cracking
- 15:53tool. It's a Brute Force tool.
- 15:54It has rainbow tables built in. You can build a custom rainbow
- 15:57table if you want. And you have to have your Or n,
- 16:00TD, s dot zip file, which has the active directory passwords,
- 16:05as well as the key to decrypt. That debt file.
- 16:08The did file is encrypted and the key to decrypt is also with
- 16:12active directory. So, I ran through this exercise
- 16:14at one of the orgs that I worked with just as a fun exercise, as
- 16:18well as an educational campaign to passwords.
- 16:21And what we did was, we took a shadow copy from our domain
- 16:26controller on a backup, so we weren't pulling it off of our
- 16:29Ian domain controller. We got the dead file, as well as
- 16:32the key and then we decrypted it and ran it through John, the
- 16:35Ripper. The first thing we did was run
- 16:36it through a very basic table, like how Adam talked about,
- 16:39where we knew our company. We so we put like company name
- 16:42with the Year exclamation mark or like because we're in
- 16:45Wisconsin. We do like Packers exclamation
- 16:48mark or Brewers or badgers or whatever.
- 16:50And so we built a very simple, probably 10 to 15 word, rainbow
- 16:55table, with the associated hashes and ran them through.
- 16:57And actually, we got several, right?
- 16:59Because company name or like Autumn 2016 exclamation mark or
- 17:03spring 2016. Estimation Mark those are all in
- 17:06there. And so we just did that and we
- 17:07got several people that way very easily and that took no time at
- 17:11all. Then we actually ran it through
- 17:13the Brute Force. Password cracker and we didn't
- 17:15run it for very long. I think we ran it for like a
- 17:17week and we got to maybe six or seven characters and we were
- 17:21able to crack several of passwords just by brute forcing
- 17:24it. And so that was actually I think
- 17:26we rented like 88 characters of how long we We went for and I
- 17:30think with this basic server, it wasn't like super beefy or
- 17:33anything like that, but we ran it off of the server blade and
- 17:35so we were able to get several passwords that way, but it was a
- 17:38fun exercise to do. If you have a lab environment,
- 17:40definitely give this a try because it's a good learning
- 17:43experience. If you do it at an organization,
- 17:45it's great to like use this as an education campaign and say,
- 17:48hey, even with very, very minimal assets.
- 17:51I was able to crack this many users, this many passwords and
- 17:55you can go to those users and kind of give them an education,
- 17:57maybe put together a password strength.
- 17:59Action campaign to educate your users.
- 18:02So something that I would recommend doing if you had time.
- 18:05I'd s this completely, I used John the Ripper when I did the
- 18:10certified ethical hacker as well, and it was very
- 18:13eye-opening to just understand how this all works and how
- 18:16commoditize these tools are today again, by this.
- 18:19By the time, an attacker probably has been able to gain
- 18:22access to this. They've been able to do it other
- 18:24ways. I think it's less of a concern
- 18:26with active directory, but again, like when websites get
- 18:28dumped, you know, Oh, there's always like oh this website had
- 18:31their password table dumped or this page website did and
- 18:34especially if they're not salted, you know, they're the
- 18:38bad guys are going to be out running those through these
- 18:41these engines and seeing how many pastors they can come up
- 18:43with. And the point I keep making is
- 18:45for most attackers. They're not focused on any one
- 18:48person's password. It's just how many can I find,
- 18:51you know, there's that cat and mouse game, but it's also, those
- 18:53are then Commodities, you can sell, you know, on the dark web
- 18:56as well as selling validated username password.
- 18:59Combinations that have been proven out and those generally
- 19:03go for literally, you know, cents on the dollar.
- 19:05It's not terribly expensive. To go find some user identities,
- 19:08and different Enterprises are different websites or whatever,
- 19:11and then you can start hacking your way through things.
- 19:13So it's just great to get hands on the tools.
- 19:15You can understand all this conceptually and I'd say I did
- 19:18and I am sure most of our listeners.
- 19:19Do, you know as Security Professionals?
- 19:21We understand conceptually what password hacking looks like.
- 19:24Oh boy. It's not a different level.
- 19:25When you fire up one of these tools and you kick it off and
- 19:28you see how many Guesses. It's gone through even on not
- 19:31impressive hardware, and you're just like, holy smokes, you
- 19:34know, this is the thing. And again, this doesn't replace
- 19:36the other methods through which passwords or potentially
- 19:38compromised but it is definitely enlightening to understand what
- 19:42this looks like in. And certainly you'll believe in
- 19:45salting helps Papa rain helps. But again, like any said, it's
- 19:48only a matter of time. And so let's bump those password
- 19:51lengths to a minimum of eight or better ideally, you know 10 in
- 19:55and beyond your pretty good. So you don't really need to go
- 19:58higher than that. And Gosh, this is just a really
- 20:02eye-opening exercise. That's our show for this week.
- 20:05Thanks for listening and watching.
- 20:07Hopefully you learned a little bit about password cracking, or
- 20:10at least reviewed the basic concepts, and that'll help your
- 20:13orgs make better policy. If you have any questions, our
- 20:15contact information will be in the show notes.
- 20:17Thanks. We will talk to you guys next
- 20:18week. Thank you for listening to the
- 20:20blue security podcast. Please check out the show notes.
- 20:23Catch up on episodes. You may have missed and
- 20:25subscribe. So you don't miss any future
- 20:27episodes, find Andy on Twitter. At age, 0, 0, and Adam at AJ
- 20:32Brewer. See you in our next episode.