1 00:00:00,780 --> 00:00:05,560 Hello, my name is Chris Nevin and I work for NCC Group. 2 00:00:05,580 --> 00:00:12,800 So this tool is called Carnivore, so that's a Microsoft external attack tool or assessment tool. 3 00:00:12,800 --> 00:00:19,120 So the cryptozoologists amongst you might know this, so that spells meat, so that's very amusing. 4 00:00:19,180 --> 00:00:28,260 And it's basically a tool to help pen testers find misconfigurations and vulnerabilities in Microsoft on-premises servers. 5 00:00:28,440 --> 00:00:33,480 So also apologies if I talk quickly, but there is quite a lot to get through. 6 00:00:35,080 --> 00:00:37,900 So the basic outline of the presentation. 7 00:00:37,900 --> 00:00:48,920 So I'm going to start with a demonstration just to show what the tool can do and then dive a bit deeper into some of the techniques and the research behind them after that. 8 00:00:49,820 --> 00:00:52,340 So now intro demonstration. 9 00:00:52,960 --> 00:00:58,520 Okay, so first a quick overview just to give you a taste of what the tool can do. 10 00:00:58,520 --> 00:01:06,600 So just before I kick it off, we've selected all services and we're also going to attempt to discover the internal domain information. 11 00:01:07,000 --> 00:01:10,460 You might notice that it's a .nev domain. 12 00:01:10,620 --> 00:01:15,560 Obviously that wouldn't normally be a top-level domain, but this is my training lab. 13 00:01:16,160 --> 00:01:25,920 So first of all, it's going to do DNS lookups for subdomains, which are normally connected with a particular service. 14 00:01:25,920 --> 00:01:30,880 So for example, link discover with Skype, then it verifies there's something there. 15 00:01:30,880 --> 00:01:34,200 So it's not just a wild card resolution. 16 00:01:34,260 --> 00:01:41,060 And then it also does some checks to make sure, does it also actually seem to be an exchange or a Skype server? 17 00:01:41,520 --> 00:01:46,840 So I've also built in some kind of bailout options. 18 00:01:46,840 --> 00:01:50,740 So for example, we get back a server header saying that it's Nginx. 19 00:01:50,740 --> 00:01:52,000 It's not even Windows. 20 00:01:52,000 --> 00:01:57,560 We don't need to test every possible endpoint just in case one of them is a Skype server. 21 00:01:58,780 --> 00:02:01,260 So yes, that's something that we do. 22 00:02:01,500 --> 00:02:07,340 So it also validates the username enumeration and the password spray URL separately. 23 00:02:07,720 --> 00:02:20,080 I'll come on to that in a little bit, but basically there are occasions where an organization might have hidden most things, but there'll be one password spray URL kind of hidden away. 24 00:02:20,180 --> 00:02:28,080 So we try the most obvious, and then if they don't hit, there are other kind of password spray endpoints that are possible. 25 00:02:28,820 --> 00:02:35,420 So yeah, so hopefully if an organization has something exposed, then we'll be able to find it to report to them. 26 00:02:35,880 --> 00:02:45,860 So we also log everything here, and you've got export options if you want to kind of manually export things for some reason. 27 00:02:46,300 --> 00:02:59,300 I'll cover Office 365 more at the end, but for this section, if Office 365 is ticked, then it will explicitly check if this has any kind of cloud presence. 28 00:02:59,300 --> 00:03:13,160 Even if it's not ticked, then the response to Skype for Business, for example, might come back and say, I'm hosted in the cloud, and then we'll still do the standard checks for, is it federated, and that kind of thing. 29 00:03:13,160 --> 00:03:23,600 And then it will add, so say we just did Skype for Business, it says it's in the cloud, it turns out it's federated, we'll get an Office 365 and an ADFS option here. 30 00:03:24,840 --> 00:03:34,080 So okay, so we've also got global verbosity here, so you can kind of tweak that up and down depending on what you want to see. 31 00:03:34,740 --> 00:03:37,900 Okay, so let me kick this off. 32 00:03:39,280 --> 00:03:48,820 Okay, so the other thing with this discover internal domain, then it does the fairly standard blank type one NTLM message. 33 00:03:48,820 --> 00:03:52,680 And you can see it's pulled back the internal domain name. 34 00:03:52,680 --> 00:03:57,160 So at the moment, it does that individually for each of these services. 35 00:03:57,160 --> 00:04:06,360 And that's because, you know, Skype might be hosted in Germany, and ADFS server, the ADFS server might be in Canada for some reason. 36 00:04:06,820 --> 00:04:15,960 And so when you're hitting, when you're spraying that server, then you've got the internal domain information for the particular server that you're hitting. 37 00:04:16,320 --> 00:04:21,100 And in fact, even on a job just last week, then these were all different. 38 00:04:21,960 --> 00:04:26,960 So it does happen quite frequently, I might add some kind of advanced options. 39 00:04:27,360 --> 00:04:30,080 So you can say, just assume they're all same. 40 00:04:30,240 --> 00:04:36,040 But like say, that's maybe, you know, a recipe for potential disaster. 41 00:04:36,040 --> 00:04:38,980 So okay, we've also got the IP addresses here. 42 00:04:38,980 --> 00:04:41,560 So you can obviously check those against your scope. 43 00:04:41,560 --> 00:04:51,060 And if you want to, you can kind of run this once, check the IP addresses against your scope, and then do the more active kind of blank NTLM one message. 44 00:04:52,240 --> 00:04:56,760 And so for the other thing to mention is for Skype. 45 00:04:56,760 --> 00:05:00,540 So link discover is the kind of auto discover service. 46 00:05:00,540 --> 00:05:05,620 And that actually points to the real server, which is what we want to hit. 47 00:05:05,620 --> 00:05:11,580 So that's why there's two kind of entries for Skype there. 48 00:05:12,620 --> 00:05:17,040 So we've now got Skype exchange, ADFS and RD web. 49 00:05:17,040 --> 00:05:23,820 So I'm going to show you a quick run through of username enumeration and password spraying, just to give you an idea. 50 00:05:23,820 --> 00:05:27,040 So smart enumeration, we'll leave it on the defaults. 51 00:05:27,040 --> 00:05:30,400 We're also going for password one, just kind of standard. 52 00:05:31,420 --> 00:05:34,800 So you see, there's quite a lot of usernames to try here. 53 00:05:34,800 --> 00:05:38,780 As it's going through, we found one of a particular format. 54 00:05:38,780 --> 00:05:42,800 So it's now continuing to loop through nine different formats. 55 00:05:43,480 --> 00:05:53,580 And you'll see that when we discover the correct format, then this will drop drastically, because then we switch to just using usernames of that format. 56 00:05:55,360 --> 00:05:57,780 So we've now got two of the same format. 57 00:05:57,780 --> 00:06:03,540 So first initial surname, and now we've got three. 58 00:06:03,540 --> 00:06:06,820 So you'll see that it's now selected that format of JSmith. 59 00:06:07,080 --> 00:06:17,560 So everything we do, oh sorry, if we left that continuing, it would just be, as you can see here, it's now less usernames, and it's just doing usernames of that format. 60 00:06:18,440 --> 00:06:22,660 So now I'll quickly show you a password spray as well. 61 00:06:23,020 --> 00:06:26,600 So I'll use that same format, JSmith. 62 00:06:27,460 --> 00:06:34,160 So for the password spray, that will now spray that in the kind of modern style username format. 63 00:06:34,160 --> 00:06:36,800 So jsmith at nevtech.nev. 64 00:06:36,820 --> 00:06:46,260 And we'll just try summer 2020, just to see if there happens to be a user who might have been daft enough to use that as a password. 65 00:06:48,710 --> 00:06:50,030 So here we go. 66 00:06:50,030 --> 00:06:51,870 So that's going to take a second. 67 00:06:52,050 --> 00:06:58,050 I'm sure we're not going to find anyone, because of course no one ever uses passwords like this. 68 00:06:58,210 --> 00:07:01,090 Who would possibly be that foolish? 69 00:07:01,910 --> 00:07:03,730 So here we go. 70 00:07:05,170 --> 00:07:10,830 If we give it another couple of seconds, you can see again, this is just doing that one username list. 71 00:07:10,830 --> 00:07:18,510 So obviously that's the same number of users total that it will be spraying as the smart enumeration was looking at. 72 00:07:20,920 --> 00:07:22,620 So it should be around about now. 73 00:07:22,620 --> 00:07:23,240 So there you go. 74 00:07:23,240 --> 00:07:26,740 So we've now uncovered one user with that password. 75 00:07:26,760 --> 00:07:33,340 We've used the RD web service, but obviously we could have sprayed that on any of these other services. 76 00:07:33,340 --> 00:07:42,560 And at the moment, looking at the internal domain information, we can probably assume that they're kind of be the same across all of them. 77 00:07:43,620 --> 00:07:44,300 Okay. 78 00:07:44,300 --> 00:07:46,180 So let's have a look. 79 00:07:46,180 --> 00:07:49,020 Let's just do one with Skype. 80 00:07:49,040 --> 00:07:49,320 So 81 00:07:57,540 --> 00:08:01,640 just to show you, you can also password spray enumerated users. 82 00:08:02,180 --> 00:08:04,400 So let's use that same. 83 00:08:12,180 --> 00:08:13,020 Okay. 84 00:08:13,160 --> 00:08:14,280 Okay. 85 00:08:14,660 --> 00:08:22,320 So for that option, then we were spraying the users in the legacy format, because those are the ones we've already enumerated. 86 00:08:22,820 --> 00:08:32,020 And for username enumeration, that's incredibly slow because for every invalid user, you might have to wait something like 20 or 30 seconds. 87 00:08:32,120 --> 00:08:39,940 When we're spraying this list of already enumerated users, then we kind of know already that they exist. 88 00:08:39,940 --> 00:08:46,660 And actually that's still quite fast, even when spraying in legacy format, because you're not having to wait for every invalid user. 89 00:08:47,220 --> 00:08:50,460 So obviously we've now got him as well. 90 00:08:50,460 --> 00:08:52,920 You can see we've got this access token here. 91 00:08:52,920 --> 00:08:55,800 So I'll quickly show you the address book. 92 00:08:55,840 --> 00:09:00,100 So we'll choose this user who we've already got the access token for. 93 00:09:00,100 --> 00:09:03,440 Again, I'll explain in more detail some of these other settings. 94 00:09:03,600 --> 00:09:07,240 But for now, we're just going to let this go, see what happens. 95 00:09:11,640 --> 00:09:15,100 I'm also going to come back to the meeting snooper later. 96 00:09:15,280 --> 00:09:20,660 So this is just to kind of show the address book functionality. 97 00:09:20,660 --> 00:09:21,840 Here we go. 98 00:09:28,170 --> 00:09:31,810 And so you can see now all of these other users popping up. 99 00:09:31,810 --> 00:09:36,890 So we get the SIP username, the email address, title, department. 100 00:09:37,430 --> 00:09:39,570 We can kind of tick these on and off. 101 00:09:39,590 --> 00:09:44,590 The default settings I've got here are basically the ones we can get relatively quickly. 102 00:09:45,750 --> 00:09:53,910 So if I actually expand that and choose to pull some of this other information, it can take quite a long time, especially with quite a large domain. 103 00:09:54,070 --> 00:09:56,730 So in this instance, we just go for the default. 104 00:09:56,730 --> 00:09:57,950 It's fairly quick. 105 00:09:58,810 --> 00:10:04,610 Obviously for my test lab, this is quite a small number of users, but there you go. 106 00:10:04,610 --> 00:10:08,130 You can see the general gist of what's possible with this tool. 107 00:10:08,530 --> 00:10:12,170 Okay, so now for some just general statistics. 108 00:10:12,170 --> 00:10:21,370 So first of all, I basically ran a version of this against the Alexa, well, the top 100,000 of the Alexa top a million. 109 00:10:21,370 --> 00:10:26,610 Of those, 11.79% were attackable at all. 110 00:10:27,790 --> 00:10:33,830 And so this shows that of that 11%, about 11%, so how many had each service. 111 00:10:33,830 --> 00:10:37,390 So obviously some could have had more than one service. 112 00:10:37,950 --> 00:10:43,970 This started, Carnivore started initially as a Skype attacking assessment tool. 113 00:10:43,970 --> 00:10:52,530 So that's secretly my favorite, but you can see it's kind of still getting beaten out by Exchange and ADFS, maybe not by all that much. 114 00:10:52,890 --> 00:11:07,510 So one caveat with the cloud element here is that there are some false positives in there, because for this assessment, I didn't explicitly check whether they were hosted in Office 365. 115 00:11:07,510 --> 00:11:15,010 So this is just listing if when I made a link discover request, did it come back and say it was hosted in the cloud. 116 00:11:15,430 --> 00:11:19,450 So actually that number might even be higher if we'd have explicitly asked. 117 00:11:19,730 --> 00:11:29,390 And for some of them, it kind of seems to suggest that they're hosted in the cloud, but then maybe everything isn't properly configured and that service isn't there. 118 00:11:29,810 --> 00:11:38,850 It's like I say, the cloud kind of maybe take with a pinch of salt, but the others, that's what was found and what was kind of verified as existing. 119 00:11:39,850 --> 00:11:45,590 So the first part, subdomain enumeration, we'll go into that in a little bit more detail. 120 00:11:47,530 --> 00:11:57,230 Okay, so as I said before, I split the username enumeration URL and the pass spray or the endpoint validation. 121 00:11:57,330 --> 00:12:14,270 Previously, it bailed if the username enumeration wasn't there, but then I found multiple times, and in fact on that wider kind of mass assessment I did, then quite often you would find an organization to have just one or just the other. 122 00:12:14,750 --> 00:12:25,950 So for example, here you can see actually there's 53% had a password spray endpoint over 47% with a username enumeration. 123 00:12:26,010 --> 00:12:31,710 So kind of 6% more had a password spray endpoint than had both. 124 00:12:31,710 --> 00:12:34,650 There were some that just had username enumeration. 125 00:12:34,770 --> 00:12:53,890 What's interesting about this is that it means that for those organizations with just a kind of weird password spray NTLM authentication endpoint somewhere, then it seems likely that they potentially might not even be aware of that because they've kind of firewalled off or hidden away all of the well-known, 126 00:12:53,890 --> 00:13:04,510 the username enumeration, the standard login points, but then they have this one password spray endpoint that kind of seems to have eluded that. 127 00:13:04,510 --> 00:13:06,270 So yeah, that's kind of interesting. 128 00:13:08,010 --> 00:13:12,350 So Carnival looks for subdomains in the order shown here. 129 00:13:12,350 --> 00:13:18,650 So these statistics are taken from that 11% of the 100,000. 130 00:13:18,930 --> 00:13:30,510 So hopefully it means that we'll do as few requests as possible because obviously we're looking at the one that's highly likely to exist and then only looking at the others if it doesn't. 131 00:13:30,830 --> 00:13:37,310 So in future I might add an option for a kind of, you know, you can choose between light or full enumeration. 132 00:13:37,330 --> 00:13:42,390 So maybe you could choose to just look at the top two and then discount it. 133 00:13:43,230 --> 00:13:50,510 And yeah, so then again, maybe managing to kind of cut that down even more as to how many requests you need to send. 134 00:13:51,190 --> 00:13:55,750 So now username enumeration in a little bit more detail. 135 00:13:56,730 --> 00:13:58,870 So we're going to start with a demonstration. 136 00:13:59,850 --> 00:14:04,010 Okay, so we've got various options here that I'm going to go through. 137 00:14:04,010 --> 00:14:07,450 So firstly, smart enumeration that we saw before. 138 00:14:07,450 --> 00:14:17,550 So basically that will take these nine different formats of username taken from the top statistically likely usernames lists. 139 00:14:17,990 --> 00:14:26,270 And it will basically try the top username in each list and then the top of the next list, top of the next list. 140 00:14:26,270 --> 00:14:31,850 And essentially as you saw before, it's looking for three valid usernames of the same format. 141 00:14:31,850 --> 00:14:38,190 So that's using the timing based difference, which is fairly well known for Skype and Exchange. 142 00:14:38,190 --> 00:14:42,130 I've added it here for ADFS and RDWeb as well. 143 00:14:42,910 --> 00:14:52,890 So we've got this advanced option here as well, that if you want, you can kind of pick a format and where you want to start in that list, or you can leave it as it is. 144 00:14:52,890 --> 00:14:57,470 You can also do an individual username, or you can provide your own list. 145 00:14:57,650 --> 00:14:59,890 Or there's these pre-built ones. 146 00:14:59,890 --> 00:15:02,610 So these are kind of standard and service accounts. 147 00:15:02,770 --> 00:15:07,010 And Council Killer was created by my colleague Owen Bellis. 148 00:15:07,070 --> 00:15:13,210 So that's kind of a list of maybe fairly standard user accounts that might be in there. 149 00:15:13,530 --> 00:15:15,710 So you can set the password. 150 00:15:15,710 --> 00:15:19,250 So obviously also it works on the timing based difference. 151 00:15:19,250 --> 00:15:22,810 And then also if you get the password right, then great. 152 00:15:23,290 --> 00:15:29,330 So again, I would just show you, obviously this is fairly similar to what we saw before. 153 00:15:29,590 --> 00:15:37,550 One interesting additional point to note is additional information you can get depending on the service. 154 00:15:37,550 --> 00:15:43,250 So for Skype, then we can actually determine quite a bit of additional information. 155 00:15:43,430 --> 00:15:51,990 So SIP enabled basically just means... so actually, sorry, some of these will only come up if you get the password right as well. 156 00:15:51,990 --> 00:15:59,470 So SIP enabled would mean you've got the username and the password right, and that user is basically set up on Skype. 157 00:15:59,650 --> 00:16:05,630 So account disabled, whatever password you give, you would get that if the account is disabled. 158 00:16:05,990 --> 00:16:07,910 You should see that in a second. 159 00:16:08,990 --> 00:16:10,630 Now that it's switched over... 160 00:16:12,770 --> 00:16:15,630 in fact, I might have re-enabled that user. 161 00:16:15,630 --> 00:16:27,110 But so basically if you get a disabled account, then essentially we won't do anything else with it because basically whatever you put in, you're not going to be able to kind of do anything. 162 00:16:28,190 --> 00:16:36,270 For Skype, you can also tell if the password's expired and it's possible that you might actually then be able to take that password. 163 00:16:36,430 --> 00:16:45,310 And if you found an endpoint, you know, maybe for the VPN, it might be you can even kind of put that password in and it will ask you to reset it. 164 00:16:45,390 --> 00:16:57,250 Obviously on a test, that's probably a little bit too crazy of a thing to do, maybe for a red team or with the kind of technical point of contacts, you know, green light. 165 00:16:57,730 --> 00:17:00,330 And then for Skype, we can also get this server error. 166 00:17:00,330 --> 00:17:02,570 But again, that means you've got the password right. 167 00:17:02,710 --> 00:17:06,250 And as I said before, you'll get the access token there if you do. 168 00:17:06,610 --> 00:17:09,150 So yeah, username enumeration. 169 00:17:09,330 --> 00:17:24,750 OK, so as you've just seen, smart enumeration will take nine lists of statistically likely usernames and it will go through those until it finds three of the same and then automatically select that format and then carry on. 170 00:17:24,750 --> 00:17:29,870 Now, one interesting thing is this difference between legacy and modern formats. 171 00:17:29,870 --> 00:17:32,610 So legacy is domain slash username. 172 00:17:32,610 --> 00:17:36,630 Modern kind of email style is username at domain. 173 00:17:36,790 --> 00:17:41,230 So that can match, that they can match, but they don't necessarily have to. 174 00:17:41,230 --> 00:17:46,150 And again, the modern format could match the email, but doesn't necessarily have to. 175 00:17:46,150 --> 00:17:53,030 Now for username enumeration, we can only use the legacy format and that's to get that timing based difference. 176 00:17:53,330 --> 00:18:00,470 So one interesting thing is that that causes a little hiccup when rolling over to password spraying. 177 00:18:00,770 --> 00:18:10,670 So previously I used username enumeration to discover the format and then just assumed that it would be the same for the modern format for when we spray. 178 00:18:10,810 --> 00:18:15,610 Now, because technically that might not be the case, I don't do that anymore. 179 00:18:15,610 --> 00:18:26,670 The problem is it means on password spraying, if you choose to use the discovered username format, then invalid usernames will still take ages to do. 180 00:18:26,670 --> 00:18:37,910 So what I would suggest as a way of doing this, because basically, yes, so username enumeration, every invalid user, 30 to 40 seconds. 181 00:18:37,910 --> 00:18:43,990 So if you waited for that to finish anyway, that's going to take the rest of the day, a couple of days. 182 00:18:44,050 --> 00:18:51,130 So ideally what you want to do anyway is use username enumeration to get the potential, the likely format. 183 00:18:52,070 --> 00:18:55,110 That might take five minutes, say. 184 00:18:55,110 --> 00:19:09,510 Then pause that, switch over to password spray, and then instead of using the discovered format, which because we've only discovered that in the legacy style, then that will take a long time. 185 00:19:09,510 --> 00:19:13,930 So instead, pick the same format and password spray those. 186 00:19:13,930 --> 00:19:22,290 Hopefully you should get some credentials or some invalid, sorry, disabled accounts, which give you a pointer that that is the correct format. 187 00:19:22,910 --> 00:19:27,450 But if you don't, then it is possible that the formats don't match. 188 00:19:27,570 --> 00:19:35,390 And you might need to do a little bit more kind of manual going through different potential formats to discover which it is. 189 00:19:35,490 --> 00:19:44,670 So the other thing to say is that, so obviously with username enumeration, we discover a valid username, even if the password is wrong. 190 00:19:44,870 --> 00:19:50,070 Whereas password spraying, we only find out anything if we get both correct. 191 00:19:50,790 --> 00:19:55,530 So you can, if you want to, stay with username enumeration. 192 00:19:55,530 --> 00:19:59,190 You get a nice list and it takes 48 hours. 193 00:19:59,190 --> 00:20:13,830 However, because you will essentially be hitting the same users with the password that you're trying, then actually in terms of progressing the test, then you're not going to really lose anything by switching over to password spraying. 194 00:20:13,830 --> 00:20:15,670 You'd be hitting the same users. 195 00:20:15,730 --> 00:20:20,090 So you're going to find the same users that might have password one as their password. 196 00:20:20,330 --> 00:20:23,350 Just it would take 10 minutes instead of two days. 197 00:20:23,550 --> 00:20:26,230 So yeah, so that would be my suggested method. 198 00:20:26,230 --> 00:20:40,650 So now I'm going to show where we get the time-based difference and some other things for ADFS and RDWeb, because I don't think there's much publicly written about those, whereas there is for Skype and Exchange. 199 00:20:40,650 --> 00:20:42,830 So this is maybe more interesting. 200 00:20:43,130 --> 00:20:47,370 So this is where we get the time-based difference for ADFS. 201 00:20:47,910 --> 00:20:58,410 Now for ADFS, there's this extra kind of interesting extra bit, which is that it needs an MSIS SAML cookie to be sent in the request. 202 00:20:58,410 --> 00:21:08,110 So basically, in order to get that, I first send the request here, sorry, to the same place, but with this single sign out parameter. 203 00:21:08,210 --> 00:21:19,350 And basically the response to that will give us the cookie that we need, which we then here include when we make a password guess, as you can see. 204 00:21:20,410 --> 00:21:25,070 And then here you'll see the invalid response. 205 00:21:25,190 --> 00:21:27,110 So it's just 200 OK. 206 00:21:28,430 --> 00:21:34,810 And so that's told us nothing, or with the timing difference, maybe it's told us if the user's valid. 207 00:21:35,570 --> 00:21:37,190 And this is a valid response. 208 00:21:37,190 --> 00:21:42,030 We get the 302 redirect, and it sets this MSIS auth cookie. 209 00:21:42,650 --> 00:21:46,690 So for RDWeb, we make a POST request like this. 210 00:21:46,690 --> 00:21:51,090 So there's the username and the password to this URL. 211 00:21:52,270 --> 00:21:55,990 And if it's invalid, then we get the 200 OK again. 212 00:21:55,990 --> 00:22:03,330 And for TSWA auth HTTP only cookie, that either isn't there or it's blank. 213 00:22:03,330 --> 00:22:07,570 So again, we can use timing-based difference with the username. 214 00:22:08,150 --> 00:22:21,690 Or if it's completely valid, so the username and password are correct, again, it's the 302 redirect, and that TSWA auth HTTP only cookie now has a value as shown there. 215 00:22:22,170 --> 00:22:24,130 OK, so now password spraying. 216 00:22:25,110 --> 00:22:30,310 So as I said before, there's a little hiccup here with the discovered format. 217 00:22:30,490 --> 00:22:41,910 So obviously, that's up to you if you want to stick with that discovered format, or just simply choose it from the list, and we'll spray that in the user at domain style instead. 218 00:22:42,430 --> 00:22:48,570 So for password spraying, it basically defaults to using that style if possible, because it's quicker. 219 00:22:49,230 --> 00:23:00,430 And also, if you provide a list of usernames, you can, if you want, provide it with domain slash user or user at domain, and it will use what you've given. 220 00:23:02,810 --> 00:23:04,390 So let me have a look. 221 00:23:04,390 --> 00:23:12,230 Yep, so also, as I said, you can use these pre-built lists if you want to go for that, or you can give it a file of your own. 222 00:23:12,430 --> 00:23:20,450 And as I've said, if you want to, you can kind of pre-add whatever you want in there, and it will use that instead. 223 00:23:20,450 --> 00:23:25,930 So another thing to say is that if you want to, you can just go straight to password spraying. 224 00:23:25,930 --> 00:23:29,010 You don't have to do the username enumeration first. 225 00:23:29,550 --> 00:23:35,830 So yeah, basically, if you've done the subdomain enumeration, you've got the internal domain information, you can just go straight here. 226 00:23:35,830 --> 00:23:42,310 Maybe you've done some OSINT, and you have an idea what the format might be, you can just go straight here and spray it. 227 00:23:42,870 --> 00:23:49,310 Okay, so now a little demonstration of password spraying, so I can show you that in a bit more detail as well. 228 00:23:49,430 --> 00:23:55,590 Okay, so as you can see here, the top option is use discovered username format. 229 00:23:55,590 --> 00:24:01,430 So if we'd already done the username enumeration, then we'd be able to basically just tip that here. 230 00:24:01,430 --> 00:24:05,850 And as I've said, that will spray in the legacy format, so you need to be careful. 231 00:24:06,130 --> 00:24:10,170 The other choice you've got is that you can just pick what list you want to spray. 232 00:24:10,470 --> 00:24:29,570 Again, you can spray these kind of inbuilt lists, you can give it a file of your own, or you can also spray just enumerated users, which again will use the username that we've already discovered, the format that we've already discovered that user in, because obviously we know that that exists. 233 00:24:29,750 --> 00:24:36,870 So again, you can put the password in here, that's obviously distinct to the username enumeration password. 234 00:24:37,170 --> 00:24:56,890 And then if I click spray, you'll see that this is much quicker, because this is able to be multi-threaded, you're not waiting to check that the kind of time-based information is accurate, which multi-threading the username enumeration can kind of throw that off, 235 00:24:56,890 --> 00:25:01,010 because you're making it do multiple ones at the same time. 236 00:25:01,330 --> 00:25:11,650 And as you can see, so it's gone through the list, and as we saw before, it's found this user and access token here, and we've also got one with the disabled account. 237 00:25:13,090 --> 00:25:16,790 Okay, so as you saw there, we've got these different columns. 238 00:25:16,850 --> 00:25:22,470 So for Office 365 spraying, I'll come on to how we do that at the end. 239 00:25:22,470 --> 00:25:43,290 But basically, if we can spray the Microsoft login portal, then we can determine a valid user versus an invalid user, and valid credentials versus invalid credentials, and we can also actually tell if you've got the right username and password, but the organization has MFA enabled. 240 00:25:44,510 --> 00:25:51,310 So SIP enabled just means they have Skype access, and then depending on the service, we can tell some additional things. 241 00:25:51,310 --> 00:25:58,750 So again, Skype is actually my favorite service to look at, because you can actually tell the most from Skype. 242 00:25:58,750 --> 00:26:06,210 So we can tell if the account's disabled, you can tell if they're SIP enabled, and you can tell if even if the password is expired. 243 00:26:06,210 --> 00:26:14,290 So you've got password right, but it's expired, and also this server error, we can still tell that that's a valid username and password. 244 00:26:14,610 --> 00:26:26,110 For Exchange and RDWeb, then we can also still tell if the password is expired or if it's correct, but not some of the additional information. 245 00:26:27,930 --> 00:26:40,630 So username enumeration is timing based, so I only have one location for each of those where that's possible, but for password spraying, there's multiple places we can kind of spray. 246 00:26:40,630 --> 00:26:48,550 So again, from the 100,000 that I looked at, that's where these statistics have come from. 247 00:26:48,550 --> 00:26:59,550 So this is the order in the subdomain enumeration, and when we're validating if the password spray endpoints there, this is the order that Carnivore will look for those in. 248 00:26:59,690 --> 00:27:08,950 Again, hopefully this will reduce how many requests we need to make, and in the future, again, maybe that advanced option to say just look at the top two. 249 00:27:08,950 --> 00:27:26,350 Obviously you can see here the top two would actually get the vast majority of, you know, would have found it in the vast majority of cases, and then we've got some where there's literally just one out of that 11% that had slash web ticket was there. 250 00:27:27,410 --> 00:27:40,130 So this is a mix of known endpoints, kind of publicly written about, ones taken from IIS, from the server itself, and which allow NTLM authentication. 251 00:27:40,130 --> 00:27:44,510 So NTLM authentication, I'm going to go into a bit more detail now. 252 00:27:44,630 --> 00:27:54,350 So yeah, so just to mention briefly, when I had a look, there kind of doesn't seem to be that much for NTLM, web-based NTLM authentication spraying. 253 00:27:54,350 --> 00:27:59,810 It's possible Hydra or something similar might do it, but there didn't seem to be that many tools for it. 254 00:27:59,810 --> 00:28:16,310 So here's a little bit of code, very simple for C-sharp, so we can literally just create the new network credential, give it the username and password, and then in response, if it's 401 unauthorized, it's bad, otherwise you're good to go. 255 00:28:17,590 --> 00:28:24,230 So yeah, incredibly simple, and Carnivore is able to password spray NTLM auth endpoints. 256 00:28:24,550 --> 00:28:35,450 So for those, you can still do the blank type one message, but actually, it's part of the protocol is kind of determining and including the domain name. 257 00:28:35,450 --> 00:28:48,510 So here, when we're giving the username and password, we can literally just say cscot password one, and actually, as part of this request, it will add the nevtech element of that. 258 00:28:48,910 --> 00:29:12,470 So an interesting thing to note is that, as I said before, when I included some NTLM authentication endpoints with the list of subdomains that I look at, then there were some quite big organizations where everything else seemed to not be accessible, and then you've got one kind of weird NTLM auth endpoint hidden away, 259 00:29:12,470 --> 00:29:17,930 meaning that they're still susceptible to password spraying against the internal domain. 260 00:29:18,130 --> 00:29:35,970 Essentially, I mean, this could even be used for denial of service, because yes, we hit the normal password lockout policies, but essentially, if you purposefully hit that, and you've locked out everyone in the domain, so that's obviously something that an organization would want to be aware of, 261 00:29:35,970 --> 00:29:39,750 because that would be a bad day for them as well. 262 00:29:39,970 --> 00:29:47,050 So a quick sidetrack into a note on some of these different services, just in case you haven't seen them before. 263 00:29:47,230 --> 00:29:56,710 So ADFS, it's a portal that can be present to allow you to sign into different third-party services. 264 00:29:56,890 --> 00:30:14,370 Sometimes these might be assumed to be internal, so on past red teams, then this is given access to full job posting applications, so third-party applications, that were linked to the company's Twitter and LinkedIn, all of their job postings. 265 00:30:14,410 --> 00:30:28,610 So obviously, for kind of phishing or ongoing attacks, then having access through ADFS to that company's kind of LinkedIn job postings, or even reputational damage, could have been fairly troubling. 266 00:30:28,610 --> 00:30:43,370 So basically, you go to the same URL that I gave earlier, and that would give, or would normally give a kind of drop-down list, where you'll see the different applications that you can authenticate into. 267 00:30:43,930 --> 00:30:49,510 So I've also seen internal service desks that you can get into. 268 00:30:49,510 --> 00:31:05,350 I was logging all call center queries, so that contained incredibly sensitive customer details and information, because it was everyone on their call center putting in, you know, this customer this bank account number, and this credit card number has this question. 269 00:31:05,350 --> 00:31:14,930 And that was basically accessible externally through ADFS, and also things like HR, user admin portals. 270 00:31:15,410 --> 00:31:30,810 And so one other thing to note there is that if it's Office 365 and federated equals win, so basically Office 365's password spraying avoidance and defense mechanisms are fairly brutal. 271 00:31:31,210 --> 00:31:40,770 But basically, if the organization is federated, it means that you, not just that you can, but that you have to hit the ADFS server. 272 00:31:40,990 --> 00:31:47,510 And the response to a request I'll show in a bit will tell you where that ADFS server is. 273 00:31:47,550 --> 00:32:01,630 And basically, yeah, so if that exists, it's actually a lot better for us, because it means we can avoid Office 365's robust defense mechanisms, and we're just hitting ADFS the same as we would before. 274 00:32:02,170 --> 00:32:05,050 And for RDP, that one's fairly simple. 275 00:32:05,050 --> 00:32:07,770 It's literally just remote desktop through the web. 276 00:32:07,850 --> 00:32:16,670 Depending on how that's configured, maybe you'll be able to RDP into a workstation in the domain, you know, things like that. 277 00:32:16,670 --> 00:32:19,990 And yeah, so hopefully you'll have seen Skype and Outlook before. 278 00:32:20,610 --> 00:32:27,270 So now, post-compromise, we're going to look at the address list pulling first with a quick demonstration. 279 00:32:27,810 --> 00:32:38,570 Okay, so just as a reminder, so this is used to pull the address book through the UCWA API, just to remind you what that looked like. 280 00:32:38,570 --> 00:32:40,730 So we have these options here. 281 00:32:40,730 --> 00:32:47,450 So if you untick both of those, that means you're just looking for the compromised user. 282 00:32:47,610 --> 00:32:53,570 Personal contacts is the personal contacts of that compromised user, so their favorites. 283 00:32:53,590 --> 00:33:05,510 That's an interesting one for, say, ongoing social engineering, because then you know, and from the other information you've got here, then you know, okay, my compromised user has this job. 284 00:33:05,510 --> 00:33:10,130 His favorites include these people, and they have these jobs. 285 00:33:10,130 --> 00:33:19,130 So in terms of kind of fashioning a good phishing payload, then obviously that would be incredibly useful. 286 00:33:19,230 --> 00:33:30,070 We can kind of run this on the personal contacts first, and then add in the full address list, just to make that distinction, or yes, just pick the full address list. 287 00:33:30,270 --> 00:33:38,550 The data here, as I said before, so the ones that are chosen by default, those are the ones that are quicker to get. 288 00:33:38,830 --> 00:33:48,430 So for some reason, the way that the UCWA API works, then we get different pieces of information depending on where we've queried that person. 289 00:33:48,470 --> 00:33:51,430 So if they're you, you get this information. 290 00:33:51,430 --> 00:33:54,110 If they're your personal contact, you get this information. 291 00:33:54,170 --> 00:33:57,830 If it's through the people search function, you get that information. 292 00:33:57,970 --> 00:34:02,630 So this is kind of the stripped down list of what you get in every case. 293 00:34:03,550 --> 00:34:11,610 Then if you want to kind of go on and pull everything back, we can, but that can take numerous additional requests per user. 294 00:34:12,550 --> 00:34:19,550 So obviously for a domain of say 6,000 people, that could take an incredibly long amount of time. 295 00:34:19,550 --> 00:34:26,890 So what we do is if we kick this off, I might have just missed the button, that's a good sign. 296 00:34:27,250 --> 00:34:39,790 So you'll see it will pull back the standard information for the users first, and then it will kick off some additional threads to pull that additional information. 297 00:34:40,270 --> 00:34:43,670 And then as we go, you'll see that start to fill in. 298 00:34:44,290 --> 00:34:47,410 And then I'll go over some of these things later. 299 00:34:47,410 --> 00:34:52,730 And the additional settings here, I'll go over in more detail. 300 00:34:53,250 --> 00:35:01,090 Okay, so as you just saw, the information that we can get back through Skype for Business is a bit of a social engineer's dream. 301 00:35:01,090 --> 00:35:10,930 So you've got the department, you've got the office location they work in, and you've got even whether they're online or offline. 302 00:35:11,210 --> 00:35:16,470 Additionally, this does say online mobile, online desktop. 303 00:35:16,490 --> 00:35:23,230 So I've never fully seen that work in a useful way, but that option's there. 304 00:35:23,550 --> 00:35:30,250 So we also get email address, phone number, and this note here is any status message that they've set. 305 00:35:30,570 --> 00:35:37,530 So those quite frequently I've seen people will put on there about annual leave, if they're going to be out of the office. 306 00:35:37,670 --> 00:35:47,910 So obviously, again, as far as social engineering goes, you know what office they're in, you know their name, email address, what their job title is, you know they're going to be out of the office. 307 00:35:48,090 --> 00:36:00,290 So quite a lot of information for maybe even being able to turn up and say, oh, I'm supposed to be meeting so-and-so or even impersonating someone and you know that they're definitely not going to be in the office. 308 00:36:01,790 --> 00:36:08,030 So as I was saying, the problem is some of this extra information does take a large number of additional requests. 309 00:36:09,130 --> 00:36:15,790 So yeah, by all means, tick all, but just beware, that might take a very long time. 310 00:36:16,810 --> 00:36:19,730 And yeah, those are the options you've got. 311 00:36:20,210 --> 00:36:28,550 So Carnivore pulls the internal address book back using people search on the UC with the UCWA API. 312 00:36:28,550 --> 00:36:33,970 So this does mean that we're essentially having to search letter by letter, A through Z. 313 00:36:34,370 --> 00:36:48,250 However, there's an upper limit of 100 on the amount of responses it returns, and there isn't a next link that we can say, here's the first 100, now go to the next link for the next, you know, however many and so on. 314 00:36:48,610 --> 00:36:55,390 So basically, what we have to resort to is searching by digraphs and trigraphs. 315 00:36:55,390 --> 00:37:02,210 So essentially, A, B, A, C, A, D, and then even A, B, C, A, B, D, A, B, E. 316 00:37:03,070 --> 00:37:23,690 And so basically, we can then take either from the top statistically likely usernames list, we can do all of the likely and unique kind of three letters that are there, or you can do all possible two character combinations. 317 00:37:24,110 --> 00:37:34,730 So what's interesting and fun about the UCWA API is that there doesn't seem to be much rhyme or reason as to the way that works in terms of what we get back. 318 00:37:35,050 --> 00:37:44,910 So to take an example, if we're looking for every pull in the domain, so we know that there's four, and we search for P, you get back 150 results. 319 00:37:44,910 --> 00:37:48,110 So we're just going to get the top 100, there's two pulls in there. 320 00:37:48,110 --> 00:37:53,570 So then we search for PA, we get back 20 results, but this time there's three pulls. 321 00:37:53,570 --> 00:38:01,370 So we've got one extra, but for some reason, even though we haven't hit the upper limit, we've still not actually got back every pull who's in the domain. 322 00:38:01,370 --> 00:38:08,350 So then we search for PAU, and now we get this mysterious rogue fourth pull that we've never seen before. 323 00:38:08,490 --> 00:38:15,930 So essentially, in the interest of me keeping my sanity, I've stuck with diagraphs and trigraphs. 324 00:38:15,930 --> 00:38:22,530 It's possible you might want to go on and do quad graphs and quint graphs and whatever else they're called. 325 00:38:22,530 --> 00:38:38,430 However, so when I looked at this with the common trigraphs, and then with every possible three character combination, that actually only added an additional, I think it was maybe even one user, in a domain of 6,000. 326 00:38:38,610 --> 00:38:48,870 And the difference is common does 2,249 requests, whereas every possible was about 17,500. 327 00:38:48,890 --> 00:38:57,750 So all of that for one additional user that, as I've said, was kind of hiding away, and we weren't able to get otherwise. 328 00:38:57,750 --> 00:39:03,410 So essentially, hopefully that explains the kind of options on the address list a little bit more. 329 00:39:05,010 --> 00:39:07,790 One additional kind of side note. 330 00:39:07,790 --> 00:39:26,000 So it's fairly uncommon, but I've seen it where a misconfigured Microsoft web app proxy basically meant that when you auth to the first server, and it gives you back the token, and then you try and use that against the application's endpoint, then it essentially sends it to the wrong place, 331 00:39:26,000 --> 00:39:31,740 or you've been authed to the wrong box, and so it then doesn't like it. 332 00:39:31,740 --> 00:39:40,080 That actually also stops the legitimate Skype client from being able to authenticate, you know, to Skype. 333 00:39:40,080 --> 00:39:43,640 However, now Carnivore is able to detect that. 334 00:39:43,640 --> 00:39:46,680 It re-auths to the correct box and carries on. 335 00:39:46,680 --> 00:39:54,940 So basically Carnivore is able to connect and carry on using the API, even when the legitimate client actually couldn't. 336 00:39:55,560 --> 00:40:00,320 Okay, so now the final post-compromise function, which is MeetingSnooper. 337 00:40:00,520 --> 00:40:06,740 So unfortunately, my lab servers stopped working for this, so we have to make do with screenshots. 338 00:40:08,380 --> 00:40:13,820 Okay, so as you can see here, this is the MeetingSnooper tab. 339 00:40:13,820 --> 00:40:29,520 So once you've compromised the user, if you've got Skype available, so this uses the UCWA API as well, then you can go here and you have to choose, you have to pick the compromised user that you want to use there. 340 00:40:30,200 --> 00:40:36,820 So now we can either choose, basically we can do this for all compromised users or just a selected user. 341 00:40:37,440 --> 00:40:44,000 Now one thing to say is that this only picks up currently scheduled meetings, obviously. 342 00:40:44,020 --> 00:40:55,840 So basically we can run this throughout the day multiple times or, you know, at the start of the day you could run it, see if any new meetings have been added, and then kind of keep running it to pull back new information. 343 00:40:57,300 --> 00:41:01,840 So first of all, it dumps the standard dial-in information to the output log. 344 00:41:01,840 --> 00:41:07,480 So if you've ever had an email inviting you to a Skype meeting, this will look fairly familiar to you. 345 00:41:07,480 --> 00:41:13,780 So you've got the internal number you can dial and then a number for each country or city within that country. 346 00:41:15,760 --> 00:41:19,720 And so now apologies for how utterly rubbish this looks. 347 00:41:19,740 --> 00:41:24,740 As I said, my training lab unfortunately kind of packing in at the key moment there. 348 00:41:25,080 --> 00:41:37,340 But yeah, so to stress this isn't an exploit or a zero day, it's basically highlighting what's already possible through kind of weaponization of the UCWA API for attackers. 349 00:41:37,340 --> 00:41:55,860 Obviously it does depend on compromised credentials, but basically so far this tool has shown how we can go from external over the internet to kind of complete compromise and to this point of being able to dump out scheduled meetings for compromised users. 350 00:41:55,860 --> 00:42:07,120 So one thing to say is that when kind of using this tool on jobs, then often you find if you're going to get anyone, you probably are going to get like 50 to 100 users. 351 00:42:07,360 --> 00:42:21,140 And obviously in that case, then this becomes more interesting because, you know, one user might have one meeting that week, but if you've got 50 users, then maybe you've got someone who's a little bit more interesting. 352 00:42:21,720 --> 00:42:32,220 So you can then see here what happens when you run this tool is that it gives you information for each meeting that compromised user has scheduled. 353 00:42:32,240 --> 00:42:35,320 So the conference ID there is the PIN. 354 00:42:35,320 --> 00:42:43,460 So basically when you dial in, you dial into the phone number and it asks you for a PIN and that's that conference ID. 355 00:42:43,620 --> 00:42:46,760 And basically that conference ID is unique to that user. 356 00:42:46,760 --> 00:42:53,500 So when you dial in, you'll be impersonating whoever it is that you've compromised. 357 00:42:53,980 --> 00:43:01,880 So for example, you dial in, then you show up as being, say, a Chris Nevin guest. 358 00:43:02,100 --> 00:43:13,840 Now, obviously, if the people in the meeting are kind of using the desktop application, then maybe it would look weird to have multiple Chris Nevin guests there. 359 00:43:14,020 --> 00:43:19,700 If everyone's using the phone to dial in, I'm not sure that they would notice this at all. 360 00:43:20,400 --> 00:43:35,540 And in fact, even if they did see these two Chris Nevin guests, how likely is it that people are going to assume, oh, this is someone impersonating and joining in and listening, as opposed to maybe there's some weird bug that's happening. 361 00:43:36,320 --> 00:43:41,520 So the information we get here includes the subject of the meeting and the attendees. 362 00:43:41,680 --> 00:43:48,980 So obviously these meetings here I've scheduled just to kind of demonstrate, but obviously this could be a lot more juicy. 363 00:43:49,020 --> 00:43:54,700 So for example, you've compromised a user, you know from their address book that they're the head of financial fraud. 364 00:43:54,700 --> 00:44:00,600 And this meeting subject shows it's the weekly financial crime investigation update. 365 00:44:00,700 --> 00:44:06,740 So obviously you can see why this would be kind of concerning for an organization if this was possible. 366 00:44:06,740 --> 00:44:24,500 And because, again, without any exploit, any need for any further phishing or payloads being executed, you've basically gone from being over the internet to being able to listen in on and even record the sensitive meetings, essentially impersonating that user. 367 00:44:25,740 --> 00:44:29,800 So on the right, you can see the lobby bypass enabled. 368 00:44:29,800 --> 00:44:34,460 That basically means that if you dial in, does it bypass the lobby? 369 00:44:34,460 --> 00:44:40,740 If that's enabled, that means you're not even in a waiting room that someone has to let you in. 370 00:44:41,580 --> 00:44:49,100 So the join URL, if you go to that, you can join the meeting and you can basically enter a name of your choice. 371 00:44:49,180 --> 00:44:57,420 So obviously one thing you could do is, again, you've done the address book, you know, is there a social engineering angle? 372 00:44:57,420 --> 00:45:00,900 Maybe you could kind of choose your name based on that. 373 00:45:01,120 --> 00:45:10,860 Potentially it might be more likely to get caught, whereas actually just dialing in and there being two of the compromised user is maybe less troubling. 374 00:45:11,640 --> 00:45:18,080 So another thing to say is that the API basically only seems to give the meeting expiry. 375 00:45:18,080 --> 00:45:21,060 So that's two weeks after the meeting ends. 376 00:45:21,060 --> 00:45:31,560 So Carnivore will take off, it will remove the two weeks for you automatically, and then it's kind of maybe you'll need to do some kind of common sense around that. 377 00:45:31,560 --> 00:45:35,080 So for example, you see the top meeting there. 378 00:45:35,400 --> 00:45:39,700 All we actually have been able to is that the meeting ends at 11.30. 379 00:45:39,700 --> 00:45:44,620 Now I've set the subject for that one to be the time while I was troubleshooting. 380 00:45:44,800 --> 00:45:48,020 So you can see that actually that meeting starts at 11. 381 00:45:48,600 --> 00:45:53,260 As I say, normally you wouldn't get that information because that's the subject. 382 00:45:53,440 --> 00:46:01,120 So obviously, yeah, if you apply some common sense to it, then you can see, OK, the meeting ends at 11.30. 383 00:46:01,120 --> 00:46:04,820 It probably starts at 11 or even 10.30. 384 00:46:05,920 --> 00:46:11,400 So yeah, so that's the meeting snooping, what you get back from it basically. 385 00:46:11,520 --> 00:46:19,380 So there are a couple of extra points to mention, which are that this only seems to be able to pull back self-scheduled meetings. 386 00:46:19,680 --> 00:46:26,680 So again, doesn't fully make sense to me because obviously in Outlook or something, you don't just see meetings you've scheduled. 387 00:46:26,680 --> 00:46:31,120 You see every meeting that you're scheduled to be a part of. 388 00:46:31,380 --> 00:46:34,400 Unfortunately, we're not able to get that through this tool. 389 00:46:35,140 --> 00:46:40,300 And so, yeah, and then also meeting end time only, as I said before. 390 00:46:40,620 --> 00:46:43,240 Now, there are some weird edge cases with that. 391 00:46:43,240 --> 00:46:47,040 So, for example, I set a recurring meeting. 392 00:46:47,040 --> 00:46:55,260 And so the only information we get back is that it ends on the 26th of December 2022, which obviously isn't that useful. 393 00:46:55,340 --> 00:46:58,100 Again, maybe you could figure out, OK, that's a Friday. 394 00:46:58,100 --> 00:46:59,400 It's at half ten. 395 00:46:59,400 --> 00:47:01,280 So maybe it's every Friday. 396 00:47:01,480 --> 00:47:05,440 But again, we can't get that back through the API, unfortunately. 397 00:47:06,360 --> 00:47:08,260 OK, so Office 365. 398 00:47:08,740 --> 00:47:10,820 So I'm not going to demo this. 399 00:47:10,820 --> 00:47:14,460 So what I've been showing so far is basically just my lab. 400 00:47:14,960 --> 00:47:21,300 And so, yeah, we're not going to demo Office 365, but I'm going to talk you through how Carnivore works. 401 00:47:21,560 --> 00:47:30,820 So, for example, or sorry, one thing to say is that username enumeration that doesn't require a password guess has been quite widely covered. 402 00:47:30,820 --> 00:47:35,520 So there's things like O365 or O365enum. 403 00:47:35,520 --> 00:47:40,980 So I'm just going to quickly kind of get into password spraying and give some key pointers. 404 00:47:42,040 --> 00:47:45,180 So, as I said before, federated is a win. 405 00:47:45,180 --> 00:47:50,460 So just the usual Active Directory rules will apply to lockouts. 406 00:47:50,520 --> 00:47:57,820 But again, that kind of doesn't include the extremely robust Office 365 rules. 407 00:47:58,020 --> 00:48:06,680 So, as I've said, there's a link that I'm about to show you where you can find out if an organization is federated or not. 408 00:48:06,680 --> 00:48:12,600 If it is, you'll get back the ADFS server location and Carnivore will add that automatically. 409 00:48:13,120 --> 00:48:27,640 So if it's not federated, we can still spray, sorry, we have to spray the Office portal, but then we can also determine if a user and password is valid, even if we have MFA on there. 410 00:48:27,680 --> 00:48:38,620 I'm sorry, I should have said again, with federated, if it's federated, you have to spray ADFS and you can't spray the Office portal and you won't get back anything interesting, anything useful. 411 00:48:38,960 --> 00:48:42,500 So password spray counter measures for Office 365. 412 00:48:42,920 --> 00:48:49,360 So they have things like trusted versus untrusted network, have separate bad password counts. 413 00:48:49,420 --> 00:49:02,260 So again, if you're from the untrusted side, which presumably you would be from an untrusted network, then, you know, your password spray is adding to account of everyone else in the world. 414 00:49:02,260 --> 00:49:07,580 So again, lockout is fairly frequent and quick. 415 00:49:08,160 --> 00:49:17,360 But from the Microsoft side, obviously that's designed so that then the genuine user can still sign in while on their corporate VPN or something like that. 416 00:49:17,460 --> 00:49:22,900 So obviously good security measures, but difficult from a red team perspective. 417 00:49:23,900 --> 00:49:28,220 So first of all, to find out if the organization is federated. 418 00:49:28,260 --> 00:49:30,260 So this is an example request here. 419 00:49:30,260 --> 00:49:32,800 So the username itself is irrelevant. 420 00:49:32,800 --> 00:49:36,440 It's just the appdomain.com that we're looking for. 421 00:49:38,320 --> 00:49:40,000 And the response here. 422 00:49:40,020 --> 00:49:44,880 So if they were federated, that would say federated instead of managed. 423 00:49:45,000 --> 00:49:49,140 And it can also include some kind of boilerplate text. 424 00:49:49,220 --> 00:49:52,800 So, for example, is keep me signed in disabled? 425 00:49:52,980 --> 00:50:07,300 Obviously, that one might be interesting from a red team perspective, because maybe it hints that they have fairly good security and they've had their configuration looked at because users can't just stay signed in forever. 426 00:50:07,820 --> 00:50:15,940 You also get the federation brand name there, and you can get back, you know, logo information and that kind of thing. 427 00:50:16,220 --> 00:50:25,640 So also, if they said federated, then we would see the location of the ADFS authentication endpoint there as well. 428 00:50:26,920 --> 00:50:31,340 So for password spraying, this is how Carnivore does it. 429 00:50:31,340 --> 00:50:34,080 So this is the endpoint that we're hitting. 430 00:50:34,360 --> 00:50:37,060 There's the username and the password. 431 00:50:37,280 --> 00:50:45,280 So the client ID and the scope, obviously, that could be tweaked to maybe be a little bit more realistic or representative. 432 00:50:45,280 --> 00:50:47,920 But this is what Carnivore uses. 433 00:50:49,320 --> 00:50:52,920 And so this first one is if there's an invalid password. 434 00:50:52,920 --> 00:50:57,900 Now, obviously, the actual response here says invalid username or password. 435 00:50:57,900 --> 00:51:01,820 So obviously, that seems like maybe that's going to be a bit tricky for us. 436 00:51:01,820 --> 00:51:03,820 Is it the username or is it the password? 437 00:51:03,820 --> 00:51:05,280 We're not fully sure. 438 00:51:05,960 --> 00:51:09,780 But then if the username is incorrect, then we get this message back. 439 00:51:09,780 --> 00:51:13,820 The user account does not exist in that directory. 440 00:51:13,980 --> 00:51:19,540 So obviously, from that, we can tell the previous response means the password's wrong, not the username. 441 00:51:19,900 --> 00:51:24,780 And just to also mention there where it says email hidden, I've not added that. 442 00:51:24,780 --> 00:51:26,540 That's the actual response. 443 00:51:27,020 --> 00:51:31,140 So then this is a valid user and password without NFA. 444 00:51:31,340 --> 00:51:36,180 So again, this is specific to the request that I make in Carnivore. 445 00:51:36,280 --> 00:51:53,160 So because we gave a client ID that doesn't exist, then if the username and password is correct, you'd get this unauthorized client and a message that that application doesn't exist, because obviously, it's not a proper client ID. 446 00:51:55,060 --> 00:52:02,280 And again, so if it's valid user and password with MFA, then again, we get this invalid grant. 447 00:52:02,280 --> 00:52:08,880 But now it's telling us that it's due to configuration, meaning that you need to supply multi-factor authentication. 448 00:52:09,100 --> 00:52:13,200 So again, username and password is correct, but you need MFA. 449 00:52:14,840 --> 00:52:17,440 So outro very briefly. 450 00:52:17,880 --> 00:52:22,180 Yes, so almost forgot to put it in, but here's a link to the tool itself. 451 00:52:22,360 --> 00:52:31,600 So obviously you can go there and download the latest version and any issues or anything that you want to bring up there, I'll be happy to try and help wherever I can. 452 00:52:31,720 --> 00:52:32,900 So thank you for listening. 453 00:52:32,900 --> 00:52:36,800 Hopefully it's been useful and enjoy carnivoring.