Kali Linux
• Kali Linux used to pentest:
• Multi tools used for hacking
• Script kiddy
• Does not used with professional
hacker
Kali Works as window
• Kali-undercover
• Screen same as window
• File and folder as windows
• Command shell the same as cmd
• Return
• Kali-undercover
Kali files
• Sensitive for the letters , capital
not equal small
• Windows not sensitive for the
case of the letter
Why kali
• Most tools used in penetration testing found
• 90% tools designed to work with kali
• Most work by command line
• Graphical tools is slower to work and have bugs
Pwd, clear
• Pwd Where we are
• Clear to clean the cmd screen
ls
• Display the content folder
Ls -l
File and folder system
Files and folders for system
The Linux Filesystem /
• /bin - basic programs (ls, cd, cat, etc.)
• /sbin - system programs (fdisk, mkfs, sysctl, etc)
• /etc - configuration files
• /tmp - temporary files (typically deleted on boot)
• /usr/bin - applications (apt, ncat, nmap, etc.)
• /usr/share - application support and data files
Tmp is the temporary directory
System search on command in this path
/etc
• Commands or application found in /bin and /sbin
• If you want to modify on command or applications configuration from
/etc
/usr/bin
/usr/share/
Give interface IP address
Add a default route interface
Kali repository
Add user and password
Change username for this user
Delete user
Shell on kali
Change from shell to other shell
Display the users in kali, and profile and bash
Display password
Which user work on kali
Change to another user
Exit form alex user
Which command is used to locate the
executable file
Search about any files
In this location find f1.txt
Linux kernel: Get detailed info about your
system specifications
Neofetch tool return more information about system
System Message from the kernel
System record for services
Monitor memory • io:
• procs: • bi: Blocks received from a block device (read).
• r: Number of processes waiting for runtime. • bo: Blocks sent to a block device (write).
• b: Number of processes in uninterruptible • system:
sleep. • in: Number of interrupts per second.
• memory: • cs: Number of context switches per second.
• swpd: Amount of virtual memory used. • cpu:
• free: Amount of free memory. • us: Time spent running non-kernel code (user
• buff: Amount of memory used as buffers. time).
• cache: Amount of memory used as cache. • sy: Time spent running kernel code (system
• swap: time).
• si: Amount of memory swapped in from • id: Time spent idle.
disk. • wa: Time spent waiting for I/O.
• so: Amount of memory swapped out to disk.
vmstat
• This command displays system statistics every second for 10
seconds.
Command line display
• man - a special program is used to view the manual for the other
things.
• whatis - display one-line manual page descriptions #Help
• apropos - search the manual page names and descriptions
Man
ping
Ping –help
Ping 5 packets
What the Object from this tool
Tools
do ping
Type the command
ifconfig
IP address for new systems
Change mac address
Create file or folder
Remove directory
Ls -l
Dr. Ahmed Alhimiary 48
File and folder permissions
Dr. Ahmed Alhimiary 49
chown: change the owner of file, similar to
chmod
• Change the owner or group for files or directory
Change own the directory does not change
own the files inside this directory
Change the directory and any thing inside the
directory used Recursively option
Work with text
• Read the file content
• Nano f1.txt
• Less f1.txt
Echo
command
Dr. Ahmed Alhimiary 54
Cat
command
Dr. Ahmed Alhimiary 55
If the file is very lage first use wc
• The output of this command:
• 6 lines
• 50 words
• 263 byte-size
• The name of the file (f1.txt)
Grep
• It searches for lines that match a
regular expression and print
them
• Grep –c to count the number of
words found in the file
shred If you ever wanted a file to
be almost impossible to
recover, shred can help you
with this task.
This command overrides the
contents of a file repeatedly,
and as a result, the given file
becomes extremely difficult
to recover.
Shred –u file to delete the
file
encryption
• Encryption is the process of encoding data to prevent unauthorized
access
• OpenSSL is a powerful toolkit for SSL/TLS protocols and includes
various cryptographic functions.
decrypt
Ccrypt tool
hashing
TCP/IP layers
Transport layer ports
ports
Services on window system
Port for services, file services
In linux
Local DNS server
DNS resolve the IP address from local PC
Phishing IP address
On kali
UDP Header
TCP flags
Flags
TCP flag state
TCP Flags
Flag Name Functions
Set during initial communication. Negotiating of parameters and
SYN Synchronize
sequence numbers
Acknowledgme Set as an acknowledgement to the SYN flag. Always set after
ACK
nt initial SYN
RST Reset Forces the termination of a connection (in both directions)
FIN Finish Ordered close to communications
PSH Push Forces the delivery of data without concern for buffering
Data inside is being sent out of band. Example is cancelling a
URG Urgent
message
Syn packet in wireshark
Syn/ack packet in wireshark
Three-way handshake
homework
• Give me with the picture most significant work with this command
• df
• du
• top
• htop
• ps aux
• Kill
• Tar
• Curl, wget,grep
• resync