Add Log_Analysis_and_Chainsaw_Rule_Creation_-_HTB_Sherlocks_-_CrownJewel2.jsonl
Browse files
Log_Analysis_and_Chainsaw_Rule_Creation_-_HTB_Sherlocks_-_CrownJewel2.jsonl
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"text": "what's going on YouTube this is ipsec and we're going to be doing another Str loock today from hack the box which are just defensive challenges this time it is going to be Crown Jewel 2 which is a sequel to Crown Jewel one and if you haven't watched that first video I would highly recommend doing so because I'm not going to cover a lot of the basics again and also in the interest of time I'm going to skip a lot of the Recon I normally would do that is just like looking at all the data in my log file converting all the event IDs to names and things like that because it does take time and I'm going to replace doing that with something I think may be more interesting and that is writing a rule file in chainsaw so then you can use the hunt command and have it automatically find things which I think is just amazing and also it helps me motivate to", "start": 0.12, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 2 |
+
{"text": "do these Sherlocks because as I do the Sherlocks I create the rule files and then when I go on engagements do forensics I replay those rule files against the uh data from the engagement and I discover how good my actual rule was if there were a lot of false positives or not and if there weren't false positives then the data I made while I was doing sh loocks becomes immediately valuable because it takes a long time to hunt for something if you just don't have some predefined rule set to automatically look over your data if that doesn't make sense it'll make sense by the time we're done with this video so let's just jump into the Sherlock let me make myself smaller and we can go over the scenario the fella domain environment is pure chaos it looks like we didn't do a good job cleaning out the", "start": 41.079, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 3 |
+
{"text": "attackers in the last one and they have managed to dump ntds.dit yet again if we look at the Sherlock info page it does tell us they used ntds util to dump it um it also um says it here as well I recommend reading both the scenario in the info before you begin and you could also start reading the questions but I like looking at the data before I go into the questions because I find if I look at the questions first it kind of taints the information and again on engagements you don't always know exactly what's happening the first time so you want your like Recon your quick like wins to be really on point so I'm going to use two different tools the first one I guess you could have guessed is going to be chainsaw and I've already downloaded it and unzipped it so I'm going to go opt chainsaw and then we're going to execute the binary specify the hunt and then we use the", "start": 82.64, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 4 |
+
{"text": "mapping flag to put it in opt chainsaw mappings and then what is it like Sigma event logs all. yl and then we got to give it the sigma directory which is just a lot of just default rules so do op chainsaw Sigma and then custom chainsaw rules is-- rule opt chainsaw rules so if we run this command it should output a table if we put all the event logs so I'm going to do star. evtx so it knows to process the evtx files and then we got a table it's a bit hard to read because my font's so big let me change that to be smaller and there we go uh the first thing we have is schedule task deletion and looking at the task name it's create Explorer shell un elevated task and I think this isn't really that interesting to me I think this happens all the time but if you're a Defender and know otherwise something sticks out here please let me know um there's also", "start": 135.2, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 5 |
+
{"text": "a volume Shadow copy Mount and we can see device hard disk Shadow uh copy one um was initiated and this is suspicious to me um sometimes environments do use Shadow copies and you see a lot of these it may not be suspicious but it indicating it's the first copy this is definitely suspicious cuz it looks like the domain has been using them before and the attacker probably created a shadow copy the reason why they do Shadow copies is because this ntds.dit file is a protected file you cannot read it as even as administrator you have to like either go into the raw NTFS data and read it so you bypass some acl's or if you create a shadow copy that's a backup file then you can access it right so those are the two main ways people access this database which again is the active directory database other files", "start": 190.159, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 6 |
+
{"text": "like accessing overshadow copies is like the Sam which is part of the registry the system like all those files right I think it's like C and windows uh probably system 32 config or maybe it's just C and windows config and then the file would be called Sam right so the registry Highs are important and also ntds.dit um but really not all that much information so I'm going to use a different tool and that's going to be Hayabusa and let me make the font bigger hopefully this one displays a little bit better if we execute the binary we can just run it if you don't have this tool tool um I just went to GitHub Hayabusa yeah and it's on the Yamato security um GitHub so just download the release and unzip it that's all I did and then normally I go into the directory and then run it with the update rules command this is going to make sure all my rules are up to date and if I ran it", "start": 236.239, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 7 |
+
{"text": "when I wasn't in the high abusa directory it would create a directory called rules and put them there so that's why I always like cing to this directory before I run the tool just so everything stays organized so the next one we want to run let's see it's probably going to be a CSV timeline let's just go with that so I'm can do CSV timeline then Dash to see options and let's see what do we have um I'm just going to specify I want to say it's Das D and then the directory for event logs um let's see yeah- D so we'll do d D htb um what is it Crown Jew 2 and that should be all I need it's going to ask me a few questions I'm just going to do let's say the core rules first we don't have cismon logs here so I do no there and it found nothing okay let's go and change it up this time we're going to do core Plus um again no to cismon because again don't have any", "start": 292.6, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 8 |
+
{"text": "and we got some detections so looking at this we have 12 medium detections and and going up it is all ntds util abuse so we have dump to a suspicious location and if we look here we have C colon Windows temp dump temp active directory ntds.dit so that is white flagged right um we also have it just being ran I guess here it's in the um Shadow copy directory whatever you want to call that um so just a lot of flags here with this command we could like go crazy and just say all events and rules and see if it generates anything I'm just going to do yes to everything and see how much we actually get um it's loading the detection set it says please wait it doesn't take too long and um let's see we have rare schedule task Creations deletions volume Shadow copy credentials enumerated remote schedule task", "start": 354.28, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 9 |
+
{"text": "creation um ntds util abuse um no critical or high alerts but this is a pretty cool tool if you don't want to like um go deep diving into your logs right away I like running this just to see what it points out right so a lot of group enumeration stuff and things like that um when you do the everything option obviously there's going to be false positives it's not all malicious it's just to give you a quick idea at what is in the log so let's take a step back and go look at what the questions are right so we know there's probably some type of suspicious ntds.dit xfill right probably from the ntds util tool because that's what all tool said so it wants us to um look at the most recent timestamp which this service entered a running State and that is the Microsoft Shadow Copy Service so remembering from the", "start": 416.039, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 10 |
+
{"text": "last Crown rule that was in the um I think system log and I'm just going to cat a file out of the last video um it's going to be system. text and this is where we did all the event IDs um what they mean and then how much they occurred and I want to look at a service change State and that's going to be event ID 7036 so those are the events we want to look at here so I'm going to do a chainsaw command so we do opt chainsaw chainsaw dump uh pipe it to Json star. evtx and pipe it out to events. Json so now we just have a big old Json file we can C it then pipe it over to JQ and actually what I'm going to do real quick is I'm going to dump it to Json L I think it's Json log format and we're going to show what that does real quick so if I just do um cat events Json jq.", "start": 472.12, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 11 |
+
{"text": "L it puts it in this list and then um yeah it just puts it kind of in a list and does like in the Json L format doesn't doting nesting in the last video I used this to get rid of the nesting um if we look at the logs it's not there but what I'm going to do here is change it to do dump Json L because I like this format better so let's now cat events Json L Jake we can less it again and you can see what it looks like every event is just on one line the log itself is a little bit bigger because again the nesting does save space we can see 1.3 Megs instead of 932k but um actually that's not what I expected I expected this log to be bigger than this I don't understand what's going on um I like using Json L it saves one of the um list item things probably to explain that wrong but at least you have my reasoning why we switch to Json L this video so uh what we want to do is", "start": 530.64, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 12 |
+
{"text": "grab the system log so we're going to do event system Channel system so we're going to do a JQ Dot and then a select um I'm going to specify event here so I don't have to keep typing event every single time um system. channel is equal to system right I think I did that right looking at that yes the first um event is now system and then I already forgot what the event code was we wanted I want to say 7036 let's see if my memory is good so I'll do a and Dot um system event ID is equal to 7036 and let's see is this good yep it is so we have pram one and pram 2 this is the service and the state so let's dum all those so I'm going to now say dump. pram one. pram 2 we want to put this in that single quote and up P there we go uh we need to do event data event data there we go so we have stopped running we probably want to also select when it is running so we can say", "start": 603.32, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 13 |
+
{"text": "and. system oh no this is going to be event data. pram 2 is equal to running because that's what the question asks right um most recent time stamp wish the service yep it did so now that we have running I'm only going to look at pram one and we're going to get a list of all the services and Let's see we can GP this for shadow and we either want the volume Shadow copy or Shadow copy provider so what I'm going to do here is we'll go back to select everything and then I'm going to do A- C so that puts it all in one line and I'm going to do a g-i for volume and that'll get me the three events and then we can look at the time stamps so let's see um we have volume Shadow copy at 2024 515 see this one 515 I don't know exactly what they want but they wanted the most recent one so I'm going to try this time stamp we'll do up to here I", "start": 692.959, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 14 |
+
{"text": "forgot to copy that too so this is the most recent time volume Shadow copy went into a running state yeah okay it does not like the T it wants a space here and we'll see if this is works it does awesome so identify the full path of the dumped ntds file so that's something the hunt command already told us we want to look at ntds util um if we didn't do the hunt command we could just Google like um let's see ntds util event log and let's see see we have this page Velociraptor what is this um don't know exactly what this page is there we go the Velociraptor is telling us probably event 216 325 326 and 327 um if we look at the LOL bin repository of ntds util um no this is living on the land not L bin living on the land binaries this tells us exactly how to use ntds util and the one thing I'm noting about this right this is why", "start": 770.72, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 15 |
+
{"text": "I normally like researching the commands um before I do a lot of like analysis we don't see them actually specifying a file name in this they just specify the directory for the dump to go to I think so because they're not specifying a file name we can just make hunt rules targeted towards files thems and we want to look at what these event IDs are so let's Google let's see this is event ID 216 we may have to specify the exact log uh this is Windows backup this looks good um let's see restore failed with errors let's look at 325 so event ID 325 see 327 326 that's funny that that came up when I search 325 um let's see ntds util the box I'm not sure exactly what that one is but we have 327 and 326 a database engine has attached and a database are these the same I thought one would be detached 327 326", "start": 843.8, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 16 |
+
{"text": "let's see this one has a recovery cache that is bizarre I could swear one of those is like ntds util has finished uh let's do 326 Different Page uh this is the same exact information all right so I'm going to go with 326 is it started and 327 is it finished um I'm not positive though so okay let us look at those events so we want to now go system event ID we can delete this running query and it was 32 7 and The Log I think was application there we go so we can see the data so the event data it looks like the 1 two 3 four five the fifth parameter is the location of ntds.dit that is in a shadow copy place since that's like a snapshot um let's see is there any other task datas there we go that's the path that even higher booster told us earlier right we could have just answered this question really quickly if we just remembered we ran", "start": 929.44, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 17 |
+
{"text": "hausa and it told us where that dumped uh let's see I'm going to look at 327 or 326 since that was 327 logs attached let's see 1 2 3 4 five dfsr so it look look like this event is slightly different DS token don't exactly know what that file is um I the FSR does this one have an ntds even let's see what I'm going to do is a-h cp-i ntds.dit and then JQ do uh we need to make sure we have a space with the- C there we go so this is the snapshot and that's it so 326 is not showing us um the actual file workor goes to so I'm going to guess that 326 is it started the backup copy it's pulling it out of this directory and then 327 would be it finishing but again that's all my guess right so let us see what the question was and then I'm going to create a chainsaw rule in order to automate this so let's see full path okay so let's go", "start": 1029.36, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 18 |
+
{"text": "with um 327 JQ let's create a rule F to extract this because it got a double these double slashes and I think it would be just a pain to extract that with JQ it' be quicker just to erase them but what we could do is create the hunt file and then not have that to begin with so when I was looking at chainsaw hunt files I'll show you like how I went to learn this because this is something I just learned about today um I didn't really have much experience creating these I was just looking at like how they worked so I went to a hunt file let's go let's say login attack account brute force and then we can see how it's structured right we got a title we got a grouping description the author the kind of files so evtx this could be MF things like that the level you want to give it the status um the fields so this is going to rename Fields so we take the event system ID field rename it to event ID so", "start": 1123.64, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 19 |
+
{"text": "it's much more user friendly and then we give it a condition so we have condition failed logins and not empty so we got two things fail logins here which is going to be a 4625 and empty is going to be um username is null right and this means it wants more than five of these so we got an aggregate as well so you can do like counts things like that this is just giving us a good explanation of the rules um if I wanted to know more about filters I just did like a gp-r filter and then a let's do five and let's do it to l-s and I kind of just looked around at all the filters here and kind of understanding how it's structured right so I'm going to um make a directory here as ITA camel case no let's do make I'll call it Shadow copies I guess um that seems like a good name and then we can CP login attacks account", "start": 1185.28, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 20 |
+
{"text": "Brute Force if we do a F-Type F there's not really a strict naming convention I like the event ID and then a description so that's the one I'm going to use so I'm going to CP um let's just do the login one again and then we'll call this uh what do we want to call it um Eid 327 ntds util dump ntds that seems fine um yl and then let's edit it so we'll do Eid 327 and this title let's call this um ntds util dump complete group we'll call it um Shadow copies is what I called it uh description active directory database has been dumped I guess I don't know um author I sec time stamp that should be fine event fields we probably want the event ID um the users fine let's see we probably want to get the computer so name computer and let's look at this log file again see htb ground Jewel 2 JQ we probably want this is 327", "start": 1250.919, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 21 |
+
{"text": "okay so the computer right there chainsaw rule Shadow okay so the field is computer and that is the event system computer then name Dump location and I don't know if this is going to be accurate or not um we could just do the entire event data but that field is a little noisy right I don't want to dump all of this so I'm going to count one two 3 4 5 and we'll dump the fifth field and since it starts at zero um it'll be like the fourth like it'll look like four but it's really the fifth uh so let's do event data data for so that' be the fifth line and that should be good now we want to do um filters so I'm going to say it's going to be a um ntds file and not snapshot path because I want to only get The Dump location I don't want to get where it was snapshotted from um so we'll say ntds file this will be event", "start": 1358.2, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 22 |
+
{"text": "system event ID 327 and then Event Event data data 4 and then um we'll say NTD s.d and I discover you could do wild cards by just like looking at the previous rules right when we did that gp-r um and then we'll say snapshot path because I don't want all that um noise so do this and then we'll say dollar snap like that awesome and then we'll delete the bottom of this because this is from the failed logins and we have a rule file if we did this correctly it'll look really cool when we do a hunt command so I'm going to specify the hunt just the same exact command we did before but now we have an extra rule so hopefully it works if the demo gods are in my favor we did this all correctly go to chainsaw let's scroll up to the hunt and this is going to be yes it is so right off the bat ntds you till dump complete vent 327 and", "start": 1453.799, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 23 |
+
{"text": "there we go we have The Dump location so that was a quick um fet into creating signatures I don't know if this signature is good um after this video I'm going to spend more time learning more how to create the rule file so if you um are watching this I would highly recommend going to github.com um what is it I forget exactly where it is it's in with secure Labs if you go here look at the rules hopefully the rule I created will appear here and you will see a more upto-date rule that may have um less false positives or better like targeting thing but that's where I'm going to leave it hopefully you enjoyed how to create that event and what we forgot to do is run it and actually grab the data so I'm going to say can we output it to Json will this work it does awesome JQ Dot ntds and this looks exactly like we had", "start": 1531.72, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 24 |
+
{"text": "it before well it didn't really save me any time I was hoping it would be easier to just dump this without all the verocity but um oh well we will paste this in and see if it works submit there we go task three when was the database dump created on disk oh well that's easy we had this so going back here let's grab this Tim stamp copy paste submit uh oh it's wrong do I have the time stamp wrong what format does it want year month day that looks right huh hour hour minute minute second second so it looks like it may be wrong so let's now go take a look at exactly what we could have done wrong so let's go back to this command and let's see that looks right 59 39 58 is in that one okay are there other time stamps don't see them is there anything in the this event data no so I'm going to take a look at the", "start": 1599.44, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 25 |
+
{"text": "next question um when was The Dump considered complete and ready for use is that this time awesome so it looks like the dump gets created and then it probably takes a couple seconds or minutes for it to be considered complete so we want to look for when the actual dump started so I'm going to look for like the file create event on this so let's see what can we do I'm going to take away this event ID filter and then let's JQ it and let's see I'll probably go from the top and what event are we at so event 216 we got elas and then it's doing this 216 again elas I don't think those would be the completed that's like it's like kind of starting the job maybe I want to look for the path where it has the actual directory um we could probably change a grep up so grep ntds.dit GP temp wc- l i did spell that correctly", "start": 1716.679, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 26 |
+
{"text": "what was the path TMP okay we got three events that have the full path so this is probably the correct way now let JQ dot less and let's see so the first event ID is 330 and we have the data here then we have what event ID is this 325 data here so we want to look at what these events are so event ID 330 let's see es NT 330 event so 3:30 I don't think that's is that task scheduler probably should just open up windows at this point and look at those events yeah that's definitely not the event log we're looking at let's see event 325 IS there better information on that what do you went to that blog let's go to our own blog on hack the box and see if we say so 325 and 327 and application log so 325 the database engine created the new database this is probably what it is so if we were doing this in the event log viewer we would see more data", "start": 1800.84, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 27 |
+
{"text": "which would be nice um detached is that so that's nice to know so 325 IS started so I'm going to go and edit my hunt command actually so we can CP this to be 325 as well and you kind of want both because maybe it never detaches um so I would actually do both so we do active directory dump begin uh that is all good 325 okay let's go back to hunt and again change our size uh why do we say begin or complete first I guess I forgot one um thing but there's a different time stamp 56 we'll try this time stamp so it took 2 seconds there we go awesome so that is the answer there and we want to fix the Tool uh the thing real quick so this is NDS dump started there we go and hopefully you kind of get the value now in doing Sherlocks to um do this why is user there user doesn't have anything I just noticed", "start": 1920.48, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 28 |
+
{"text": "that user Event Event data Target username did I screw that up oh that was probably in the um thing we copied from there's no username in this log at least I don't think do we have a username doesn't tell us who did it I don't see nope I don't see a username is is process ID useful nope 0 okay so that's good let's go to the next question um event logs use event sources to track information and let's see I don't have a full capture of the event log this one's easier to answer if you had the Windows Event log in front of your face um let's see Windows Event log example let's go to images I know I probably should just open up um my windows thing but the event log has something is this it where's the question what's it asking why is it going to YouTube um the event log source is GNA be the provider attributes and Chainsaw um if you open up a vent log", "start": 2018.399, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 29 |
+
{"text": "it's relatively like it says the source I don't know why chainsaw calls it something different but that's the answer so that one is a little bit tough if you don't use the native Windows Event log viewer but we'll just handwave that because I've ran into that issue before so let's see when ntds util is used to dump the database it enumerates users and groups what are two groups enumerated by the ntds util exe process give the group names in alphabetical order joined by commas space so let's go back to Crown je one so I'm going to cat Crown je one look at the security log and I'm going to guess we want event ID 47.99 because that's an account was enumerated so let's go back to our JQ queries um where we had event ID there we go and we want 4799 and this is going to be the security laog we don't need ntds.dit so if we just look at all these JQ do we have the", "start": 2126.16, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 30 |
+
{"text": "caller process name and then Target username group and whatnot um username can also be group names so we have backup operators there so we want to look at where the process name is probably going to have um ntds util right so I'm just going to do a grap ntds there we go then we can JQ Dot and now we have all the ones with caller process I could have done a like went in and did my select just like I've done before but sometimes I like just being able to use GP because it's quicker um so now we just want to get all the um event data Target user name then sort dasu administrators and backup operators so those are the two groups so if we look administrators backup operators submit there we go and the final question now you're tasked to find the login time for the militia session use the login ID find the time when the user", "start": 2195.88, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 31 |
+
{"text": "login session started okay so this one let's see um let's grab everything here and there should be a log on ID which is this and we're going to look at for all events with this so JQ dot let's do less and let's see um I'm going to change up my query a little bit let's get uh a list I'm going to say what do I want we'll do system event ID and then event data there we go so that's a little bit um compressed so we can quickly see and then let's L this and we have event ID for all these are 4799 let's get rid of that because all we want to look at is the security log so event ID 5379 this is some Windows Live thing it could be this time I think this is when it started I guess let's try this real quick um get rid of the filters so we can look at the time quickly this is system Time created tribute system time okay", "start": 2263.8, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 32 |
+
{"text": "system time create tribute system time there we go uh let's see if it's this time the very first event I don't think it would be but it's possible it is so we could look at the first event because that's when they like attempt to log in right but normally that's not the event I go off of it may be the same exact time just because everything happens so quickly um here we see that create shell un unelevated task but there's something else I wanted to talk about real quick before we wrap this video up and I promise you you will like it so let's see 4799 um subject username login ID so that is let's see 4799 appears a lot um I should go back and add this because we don't care about enumerating groups right now so we can say system event ID does not equal 4799 and that did not work because I did", "start": 2368.68, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 33 |
+
{"text": "not say and there we go so Windows Live login that this is again that task I am not getting the log I expected I thought we'd be able to see like a keros ticket let's see I may pause the video and come back to this if I don't see this um TI It opt is that it do we get lucky with the login session maybe the login session isn't part of the curos thing uh the login U ID or ID is not here so that's why I wasn't seeing it okay so maybe I did it the correct way um but I always like looking at the Cur stuff so that maybe got you the time um I'm just going to grab what I want so this is going to be 4768 um I forget exactly what Kos event this is I think a TGT is being created um but the key thing I wanted to just talk about really quick um whenever I look at tgts I always look at this field the ticket options um if I see 408 then", "start": 2444.2, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 34 |
+
{"text": "000010 um that's probably going to be rubius if it is uh 5 8 and then all zeros I think that's going to be impacket um sometimes you have this bit off so it be 40810 z um but the key things I look at is right here this one being a zero so 4080 would be rubius um again impacket this would just be I think 508 is impacket um so but these are just the curos tickets being created the ticket option um is all the parameters so if we went to like Olaf Kerberos calculator maybe is this it no what is the link maybe it's TGT it goes to his Twitter or X account I guess um let's see is this his post about it it's funny that yeah this is it so this is a really good um Link Link share. Olaf Heron I not can pronounce his last name but the TGT Cal is really good for understanding what the ticket options mean so if we grab", "start": 2541.72, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 35 |
+
{"text": "this put this in we can see um all the ticket options so name chaliz renewable okay affordable and renewable that's one of the more common ones rubius doesn't do that flag I believe memory serves right which gets rid of this field um and impet they do a five there and nothing there and they do proxy affordable renewable um so this is a good calculator if you just want to understand what each um field is in the Cur Bros thing and of course you can go ahead and Google what the field is to understand like the purpose of it being in that ticket but a good thing to look at um encryption type uh ZX12 is that what is ZX12 to I think that's 18 so this would probably be I think a s um cobos encryption type 12 see I know 23 which I think would be 18 in HEX would be rc4 um what are the encryption types yeah um rc4 so these would definitely", "start": 2624.76, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|
| 36 |
+
{"text": "not necessarily be suspicious Windows does rc4 a lot by default um ZX12 this would be as um generally you see attackers using the rc4 quite frequently because when they do a curb roasting attack they want to go ahead and crack it so they request as weak of an encryption type as possible so it cracks faster right you could use impacket to do a curb roast attack and request a AES ticket but it's just going to take a lot longer to crack it'll be much more obsc friendly because it's not going to stick out I know a lot of Defenders when they see these encryption types they start like that raises a flag and then they go investigate it more but um yeah hopefully that makes sense and that's enough rambling for me I'll wrap up this Sherlock and hope you guys enjoyed it take care and I'll see you all next time", "start": 2702.319, "duration": 0.0, "meta": {"video_id": "PXWrCK7bgB0", "title": "Log Analysis and Chainsaw Rule Creation - HTB Sherlocks - CrownJewel2", "url": "https://www.youtube.com/watch?v=PXWrCK7bgB0"}}
|