good morning everyone this is Mreiserloth and again this is activity 3. 1. 2 for cyber security access control today we're going to be going over the ownership and permissions settings to analyze files learn about different file types and use file hiding and encryption so go ahead and spin up your lab access control and then let's just talk a little bit about these things now when you're running these things last time we did this we were looking at files with ls and LS all those kind of things that we did in there when we did that we pulled up basically a list of all the files but if you want to know a little bit more about the files you're going to go ahead and do some different things where you're going to want to look at who can read who can write and who can execute these files this is extremely important because when we're looking at things that could potentially be harmful to your computer anything that has the ability to execute from any person means that it could be potentially dangerous that doesn't mean everything is obviously every executable file we have has the execute permission so you know if you're trying to log into Microsoft Word or you're trying to log into Google you know it's going to have you execute privileges but you know there might be that file on your computer that has the execute privilege but you didn't have it on there you didn't put it on there that's something to be wary of so just keep that in mind as we go through this now this is just a little deeper dive so what you're going to see is that when you do the list the way we're going to show you this time you're going to have three little placeholders for the owner three for the group three for the other all right and then there's going to be a 10th one at the very begin the beginning if it has a directory so if it's a directory it's going to have D if it's not a directory and it's a file it's going to have just a dash and so that's what we're looking at when we're doing all of these things so it's just another way to look at these different files okay so we're going to go in we're going to do the same thing we did before so let me go ahead and start following along in my activity we're going to go into connections and we're going to open up Alpha now remember what I said before if I go in here and the first thing we want us to do is they want us to let me go ahead and make this large they want us to go and executable but if I just do a real quick LS right you're going to see all of these things this is what I'm talking about there's nothing it's just a list of the directories and the files but we're going to actually look a little deeper so let's go into the home directory and change the directory to executables that's what they want us to do so they show you a shortcut in three they talk about a helpful tip so if I do CD exe and then I hit tab it'll actually fill out the rest so that's what we're going to do now we're in executables and now they want us to use the ls-l not one L command and they're looking for message dot sh now you'll notice now we're looking at a specific item in there so if I just do LS right you'll see that I've got message.
sh and question. exe quote of the day trust me what they're doing now is we are actually now looking a little bit deeper into the message. sh and you will notice that it is not a directory because it's got the dash in front it does have the owner has read write and executable capabilities the group of people that are doing this the whole the person have access to the group can read and execute but they cannot write and then you'll notice that the anybody else so anytime they can hear you that comes in here that's going to use this computer has no privileges whatsoever that's those last three right there on the right okay and that's what they're talking about when they do this they're comparing these things now let's go ahead and do the same thing but now I'm going to do it instead of message I want to do welcome.
txt okay so let's do welcome. tax LS Dot and I just change this out welcome dot txt oh and may give me an error because I'm the wrong directory so let me go ahead and change that I'm sorry so let's do this LS Dash l message that's age space dot dot period welcome I gotta get into the right format so now you'll notice they're comparing the two so all they're doing right here is they're comparing two different ones they're comparing message and welcome. txt and you'll notice the difference between the two that that both the owners have read and write capability but if you look at welcome.
tax nobody can access and nobody can execute this so there's no executable permissions to anybody everybody can read it but nobody can really because it's not an executable file so just keep that in mind as they're doing this and step four they're actually Elite asking you to describe the owner group and permissions of each file and so you're just going to go through that and just fill in that little table there and then they're going to look at other additional they've got this like quick portfolio you'll notice the time stamp that it was actually modified last modified then you'll also see that it has um the uh the file size so if you look that 28 and 60 is the size in bytes uh let's see what else do you have this is the group that it belongs to it belongs to the alpha group that's okay because we're in the alpha group and then the owner of the file is also Alpha so you'll see it's alpha alpha so the alpha so the lead person that would be us in the alpha group we have these first three permissions okay so for message we can read write and execute with welcome. txt we can read and write but we cannot execute so then they're going to ask you a couple of other questions now they want to go ahead and try to execute by typing in the name of the file so let's go ahead and try that so obviously we can execute message so let's try that chat message. sh and you'll notice that it says cat is home Alpha welcome dot text and if I do message sorry message dot sh the minute I do this it should execute because now I'm not doing any kind of tags or anything in front of it I'm just typing out the name of the the program the file here and so it should actually activate here let's see what we get welcome to your exploration of the Unix operating system so that's what's inside my message.
sh okay and so if you try to do the same thing with the welcome. txt so let's go ahead and do that with welcome. tax so cat dot dot period welcome [Music] dot text what are we going to get welcome to your exploration of your app as you're going to see the same thing all right um however if I do CD dot dot let's let's just go to CD let's do this LS and there's your welcome.
txt if I type in welcome. txt you'll notice that it changed it says bash file welcome. txt permission is denied because we do not have executable files executable access to the welcome doc text so that's really important thing to know is by looking at this up here when we look at these things here you'll notice that because the welcome.
tex has no executables we cannot just type in welcome. txt we can use cat to see what's inside it but we cannot activate it or execute it okay so that's what they're basically showing you in the first nine ten steps all right now when you go through they're going to actually now go into step 10 where they start talking about the file command this is what is reporting file types so let's try to do this I'm going to go back to CD executable right because that's what they want us to be in they want us to go where we have our message. sh so we're going to type in file message .
sh so if I do this it'll show you that the message is an ASCII to text type file and this is what we're talking about how you can find out what kind of file this particular thing is this is a text file that we have and if I want I can change the extension and move the file to message. doc and rerun the file command all right so they want you to go ahead and do that for step 11. and if I do that and I change that file remember if I change how do I change files let's go ahead and do that if you go back to 311 or you should have your notes you're going to use the MV command so let's see if I can get this going and V and then I want to change message.
sh . sh2 message C I do that correctly you should now have a message doc see that now it's listed there and then what I want to do is sometimes and you look at it all they're doing is they're showing this now if I execute message doc you'll see that it says the same thing as it said message sh all right so moving along so they talk about a helpful tip here unlike Windows Linux based extensions are part of a file name do not indicate a file type they're a conversion to hint at use so again remember that they're not part of it so one of the things that the good practice if you're going to go ahead and do um any type of Linux and you're going to write files good practice if you're being honest or truthful of people as you tell them what is the correct extension at the end because you know that people that are using Windows will use that as well all right so they used sh here we changed the dock because we know it's a document so that's what we did there now another one that they actually show you is what they call a wild card now some of you may have used wild cards when you're looking for things I use it all the time if I'm going into Windows Explorer so if I go into right here into my Windows Explorer File Explorer sometimes when I do my quick when I'm doing a search you'll notice that it says star. adi which means that I'm going to look for every file in this quick access that has the Avi extension does there we see that so using wild cards is actually very very nice if you're trying to find something like maybe you know you did an Excel spreadsheet and you needed to find something in an Excel spreadshe but you can't remember the name that you saved so what you can do is you can do start.
xls and then just search and it'll find all of them and then you can look through them to figure out which ones was you know which one is the ones you want so the same thing applies here so if I'm going to do file and then I'm going to do an asterisk which is what they're doing in step 12. you will see that what they're doing here is they're going to list all of those files now if you see they give you this and they say all right here we go the filemessage. doc is an ASCII to text file and they're basically giving you all of these they're giving you all of the files inside executables and what type they are question.
exe is an elf type 64-bit executable file and you will notice quote of the day is the same thing and then finally trust me is the ASCII to text file as well so they're just showing you some of those things and then they ask you to do the same thing in the pictures directory in 13 I'll let you do that on your own Okay so real quick recall how Windows handles file types return to login machine and open up file explorer so that's what they look at that they want us to go through and do the same thing here so what we want to do is we want to navigate to documents so let's go to documents and then they want to create a text document so they're going to want me to right click type in new and then they want me to do a text document any name will do so let's call this activity three one two just like that change the name okay change the name of your file you just created providing a new extension such as doc you can change the extension you get a warning which is true if I go in here and I rename and I type this in let's do this again sorry about that rename and the very end I type dot doc it'll give me a pop-up well it's supposed to give me a pop-up um as you change the extension you get a warning change your file name it might be unusual click yes this one because it was already a text document probably didn't do that however if I did change this and again we've seen this before maybe what I do is I put dlcx well but still allowing me to go ahead and do that and maybe it's because I haven't done anything inside it I don't know but yep it's just allowing us to go ahead and do this I'm not quite sure why but that's all right we'll just go ahead and Let It Go all right moving along if you look at that's how you change your document names on windows so you can see how the differences between Linux and windows all right so now they're going to go through a security scenario in Step 17 you're going to basically just review what we've done up to this point and then what you're going to do is you're going to move on to step 18.