Welcome, guys, to Chapter six.
We've been learning how to process management, so any good Linux administrator or particularly hacker
needs to understand how to manage the processes to optimize our systems.
For example, once a hacker takes control which hybrid system they might want to find and stop a certain
process like an antivirus application or firewall to do so, the hacker will first need to know how
to find the process.
The hacker might also want to a scanning script to Ron periodically to find vulnerable systems.
So we also look at how to schedule such a script.
This chapter, we're going to learn how to manage those processes, guys.
So we're going to go ahead and start out with a command P.
S, so go ahead and type that.
And so the first step in managing process to be what processes are running in your system?
And again, a time is your best friend is a command.
So there's a couple of information subprocess, ID four, four, three, three, four, seven, three,
one.
So Apostolides SAGD process.
We also see some more information over here, so little time and bash at impious.
So now we're going to do piesse acts, and while we got a lot more information here.
So the peace committee with the option will show up process running a system for users.
So he processes IDs, CPU memory.
You can keep on scrolling down.
Now, a lot of these crosses are using a lot of CPU or nothing at all, memory is have been with a terminal.
And it has a date and time.
To go ahead and just look through all this data, see any clouds that you see?
Any process is running in the background, so let's say if you want to filter it by a process name.
So to demonstrate this, we'll use the Meadow's boy exploitation framework, which is the most widely
used exploitation framework and nearly every hacker's good friend, this should come and start on a
virtual machine.
So let's go ahead and start the massive console.
Which is way for a little bit and it's starting to spoil.
And there you go, all in its glory.
Now we want to.
Take a look.
I mean, was running just fine.
So we're going to see if we can find in the process so Pierre's ox.
Middle slash,
which is to search.
And there you go, we see that is running in the background, so C.P.U, there's the memory.
So let's say if you want to find a peace process with top, so when you enter the command, obviously
you see the processes running and the colonel decides PED's, which is process yds.
Now we're going to find out who's the greediest.
And we see, oh, zalk or box.
And so, again, this is taking up most of that information there with a virtual box, so system administrators
often keep top running in the terminal to monitor the use of process resources.
As a hacker, you might want to do the same, especially if you have multiple tasks running your system.
Well, you have top running process of the age or or a question mark will bring up a list of interactive
commands and pressing Cuba quick top.
So let's go ahead and H.
And this would actually give you some commands to manipulate, this is to kill actually a process or
a nice global, pretty helpful stuff.
Let's go ahead and quit that.
So sometimes hackers often need to multi process and an upper racism like Callies ideal for this, this
hacker might have a SportsCenter running with running a vulnerability scanner and explode simultaneously.
So this was quires of the hacker, managed these processes efficiently to best use system resources
and complete the task.
So this section, guys, I'll show you how to manage multiple processes.
So what I'm going to show you right now.
Is negative 20 zero.
Plus nineteen equals nineteen, plus nineteen.
So as you can see here, negative 20, this negative 20 represents a scale negative 20 to plus 19.
So this negative 20 is most likely to receive priority.
The Xeros nice value, what you do see here, and plus 19, which is least likely to receive priority.
And again, you see 19 over here.
Pretty cool, huh?
So.
Let's go ahead and exit out of there's still clear.
So for demonstrative purposes, to assume we have a process, a slow process, and that's located in
this flash forward, then Sportstalk Process directory, everyone's to speed up in its completion,
we could start the process with a nice command.
So you type in nice negative and
negative 10.
I can't remember about the scale we went over and forward slash been four slash slow process.
So this command incremented a nice value by negative 10 increases priority, allocating it more sources.
The other hand, if we want to be nice to our fellow users and processes and give slow process a lower
priority, we could increment its nice value positively by 10.
So, again, the more negative you go, the more prioritized.
But you can do a 10 and then you can hit enter Jessica's back.
And this is just an example process that you can mess around with.
Let's say if you want to change the priority of a running process with rhinitis, so it pretty much
takes the absolute divide between negative 20 and 19 and says top priority to that particular level
rather than increasing or decreasing from the level which you started.
In addition, rhinitis requires the process side of the process you are targeting rather than the name.
So a slow process is using on an arm an inordinate amount of resources on your system and you want to
give it a lower priority, thus allowing all the processes of high priority and more resources.
You to be nice to slow process of very nice 20 process ideas.
Six, nine, nine, six.
And again, process ID, as you can see on this other window is right here.
Process.
And again, you're going to be very careful, guys, when you're managing processes, sometimes you
can cause the system to slow down or you're doing an explosion and then you or you set up a red alarm
in the background.
So you've got to be very wary how you use these commands.
So, again, very nice.
Twenty six, nine, nine, six what actually allow a higher priority and more resources to other processes
so that times guys, our process will consume way too many system resources and exhibit unusual behavior.
What works for this process?
I this type of behavior is often referred to as a zombie process.
So for you guys, probably the most paranoid symptom will be wasted resources used by the zombie that
could be better allocated to to better useful processes.
So in order to kill process, you go ahead and do kill
Nego one six nine nine six and click enter.
So that should kill the process.
So one negative one really means is that it is known as a hang up signal.
It started this entire process and restarted with the same process it.
There there will there is a scale of one three from one nine from one to three, 15 and nine that would
actually be provided has an index reference, but I will go over it.
So, too, is the intrepid signal.
It is a weak kill signal that is guaranteed to work, but it works in most cases.
Three is known as a core dump.
It terminates the process and saves a process, information and memory and then saves information the
current working directory to a file named for the reasons for doing that.
I won't go over that because it is beyond this course.
For now, 15 is a termination signal.
It is to kill Command's default kill signal.
And if you want to make sure it's dead dead use nine.
Nine is the absolute kill signal.
It forces the process to stop by sending the process resources to a special device, which is for Sagdiyev
for signal.
So again, nine is absolute kill, 15 is termination.
Three is a core dump.
It terminates the process and saves them and saves the memory information to to interrupted interrupted.
And one is the hang up signal.
So now we're going to go over scheduling, so we're going to do naanu.
It's a news.
Script.
All right, so we're going to need this newsgroup.
So let's say you want to run a move, a process running in the background to the foreground, he is
the EFG command and it requires the of the process.
You want to return to the foreground, as we're going to do next.
So let's say.
Let me ask this.
Let's say.
So let's see what we got going on.
The warp, so 68, let's say we want to run it.
Well, this is day 52 and.
It was.
This national news script, and we're going to do the Naprosyn.
OK, so the show opened with a text editor,
so it does return a new command prompt so we can enter other commands in our system while also adding
our new script.
So I guess try for ground 50 to.
Says no to stop jobs, so actually stopped.
I know, new script.
So we're going to go with 65.
No such job.
Let's try this again.
That's due for a serious.
So we're going to learn how to schedule our process right now.
So this workout time format, so we can do at seven, 20 and.
So that's to zero.
So there isn't an outcome in this one.
So what's very interesting, there isn't an Aquaman initiative with his Kalari Lennix ISO, which is
a bummer.
Let me see if it's available at.
720 am.
That's not even found.
OK, guys, I got to say that Damon is not actually initiated.
With a prompt, so we're actually going to go ahead and skip that.
That's very interesting.
I guess that little program doesn't exist.
Let's see if we can find a locate at.
You know, we're going to go ahead and skip this for now, but that's very interesting.
So the Dayman program is not actually available with this.
It's very, very interesting.
Well, as we went over the permissions managing processes.
What I will do is I will actually go over that scripting and show you how to schedule processes that
way.
So but imagine process and is a key skill for every user and hacker.
So, again, a hacker will actually need to find Krauss's targeted one to kill, such as the of our
software firewall.
They also need to match multiple processes in attack or prioritize prioritize them.
Again, I would actually show you how to create a script to schedule a process and the in the next couple
of chapters coming up.
So great work, everybody.
Again, analyze this system, learn get acquainted with the programs running in the background and see
you next chapter.