All right so let's talk about starting and stopping services.
So we're in Cali.
There are a couple different ways that we can start and stop services.
And when I talk about a service I'm talking about something like a web server or SSA H or maybe a sequel
database.
So when we cover this video today I'm going to show you a few different services and how to start them
and stop them.
I'll show you how to start them permanently on boot and we'll talk about which services are important
to keep on boot.
Which services are important to to start when you feel like that.
Just starting them or when you need them etc..
So let's start with our first service which is going to be Apache to now Apache to is a web server.
So let's go ahead and do a proof of concept first.
Let's start with the command that we learned in an earlier video which is I have config.
I'm going to grab our IP V for address right here and I just want to copy this.
I want to go out to a web browser over here
and we're just gonna paste this address.
Now you'll notice that it says it's unable to connect.
This is expected here we're not running a web server.
Now let's go back in here and let's just say service Apache to start
OK.
Looks like it went through.
Let's go ahead and hit enter again.
And now you can see the Apache to Debbie in default.
Page has been loaded.
So what is changed.
Well when we boot our machine this Apache to service is not running by default.
So if we want to run a web page then we actually have to start up the service for it to work.
As you just saw here now you could see that if we want to add files or replace files here.
Well we're going to have to edit DVR w w w h Tim Al folder.
So if we come out here and we go into other locations computer and then we go into our bar w w w HCM
Al you'll see that the index that Asian know Page is here.
So if we actually wanted to maybe host a malicious web page and have it point back to us this is one
way we might do it right here if we want to serve up some files say we have something that we want to
upload to a machine that might be malicious or you know a file that we want to transfer to somebody
else or download on another computer.
Doesn't have to be malicious.
We could host that file in this folder here.
Now that is fine this is a one way to do it right you can put your files all in one location but you
know it's not my favorite way.
It was my favorite way when I first got started.
There is a much easier way now and I will show you how to do that so let's go ahead and type Alice.
You'll see we have no documents here.
So I'm just going to echo Hello into Hello Dot text and then have that hollowed out text here.
Now what we can actually do is we can spin up a web server so we can to say Python bash em for a module
and say simple HDP server you can auto tab it and then say 80 for the port 0 8 is already in use so
let's just give it 80 80 80s and use from the Apache server at the moment.
So instead let's look at what happens.
So let's just call it out of 80 80 and you can see here that I can go to this hallowed out text and
actually get the file.
I have information in real time whether or not that file was captured and overall this is just a web
server that's so easy to spin up I can put it in the directory that I want it to.
So if I wanted to serve my desktop folder I would navigate to desktop and then spin this this python
module up.
I don't have to put everything into a var W WW folder and it just makes life really really simple.
So just proof of concept.
We can do a service Apache to stop and we can come back and make sure that that web server has been
stopped by going here and refreshing and I could see that it's gone.
We can see into something like downloads we say alas there's nothing in here.
So we can tab up a couple times and just serve up port 80 now because you can see it's not in use anymore
and come back here refresh.
You can see there's nothing in the directory listing because there's nothing in the folder.
So this is just an easy way to spin up a web server.
I think it's much easier than Apache to I'm showing you both because I like to give alternatives but
using Python moving forward is a great great feature.
My challenge to you is to look up how to spin up a FTB server with Python so I won't get redundant here.
I do have future lessons and other courses that talk about this but if you want to challenge yourself
to figure out how to spin off FTB server that's my challenge to you.
There is a module out there that you can download quite easily and spin up your own FTB server.
So let's go ahead and control C. We're going to close out of this and now let's talk about spinning
up a service permanently.
So let's say that we just had the Apache to running and then we rebooted the machine.
When we reboot our machine Apache 2 is not going to be online because we're only doing a service start.
It only holds during this session.
Once we reboot that session is gone that service is gone.
So if we want to keep something online the entire time what we can do is use sys CTO so we can say system
CDL enable or disable if you want to disable something.
And for example we could say SSD age now I'm not going to hit enter here.
This is just an example.
Well let's say that we wanted to have an SSD age available on our machines so we can SSA into it.
We are opening up SSA age for this feature here.
OK.
Let's say that we want to have a server and this is when they do want you to hit enter in.
This is going to be a database right.
This is a post rescue well.
So we're going to say sys CTO enable post guest you out and we have enabled that.
So now we reboot this post rescue will load every single time.
Now why is this important.
Well this is important because it's going to allow us to run medicinally and have the post rescue l
database running when we boot.
So it doesn't have to take the extra time to load it.
If we come over here and we just click on the Metis flight framework now post rescue is working.
And it says database already started so it's already configured it's going to skip initialization and
to go ahead and get right into it.
So it just saves us a little bit of time at us but it can take some time to to run and I think that
if you continue on I know if you continue on with being a pen tester you're definitely gonna be using
medicinally quite a bit.
So this is just one feature that if you're going to be using it it doesn't hurt to have it enabled on
your system.
Now if you feel that you want to have a patchy to boot you can go ahead and do the same thing with the
system enable system TTL enabled but the only one that I recommend putting on is this system TTL post
stress Q Well OK so that is it for this video in the next video we're going to be talking about installing
how to install things from get hub and how to install using app get.
So let's go ahead and move right into that video.