a
a
##>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
##>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
##>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
##>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
##>nl
number lines
##>wc
shows how many lines/words/chracters/bytes
-l lines
-w words
-m chars
-c bytes
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
##> iwconfig
show the wireless interfaces in your system
##> dhclient
asks for ip from dhcp server
dhclient eth0
##>dig
used to bring info about a domain name
ns (name_server)
mx (MailExchangeServer)
>>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
++
+#>git clone
to install softwares from github
##>wget
to download from any link
##>chown
used to change the ownership of a file or directory
##>chgrp
used to change to group ownership of a file
##>chomod
used to change permssions for the file
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
##>> umask
----------
##>>open
opens files in the perfered user's application
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