Ethical Hacking with Parrot OS – From Linux Basics to Exploitation

#Ethical Hacking #Linux Fundamentals #Command Line Tools #Web Enumeration #Vulnerability Scanning #Python Scripting #Programming
💬 Chat with this Video
Ask anything about this video…
Welcome to this hands-on ethical hacking crash course taught by cyber security instructor Declan Middleton. Throughout this course, you will learn the core Linux fundamentals and essential command line tools needed to navigate and audit target systems effectively. From network scanning and web enumeration with tools like inmap, dur search and burp suite to exploiting vulnerabilities and writing your own automation scripts. You will gain practical real world skills. Everything is demonstrated safely and legally inside a local CTF lab environment. So let's dive right in and get started. >> This is power. It's very similar to Ki Linux. Uh not much different really. Uh the only thing that's different is obviously the brand, the color scheme, and maybe a little bit a few more of these tools installed. So there's striking similarities in both operating systems, but again, it really doesn't matter what you use. But for this video and this showcase tutorial, I will be using Power OS for this tutorial. Everything's pretty basic, and I'm not going to really walk through too much of the Linux basics. Uh if you've seen them if if you've seen my basic Linux terminal commands in my other video, you can go check that out. Um but let's just do a quick walkthrough on the basics of Linux again just for those who may not understand. So this is a terminal. Uh a terminal is a this window here. So if you click this, this is a terminal and it's a terminal emulator that emulates a environment where you can navigate files on your system. So for example, if I type in ls, it's going to list the files and folders on my machine. So that's what the command ls does, right? And if I want to change to my desktop environment in the background, I can type in change directory cd. That's what it stands for. CD desktop, the folder name as you can see right here. So if I type in that, you can see I've it says I've changed into this directory. And if I type in ls, there's nothing here. So I can create a folder by typing mkd make directory and I'll just say folder and there we go. You can see this folder here has appeared on my desktop and if I want to remove it I can type in remove remove and then folder and then it's gone. Okay. So by the way this means recursive but it does remove the folder. So anyways that's just the Linux basics. I don't want to really show that again because I've already done that in my other videos. So you you guys you can just search up Linux commands on Google or you know watch another YouTube tutorial or even my YouTube tutorials on the basics of Linux uh Linux commands etc. So you guys can go watch my tutorial on how to do that and you can replicate you can replicate what I've done in my other videos into this video as well because it's a terminal and you can do everything with a terminal. So again, this is a terminal and it allows you to navigate and search and find files on your system as well as run commands and tools on the machine. So if I want to run the popular tool inmap, I can type in inmap and you can see here I can go ahead and type in these commands here to use the tool. So anyways, so the first commands that we should run to ensure that our system is up to date is to run the following commands. pseudo apt update-y which means yes and let's type in and and which is going to be the and operator that will allow us to run a second command. So we can do pseudoapp upgrade like this. So go ahead and type the following commands to run to update our operating system for power os. So it just updates the Linux distribution that we are using which is power OS and it allows us to ensure that all the packages and dependencies are up to date so that the tools are working the Linux distribution doesn't have any bugs or flaws or whatever the case is. It just makes sure that we update everything packages tools Python versions pip versions whatever we're going to use it's going to be up to date. So let's go ahead and run this. It might ask for a password and if it does that just enter parrot if you're using the default password parrot or you've got your own password just enter that and and upgrade it. So you can see here mine's already fully upgraded. So go ahead pause the video do that and then come back to the video once it's finished. And again I would like to address this. If you want to continue learning I have a school community for you to check out. The link is in the description below. Everything in this community is for educational purposes and you can level up have access to these courses which is available within the community. If you want ongoing further learning, these resources will be linked below for you to read and check out yourself. It's a private community and you have access to courses and resources for further learning. Before we get into hacking tools, it's important to understand how to move around the system, create files, manage folders, and read basic command output because this is what you're going to be doing most of the time. The terminal might look intimidating at first. It's just a way to control the computer using text commands. So, I have shown a tutorial before in my Kali Linux video on basic Linux commands, but I'm happy to run through it again just for beginners and people who may not understand too much about Linux. So, every hacker uses Linux because every command that you type in here, this terminal performs a function. It performs an action. So, if I type in ls, you can see here it lists my folders and directories, files, etc. So again, the terminal might look intimidating at first, but it's just a way to control the computer using text commands. In Power OS and most Linux systems, you would use the terminal constantly. So getting comfortable with the basics will make everything else much easier. So the first command I want to show you is ls. So we can see that lists folders, files. If I do ls-la, I can see more detail including hidden files, permissions, owners, file sizes, and dates. If I want to print the working directory, I can also type in pwd, which shows me the current directory I'm in. So, if I change the directory to desktop and I type in pwd, print working directory, it's just going to tell me what like folder I'm in. So, pwd tells me what folder I'm in. So let's say I type in ls- a to see if there's any hidden [snorts] files or folders. Okay, there's nothing here. If I want to create a folder, I can use the mk dur command. So let's create a folder. MK dur, which stands for make directory. Let's call it folder. Folder [snorts] one. ls. There's our folder. Now if you want to see where the folder is, we can actually see here it's on our desktop. Folder one. I can make another one. Go ahead and make folder two. Have you done that? Okay, let's create folder two. There we go. We've got two folders on our desktop. Let's go into folder one. Let's type in ls. Obviously, there's nothing in here. As you can see, if I double click on here, we can see that there is nothing in this folder because we just created it. Let's actually create a text file. So, if we type in touch and then we'll just say uh let's just say hello.ext. Now, if I actually open that folder, you can see I created a file called hello.ext. It's a text file. Now, if I want to edit this file and add something in it, obviously I can open it and do it manually. But since we are going to be working around in our command line, we don't need to do that. We can actually just do this. So, if I type in now, most people use nano. And if you've seen this before, nano is a command to edit the text file. So, I could do nano spacehello.ext. And here we go. I can edit the file. So, if I press enter, I can move down the document. If I press tab, I can move across the document. So if I say hello there, hello there. Thanks for reading. Haha, it's just a text document. Lol. Almao, nothing in Oh, nothing in here. Subscribe. And if you don't subscribe and if you don't subscribe, I'mma hack you. Okay, that was a joke. I'm not going to say that. And by the way, if you want to delete a line, this is what I want to say. Oh, by the way, let me just do this. If you want to delete a line, you can press control K or command K if you're on Mac. Well, I'm also on Mac. I'm pressing control K. Um, so if you press Ctrl K, you can delete a command. Okay, that's great. Now, if you press Ctrl X and then press Y to save it and then press enter. There we go. So, let's do that again. Nano hello.ext. So, we can enter the document. We can read it. Press Ctrl X to leave it. We don't need to save it because we haven't made any changes. Now, you can just play around with that if you want. So, if I type in ls, there's our file. Now, how do I read the file without nano? So, we could do cat hello.ext. So, if you just want to print it in the terminal instead of opening the document using nano, you can just say catello.ext, right? Or any text document. Uh, but you can't do it with folders. Uh, hello there. Thanks for reading. Haha, it's just a text document. Text documents. I put I put an s at the end. Lol. Okay. Anyways, so there's our file. And by the way, if I go out here and I show you, you can see there is our text document. Hello there. Thanks for reading. Now, if I make changes here manually and I save it, you can you can actually see that in here, right? See? So, that is how we kind of navigate around that. Okay. So, let's just take a step back cuz I went a little bit too fast. Okay. So, we created two folders, right? I'm not going to do anything with folder 2. I just wanted to create it so you can get comfortable using these commands. So if I do ls, that's what's inside our file. Now to go back outside the folder, we can type in cd dot dot. So change directory dot dot going backwards. Now you can see we've got folder one, folder 2. So let's just go back into folder one ls. We can use nano to create text files, right? We can also use touch to create text files. But the thing is if we want to view a file, I typically use micro. So nano and micro is similar. It's the same thing, but micro is better because it has advanced features like syntax highlighting. You can even add plugins like customize plugins if you want. But I I typically use micro for doing stuff like this. It's the same thing. You just press S and then you can actually just press control Q. Uh it says, do you want to save changes? I just press yes. Um, so micro is probably probably a lot easier than nano or something like vim. Um, I'm not going to really show vim to any Linux users out there. I'm not going to show vim because it might be too complicated for beginners. Okay, so let's just take a step back again. So if I open up my terminal now, this is what I want you to do. Go to your directory, your desktop directory. Okay, that's great. Is there anything here? ls folder one, folder two. Let's create folder three just to get comfortable. Now let's say I want to remove these two folders here. I want to remove folder two and folder three. So you do this remove and then recursive folder two. You can see there I've only got folder one and folder three. Now let's remove folder three. There we go. We've only got folder one as you can see here. So, we've got folder one and if I go into folder one, we've got that text file as you can see there. Let's remove the text file and let's actually see what it looks like in real time. So, before I run this command, let's actually see if it doesn't. There we go. It disappears. It gets deleted. So, this is the power of the terminal. The terminal is an emulator that you can type text commands in to receive an output to receive whatever the computer you're telling the computer to do. So the terminal does that. The terminal is very useful to type commands, receive an output, and even like run hacking tools and everything else that we'll get into. So that's the the power of the uh terminal, the command line. It's very helpful to navigate through files to run programs in the terminal to see errors or whatever results we want to get or whatever we want to do. So go ahead and pause the video and go back a directory and delete folder one. Have you done that? Okay, great. So let's type cd dot dot. Let's type in ls. So we got folder one. Let's remove folder one. And there we go. Folder one has now been deleted. as you can see. So that's just the basics of the command line. So print working directory, we've got desktop ls lists the files. LS- A lists hidden files or folders. ls space-la let you see more detail about owner permissions of the files or file sizes and dates. As you can see here, you can see the dates of the file, the user and the permissions of that file. So if you press Ctrl L on your keyboard, it clears the terminal. So if you have like a bunch of like terminal outputs and you want to clear the terminal, you can type clear like this, right? You can type clear like that, but I don't do that. I typically do Ctrl L. So I'll do that again. Ctrl L. So instead of typing in clear all the time, clear, you don't need to do that. You just press Ctrl L. Okay. Now, if you ever have access to a Linux machine, but you want to show the current logged in user, you can type in who am I. So, I typically do this in CTFs, the capture the flags. So, if I ever get access to a Linux machine or a Linux box or SSH session, I can type in who am I. I can also type in to show the computer's name. So, I could say host name. So, host name, that's the computer's name. So it would say something like parrot or ki Linux or yubuntu or you know whatever whatever Linux distribution it's running which is very helpful. But if I want to show even more information about the system like I'm talking about version here I'm talking about the version of the the kernel information. So if I type in unnamer r it's going to list and show system and kernel information. Wow that was so amazing right? You probably thought, "Wow, that was amazing." Honestly, that that wasn't really satisfying. But you can see here we've got information about the Linux kernel. Now, what is the Linux kernel? The Linux kernel is the Linux distribution operating system. So, we are running parrot, which we got from the host name command. So, if I type in clear, press Ctrl L. If I type in host name, that's the name of the computer. If I type in unnamed- R, that's the Linux, that's the power OS version of this Linux system. Now another Linux command which is very helpful is to see what network interfaces and IP addresses are on our basically on the system. If you want to see what your IP address is for this machine your computer your parados machine you can type in IP space and then just a so IPA will list. Now this looks a bit scary but just scroll up a little bit. If you see this inet this would be your IP address. Now it says local host right? This is just my local host IP address of course because it's actually shared uh it's sharing my systems address. You can see your IP address information here. Another command to do this would be pseudo if config which actually provides you again the same thing same detail of your IP address which would be here. It would be here. So what I typically do to filter out all this information, so when you see all this information, it can be quite hard to read and it can also be quite overwhelming for some people. So what you can do is type in pseudo if config and then you can do pipe. So this is like this pipe command. You could do pipe and then do grip in net. So essentially what this does, it just filters out that keyword. So, for example, have you ever been on a website and you did like command F, you know, or control F to like find a specific word on a website? This is what the grip command does on Linux. So, let's say I want to just like grip this output. So, I could do this again by doing grip and then um 12, which is just local host, right? So, it just filters out all that information just to find this specific thing here. So I could do grip look for the keyword net mask and you can see that it does the same thing. If I type in L, you can see every any word that includes L in it. So that's what the grip command does. Another command that I want to show you is the ping command. P I N G ping. If I type in ping-h this is going to bring us a help menu to understand how we can use this command. So we can see here again a lot of options. So these on the left is what you call arguments. Arguments allow you to run the tool the way you want it to. So for example, if I use this argument when I run the tool, this is what it does. If I want to use this argument here, I can set this seconds between sending each packet. So anyways, let's actually see what this tool does. So if I type in ping and then you want to get an IP address of something, this command basically tests internet connectivity. That's all it does. So if you want to ping let's say a website to see if it's running or if you want to ping uh your own web server to see if it's running, it basically sends packets like just basic packets to see if it's up and running and it will come back with the result. So for this example, I'm going to use my modem as the web server. Well, it's not a web server. It's basically my modem. it's my router. If my router is running, I can ping it. If it's down, I can also ping it, but it's obviously not going to bring it back a response. It's going to say that the host is down. So, if I type in pseudo net discover, I can basically see what devices are on my network. So, net discover is a command to see what devices are around you on the network, on your current network. So, whatever Wi-Fi network you connect to and you type in net discover, it's basically network discovery. Network discover. It's going to discover all the devices on your network or on a network. And it's also going to supply the information about the IP address, the MAC address, and even maybe the host name. So, you can see there some of them may be unknown. Um, but you can also just like grab it and probably inmap it, which we'll look at later. Um, but here is my modem. That's my modem address. That's my router, which is giving me the internet connection. So, if I do ping 192.168.1.1, uh, it says the network is unreachable. Let's do pseudo. network is unreachable. Why is that? I can see why that's happening because it's not actually. So, this is a perfect example. If I try and ping this, it says network unreachable because my Power OS machine is actually not really connected to the internet just yet. Uh, so I'm not actually connected to the Wi-Fi yet. It says I'm wired, but the virtual machine is actually bridged. Uh, it's not bridged. So, I don't actually have a IP address assigned to my machine because I'm not connected to the router yet. So this is actually the response that you would get if the network is down or if a website is down. It just means that your device doesn't know where to send the packets, right? So this usually points to a missing IP address, a disabled network adapter or a invalid default gateway. So my device needs to know which router to use. Uh basically so I can try and verify my default gateway to connect to. So, if I type in IP route show or actually that's probably not going to be best because if I do if config like we saw earlier, um you can actually see here that it's just local host. So, I don't actually have an IP address assigned to me yet. So, I might need to kind of renew my connection. So, there's a lot of like other network commands that we can do uh to connect to the Wi-Fi, you know, through our terminal, but that's not for this tutorial. I will just do it manually. So, I've got it working. So if I type in IPA A, we can still see that now I have a assigned IP address to my machine of course. Um but this is actually your local host one, right? But if I do pseudo ping 192.168.1.1 which is my router and I press enter now it's going to send packets to the router and it's going to bring it back to see if the router is running. So now since I'm connected properly, the packets are being sent and it's bring being brought back uh giving me the response that okay 64 bytes from 192.168.1.1 is up and running. So it basically sends bytes packets and it receives it back. It comes back to you to give you information if it is running or if it's down. That's just to test the network connectivity. So that is what the ping command does. So you can see there 44 packets transmitted, 44 received, zero packet loss. That is brilliant. So it gives us some basic information about the address ping statistics. That's brilliant. So you can do this with a website or you could also do this with a address on your network. The next command that I want to show you is a Linux command to actually see what commands you've already ran. So, kind of like how you would go in a website or like your browser, right? If you open up your browser and you go to browser history, you can see all the websites you've browsed and been on. The same thing is for Linux. So if you type in history in your terminal and you press enter, you can see all the commands that we've typed in the terminal so far. This is very helpful for us because we can actually when we're on a Linux machine or a device, we can type in history to see what previous commands were running or have been running or ran on the machine. So as we can see here, these are all the commands that we ran prior at the beginning of the video. Now, it's got 723 commands that I've actually ran before this video. Pretty cool, right? So, that's what the history command does. It just shows previously used commands. The next command that I want to show you is a command called man. Man stands for manual. So, the man command in Linux is actually a manual command, meaning you can open up any command with a manual. So let's say I want to learn about how the ls command works better. So you can type in man space ls and it's going to give you a manual list of what the ls command does. So we can see here the name of the Linux command is ls which stands for list directory contents and we can read more about it. It lists information about the files the current directory by default sorts entries alphabetically. So you can read about like more of like ls commands you can run and what the ls command does. So in order to leave this you can just press shift colon and then press q to quit. So let's say I want to learn more about the history command. So if I type in man history we can understand how Linux commands work with the manual Linux command. It's just a very helpful way to understand a command or to understand something on Linux if we do not understand it. So the man or manual command is very helpful because we can learn about other commands better. So I want to know let's say n mapap. I want to open the manual for the n mapap command. So if I type in manual for the mm mapap command, it's going to tell me everything about what the map command does or what this tool is about. So in MAP if we run the in MAPAP command, it's a network exploration tool that probes ports and we can read more about it. So anyways, that's the manual command. If we want to update a Linux operating system to ensure that nothing breaks, we can type in pseudoapp update. Now I did show you this in the beginning. Pseudoapp update basically runs as a pseudo privileged user and then the apt command is a command that updates the operating system. So apt is a package manager for this Linux distribution. So what is a package manager? A package manager manages dependencies packages on the current system or folder or directory. So the apt or apt command is a package manager that we can use to update the current operating system. As you can see here, [snorts] all packages are up to date. That's great. So all the packages are on our system are up to date. All the Python programs, the Python, the Pearl, the whatever else, right? It's all up to date. That's great. So if I type in pseudoapp upgrade. So I want to upgrade installed packages already. I can type in upgrade. But there's nothing to upgrade. Everything is upgraded and everything's updated. So that is all the commands that we need to do. Okay. So now that we've looked at those commands, let's dive a little bit more into files, folders, and permissions. We have already done this a little bit. Um but I want to kind of go a little bit more into detail with you know the types of um ways to not only create these files write into files uh but like copy and move files and a whole other bunch of other commands that I want to show as well. So we already learned how to make a directory. Uh we've also learned how to create a folder. Did you know that you can create a empty file uh using the echo command in Linux? So the echo command is a very helpful command because because we can actually echo something into a file. Um so for example, if I type in ls, let's go to our desktop. So cd uh desktop, we can see there's nothing here. Um but if I do echo and then strings, these are this is what you call a string. So a string is basically where we can um add text into. So in order to add a string you do double quotations. You can also do single quotations but it has to be inside the string here or else it's not going to work. So we could do hello parrot OS and then we can type in notes.ext. So notes.ext text doesn't exist. But essentially what we are doing is we are echoing we are writing this piece of text here into a new file that it's going to automatically create called notes.ext. So if I press enter you can see in the background it has now created a nodes.ext file. And if I type in cat we can read the file. I I put js I mean text. There we go. Hello parrot OS. So that is a very helpful command because if we want to instead of doing everything manually where we have to drag something and copy it and then go back to the file and open the the text file and paste it, all we can do is just type an echo and then paste whatever you want to paste. It could be a very long long long thing. It could be like a long as uh string here that you can just echo straight into nodes.ext. And also if you want to so you can see here it says hello par. This is the top text, right? But if you want to add another line, you can do this as well. So if we do nodes.ext, we can see there it's added it on the second line. Um, so if you want to change the first line, uh, let's just clear this. Let's do echo. So cat note.ext. So that's what it shows there. If you want to remove the first line and add something else, we could do echo removed the first line nodes.ext. So make sure that you have a single uh write operator here and then if you press enter you can uh cat the file you can you can see that it removes the first line and second line uh that's amazing. So yeah echo the echo command is very helpful because it creates a new empty file with data which is a string which is text into that file which is very helpful because it writes that text into a file. Uh, another helpful command is to let's say that we want to copy this file. So, instead of doing this, what most people will do is literally just like rightclick this and copy it and paste it to create another version or like a copy of this file. Instead of doing it manually, what we can do here in the terminal since we have the file here displayed already is we can say cp which stands for copy copy the nodes.ext file into a new uh nodes.ext file. There we go. So now you can see there is two text files that have been created. And if I do notes.ext, you can see that's the first one. And if you want to see the second one, you just do cat new nodes.ext. And you can see you can echo something new into the new nodes.ext file and cat it as well. You see that? It's different. Pretty cool, right? So, let's go ahead and uh delete these. Now, by the way, if you want to delete more than one thing, this is a very helpful command. Let's just say that there's so uh many like text files, right? Let's just say that there's like a bunch of text files. Um, in order to remove all these text files or to remove all these files in a directory, we can type in remove dash recursive. Uh, what is the we can type in remove recursive recursive force or I like to simplify it by saying remove fully to it's easier to remember. So remove remove fully. So recursive it tells the command to go into the file or take the file and basically remove everything to do with it. and force is it just ignores like the permission of the file or whatever. You just force delete it. So that's what it stands for. That's why I say remove fully um because it's just a lot easier to remember. So anyways, let's say that there's a bunch of text files. I want to remove all these text files, specifically text files. Be very careful here because it can be very dangerous. But if you put this asterisk, I think that's how you say asterisk. Oh, what is it called? I just Okay, let's just say star. Can't even say it properly. So if we put asterisk, do not press enter. Please do not. Do not do not do not. And if you accidentally did, press Ctrl C quickly. Um, but anyways, this is very dangerous because it can actually like delete your whole operating system. Like I'm just talking about the Linux operating system. It can delete stuff. Um, so we we don't want to do that. What we want to do is uh remove remove fully asterisk and then uh text. Um, so it specifically removes any file uh associated with the text file type. So uh and by the way this if you were to do this without it and you were to run this you still need to have permission to run it. You can't just delete everything automatically. That's why we are not a pseudo user. If we were the root user uh basically meaning if we were the administrator uh and we accidentally ran this by itself it would delete the whole system um the whole kernel which is very bad. But that's why we are not a root user. We are just a default user here running remove uh recursive forcefully or remove fully uh specifically removing the text files. So if we do this, there we go. If I type in ls, you can see all the text files are gone. So it's a helpful way to instead of deleting things manually, you can just type in remove remove fully and then the star.ext or anything. It could be js. It could be dot whatever or it doesn't even have to be that. anything that's ending with a specific number or letter, it can just delete the whole all of them. Right? So, it's a very helpful automatic uh way to delete everything that you want to delete. Now, I've just created a uh rename me.ext file because we we're going to rename it. So, the way that we can actually rename uh this text file, basically moving it. So, if we type in move, this is basically the move command. We can move the file to a different directory or folder, but we're not going to do that. Instead, we're just going to say rename. And by the way, uh, one helpful thing is if you don't want to type this out fully, you can just type in the first couple of like characters here, letters, and then press tab, and then it automp completes for you. So, if you have like a long like folder name file, you can just press tab automatically, and it already autompletes what you're going to type, which is very nice. So, move this file to, and let's call it something else. uh new name uh text. There we go. So, if I do ls, you can see it changed its file name, which is very helpful. You can do the same thing with folders, too, by the way. But anyways, let's delete this. Uh let's just do remove new name.x. Brilliant. Everything is looking good. This is such a good tutorial so far. Please do not forget to like and subscribe. Anyways, let's continue. So you can see here I ran ls to list all my main folders within my home directory of my user. But a very helpful command to see like a file type or whatever we can run this command called file and then add a file name to understand what type of file it is. So if I type in for example this this is a python file. Uh this is a Python program called Penelopey um which I'll get into a little bit later but it is a py file. It's a Python file. So we can actually run file and then the file name to understand what type of file it is. So we can see here the file name and it says here that this type of file is a Python script. So the file command is very helpful on Linux because it can help you identify the file type if you do not know what it is. Sometimes the files or just regular files that may have been created does not necessarily have to have a text file type. So if you want to identify what type of file it is, you just use the file command with the file name uh of whatever the file is, right? to [snorts] identify it. Now, another command that we can take a look at is let's say if I go into this directory here, I got to make sure it's capital live py. So, this this is like this is just like an exploit thing uh for a vulnerability and an application that I did for a CTF lab. In this video, I'm just going to show you this command called uh du. Right? So du basically shows the folder or file sizes within a current directory. So du-sh with the asteris asteris or the star symbol. We can actually see it lists all these files. It lists all the files and folders and text files and it tells us here on the left side of the screen of the terminal the size of the file or the sizes in the current directory which can be helpful in some cases. So, DU stands for disk usage and it's basically used to estimate and display the amount of disk space used by files and directories on a Linux system. It just helps us identify which files or folders consume the most space. Now, I've got a hidden text file somewhere on this Linux system, but how can I try and find this hidden text file on my Linux system? I don't know where it is. It's going to take me forever to find it. You know, I would have to browse it manually to find it, right? No, I'm just kidding. You don't have to do that. What you can do in the terminal is use this command which is very helpful. You can use this command on Linux called find. Find basically finds the file. So in order to use this, you have to specify if you want to search the whole system. Um if you know the file's name, you can try and find it and it will locate it in a specific directory on the system automatically for you. So in order to use this find command to find this hidden file, we have to search through the entire system. So we could do something like find slash and then the name of the file which was called hidden.ext. So if you already know the name of the file, that's very helpful because then you can find you run the find command. Search through the entire search through the entire system with the name that you've provided to search for this file. Now if I run that, you might see a bunch of like other stuff. It's going to say permission denied, permission denied. It's basically searching through all these directories and folders to find that specific file name. And uh unfortunately it doesn't look like we actually found it. Obviously we don't have permission. So maybe we should try and run as pseudo. And let's see if that makes a difference um at all. So let's try again but with pseudo meaning we have root privileges to search through the system to find this file name. There we go. Look at that. Here's the hidden.ext file. It's in the opt directory. Let's type in cd / opt optional directory ls. There it is. There's the hidden text file. Is there anything in it? Yes. It says subscribe. And again, I would like to address this. If you want to continue learning, I have a school community for you to check out. The link is in the description below. Everything in this community is for educational purposes and you can level up have access to these courses which is available within the community. If you want ongoing further learning these resources will be linked below for you to read and check out yourself. It's a private community and you have access to courses and resources for further learning. We're going to do something a little bit exciting here. We're going to take a look at a little bit of some uh bash scripting which I'm pretty sure you may or may not be familiar with. So there's a thing called Bash, right? And it's basically a Linux scripting language. It's actually just a regular uh scripting language or programming language that you can use to basically automate stuff. Pretty cool, right? So, um, let's actually go ahead and just remove this hidden file, uh, off my, uh, out of my optional directory. I don't need it. I'm going to go cd back to my home directory and back into my desktop directory. Um, so we can do some stuff. So, now let's create a file called uh, let's just call it program.sh. So, we're just calling it program.sh. Uh, it's just a regular program. You can call it whatever you want, right? You can even just call it script, right? So, let's just create a basic script here. Okay. [snorts] Or or let's just do Yeah, let's just do script. So, we've got our script here, script.sh. Now, let's go ahead and edit this file uh to add some bash code. So, the really cool thing about bash is that we can do uh a lot of things. Basically, we can automate things. We can automate stuff. We can even automate commands. So instead of doing everything manually, we can just add or program a script to do it for us with u basically bash. So let's say that we want to list a file. So we could literally just do ls- a, right? And just save it and then press q. You can also do that with nano if you want. So if I do catch uh script.sh, we can see we've just got this line uh this this command here ls- a uh in this sh script. Now we can go ahead and run it by doing this uh dash oh sorry dot slashcript.sh or you could do bashcript.sh permission denied. Okay. So this is exactly what I want to show you. So if this happens to you it's because the file type this file is uh doesn't have the permissions to run. So let's give it permissions. So the way that you do this is you basically do chod where we actually change the permission or the common permission for executable scripts. Uh we could give the owner which is the user um read and write access right? So we can read it, write it, run it. Um so we could do chod uh 755. Uh there's specific codes that you can use. So you could do 755 777. uh we're just going to do 755 with the script name. So if you do that and now if you run it dot /script.sh sh. Now you can see that it successfully listed the files uh within the current directory which is literally just that right so let's go ahead and edit our script so it basically automates this by running the command that's in here so if we want to like let's say hm let's let's do this so we've got the script right but I want to create five or seven folders here on my desktop just to show you you can just you can just do this make directory folder one or just do folder one and then folder two folder Now, by the way, you don't have to do that. U there's other ways to do that, but let's just say make folder 2 blah blah blah. Now, let's save that. Now, let's go ahead and run it again. There we go. It created two folders automatically for us. So, bash scripting is very helpful because we can actually uh script stuff or add uh Linux commands within the bash script to basically automate uh what we want to run. It doesn't have to be Linux commands. You can actually write bash code, bash scripting to actually script it. So I found this devdocs.io/bash io/bash which is basically a it's a website where you can read more about the programming language itself right you can actually search up any uh programming language here it could be Python you have to change in the URL so it could be Python it can be JavaScript whatever but look we are just taking a look at bash so documentation is important what is documentation documentation it's everything to do with the programming language it's like a manual this is like the bash Bash manual page for learning about the bash programming language or scripting language uh to understand it better. So we can go to any of these areas and actually look at what is all of this about. So shell syntax is when this shell reads input blah blah blah. So you can read more about it. Um but we can actually look at the bash code itself. So you can actually see some bash code. Um, we can even take a look at what we can do or even uh write some basic bash scripts here. By the way, you got all these bash commands. By default, Linux uses bash. Anyways, so for example, let's go to this link here from W3 schools where we can learn more about bash. You can see here we've got some basic stuff here like this example using variables. So, some basic bash scripting here. I'm just going to go ahead and copy that. Go back to my script here. I just copied those examples from W3 schools. Um, but you can actually go ahead and uh just take a look at the basics if you want to search it up. But we can see here this is just some basic bash script here. Um, so we can actually see here we can assign a value to a variable. Um, this is just a basic if statement. An if statement allows you to basically when you run a program it goes like so if the function does this then echo this or do this else if it could do this an if statement is really cool which we'll dive into in this video uh with Python not so much with bash but bash is very uh a good way to script and automate stuff as well. So obviously this is number 15. Number is equal to 15. Uh if the number is greater than 10 then echo number is greater than 10. We've got this little script here uh at the top. We've got variables here at the top. So we got a variable is just a stored value. Right? So a variable holds data holds a value. So we can call a variable anything. It could be called anything. So for example, this is a variable called name. name is equal to a string uh which is world. So this could also be anything test, right? Um echo hello name. So it's just going to echo hello and then the variable which is this hello test text. Um let's actually change this say hello Declan Middleton. If I go out and I run the script, uh, it says command not found. Okay, so we've got an error. Okay, let's take a look. Line three, line 8, line three. It's probably this. Yeah, there we go. So, [snorts] you got to remember, you got to make sure that this doesn't have any spaces here. Okay, there we go. So, now let's run it. It says hello Declan Middleton number is greater than 10. So you can do whatever with bash. Bash is very helpful. You can add a bunch of Linux uh bash commands in here to run multiple folders and files. Uh you can even store your scans or outputs into files. So you can write a bash script that automates repetitive tasks like scanning or creating files or folders in a specific directory or moving stuff around. So you just manage system operations in this Linux environment. Now in relation to hacking of course we can use bash scripting to automate security tools. We can run security tools and perform security testing using bash scripting so that we don't have to repetitively run the same command over and over again you know. So this is just a example beginner bash script. I just got cooking here. So, basically what this bash script does, it just does basic recon uh on a specific target. It could be like an IP address which checks to find common ports and things like that. So, it could just be a URL, but you can see here it checks to see if the target is online using ping like I showed you in the beginning. And you can see I'm using if conditionals basically saying, well, if the target is online, then echo online. else if the target is not online please print on the terminal or echo on the terminal that the target does not respond to the ping uh basically the target is not online we can also check for common ports so I've added this here a list of ports to check through and so basically with this ports variable for every port in ports checking this variable for every port that's in the ports all of these ports uh run this command so that's what it's doing it's running this line of code and then if a port is open. If any of these ports show here that it's open, then echo open port and it displays the port variable and echo checking HTTP headers. Uh, I'm not really going to do that. So, let's just delete this and just say, you know what, recon. So, like I showed you in the beginning, let's remove uh folder. I'll just say remove uh fold folder one uh folder two. Now I want to call this script. Now let's use the move command. Move script.sh to recon.sh. So it's just renaming it. There we go. Now it's renamed. So it's a recon script. So we're going to run recon.sh. Enter target IP or or domain. Um it's just IP. So, we could just let's just do my router. There we go. It's going to do a ping request and it's checking to see if those if there's any ports that is open. And yes, there is. Look at that. So, port 53, port 80, which is running a HTTP uh web server. So, that's very nice. It's running HTTPS. We've got port 8080. So, these ports are open uh which we'll dive into later about ports. So a port is just a open service. That's all it is. So it could be a website server running. Basically ports have specific numbers associated to that service. So for example, port 80 and port 8080 is associated to a web server. Port 53 is just basically the domain name system, the DNS. So right now all of this information here is just to tell us that a website is running on that IP address. So if we actually go to that IP address, uh it might show a website on that port. So pretty helpful. So again, this script does not do anything advanced or malicious, but it simply demonstrates if I go back to recon.sh, SH. It just demonstrates how simple a script can automate something so repetitive like typing in like for example the ping command or endmap command, you know, but you want to like loop through all the ports and check to see if it's open, you know, you can use bash scripting to automate stuff to reduce the amount of repetitive tasks that you do as a ethical hacker. checking if a host is online, testing testing ports, viewing HTTP headers. Uh tools like end mapap do this much better, but writing a small bash script helps you understand what's happening behind the scenes. And again, I'm going to say it again, it's good to automate stuff as well with bash. By [snorts] the way, you can also do the exact same thing with Python, which is what I recommend because Python and Bash is pre-installed on every Linux system, including Mac OS. So, that's great. Let's save that. Let's quit it. Let's clear the terminal. Ctrl L. Let's list it and let's uh remove it. Recon.sh. Pretty cool, right? So, that was that. So a command that I want to dive a little bit more into is the pseudo command. So pseudo is pseudo is a command to become a privileged user. So like an administrator. So for example, if you are on Windows and you open something at administrator, it means it's the highest user on the system. So for example, you can see I'm just basic user. But if I do sudo and then sue, it opens a root shell. So we can see now we are the highest user on the Linux system. And you can see this is the basic root directory for the root user. So the main user is separate from the root user. So if I go back to the home directory, let's go back to my user directory because this is my user folder. But now as a privileged user, as the root user, we can do a lot of things. But you got to be very careful because the root user, you know, you don't want to accidentally run a command and it destroys everything as the root user. Uh because this is the highest user on the system. So if you want to exit this root shell or this root session, you can just type in exit and then it just exit that user. What if you want to create another user? Well, we have to be pseudo to do that. So let's do pseudo sue. Let's become the root user. Let's actually add another user. So if I go back a directory here, you can actually see that there is no other user but user. Wow, that's amazing. But now let's let's create another user by using the add user command. So if we type in add user and then the name of the user, I'll just say student because you're watching this video and you're learning from it. So if I do add user student, we create a new a new user account for that user. But we also have to create a password for that user. So we can say let's just say password 1 2 3. And by the way, it's not going to display it, but if you press enter, it will work. So password 1 2 3. There we go. It says enter the new value or press enter by default. So we can add our full name, room number, workphone, home phone. So this just stores on the Linux system. You don't actually need to include that. Uh is this information correct? Yes. So there we go. So if I type in ls, it's already created a new user for that user. So because if I go to student now, it's created a default user for everyone for that user. So that user has their own desktop, their own documents folder, their own downloads folder. Everything else it's associated to that user and that user alone. So, let's go back. We've got two users. We've created a user by using the add user command, which is cool. And by the way, if you want to give it a practice, you want to give it a go, just pause the video and create another user if you want to. Now, the password for my other users's account, this one here, is just password 1 2 3. But let's say that you want to change the password for that user. So we can use a command called password or password. It's literally just like this uh pass WD password. So we need to do pseudo password and then the user's name. So we can say student in this example. Now we can add a new password. So let's add a new password. Let's say test 1 2 3 test 1 2 3 password updated successfully. So it's no longer password 1 2 3 because if I if I try that if I want to switch that to that user and I do Sue. So Sue is basically switching to that user. So Sue uh student now I'm that user. Pretty cool right? So if I go to directory we can see everything about it. I'm this user. Now, if I want to do uh pseudo sue, it's going to say password. And if I do password 1 2 3, guess what happens? It's not going to work. Look, watch. Sorry. Try again. Okay, let's try our new password. Test 1 2 3. Oh, you can see. So, the password did work, but I can't become a pseudo user because I haven't given this account pseudo privileges. So if the student tries to become the administrator or the root user of the Linux system, they cannot do that because I need to add them in the pseudo file so that if they run the pseudo sue command, they can become the root user. So they don't have permission to do that. So anyways, I've typed in exit and now we are back. This is pretty nice. This is actually pretty fun to do. Now let's say that we want to add that user to the pseudo group so that the user can become root if they type in pseudo sue. So we can say pseudo user mod- a g and then pseudo student. There we go. So if I do if I switch to that user as you can see I'm this user now. And if I try to become the root user, it's going to say password test one, two, three. Yes, I am root now. Look how amazing Linux commands can be to switch privileges, to switch permissions. It's amazing. Linux is very flexible in the way that we do things as ethical hackers. Now, the final command, let's delete the user. So, how do we do that? Do we just delete the uh directory? I mean, the directory can be deleted. Um, but the problem is it's not going to remove the user, so that's not going to work. Um, deleting the folder is not going to work. It's still the user is still on the system. Um, so the way that we can do that is type in pseudo dell user. So, delete user and then the user's name. So, we can delete the user completely. And we can also add another command but I'll just do this one first. So pseudo delete user student right and I'll say and and like run another command uh let's do pseudo dell user student pseudo which basically will remove that student's privileges after they are deleted completely. So we can see the reason why it's not working is because we are already the student. You see that we are already the student. So let's go out of student and let's try that again. So let's try pseudo d user student and pseudo dell user student pseudo. The user student does not exist. User student does not exist. Okay. No, that's great. That's brilliant. So it did do it. Okay. That's that's good. It worked the first time. So it did delete the user, but the problem is the fold is still there. So we can actually just delete that manually. Um, so we can just say remove uh remove fully or whatever terminology you want to use. Remove student that removes the folder. So yeah, there we go. Pretty amazing, right? And again, I would like to address this. If you want to continue learning, I have a school community for you to check out. The link is in the description below. Everything in this community is for educational purposes and you can level up have access to these courses which is available within the community if you want ongoing further learning. These resources will be linked below for you to read and check out yourself. It's a private community and you have access to courses and resources for further learning. Let's go exit so we don't mess around with root. And uh yeah, there we go. That was that was basically the basics of adding a user, deleting a user, switching permissions for the user. So, we're getting familiar with Linux now. This is great. We're getting familiar with Linux and how it operates and how it works. We added a user. We deleted a user. We added a user to a group. We removed a user from a group. Now, one more command I want to show you. I don't want you to run this, and I'll show you why. So there's a command that you can run called please don't do this. If you type in pseudo reboot, this will reboot your whole operating system. So it doesn't delete anything. It just reboots your computer uh your Linux distribution, right? Not your main computer uh because we are inside a virtual machine, but it just goes ahead and reboots the system. So that's all it does. It just reboots the Linux kernel. So if you type in pseudo reboot and if I press enter, it's going to reboot as you can see. So it's going to go ahead and reboot. It just went black. Okay, you can see UTM is now showing. Um, so I just rebooted uh everything like the whole operating system. So I need to go back to my Linux uh DRO here. As you can see, it's going to show up now. All right, we are back. So it it fully rebooted. That's amazing. So yeah, that's it. Just restarts the system. Uh so we learned quite a bit so far. Now let's continue by taking a look at some ethical hacking and penetration testing tools that you may use in real world security testing. We'll go through each tool in this order and briefly explain what it does. So these are the tools that we are going to be taking a look at. So the most obvious one is inmap dur search fto whatweb search burpuite and just python. So, first I'm just going to briefly explain what these individual tools do before we start taking a look at it into more detail. N MAPAP is a network scanning tool used to discover hosts, open ports, running services, and sometimes service versions. What this means is is that when you use the tool endmap, you can scan an IP address of a particular host and it will bring back information of software on that machine that is running on that machine with the service version of that software. And the reason why this is so useful for us as ethical hackers is that we can search for vulnerabilities in these versions. Dur search however is a web content discovery tool. So end mapap is a network scanning tool. Dur search is a website testing tool. It finds common directories, hidden directories, files, admin panels, backup paths or other links on a website. This tool called fuff, which actually stands for fuzz faster, you fool, is actually pretty funny. FUF is commonly used for web fuzzing just like how dur search does it but fuff can actually go into more detail on brute forcing specific requests or parameter discovery which we'll dive in a little bit later. Nectto is a website vulnerability scanner. So it does everything similar to what DUR search does. But Nikto actually checks for outdated software or files that is misconfigured or if there's any security issues on the website associated to a version of a plugin or software or whatever that the website is using like an outdated PHP version. Necto is going to provide us information on this vulnerability or on this security issue. So, Nectto is very good at finding these flaws on a web application. So, Nectto is a web vulnerability scanner. What webe however is a fingerprinting tool. Uh, what web is a tool used by ethical hackers to identify technologies running on a website. So, for example, if you type in what web and then a website name, it's going to provide you information about that website, about what the website's using, uh is it using PHP, is it using JavaScript libraries, is it using uh frameworks or CMS platforms, plugins, it will provide you that information. Search let you search for known vulnerabilities that is public. So you can find public exploits for a vulnerable piece of software using search exploit which allows you to search the exploit DB database from the terminal to find known public exploits for vulnerable software. Burp Suite is a web application testing tool or software used to intercept, inspect, modify, and replay HTTP requests between your browser and a website. We'll dive into this a little bit later. And last but not least, it is Python 3. Python is installed basically on most systems, but Python itself as a scripting language is really good for ethical hacking, for scripting, automating, exploit development, passing data, and building custom security tools. So, without further ado, let's go ahead and let's start with end mapap. Let's go ahead and try this out. I've got a vulnerable machine running on my network. But the first thing I want to do is help you set up your vulnerable web server machine that we are going to be doing in this course. So the machine that I'm going to help you set up is going to be this vulnerable web machine. You can set this up by downloading it from the link in the description. You can either use virtual box or VMware to run this vulnerable web machine and this machine is called explorer. So we are going to use a public intentionally vulnerable vulnix CTF machine in a local lab environment. This is completely safe and legal to do because it's a capture the flag machine. Its whole purpose is to be hacked. It's to practice your skills as a ethical hacker to identify security vulnerabilities in a vulnerable web server website or machine. So, we're going to set this machine from Volux called Explorer. We're going to download the VM and set it up in Virtual Box so that we can actually continue with this video. If you just want to continue to watch the video without actually participating, that's completely fine and you can still learn by doing that. But if you do want to follow along and download the machine, you can continue to watch what I'm about to do next, which is show you how to install it and set it up. By the way, the credit goes to the person who made this vulnerable machine for us to learn from. This is for educational purposes only. I'll leave a link to the Volix machine in the description below. If I did not link it, please remind me in the comments to ensure that I've linked it. All right, let's continue. So, as of right now, I am on my Windows 11 machine and I've just downloaded the Explorer virtual machine that we will be basically hacking into. So, we can see it's downloaded and I've got Virtual Box right here uh with Power OS, but I'm not going to need this because I'm not uh doing Power OS on here. I've got Power OS on my M1 MacBook Air uh using UTM. Okay, so we've already set this. Um so, what we can go ahead and do is uh open this file. Uh we I don't think it's exported. I don't think so. Yeah, you can see there it has not been exported. What I can do is just copy this, go back to my folder, paste it in, and copy the file, the OVA or OVF file that I will open here. So, you'll see now. Okay, zoom in. So, this Explorer one is the one that we want to open. So, we can just double click this and that will go ahead and import it into Virtual Box for us to do uh the machine. So, let's go close that. There we It says importing appliance. And so that's going to go ahead and import it. There we go. Uh let's go to settings really quickly on the Windows machine. Let's go to settings here in the virtual box manager. Go to network. Make sure that it's bridged. Uh which should be automatically by default. And uh there's not nothing else to change. Uh yeah, there's nothing else to change. So you can just go ahead and just double click it. Just run it. Or you can click it and press start. It's powering up the virtual machine instance. So this will be on our local network. You can see you can actually have to change the network adapter uh just in case. Uh by default this would not happen to you. Uh but it's because I have to actually select it through the virtual editor which you can see the adapter type which I'm already using. Um so this won't happen to you. Uh invalid settings detected. I'm not sure what's invalid. So, I've just realized why this isn't actually setting up properly on Virtual Box and it's not actually configured properly during installation. So, I guess some of or whatever packages weren't installed properly wasn't configured with Virtual Box software. So, what I might need to do quickly is just completely uninstall uh Virtual Box. So, I'm going to go ahead and uninstall Virtual Box completely. Just going to go ahead and uninstall it. So, I'm just installing Virtual Box again. You can see here I'm downloading the latest version. Okay. So, let's go ahead and run this. It's the same same flow. So, it's it's not going to be hard to do at all. You can see here. Uh I can accept the terms and conditions blah blah blah. Go next. It says warning network disconnection. That's fine. Um, missing dependencies. Okay, so this is exactly what the core issue was. So, all you do to fix this issue is just download the latest Python version uh for on their website. Just go ahead and run the Python installer to install Python. Uh, launch ready and ready. Yeah, let's do that. So, it's going to go ahead and install Python. There we go. Done. And now we can use it. Add to your path. Yes. Uh, install C Python. Yes. Okay, there we go. So, it's installing the latest version of Python. View online help. No. All right, there we go. So, now it's installed. Um, okay. So, I guess we might need to install this package here called Win32 API, which we can do in cmd uh command prompt because it's installed. So we can do pip install pi win32 and this is going to install it globally on the system meaning uh it's going to be able to work. So you can see it says downloading installed the packages uh it says warning the scripts blah blah blah uh which is not in path consider adding this directory in your path. Let's just see if this works. If it doesn't I'll add it in my path. Um so we can just decline this uh and just click finish. Let's run that installation again with virtual box. It's actually good that we actually going through these errors just in case if anyone actually goes through these errors uh just like how I am uh because then you can actually see how I fix it. So yeah, let's go next. Install uh hopefully this will fix it uh because we have installed the packages needed uh for Oracle Virtual Box software. You can see there it said installing network driver. everything to do with uh network connectivity. Uh Oracle Virtual Box has now been installed. Uh so let's go ahead and finish that off. I don't think we need to import the virtual machine again. Uh but if we do, we'll do it. That's fine. Uh we can actually go ahead and uh well, we've got the Explorer uh machine downloaded. So we can just close this tab. It's on our computer now. So I'm just waiting for the uh virtual box to open. I'll just click it again. Okay, there we go. So it is now open. And uh you can see there it says aborted. But if I click settings, hopefully this would have fixed the issue. Yeah, look at that. It says invalid settings. Uh you know that invalid settings option is not there anymore, which is good. And also it opened twice cuz I clicked it twice. Okay, so let's go ahead and run it and see if it works. Powering VM. There we go. It is now successfully working. running the vulnerable virtual machine that we will be attacking and learning from in this course. This is a safe legal environment for you to practice your ethical hacking skills in. So, this is just one virtual vulnerable machine that you can download and try out. So, you can see there we've got the IP address of the machine. That's our local host, but it's going to assign an IP address to this virtual machine, which you'll see it change now. and then we'll know what IP address we can map scan uh on our power to OS machine. Uh just keep in mind it might take some time to actually uh assign an IP address. Sometimes it takes a little while, sometimes it's instant um depending on how I don't know what is happening. So I think I don't know if that's another problem. Hopefully not. Um let's have a look. So, if we go to network, uh, yeah, so everything's, yeah, everything's actually using my correct or actually, no, it's not. Um, I have to select this one because it's my specific adapter. Uh, yeah. So, make sure that you select your adapter correctly. So, you can just click okay. Um, I don't think it's going to change it now. We might need to reboot it. Um, so let's go ahead and do that. Power off the virtual machine. I I I do apologize if this is really timeconuming, but this is a necessity. So, let's go ahead and run it again. Uh, there we go. So it's powering the VM up again and uh now we should actually have a assigned IP address to this virtual machine. Uh which is pretty simple and straightforward. So you can see it's loading the Linux kernel uh the DBN machine which has all the uh vulnerabil uh vulnerabilities. Uh it could be a website application u whatever the case is. There we go. We've got 192.168.1.56. So there we go. It has assigned an IP address uh for us to basically perform enumeration uh port probing and even you know investigating whatever this web server is running. Uh and by the way you can also you can also install power OS alongside your Windows machine here as well with virtual box or VMware uh to also try it out. So it's the same method. All right let's get back to our power OS machine. Let's open up the terminal. Now let's apply what we've learned so far in this course so that we can understand what we need to do and how to do things. So the first thing I want to do is to ensure that the host the vulnerable web server that I will be hacking into in this course is actually live and running on my local network. So ping 192.168.56. Yes, it is up and running. That's great. So now this is a good start. Seven packets transmitted. That's amazing. So that's great. It's up and running. We can start doing the MAPAP scans. So to start off with N MAPAP here, we're going to say NAPAP-H just to get a understanding of the help menu manual here uh to see what types of scans we can do. So you can see the basic examples down here. But what I want to do is let's just start off with some basic MAP scan. So we could do this. So we can type in MAP1 192.168.1.56 which is the IP address of the target machine. And we can just press enter. Now when you press enter, it's just going to go ahead and scan this IP address to see if there's any ports, services or software that is running on this machine for us as an ethical hacker to gain a better understanding on what we can leverage from. So right away we got two ports that is open. We got port SSH and port HTTP. So port 22, port 80. 80 is a HTTP. And we can see here that what what is HTTP? It's a website. So right away when we perform the MAB scan now we understand that on this machine there is a web site running. So it's running a web server. The website is hosted on the web server and we can actually go to this IP address with this port number and there will be a HTTP website to take a look at. So let's do that. So if I open up my browser and I go to 192.168.1.56 uh on port 80 colon port 80. Just type in that. There we go. It works. This is the default web page for the server. The web server is running but no content has been added yet. So, we're going to take a look at some other tools like that we've spoke about like dur search to see if we can do some directory scans to see if there's any other, you know, files or directories or other webs uh other web pages on this website application for us to take a look at. But what I want to focus on is strictly on MAPAP just right now so that we can better understand the types of scans we can perform to get more information about it or just better scans to do really. So, let's go back to our terminal with end mapap. Honestly, in MAPAP is the greatest thing that's ever been around. Okay, so that was pretty basic. All we did was literally just type in end mapap and then just the IP address. Now, these types of scans is really basic of course, but what are other scans that we can do to this IP address? Well, we can do types of service scans. So we can do like nm mapap- sv and then the IP address which will allow us to perform service version scanning. So it just detects service versions like the version of whatever service is open. So it helps us better understand, you know, if we copy that service and we search it up on Google, we might come across a a vulnerability or maybe some sort of like a metas-ploit module or other script that we can do to enumerate it or maybe even gain access to it. So nmap- sv this is an argument which we supply to the MAP tool with the IP address. So if we run this, it's probably going to not really give us a version. Uh maybe it's going to give us a SSH version. It's probably going to Yeah, there we go. So, we can see right away this type of MAP scan has provided us a version of what SSH is running on this box. Uh it even tells us that it's a DBN Linux machine. And as for HTTP, it's using HTTP 2.4.65. So, it's really helpful to actually use these types of scans to better understand what we are looking at when we're doing a penetration test. So, yeah. So you can do map- sv with the IP to get service version to understand it better. And uh if you just want to like if I do -p and then just type in the ports like if you if you know your port numbers if you know your port numbers you can just type in the ports that you want to specifically um select to find to see if any of these three ports are open. So basically what I'm doing is is checking custom ports. So port 22, port 80, port 443, port 443 to see if any of these three ports are open. Now obviously we these two ports are open. Uh port 443 however is not. I can also do 8080. You can be very selective here. You don't have to add these. And by the way um I'll show you a different scan that we can also do to scan all types of ports. So that's going to go ahead and run and also provide us with the service information. So we can see here I've just added these ports to the list to see if it is open. So 443 the state of this port is closed because it's not a HTTPS website. It's using HTTP which is a insecure uh website application because they didn't have SSL uh certificates. Port 880 um that's closed. So it's just a HTTP proxy but that's closed. So port 8080 can also be a web server which is also running um similar to port 80. In this case there is nothing here. And by the way I think what I want to do really quickly is instead of typing the IP address out all the time we can actually see the name of the machine here. It says explorer.hub. hub, right? And then here's the this IP address associated to this name. So explorer.hub. What I want to do is is just copy explorer. Um I think I've already done this. So if I if I go to pseudo micro etc hosts. So go into this file configuration file. Um it looks like it's empty. Why is that? My terminal isn't responding. Let me close it. I don't know why that did that. That's weird. Um let me just have a look. Cat etc host. Okay, so I haven't done it. So, what I want to do is just edit it really quickly. Uh, pseudo micro etc hosts. I don't know why it does that. That's so annoying. Hang on. I'll use nano. I have to use nano uh [snorts] etc host. All right, let me quickly just fix this. Let me delete these ones. Uh, controll K. Get rid of those. So, add the IP address of the machine at the bottom. So, 192.168.1.56 and it's called Explorer. Think I spelled that correctly. Explorer.nyx, which is just you can add it as a custom domain, right? You can even do.io or whatever. It doesn't really matter. I do nyx because that's by default the vulnix machine. Vx. So I just do nx nyx. And then I just press controll x uh yes. Press y press enter. Now it is save as you can see there. So what this basically does is if we go to this URL now, it's actually just going to load the domain. So that this is the IP address. This is the domain that we've just added. So it's just easier to copy and remember. So if I actually go here and paste in uh this address like this explore.nyx like this, you can see now that it's literally just using this as the domain pointing to this IP address. So this is remember this is on your local network. So, no one can actually go to this domain because it's in your your hosts file which is only localized for you. All right, let's clear that. Let's close this. We're not going to do anything there. We're still doing MMAP scans. So, if I go back to the MAPAP scans now, we can just do this explorer NYX. And it'll still do the same thing because it scans the domain, it scans the IP address, it knows what it's scanning because it's in the etc hosts file. So, that's great. Uh so another scan that I commonly do is S C and then obviously SV. And by the way you can also do it like this for shorten. Um so you can do SV and then explorer get rid of the HTTP. So basically what this scan does the - S just runs basic like safe scripts. So, NM MAPAP has like script modules that you can specifically run to see if the machine has a particular vulnerability or something like that. And then this is just scanning the the versions again. So, which we already know. So, these are like just different types of scans that you can do. Yeah, you can see here it's actually provided us a little bit more detail here because we did - SC as well. And this is actually really good. Do you know why? Because look, it says HTTP title. Site doesn't have a title. Um but you can actually see here it's actually provided us a directory. So sometimes end mapap it also checks for like any directory or robots.ext uh on the site. So you can see here it fetched the robots.ext file on the website. So basically robots.ext just allows you to when you add it on a website or you've built your own website before you can add a a sitemap or robots.ext text file to ensure that no bots can find these files or have access to these directories when they navigate it to on the website. But we can actually see here that in this robots text file we've got a exter which is actually a directory. So again if I go to the browser now check this out. This is this is pretty cool. So if I go to the browser and I type in ext explorer there's a look at this. It's a web page now. Now it's actually a login page. Now we don't know what the credentials are. Now this is like where we get to like brute forcing or maybe even like password guessing, you know, like admin admin or whatever. Um, so we have to like figure out what we can do here. We could also try and perform some sort of SQL injection or whatever the case is, whatever we want to do. JavaScript frameworks. You can see there we've got some JavaScript frameworks here. 3.4.0. You can actually search this up to see if it has any vulnerabilities or maybe like cross-ite scripting or whatever, but that's a whole different thing. We're still focusing on some MAPAP stuff. So, those are the types of scans you can do. Now, if I do dash A, like - capital A, this is a aggressive scan. So, essentially what this does, it it scans aggressively. And by the way, it's probably not best practice to do this because when it scans aggressively, it can actually the IDS systems on the other machine that they may have set up or the firewall can definitely detect these aggressive scans because it's quite noisy. So the aggressive scan just goes like full-on tryhard mode to try and find as much information it can from the scan. So OS, the operating system type, the service version detection, and common scripts. So it it really goes hard like tryh hard mode as if you were like playing PUBG like you full tryh hard mode. That's kind of what this argument does here. And if you want to scan all types of ports, not just common ones, but every single port that may exist, you can do dashp and then just dash again. So -p dash will scan all types of ports. So if I supply the IP, oh sorry, the domain which is the IP address, you can also do that. it's going to go ahead and do it. As you can see here, and by the way, it doesn't automatically give us an output. So, if yours is still like this, it just doesn't give you an output and it just takes forever. You can actually just press the up arrow key on your keyboard to see how long it's going to take to scan. So, you can see there it's about 15% done. Uh you can see how long it will take and it'll also give you the time remaining. So, it's going to take a while for these aggressive scans. So, we don't we don't need to do this. I just wanted to show you, but it's really cool. So aggressive scans do take long and it's very noisy, you can do a full port scan like this, which won't take too long. But if you want to see what the scan is doing while it's running, you can add another argument called -v for verbose. And if you enter that, it can just tell you uh what information it's found already while still scanning. So that is what the -v does. And -p dash scans all types of ports like I said. So you can see here it's finding all this information and blah blah blah. So that's amazing. Now let's do a full like MAPAP like a proper N map command scan. So let's do N MAP- SC c-- SV- N. So O N uh allows you to save the output into a normal text file. So basically - allows you to save it to save the scan into a text file. So we could just say inmap basic.ext basics.ext or something like that or MAP basic.ext text. Okay. Explorer.nyx. Find common scripts. Find the service version and save it into a text file and supply said IP address or domain. And you can see right away it's going to go ahead and scan it. And it's going to take the scan results and put it into the text file endmap basic.ext. So all this information you see here, if I clear the terminal, it's gone. If I type in ls, we've got it right there. So I can just say cat and map tab.ext. There we go. Boom. Look at that. It's saved it in a text file. So that's how you save scans. You save reports, things like that. It's really helpful. All right. So one more scan I want to show you is a more stealthier scan. So, you're probably thinking, well, Declan, you know, if it's an aggressive scan and these scans are noisy, what can we go about or what can we do about it if we want to do like a anonymous scan? So, this usually involves spoofing your identity using decoys or routing your traffic through proxy chains or maybe like the tour network, you know. So, I I will show you what decoys are first. So essentially if I type in m apps s. So if I do everything I did before but I do - ss this is a stealth scan. So this is like a synac request. So - ss is a stealth scan. If you want to learn more about these types of scans like I said you can type in n mapap-h for the help menu. So you can see the different types of arguments like we were running before. So you can play around with these different types of arguments here to understand what types of scans you can do. Another one that we can uh take a look at here which is in the end MAPAP tool itself is firewall/IDS evasion and spoofing. So these are just different arguments to perform spoofing techniques when doing end mapap scans. So we've got decoys which is great. We can spoof a source address but we're going to just take a look at this argument parameter here. Uh what's very nice is that with the timing and performance tab in the IMAP scan tool, you can see the different like arguments or methods we can actually add here in the tool as well. So scan delay like the how many seconds like delayed between each scan or probe, the minimum minimum rate that it scans or the max rate that it's sends packets. This is some very helpful commands that we can run during an MAP scan. So if I do let's say nm mapap- s- d I have to kind of add a decoy. So I could do rnd colon 10. So this command performs and instructs m app to use a tcp sin stealth scan while generating 10 random IP addresses. This command here with the decoy method or the decoy argument in inmap allows you to add decoys. So, if I do 10 or five or two, I'll do 10. It's going to send like while it's doing the scan, it's going to it's going to send out 10 like decoys like spoof decoys of an IP address. I would recommend not adding anything above 100 or 50. I recommend 10 is probably the best range. And the reason why I say this is because it can accidentally flood the target system and trigger bandwidth alarms, which you do not want to do. So, this will send 10 decoys while you're scanning to mask your actual location by routing, which is pretty interesting. And then you can supply the end map address. Like I said, this is just for educational uh purposes here. I don't want you to do anything malicious to any real world application without permission. I'll just show you like what hackers actually do to hide themselves. But actually this is a really interesting way as an ethical hacker and penetration tester to understand end mapap scanning techniques. You know instead of doing this what most hackers would do before running a command like end mapap or sql map or whatever hacking tool is they will use a tool called proxy chains. So this tool proxy chains version 4 which is the latest proxy chains will okay it says it says command not found the oldest version here is proxy chains 3.1 but the latest version is version 4. So proxy chains allows you to mask your actual location by routing all your mAP traffic through the tour network or set a socks proxy. So that's that's also pretty interesting. So that's how hackers sometimes get away with things. uh not all the time, you know, like occasionally using proxy chains or running decoys with proxy chains, you know, it will be a very slow scan if you do that because it will take forever. But if you really want, you know, quote unquote anonymity, I don't know if this would be the best method, but I would say it's good enough or decent enough to um definitely send out some decoys, but you don't actually have to do that. It would be recommended to if you just want to do like an anonymous scan on yourself. Uh R&D will send out decoys like I mentioned. And uh if I run that, you requested a scan type which requires root privileges. So you can see here I can't send out decoys yet. So I have to do pseudo then run it. Then it's going to send out decoys uh to that web server while we're performing uh this MAP scan. You can see there it's about 76% done. Uh you can see here it's performing a sin stealth scan running decoys 10 decoys masking my IP address or while I do the scan essentially. So you can do more research on what R&D is and the decoys that you can do. But this is a pretty basic MAPAP tutorial with this course. So yeah, pseudo- ss-d r&d10 with the domain or IP address will definitely do a good job at getting that information. So anyways, we already know these in MAPAP results because we've got a MAP basic text file that we exported into by running mAP- N and then the file name.ext. This will save your MAPAP scan into a file using this argument here, this parameter. And we can type in the IP address to scan, right? So it will save that data. It will save that scan in the text file. Um, you can also do it like this. A lot of people do this. I've seen it before. So, let's say I take this command, right? Uh, I do this n map.ext. That still works if you add this write operator. This will just save it into a text file. So, you can just say save. Oh, no, don't do that. Save into a text file called mAP.ext. Right? So, you can do it like that or you can, like I said, I do it like this. - mAP.ext. Okay. So, let's move forward. Let's now move into web enumeration because we got information about the target machine. We know what it's running. It's running a website. So now we are going to focus on web enumeration basics. So let's get started with that. So what are some tools that I showed you in the beginning or that we were going to use? I showed that we were going to use a tool called what web which we can use in the terminal. Um, but you know, the best thing to do is also use Weapalizer. You know, if you just want to stick it in the browser. Uh, what Webb and Weapalizer aren't the same thing. Weapilizer just pulls information already from the website. And same with what web, but it just does it in the terminal. So, let's type in what web and then the address of the website, which is explorer.nyx. There we go. So, what webb will pull that information from the headers on the website and it will tell us what versions or what service it's using. It's kind of like what MAP does, right? Because it does banner grabbing. It fetches that HTTP server information um to provide us, you know, like everything like this, like Apache version, uh the type of Linux or computer or machine it's using and also the IP address and country and all this other information that you may get during the scan. So that's just what web. And if you want to do more stuff with what web, you can just type in what web-h and there we go. So you can do these types of scans here. It says scan the local network for HTTP websites. So you can do that if you want. Obviously we don't need to do that, but it just shows you like the power of this tool. You can also perform an aggressive scan. Um but you have to supply the address here. So - a version 3. The method of the aggressive scan detects the exact version of whatever. Right? You can read more about these scans and also the types of arguments you can use here as well. But we're not really going to look too much into what web. That was just the basics. So it's kind of similar to what MAP would do by performing banner grabbing. It just allows you to detect web technologies. Another command that we can use is curl to fetch HTTP response headers to see what the website's using. This is kind of like what what web already does, but we can also just use it with curl just in case you don't have what web installed. So if we supply the address, you can see it still does the same thing. The type of server which is Apache. It's using Apache. It's running DBN Linux. The HTTP version. And it does this by fetching the response headers in the HTTP request. Let's actually go onto the web application to see the robots.ext file. So during the MAP scan, it did find this and we navigated over to this directory to see if it was a valid directory, which it is. It's a valid file path, which we can navigate to on this web application. You can also do sitemap.xml, which I don't think. Yeah. So on this machine, it doesn't have a sitemap.xml, but it does have a robots.ext. It's good to check both just in case. Let's use the directory search tool called dur search to find other directories on this application if there is any. So copy the URL. Go back to your terminal and type in dur search-u which stands for URL. Paste it in. Now you can just run it like this if you really want to and it will still work. You can see that it's trying to see if there's other directories or files on this web application. But you can see here we are getting 403 meaning we don't have access to this directory. It's forbidden. But you can see how fast this directory scan goes. But let's press Ctrl C and press quit and also quit without saving. Let's run this command again. But before we do that we can supply an argument called crawl. So crawl which will crawl the web application. we can say exclude status which means exclude status codes like 403. So it basically means don't show these types of uh responses while scanning. So it could be 404 503 like like an invalid gateway. Um we can also do 301. It's a good practice to do that. So anyways, it's going to go and perform a directory scan by doing crawl and it's going to exclude these status codes which won't show up during the scan. So if now if I go ahead and run it now, you can actually see when I run it again, we don't see those 403 responses. It's just scanning until it finds a valid directory or file path. But we already know that the only file path on this web server is /extplorer. You can see there it found the robots.ext text which we have already taken a look at which had the valid file path. Another tool I want to show you is a tool called fuff. So fuff stands for fuzz faster you fool. And we can see we've got different parameters here arguments that we can use in this tool. So fuff is similar to dur search in a way. It does the exact same thing of performing directory fuzzing. So we can actually do the same thing as we did with dur search but with f. So we can do f w. So we can specify the word list which is user share word lists. You can select sec lists if you want. So I'm going to go to I'll do discovery. I'll do web content. And then we can see here we've got a list of directories for us to choose from. But instead of doing these, what I will do instead is just the basic uh word list that we will use from derb which is just a common word list directory that we will perform when we are fuzzing. So again let's do the same thing. So specify the URL and also ensure that you type in fuzz at the end of it to tell this tool to fuzz the location of what we are brute forcing or fuzzing. So we can see we are doing fuff word list. Here we're specifying the word list and then here we are specifying the URL and telling the tool to fuzz the end end location of the URL to find and fuzz directories. So you can see that is what it looks like. And if we run it, you can run it like this. But you can see while it's performing a directory fuzz scan, we can see that we've just got white text on the screen, which makes it very difficult to see. But you can also use FUF to filter out these request scans here. So we can filter out by words or lines. So I'll show you what that does. So if you want to see a colored output, we can do dash c for colored. And now you can see that we've got coloring, but let's filter out by 10. And by the way, you can see this because when it scans, it says status 43. You can also filter that out if you want, but I'm going to filter 10. And it's going to go ahead and fuzz until it finds a correct directory. As you can see here, we've got index.html, and we've also got robots.ext just like how we found on dur search. So it's a very similar way of performing directory scanning. But what I really like about FUF is that you can also perform subdomain enumeration. So you can check for any subdomains which I'll show you now. So instead of doing it like this, we still specify the URL, but we can say host fuzz. This is where we fuzzing. We're fuzzing the beginning of the URL, which is where the subdomains would be. And I don't think there is any subdomains on here, but that this is a good practice to check for subdomains just in case there is. So now if I go ahead and run it, it's going to give us a lot of like 200 requests, right? Like status 200. But let's go let's actually go ahead and filter that out because those are just false positives. So let's go ahead and do that because we won't truly know what the subdomain is until we get a response back. So you can see it's just performing subdomain enumeration and you can see that nothing came back. So that means that there is no subdomains. So that's how you perform a subdomain which is very nice. And also let's go back to this scan as we did previously with directory fuzzing. Not subdomain fuzzing, directory fuzzing. Let's actually add another one called dash e. So we can specify the extensions for the tool to look for. So we can say okay while it's fuzzing find anything with the text uh or maybe HTML or maybe PHP. So anything with that end of the URL so text or HTML it's going to find that in the request and it's just going to filter that out for us. As you can see there index.html it's going to find any file type that is just a text file or a PHP file. So we can we can specify the extensions that we want to look for specifically which is very nice. Now onto the next one. We will be taking a look at Nectto. So Nectto is a web security tool that finds web vulnerabilities which is very nice. So if we come up here in the tool we can specify the host with the H argument. So we can do this nectoo necto-host and then we could just supply the URL and you can see it's already going to go scan it and find any vulnerabilities associated to it. It's going to check the headers. It's it's already found the robots.ext the Apache version. So, it's a very loud vulnerability scanner, but it's very helpful in finding these flaws or vulnerabilities that you may come across. So, think like end mapap, but for websites. This is kind of like what Nikto does. So, it really tries to dig deep to find any loopholes or anything that kind of exposes itself. So, I'm going to go ahead and press Ctrl + C because we're not going to be doing a lot with Necto at all. I think the best thing to do is just check out what this web application entails. So, if we go back to this login page here, we can see that we can't log in. We need to know the username and password, which we don't actually know. See, login failed. Try again. So, if I keep pressing login and login and login, it doesn't look like it has rate limiting. So, we could try and just brute force this with the FUF tool, which I can actually show you. But first, what I need to do is, you know, when you type in something on this web application and then you press the login button. This sends a request. But what we need to do is we need to actually copy that request so that we can send it over and over again until we get a successful login. So in order for us to kind of play around with this, we need to use a tool or actually a software. Uh it's a program called Burp Suite. So if I come here to the menu and I go to web application analysis. Uh yeah, here it is. Web application proxies. Burpuite. So let's go ahead and open that up. So Burpuite is a software that allows you to perform these requests, but you can actually see what the request does. See, I'll show you now once this loads up. It's very helpful and a lot of hackers use uh Burp Suite because it helps you analyze a web application in a much wider scale. So, if I go to the proxy tab, you can see that the interceptor is on. So, let's actually use this browser instead. Uh because this is what we're going to be needing. So, let's just close that. I don't know why that's opening. We don't need that. Uh let's go ahead and copy this URL cuz this is the URL we're going to. You can see there's already a request coming in, but let's just forward that. We don't need anything with that. So, let's go ahead and open up this browser. It says the login key ring. Okay, so we can just type in parrot. All right, there we go. Let's just move this along. All right, let's paste that in to go to this URL. And you can see here we can already see the request coming through. So, the request won't send until we click forward. So, it's kind of like a man in the middle. It's like our proxy only allows to forward this request when we click the forward button. So if I click the forward button now you can see here we get the request of what this is uh about. So we got the cookie information. We've got index.php option. So this is a PHP application. So let's forward that request. And you can actually see here here we are again on the web app but we don't actually know the credentials. So like I said, we need to actually copy this request. So I know this is very difficult to see. So let me just uh let me forward this. All right. So you see this. Let me try and make this a little bit bigger here for you to see. I've just made it a little bit bigger here so that on the video you can see it. So if we go to the proxy tab, the interceptor is on. So this captures any request coming through this browser here through the proxy. So in order for the request to go forward, we have to press the button forward. We can also drop the request if we don't want it to go through. Anyways, let's forward this. So you can see here if I do test test and I click the button log in, we can see here it says please wait. So the request hasn't gone through yet. We can see the type of request happening behind the scenes. You can see this is a post request and you can see the type of request that is being sent. So we we've got option which is the web application action login. Uh username is test and password is test. So what I want to do here is I want to reuse this request. So if you go to repeater, if you if you rightclick and you send to the repeater tab, the repeater tab just allows you to repeat the request over and over again. So if I go to the repeater and I click send, you can see in the response tab that we get a response, but it says login failed. Try again. Success is false. If I do like change the password again and again, you see we're going to have to do this manually. But the thing is I don't want to do it manually. I want to automate this. So we can actually use fuff to do this. Um, which is very nice. So if I send that again, you're obviously going to see in the response that the login has failed because we don't have the correct credentials. So the best thing that we can do is first of all let's let's see if it let's just do user enumeration. Let's see if we can actually figure out okay so it says okay login failed try again. Um so we don't actually know what the user is. We have to actually figure that out first. Uh, it could we could try admin admin or just admin and then test 1 2 3 login failed. Try again. Let's go back. What did the response say? It says login failed. Okay. Yeah. So, it just says login failed. But you can do this with fuff. So, that's what I'm going to show you. So, go ahead and actually go to the request, copy this request. Let's copy this. There we go. I'm going to copy that. I'm just going to shrink this for now. I'm going to go to the terminal and I'm going to save it. So I'm going to say micro. I'm going to call it explorer request or justre. You can call it whatever. I've just called it request like this. And I paste it in. Now this is the request that we have here. So I can send this over and over again. But what I want to do here is go to the username field, change this to fuzz. Oh, we can we can do fuzz user like that. And then we can also do here uh password fuzz pass. So f pass fuzz user and fuzz pass. I can just save that and press quit. Ctrl S and then controll Q to quit. So that's the that's the uh request here. So what I want to do is I want to supply this within the tool of fuff. So if I type in fuff, you can actually do this with the request parameter here. So look, it says here this is a cluster bomb technique. So request request protocol and the path to the word list associated with the keyword. So we've got the request and this is going to be a clust bomb uh technique or brute force. So file containing the raw HTTP request right and then the request proto uh the protocol. So by default it's HTTP. So we can say fuff uh the request is explorer request like that. Then we can say request protocol. Yeah. So request protocol let's copy that. Let's just paste that in. So request protocol is HTTP like this. And then we Oh yeah, we also have to specify the mode as well. So we can say dash mode it says okay so dash mode it would be a cluster bomb. So we would actually have to add that. So dash mode is cluster bomb technique and then we can supply the word list which has to be a password list. So we could use the rocky.ext. I think we've got one actually. Um, so if I go to cd or sorry ls user share word list, we've [snorts] got a rocky.ext file. So let's use rocky.text. It's it's by default share word list and then rocku.ext. But we have to do colon and then fuzz or sorry fuzz user and then we have to repeat this again. We can also do slash user share word list. So basically I'm using the word list against the parameter that we've added in the request to tell the fuff tool to brute force this end user and also the password. So rockview text fuzz password. Uh let's see if this works. Actually it seems to be frozen right now cuz it first has to actually brute force uh whatever the user is. So it's going to take a long time for this even to happen. So but the cluster bomb technique will basically try every username and password with the rocky.ext file. But it just shows you like the capabilities of the FUF tool, how you can repeat a request and try to brute force into a login page with FUF. So FUF can perform domain enumeration, subdomain enumeration, directory fuzzing, and also brute forcing with the cluster bomb technique. But this would take a long time anyways. So for the sake of this demo, let's just do let's go back to our request and let's just take a guess on what the username is. So I'm just going to say that the username is admin. And if I press save. So I'm just guessing that maybe it's admin admin. Maybe it's admin password 1 2 3. I don't know. I just I'm just want to I want to get past this demos just to show you the capabilities of the fuff tool. So we can say username is equal to admin, but we can still keep this the same fuzz password. Uh we don't have to call it fuzz password, but it's just best practice to understand what it is called. So if I save that and if we get rid of the fuzz user, we don't actually need that anymore. We don't need that. We just got fuzz password. We can still keep it like this. So if we run it, it's just going to take the existing uh username. So hang on, let me just refresh. So it's going to take the existing username, which is admin, and it's just going to use the word list uh to go through to guess the password with that user. Let me try and reconnect to it. Oh, there we go. Maybe [snorts] that was the issue. Maybe the reason why it wasn't sending through was because it was just not connecting properly. I don't know. I could do the same thing here with the cluster method. So, if I perform this request, oh, okay, we might need to filter that out. So, let's filter that. Um, okay, we need to filter out by one. Okay, let's try that. I mean, come on, really? So if I go ahead and run this again, you can see here it's going to try all those combinations. And you can see we have successfully brute forced this login page because now you can see it says login admin and password is admin. So the username is admin and the password's admin. So let's go ahead and try that. Admin. So we've got admin admin. We have successfully logged in. Look at that. That's brilliant. We have successfully logged into the application. That shows you how beneficial tools like FUF and Hydra can be to get rid of the manual labor when doing security auditing or brute forcing or fuzzing. It just saves a lot of time so that you don't have to manually brute force a login page. you do it with existing tools to try and fuzz the application to get a successful login response. So that's brilliant. We are now logged into the application. And again, I would like to address this. If you want to continue learning, I have a school community for you to check out. The link is in the description below. Everything in this community is for educational purposes and you can level up have access to these courses which is available within the community. If you want ongoing further learning these resources will be linked below for you to read and check out yourself. It's a private community and you have access to courses and resources for further learning. Burpuite like we've looked at before let you see and understand the HTTP requests in your browser. In ethical hacking, this helps you test how web applications, web apps handle input sessions, sessions, forms, cookies, and parameters that you can try and manipulate or abuse when resending a request. It just allows you to test how the web app is set up. So, we can see this thing is called ext explorer. I want to try and see if there's any search exploit. Uh, let's search extra. So, okay. So, I don't I don't actually have search explore installed. No, I don't. Pseudo app install. So, I'm going to go ahead and install exploit DB so I can actually use the tool search exploit to search if there's any vulnerabilities or exploits associated to extra for this web application. So, you can see here, look at this. So, we've got a file upload. Oh, wow. Look at that. Okay, so wait, what version is this? How can we see what version this is? It doesn't actually tell us. So, it says explorer um home. So, we're on the homepage right now. This is like the website directory. This is like all the all the code to make the website work. But what I want to see is the version. What type of version is this? But anyways, this could be vulnerable to file upload. So, we got configuration file here. Log out. Admin. This is the admin. Okay, this is interesting. Oh, we can also change the password. What does this do? Oh, look at this. Your version extra 2.15. So, we've got this in Explorer. It says explorer 2.1 arbitrary file upload with metas-ploit. That's interesting. So, I don't think this exploitation module is going to work because it's behind another version. So that's for a different version, but we have 2.1.15. So we could just try and do it manually, which is completely fine. So we could try and upload a file upload attack. So you could try and use a thing called pony shell. So we're going to try and use this. So pony shell is a basically a reverse shell. Um, but it it basically just spawns a session for us so that we can actually browse around on the victim's server or the target server I should say because this is an educational video. So let's go to shell.php and all you need to do is just copy everything that you see here. Just go ahead and copy it. And if we So if you copy all this code and you go to explorer, if we go to new, we're going to call this let's just call it shell uh file. Yep. Let's create that. So we've already created it. It also needs to be a PHP file, actually. So let's let's probably let's get how do we get rid of this? Let's delete that. Oh, we can actually rename it. Okay. PHP. There we go. And uh let's paste that in. So, we got the pony shell. Uh, and now if we save that, now if we actually go and navigate on the server to, uh, shell.php, look at that. We are actually on the main machine. So, it basically sets it up as a webshell, but on the website. So when we actually go to this crafted directory here, uh this directory, sorry, this file here, we can actually go ahead and use pony shell to navigate on the server. So we got robots.ext, which is what we looked at earlier. We can even go back a directory or we can actually try to or even better, we can even try and spawn our own bash session from our terminal to browse around on the server. But look at this. We are actually on the main machine right now, just on the browser. If the admin finds this file on their own web application, that may be of a concern. But this is pretty cool though. It just shows you how different ways you can get access to a web server through file upload vulnerability. You see, what we could have done was uploaded a custom PHP file so that when we run it, just by going to the URL, it spawns it on our terminal. But instead of doing that, we just use pony webshell to just spawn the shell on the web server. So that when we can go to this directory, we can interact with the web server on the web page, which is very nice. So we can go to home. Nothing there. This is pretty cool though. Anyways, so yeah, we've basically hacked this web application. So when you use search exploit, it doesn't automatically hack anything. It helps you research known public vulnerabilities. Always read the exploit carefully and understand the affected version and test only in a legal lab environment. Now the last thing that we're going to focus on in this course is Python scripting. Now, we looked at a little bit of Bash in the beginning, but I've gone ahead and created a basic Python script that we're going to be taking a look at. So, you can see here I've created a Python's project directory in the documents directory, which you can go ahead and do. And you can see here I've got basic.py. Now, obviously, if I enter basic.py, there's nothing in here. So, we're going to take a look at the basics of Python. That's why it's called basic.py. Pi. Um, so we can just get familiar with what we are doing. Now you can use nano, you can use micro, you can use vim or you could use vscodium up the top here. You can just go here, click open folder, python projects. And there we go. You got your Python program. Just trust the authors. There we go. And we can write our Python code in here if you really want to. So, for the sake of this, I'm just going to use the text editor here because it's got syntax highlighting. It's also got suggestions. And we've also got a terminal here as well. Uh, view terminal. Here we go. So, the terminal we can also run while we are coding. We can run it in here. So, this is good. This is a good start. So, to check the Python version is to type in Python 3 version. This is how you check what Python version you have. Now you can run Python 3 in the terminal just like this but it just opens up interactive mode which allows you to actually just write Python code within the terminal here. In order to exit this you could just type in exit. Uh but you can just you know do stuff in there. Interactive mode is very helpful for some things like one of the things that you can use with interactive mode in your terminal with Python is that you do not need to save a file or run a entire script. Python just reads your code, evaluates it and prints that output. or waits for the next line. So you can just test and prototype things within the interactive console here with Python, but you have to write everything line by line. So instead of doing it like this, we're just going to write it in the text editor so we can actually have a full view of what we are coding with libraries and stuff like that. Just going to clear this terminal here. Just going to press Ctrl L there. I'm going to shrink this. So we're going to use the terminal to run the program and we're going to use the text editor to write the program. So let's just get started with some basics. So in order to print something out in the terminal when we run a Python program, we can type in print. So this print method allows you to print anything out to the console. You can use double quotations or single quotations in the method here. So you can say, "Hi there. How's it going?" And if you press Ctrl S, or you can just go to file and then save and you go ahead and run Python 3 basic.py, it's going to run the Python program, and it's going to read line by line of what you've got in the text file, your Python script. So we're running this method to print to the console saying, "Hi there, how's it going?" You can add anything in here because it's a string. So you can add this string in double quotations or single quotations. It doesn't matter. Um so that's how you do this which is very nice. Hi there. How's it going? So printing allows you to just print the console. It's very helpful for when you run a Python program and you're doing certain behaviors and methods within the script because then you can print what that response is. So for example, let's say I send a request to a website to get information about it and then I bring it back that information and say print information found and then I just like print out what the information is. So I can use print to do that. Um another thing I want to show you is variables. So variables are something like this. So I can say name is equal to declan. You can put your name here. Name is equal to declan. So this is a variable. With variables, it can be anything. A variable is just a stored value or stored data type. So a variable stores information. So that's what you call upon later. So you can say name, house, address, whatever. So name is equal to declan as in a string. And in order to bring it here to say let's say like hello and then name. Obviously this is not going to work. I'll show you why. So I enter name is equal declan hello name. It's going to basically print out what this data what this variable is holding which is this data string here saying declan. Now if I run this it's just going to say hello name. And you see it doesn't say hello Declan because we forgot one more thing. In order to call that variable within a string, you can just take away the string and put it here. And then you can just add a little comma there. So if you say hello name now, it will say hello Declan. So you got to make sure that the variable isn't just in the string like this because if it's if it's in the string here, the program doesn't know what to call because it's in a string. So it's just a string. it just reads it as a string. It doesn't read it as a variable. So, it doesn't see that you're trying to call it. But what you can do is you can do this. If you go to the beginning here, this is another way of doing it. Um, so you could do it like this as I showed you, which will call the variable. Or you could do it like this. So, if I do this, you can add a f in the beginning. You could just say name like this. See if I run this again, it works the same. So there's different ways of doing it. I prefer this method like of doing it. So this is a Python F string format. So basically what this means is formatted string literal. F strings just provides a a concise way to embed expressions inside string literal by prefixing the string with f using curly braces here to call the variable. So it's a very efficient way of doing it. You can do it both ways. I prefer it this way just in case like you have multiple variables to call upon or other methods that you want the behavior of the program to do. So it's very nice to do that. So again, if I run this again, it still does the same thing. So it just says hello Declan. It calls the name variable in the print method using the f string literal here. What you could do as well, you can do a thing called string concatenation, which is like this. So you could do hello. So if I get rid of the if string literal and I do hello and then name plus name. You can also do it like this. So this is what you call string concatenation. It just basically joins strings or joins whatever data you want to put together. So it's basically a simple operator plus operator here to call this variable. So it just says hello in a string and then plus the variable that you want to call. So if I run that, there we go. It does the same thing. So you can add some space there as well. But you see it does the same thing. Again, multiple ways of doing it. I, like I said, I prefer this way of doing it because it's just nice and easy to read. So, yeah, that's the basics of variables and string literals. A variable in any programming language, especially Python, it's just a name that you give it that acts as like a reference to something that is stored in memory. So you can create a variable the moment you assign a value using an operator or you can create a variable to store data like a string or whatever it could be. So for example in a in a real world practice scenario we could do something like this. So I'm just going to go ahead and comment this out. So I just I did control a to select everything and then I pressed controll slash to comment it out. So when you comment things out in Python like this it's not going to run anything. So if you comment out the line of code, the Python program will not read that commented line out. So it's not going to read that line because it's commented out. So what I want to do is for example, if we do target is equal to input, this is another method that we're going to take a look at. So input, we'll say enter target. Uh let's just say I don't know IP as an example for educational demo. So we say print and then we'll say uh target oh let me use this target is and then target see look this is just like a example of how we can actually use these. So the input method actually is like a variable. So this is a variable. This target is a variable. And we're using the input method to capture the string data that is put into this variable. And then we basically just call it by calling the print method to print it to the terminal. So we can say print uh or python 3 basic.py enter target IP. So I'll just do mine. This doesn't do anything. There's no there's no functions here. It doesn't scan. It's just basically storing the string data and printing it to the terminal. So I can just say just some random IP like my modem on my network and you can see there it says target is. It just prints it on the terminal target is and then the string that we stored in here with the input method. It's just like a very nice way to store values and call it. So you can see how you would put this into practice. Um which is also very nice. So the next thing that I want to look at here is a thing called if statements. So if statements are also known as conditionals. Basically it just allows you to structure your program concisely to understand what needs to be ran next. So for example, if I have a port that is open on my network that is port 80, I can use an if conditional saying if if the port is equal to 80, then we can print saying that this is a HTTP servers detected. else print different port. So you can see here if the port is on port 80 if the port is equal to port 80 then print HTTP service detected otherwise say different port. Now if I run this okay I forgot to add a another equal there. So if I run this now there we go it says HTTP service detected. So if this port was something else like port 22 and it's not port 80, it's going to say different port. So you can change things based on what the type of condition is. So if the port is equal to 80 or if the port is this, then do this. So you're basically telling the program what to do based on a situation. So for example, if I get a response from the website, print this. Otherwise, if there's no response coming from the website, the request didn't send through, then say this. So, if statements kind of structure your code the way that the program should function, the the way that it should work. In Python, an if statement is used to make decisions in the code. It checks to see if a condition is true or false and only runs a specific block of code if that result is true. So if the response of the website is found on port 80 then we can say website found port 80 is open else different port you know something else. The next thing that I want to show you here is so that's if statements. Let's take a look at loops. So loops in Python are this. So for example let's say that I'm looping through ports. So let's say for port in this array. So array is basically where you can store data. So I'm just going to say port 21 22 port 80 and port let's say 443. I'm going to say print checking port. Now you can do it like this like I showed you or you can do it the way that I like to do it which is import and then come back here and put the f you can put the f here and save it. So now if you run this Python program you can see right away it checks to see what ports are in this array. So this is what looping does. So looping just loops whatever is in the array as you can see here. So for every port that's in this array, we can check to see if it is open. So you can see it's like just checking the port. But this doesn't do anything. It just prints to see if that port is open. But we can actually code some logic to say, okay, check to see if these ports are open. And we can use like a library called sockets to print out on the terminal to check to see if port 21 or port 22 or port 80 is open, which is very nice. So you can see how you can actually apply that logic. All right. All right. So, what I'm going to do is I'm just going to delete everything that I I have up here. You don't have to do that, and I don't recommend that. I suggest you save what you have already. And also take notes as you go along. What I want to show you next is a thing called import modules. So, import modules is modules that are basically programmed by someone else, a another programmer or maybe a team of programmers, who knows? You can import libraries in your code such as socket, you can import OS, you can import requests, you can import whatever. So these are just uh different libraries that you can import into your code which basically means that you don't have to do everything from scratch. You can use existing libraries that have already been made to implement in your code to test things. So I can say import socket and then I can say uh print socket get host name host name like this. So this is a method in the socket library which you have to learn more about. Every library that you use in your code they all have different documentation on how to use it. So you just have to search up for example if I want to learn more about requests I have to go search up the requests library and learn about that too. It's very helpful though. So you can say import socket and then just get host name and essentially what this does it just tells me what my device name is basically on my network. Um so basically socket.gethost name of my machine which is just parrot. So that's what other devices on the network would recognize me as. So that's also pretty nice. And when you import packages so when you import these libraries and you try and run your code sometimes it will say that oh you know package not found like you need to install it. So if you ever get that, you can actually install these libraries uh by doing this. So pip 3 install and then the library name. So let's say requests, you can do that and it will go ahead and install it. But by default, it's already installed on Power OS because Python is used most of the time anyways for everything. Python is pre-installed on Linux, but if you ever do get that, that's how you install it. But you have to install it within a virtual environment with Python. So that's pretty cool. So let's actually get a basic example of like a good program. So let's import requests and let's say URL is equal to http exploreryx like the machine that we've been doing in the beginning and so URL is the variable and let's create another v variable here. Let's make another variable here called response is equal to requests.get which is a method. to get the URL and let's just try and see if the response status code uh comes back and also let's print response headers. So basically what this will do is if there is a response it's going to basically perform a get request to this URL and print out the status code to see if it is valid. So if we go ahead and run this there we go. It means that this website is running and it's actually giving us information such as uh the server type. So this is all in the headers of the web application which is again very nice. And we can also see the status code here which is 200 meaning the website is up. It's running. So you can you can apply if statements like if the response uh status code is equal to 200. So the response 200 then you can just print like this print uh let's just get rid of this. You can do that but I'll just print uh website is up and running like that. Or you can just say website is up. Okay let's just do that. There we go. Website is up. You can see that right there. And if the website is not up, you can just say else, you know, if the website doesn't come back, you can just say website down, but it's up, so it's not down. But you get the point. It's It's really nice of how you can do things like this. So website is up. It's running. That's great. Uh, print website down. And you can also like stylize it if you want. Like I tend to do this a lot in my scripts, like when I code in Python. It's just like, you know, it just creates like a nice visual flare when you look at it. You know what I mean? So I can just like run that. It says website is up. You know, it just makes it look cool. So that's how you do it. So if the status code is equal to 200, meaning the website status code is up and running, we say that the website is up. Else if it's not, the website's down. So you can see how we can actually apply that logic in our code, which is very clean and easy to understand. Now, what I want to do is let's actually create a basic recon script. So, I'm going to go ahead and just delete everything cuz that was the basics that I wanted to show you. Now, I only have basic.py, but I want to rename it. So, let's move basic.py and call it recon.py. There we go. So, basic.py is not a thing, but recon.py is. So, we're going to create a basic recon script. So, this is going to be interesting. So, you know, buckle up, put your seat belt on. This is going to get really good. So, we're going to use libraries to help us in our code. So, let's use the socket library and the requests library. So, we're going to use the socket library to maybe test uh to see if there's ports open, maybe. And we could even use requests to see if the website is up and running, you know, just like how we did before, but a little bit more in detail. So let's go ahead and do that. Let's just say import socket import request like this. And so let's actually, you know, structure this properly. So we're going to use functions. And by the way, the first thing that I want to do is just say if main um oh sorry not main name uh is equal to main like this then run a function. So I'll show you what this does in a second. I add this at every single line of my Python code at the very end because basically it tells the program, hey, this is the first function that you should run throughout the entire script. So, first let's create a function and let's call it banner. So, the banner is the first thing that the person looks at when they run the tool. So, I'm pretty sure you've ran tools like metas-loit or SQL map and things like that. They have a banner. It's just like a little little logo for the tool. It just makes it nice and easy to like, oh wow, you know, like visually instead of just looking at white text and, you know, there's no banner really, but we're just going to have a simple text, right? So, let's just do print [clears throat] uh simple reconcript tutorial tutorial. There we go. So, that's our banner. Now, what I do want to run, let's create another function called get IP, right? Which I'll show you more about in just a moment. In fact, yeah, we'll get back to that in just a moment. Let's do main. So, we're going to create our main function that we're going to run. We're going to call the banner function and the main function. So the banner would run, but the main function runs and executes the banner function when the program runs. And we're going to say target is equal to input. And we're going to say enter target domain. Just like that. Or maybe maybe let's kind of help people understand what it is. So we can say enter domain. Uh let's just say example example.com and we can oh sorry example.com like that and add some spacing. So that's the target and the URL can be uh input is equal to oh sorry not input equal to is this enter URL example and then we also give here an example which is exampample.com. So these two inputs is what the user has to input for you know to continue to run other functions that we'll be running in just a moment. So we can say print. So you just got to plan out how you want the script to work and run. So we can say resolving domain just to make it look cool. And this will run when we actually have another function which is getting information about the domain and also the URL the headers. So we're going to have two functions. So we got get IP which is what I want to create and we're going to pass this target variable as a parameter to that function. So let's actually create it. So let's say def get uh ip here and we don't need and what we are passing in here is a custom variable called the domain and we can just say try this. So this is the try uh method try catch method in Python try except method in Python is we try this and then do something else. So it's similar to the if statement but it's just a better way of structuring the code as well. So we could say IP is equal to socket gethost host name and then we just say domain right? So that's the domain and we can say print uh let's use f we could just say uh let's do plus and then just say IP address and then pass in the IP. Can you see what we're doing? So this is the IP address variable and we're saying socket get host name of the domain which is the domain in here. So target is input. We capture this string variable in this input method. Store it in this variable. Call this me this function with this variable in it as the domain. And we say IP is equal to socket.gethostname method. And we print out what the IP address is of that domain. And if it doesn't connect, we can say expect except. So try except socket dot error like this. Print [snorts] could not resolve donate like that. So obviously if you run this it's not going to do anything yet because we're still uh busy writing some stuff but you can run things to see like where you would get an error if there is any error. So it looks like we got a syntax. What is that invalid syntax? Um it could be it could be this. This is probably invalid. So I would have to oh maybe wait what could be invalid? Oh I see I see the issue. It's this here. There we go. So now if I run that, it's okay. There we go. So now we've got a different error which is if statement on line 25. We go to line 25. Uh yeah, so this here hasn't actually called the function yet. So we could just say main for now. We don't actually have to have that just yet. Well, actually, yeah, that'll be good that we do cuz that's the main function we want to run. Uh so we got here simple recon script tutorial. That's the banner. Enter domain example. So we could just say http uh let's do exploreryx uh enter URL. Okay, well that was the URL. So actually my bad. So let's run that. So let's do explorer. So that's the domain and then the URL which is explorer nyx. So get host name takes no arguments. Okay. So we need to finish off the rest of the script here because we also need to get the headers as well. So that's what I want to do next. I can see the issue right. So get IP of the to also get headers. Let's actually create that function next. Let me fix that once we are done. So let's just continue because I want to write the rest of the script out. So get headers. Headers is in the URL. So, we're going to say URL and then we're going to say try this response is equal to requests.get URL just like we did before. Let's actually add a timeout. So, timeout is equal to five. And let's just say print f status code. Oops. Status code here is response dot stat oh status code just like that status code. There we go. Finally. So we are printing the status code and then we're going to print out the headers just to make it clean while we are running the code here. So we could say headers like this. Uh we can also display it like that. Yep. And then so for every header so it's going to go loop through that header and it's going to print the header. So we're going to say for every header value in oh oops in the response in the request headers. So in the response headers items I'm going to say print f head header and then also print the value which is what you're going to see when it [clears throat] is printed. And then let's add this ex accept. Okay, don't add that again. except requests do exceptions. So this is basically saying if there's a request failure meaning if there's a request that doesn't get received or doesn't come through it is an error and we can just say print uh error connecting connecting to website like this. Let's actually go back and add this. So we can actually call whatever that error is. So like this in the in the string so that we can actually read what the error is. So this is looking good. This is actually well structured the way that I like it. But we actually need to call it down here in the main function. So we're going to say print getting http headers like this. And then we can call that function saying get headers here which is also calling the URL parameter. There we go. So let's actually go ahead and let's just see what errors we have in this code. Okay. Enter the domain. So exploreryx http explorer nyx. Okay. So we got some errors here. So soccer.host Host name takes no arguments. It takes no arguments. And then also on line 33, get IP target and main H. Okay, let's actually take a look at these errors. So we got get IP target. Yep. And then the domain at the top here. So get host. Oh, sorry, not host name. It's host by name. Sorry, I realized that I used the wrong method here. So, it's get get host sorry get host by name. Right. Okay. I think that is right. We can also check the documentation. We can go on the website and look at the library modules to see if we are using it correctly. So, we can say explorer NYX. Explorer NYX. So, get headers URL. So, the other error is gone. Uh, did you mean yes, I did mean that. So, we made a slight syntax error. Uh, just a spelling mistake here. So, let's add that. There we go. I fixed it like a boss. So, I fixed that error. Let's run. Uh, what is this error on line 36? URL. Get headers URL. Uh, we have it displayed there. It should work. So, let's try that. Explorer NYX. Uh, http explorer NYX. Uh, value. Did you mean value on line 22? You see, I typed too fast. Oh, yes. I did mean value. What in the heck? Value. There we go. Sorry, I made a spelling mistake there. All right, let's try this again. So, explorer.nyx NYX http exploreryx Hey, there we go. So, it worked. All right, look at that. So, let's just do this again. So, recon Explorer NYX httpernyx. So, we enter the domain, which is the the domain of the website, and then we enter the website URL. So, it's going to pull the IP address to see if it's up and running. It's going to get the host name by name, the domain, and it's also going to print the headers. So, if I run that, it says resolving domain. IP address of that domain is 192.168.156. Getting HTTP errors. We can see the status code is 200. And it displays the headers. You see it loops through the values of the headers and displays the value, the text of the headers, the header value. So the headers is this and then the value is the value given in the headers. So this is a very clean way of utilizing Python scripting to save a lot of time when we do a lot of the manual work. Right? So using Python is very helpful to program things like this because it helps automate things when you do ethical hacking. If you've gotten this far in the course, please don't forget to leave a like and subscribe. Considering that this course is getting a little too long, I'm going to go ahead and end it here. Thank you for watching this video and I'll see you in the next. And again, I would like to address this. If you want to continue learning, I have a school community for you to check out. The link is in the description below. Everything in this community is for educational purposes and you can level up, have access to these courses which is available within the community if you want ongoing further learning. These resources will be linked below for you to read and check out yourself.

Generated algorithmically for Search Engine Indexing.

Summarize Another Video