[go: up one dir, main page]

0% found this document useful (0 votes)
4 views7 pages

a

The document provides a comprehensive list of commands used in Kali Linux, detailing their functions and options. It covers commands for file management, process monitoring, network configuration, package management, and permissions. Additionally, it includes explanations of specific command flags and their effects on file and directory operations.

Uploaded by

babbba48
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views7 pages

a

The document provides a comprehensive list of commands used in Kali Linux, detailing their functions and options. It covers commands for file management, process monitoring, network configuration, package management, and permissions. Additionally, it includes explanations of specific command flags and their effects on file and directory operations.

Uploaded by

babbba48
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

Commands in Kali:

##>whoami = show who is the user now

##>ls = list lists files and directories in the same directory


-l for a list of directories
-a for all f and d
-1 line per f or d
-x sort by entery of f exensions .exe .pdf
-U list unsorted
-S list sorted by word
-r sort reverse
-R recursive list (list all direcotries and list the dircroties inside other
directories)
-s show size
-h human readable (size will be in killo and mega bytes)
-A almost all but skip . extensions
-t sort by modified time

##>pwd :
present working directory

##>nano :
create, open, and modifiy files (text editor in kali)

##>vi :
create, open, and modifiy files (another text editor), but here the commands
usage is now clear so you need to know the shortcuts

clt+i = enter the insersion mode


clt+c = enter the command mode
: = enter the commands after it
exmple(:q!)

##>touch :
create files (touch man.txt)

##> echo
1-echo can be used to print things in terminal
2-print things into other files
3-create files and print things to them

> for editing the file


>> appending to the file

echo hello , echo hello > hello.txt

##>locate
used to search for files and directories from the database (need updatedb
before you run to show the latest updates)
* to search freely similar to Rgex

? as . in regex , and
* matches any chracter and any length
[a,b,..] used to check between the avaiable chracters
##> find
similar to locate but you don't need updatedb because the search is live, but
it is slower.
-/ path where to search first
-type
-name
-user
-4000
-perm

##> whereis
search for binaries

##> which
lookup binaries only in the variable path which sotres all commands you enter

##> cd
change directory
~ home
/ roo
.. go back one directory

##>ps >>>ps -aux

takes a snapshot of current running processes


-A all processes
-a all processes except both session leaders and processes not associated
with the terminal
-e idintical to A
-N select all process but the processes that satisfy the following condition
T processes for this terminal
r restrict selection to only running processes
x uss bsd-Style

##>grep
select the line that has the following

ls | grep man

##>cat
used to create files and modifiy them appending to them
1-create max.txt
2-editing "hello" >max.txt
3-appending ",man" >> max.txt

##>mkdir
create directories
-p create a dircetory inside another directory
##rmdir
removes directoreis
##>mv
move a file to another directory
renmae a file in the same directory

##>rm
remove file
-f force removing
-r recursion (removes all directories inside this directory)
-d for empty directories
-i prompt for conset for each file
-I only prompt for more than 3 files

<<<<rm -f ? removes all files with only one chracter

>>>>>>>>>>>>>>>>>>>>>>>> ./ related path mean the path you're in now

##>nl
number lines

##>wc
shows how many lines/words/chracters/bytes
-l lines
-w words
-m chars
-c bytes

##>sed (stread editor)


it is used to select and replace any occurances of a text

sed /s/old_word/new_word/scope g or 1 or 2 trarget_file then if you wan to


insert it into another file use > or >>

sed /s/kill/kiss/g my_text.txt >> new_file.txt

G y]
gaerzwqZRFDF sed -i for modifing the original file ddaetwtut7umhs

##> to modifiy files start with - name use -- or \ to escape the dash

example
rm -- -s.txt

rm \ -s.txt

##> ifconfig
used to show the wired network informatoin

netmask
broadtcast
up
down
hw ether (similar to macchanger tool)
example
ifconfig eth1 192.168.1.1 netmast 255.255.255.0 broadcast 192.168.1.255

ifconfig eth1 192.168.1.1 255.255.255.0 192.168.1.1 192.168.1.255

ifconfig eth1 hw ether aa:bb:cc:dd:21:23

##> iwconfig
show the wireless interfaces in your system

iwconfig eth0 essid "k40"


iwconfig eth0 mode
iwconfig eth0 nickname
iwconfig eth0 enc
iwconfig eth0 key
iwconfig eth0 ap

##> dhclient
asks for ip from dhcp server

dhclient eth0

##>dig
used to bring info about a domain name

dig www.google.com ns (ns for server)

ns (name_server)
mx (MailExchangeServer)

##> change dns server


edit the file in /etc/reslov.conf

or you can use (echo "nameserver 8.8.8.8") >> /etc/reslov.conf

##> hosts (/etc/hosts)


you can use this file along side with tools such as dnsspoot and eatercap

##> apt or apt-get


(is the software manager in debain distrubtions)

apt-cache ::: search for searching for a package in the repository


apt-get install ::: (used to install packages)
apt-install ::: (similar to apt-get )
apt-get remove ::: (to uninstall packages but leaves the configuration
files)
apt-get purge ::: (to remove packages and remove the configuration
files at the same time)

>>apt autoremove ::: to remove all dependencies and libraries that are
left after uninstalling packages

apt-get update
apt-get upgrade
apt-get upgrade update

##>repositories
servers that hold the software for particular distributions of linux are
known as repositories

/etc/apt/sources.list here you can add repostories(keep in mind every


distrbutio
has its own repositories ubuntu and kali)

##>> GUI installers


you can installed a GUI installer to install packages using the gui not the
command line
apt-get isntall synaptic

++
+#>git clone
to install softwares from github

##>wget
to download from any link

##>chown
used to change the ownership of a file or directory

chown newOwner file


chown newOwner:newGroupOwner file

##>chgrp
used to change to group ownership of a file

chown newGroup file

##>chomod
used to change permssions for the file

1)chmod a+x *.sh


2)chmod u+r , g=w , o-x
3)chmod 777 *.sh

1 = x
2 =w
3 = wx
4 = r
5 = rx
6 = rw
7 =rwx

>>>>>>>>How a umask value of 022 affects the permissions on new files and
directories

new files new directories

default 6 6 6 7 7 7 linux base permissions


0 2 2 0 2 2 umask
6 4 4 7 5 5 resulting permissions

---->>>>umask is preconfiguried to 022 in most systems in linux

##>> umask

for one session >>>


umask 222 or any number
for all the time>>>
in .bashrc add the line umask

show the default newly_created files permissions


it is usually 022

##>> sticky bit


in older linux versions (used to give a permissions to delete and create
files in a directory)

----------

##>>open
opens files in the perfered user's application

##>>SUID AND GUID set (user/group)


used to escalte privilages for hackers

4000 for usid (excute the file as if you were the owner)
2000 for Guid (permissons on this file are for the group not the user
excuting it)
6000 for (SUID + GUID) for all files
7000 for all(file or folder)

SUID
you can excute the file as root even if you don't have root privilges
(awosme target for hackers to esclaste priviliges)
you can search for it using (find)
>>>find / -perm -4000

You might also like