Linux+
Linux
▪ Linux is Open Source Operating system that can be
modified by you
▪ Anyone can add , remove code in linux
Linux Distributions
There are many distribution for linux :
Debian (Kali)
Ubuntu
Red Hat
Fedora
Centos ...
Linux
▪ Linux is used for android mobiles as Operating
system also
▪ More secure than Windows
▪ More Fast than Windows
▪ Provides all Hacking tools For Free
Linux
▪ Installation:
▪ There are Three types of installation :
▪ 1- Primary System
▪ 2- Virtual System
▪ 3- Bootable USB
Linux
▪ For Primary System you need to install it without
any other Operating System
▪ (like Windows , Mac Os)
In Primary System , Device would get
into Linux directly after boot
Linux
▪ Just go to kali.org then go to installer images then download 64
bit Image
▪ Then Burn Iso Image on USB by PowerIso App or balenaetcher
▪ Then shutdown your device and put USB and f12 or f10 or ESC to get
the boot
▪ Choose USB and start installing
Linux
▪ For Virtual Installation you need VMware
▪ Then install Iso image or VDmk Image
▪ And continue installation
Linux
▪ For bootable USB you don't need to install linux
on device , just install it on USB and then put it
on your Laptop and it will open the linux system
directly
▪ All what you need go to kali.org and choose
bootable USB image
▪ You can install another image called tails
▪ Then burn it on USB by balenaetcher
Linux
▪ After installing the system open terminal and
update it by :
▪ # sudo apt update
▪ # sudo apt upgrade
▪ apt is used to install new applications in linux
▪ Sudo means super user or root (high privileges )
(When you see (Permission denied) use # sudo
Linux Commands
▪ All commands are small letters
▪ To be root
▪ # sudo su
▪ And to be normal user
▪ # exit
▪ To see the current user
▪ # whoami
Linux Commands
▪ To see files on same directory or folder
▪ # ls
▪ To see the current folder
▪ # pwd
▪ To move to folder xyz
▪ # cd xyz
Linux Commands
▪ To get back to previous folder
▪ # cd ..
▪ To read file called xyz.txt
▪ # cat xyz.txt
▪ To create new file called xyz.txt
▪ # nano xyz.txt then write then CTRL+X then Y
title
▪ To remove file called xyz.txt
▪ # rm xyz.txt
▪ To create new folder called xyz
▪ # mkdir xyz
▪ To remove the folder xyz
▪ # rm –r xyz
Linux Paths
▪ There are two types of paths :
▪ absolute path starts with /
▪ Ex: /home/hossam/downloads/
▪ Relative path :
▪ Is it current path and you don't need to discribe
the full path
Linux Path
▪ If you are in folder /home/hossam/downloads and
need to remove file called xyz.txt in folder
downloads then you don't need to write the
full path
▪ # rm xyz.txt
▪ But if you are in different folder that what you
need to access then you will write the full path
▪ # rm /home/hossam/downloads/xyz.txt
Linux Commands
▪ To move file xyz.txt from place to /home directory
▪ # mv xyz.txt /home
▪ To change the name of xyz.txt to rednexus.txt
▪ # mv xyz.txt rednexus.txt
▪ To copy file from place to /home directory
▪ # cp xyz.txt /home
Linux Commands
▪ Difference between write and append
▪ To write is to add new content to file but deletes
the old content >
▪ To append is to add new content without
deleting old content >>
Linux Commands
▪ To print word rednexus in terminal
▪ # echo "rednexus"
▪ To write word "rednexus" inside file called xyz.txt
▪ # echo "rednexus" > xyz.txt
▪ To append word "rednexus" inside file called
xyz.txt
▪ # echo "rednexus" >> xyz.txt
Linux Commands
▪ To get information about network
▪ # ifconfig
▪ To get information about memory space
▪ # free
▪ To get information about hard disk
▪ # df –H
▪ To get information about processor
▪ # ps aux
Linux Commands
▪ There are many ways to install applications in
linux
▪ First : use # apt install <application>
▪ Second: use # snap install <application>
▪ Third : use # dpkg -i <application.deb>
Linux Permissions
▪ Permissions for files are (read , write , execute )
▪ Execute => 1 => x
▪ Write => 2 => w
▪ Read => 4 => r
▪ If you need read & write then 4+2 = 6
▪ If you need write& execute then 2+1 = 3
▪ If you need all read& write & execute then 7
Linux Permissions
▪ To see the permissions of files and folders
▪ # ls –lah
Linux Permissions
▪ First place - means that this is not a directory
▪ Remains 9 places let's separate every 3 places
▪ The first 3 rwx means read& write & execute but
for the owner
▪ The second 3 rwx for group users
▪ The thrid 3 rwx for other people who can access
Linux Permissions
If you relaized the first bit found ( d ) which
means that is directory
And the First three bits are (r w x ) => for the
owner
The second three bits are ( r – x ) => for
group users
The third three bits are ( r – x ) => for any
other user
Linux Permissions
▪ To change the permissions for a file xyz.txt
▪ # chmod 777 xyz.txt
▪ To add execute permission to a file xyz.txt
▪ # chmod +x xyz.txt
Linux Piping and redirect
▪ To redirect the output to another command use |
▪ To get the word hossam from file called xyz.txt
▪ # cat xyz.txt | |grep "hossam"
▪ To know the number of lines in file xyz.txt
▪ # cat xyz.txt | wc
Linux Labs
▪ You can get vps
▪ # ssh
[email protected]▪ And the password: segfault
▪ https://overthewire.org/wargames/bandit/bandit0.htm
l
▪ Hackthebox
Linux
The end