at 7:20am at > /root/myscanningscript




Download 7,3 Mb.
Pdf ko'rish
bet85/125
Sana14.05.2024
Hajmi7,3 Mb.
#232858
1   ...   81   82   83   84   85   86   87   88   ...   125
Bog'liq
linuxbasicsforhackers

at 7:20am
at >
/root/myscanningscript
This code snippet will schedule myscanningscript to execute today at 
7:20 
am
. When you want to stop entering commands, hit 
ctrl
­D.
Summary
Managing processes in Linux is a key skill for every Linux user and hacker. 
You must be able to view, find, kill, prioritize, and schedule processes to 
manage your Linux instance optimally. A hacker often will need to find 
processes on the target they want to kill, such as the antivirus software or a 
firewall. They will also need to manage multiple processes in an attack and 
prioritize them. 
E XERCISES
Before you move on to Chapter 7, try out the skills you learned from this chapter 
by completing the following exercises:
1. Run the 
ps
command with the 
aux
options on your system and note which 
process is first and which is last.
2. Run the 
top
command and note the two processes using the greatest 
amount of your resources.
3. Use the 
kill
command to kill the process that uses the most resources.
4. Use the 
renice
command to reduce the priority of a running process 
to +19.
5. Create a script called 
myscanning
(to see how to write a bash script, see 
Chapter 8; the content of the script is not important) with a text editor and 
then schedule it to run next Wednesday at 1 
AM
.


7
M A N A G I N G U S E R 
E N V I R O N M E N T V A R I A B L E S
To get the most from your Linux hacking 
system, you need to understand environ-
ment variables and be adept at managing 
them for optimal performance, convenience, 
and even stealth. Among the areas that Linux new-
comers find problematic, however, managing the user 
environment variables might be the most difficult to 
master. Technically, there are two types of variables: shell and environment. 
Environment variables are process-wide variables built into your system and 
interface that control the way your system looks, acts, and “feels” to the 
user, and they are inherited by any child shells or processes. Shell variables
on the other hand, are typically listed in lowercase and are only valid in the 
shell they are set in. To avoid over-explanation, I just cover some of the most 
basic and useful skills for environment and shell variables in this chapter.


72
Chapter 7
Variables are simply strings in key-value pairs. Generally, each pair will 
look like 
KEY=value
. In cases where there are multiple values, they will look 
like 
KEY=value1:value2
. As with most things in Linux, if there are spaces in the 
value, it needs to be contained in quotation marks. In Kali Linux, your envi-
ronment is your bash shell. Each user, including root, has a default set of 
environment variables that determine how the system looks, acts, and feels. 
You can change the values for these variables to make your system work 
more efficiently, tailor your work environment to best meet your individual 
needs, and potentially cover your tracks if you need to.

Download 7,3 Mb.
1   ...   81   82   83   84   85   86   87   88   ...   125




Download 7,3 Mb.
Pdf ko'rish