Module 1 Ethical Hacking

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Module : 1

Virtualization

Virtualization -

Virtualization is the process of running a virtual instance of a computer system in a layer abstracted
from the actual hardware. Most commonly, it refers to running multiple operating systems on a
computer system simultaneously. To the applications running on top of the virtualized machine, it
can appear as if they are on their own dedicated machine, where the operating system, libraries, and
other programs are unique to the guest virtualized system and unconnected to the host operating
system which sits below it.

1
Hypervisor –

Hypervisor A hypervisor is a program for creating and running virtual machines. Hypervisors
have traditionally been split into two classes: type one, or "bare metal" hypervisors that run
guest virtual machines directly on a system's hardware, essentially behaving as an
operating system.
Types of Hypervisors -
Type 1: Hardware based
Type 2: Software based

Docker -

Docker is a set of platforms as a service product that use OS-level virtualization to deliver
software in packages called containers. The service has both free and premium tiers. The
software that hosts the containers is called Docker Engine.

Architecture of Docker:

2
VM vs Docker -

3
WSL (Windows Subsystem for Linux) -

The Windows Subsystem for Linux (WSL) is a feature of the Windows operating system that enables
you to run a Linux file system, along with Linux command-line tools and GUI apps, directly on
Windows, alongside your traditional Windows desktop and apps. Windows Subsystem for Linux is a
compatibility layer for running Linux binary executables natively on Windows 10, Windows 11, and
Windows Server 2019.

4
Linux Disk Formats –

1. FAT 32 : UEFI boot has to be FAT32


 Maximum File Size: 4 GB
 Maximum Volume Size: 32 GB with Windows Format utility, 2 TB with other utilities
 (Theoretical maximum of 16 TB) - Although the larger the size the more wasted
space.
 Journalling: None
 Security: None
 Hard Links: None
 Symbolic Links: None
 Compression: None
 Transactional Writes: None
 Encryption: None
 Quotas: No

2. NTFS
 Maximum File Size: 16 exabytes (16 million TB - note this is more than the
current
 maximum volume size, so the file is actually limited by the volume size.)
 Maximum Volume Size (currently): 8 petabytes (8,000 TB)
 Journalling: Yes
 Security: ACL Based
 Hard Links: Yes
 Symbolic Links: Yes
 Compression: LZNT1 algorithm
 Transactional Writes: Yes
 Encryption: Symmetric Key file Encryption
 Quotas: Yes

3. EXT4
 Maximum File Size: 16 TB (smaller than on NTFS)
 Maximum Volume Size (currently): 1 exabyte (1 million TB) - (larger than NTFS)
 Journalling: Yes
 Security: User, Group, Other (standard Linux model)
 Hard Links: Yes
 Symbolic Links: Yes
 Compression: None (worse than NTFS) - note compression can be done through
 additional software.
 Transactional Writes: Yes

5
 Encryption: Only available on Single user systems (worse than NTFS) -
additional
 software can be used for encryption on Linux, however, I am not aware of how
 transparent the encryption process is to users with the additional software.
 Quotas: Yes

4. BTRFS
 Sub volume management(even across disks with unequal sizes)
 copy-on-write filesystem making backups easier
 It makes easier to coexist with Linux in the same volume

Directories –

6
7
Commands –

Command Description
Man <tool> Opens man pages for the specified tool.
<tool> -h Prints the help page of the tool.
Apropos Searches through man pages’ descriptions for instances of a given
<keyword> keyword.
Cat Concatenate and print files.
Whoami Displays current username.
Id Returns users identity.
Hostname Sets or prints the name of the current host system.
Uname Prints operating system name.
pwd Returns working directory name.
ifconfig The ifconfig utility is used to assign or view an address to a network
interface and/or configure network interface parameters
ip ip is a utility to show or manipulate routing, network devices,
interfaces, and tunnels.
Netstat Shows network status.
Ss Another utility to investigate sockets.
Ps Shows process status.
Who Displays who is logged in.
env Prints environment or sets and executes a command.
Lsblk Lists block devices.
Lsusb Lists USB devices.
Lsof Lists opened files.
Lspci Lists PCI devices.
Sudo Execute command as a different user.
Su The su utility requests appropriate user credentials via PAM and
switches to that user ID (the default user is the superuser). A shell
is then executed.

8
Useradd Creates a new user or update default new user information.
userdel Deletes a user account and related files.
usermod Modifies a user account.
addgroup Adds a group to the system
delgroup Removes a group from the system
passwd Changes user password.
dpkg Install, remove and configure Debian-based packages.
apt High-level package management command-line utility.
snap Install, remove and configure snap packages.
gem Standard package manager for Ruby
pip Standard package manager for Python.
git Revision control system command-line utility.
systemctl Command-line based service and systemd control manager.
ps Prints a snapshot of the current processes.
journalctl Query the systemd journal.
kill Sends a signal to a process.
bg Puts a process into background
jobs Lists all processes that are running in the background.
fg Puts a process into the foreground.
curl Command-line utility to transfer data from or to a server.
wget An alternative to curl that downloads files from FTP or HTTP(s)
server.
python3 -m Starts a Python3 web server on TCP port 8000.
http.server
ls Lists directory contents
cd Changes the directory.
clear Clears the terminal.
touch Creates an empty file.
mkdir Creates a directory.

9
tree Lists the contents of a directory recursively.
mv Move or rename files or directories.
cp Copy files or directories.
nano Terminal based text editor.
which Returns the path to a file or link
find Searches for files in a directory hierarchy
updatedb Updates the locale database for existing contents on the system.
locate Uses the locale database to find contents on the system.
more Pager that is used to read STDOUT or files.
less An alternative to more with more features.
head Prints the first ten lines of STDOUT or a file.
tail Prints the last ten lines of STDOUT or a file
sort Sorts the contents of STDOUT or a file
grep Searches for specific results that contain given patterns
cut Removes sections from each line of files
tr Replaces certain characters.
column Command-line based utility that formats its input into multiple
columns.
awk Pattern scanning and processing language.
sed A stream editor for filtering and transforming text.
wc Prints newline, word, and byte counts for a given input.
chmod Changes permission of a file or directory.
Chown Changes the owner and group of a file or directory.

1
0
File permissions -

=>1 exe
=>2 wri
3 wri exe
=>4 rea
5 rea exe
6 rea wri
7 rea wri exe

-s SUID bit permission


users to run programs with the rights of another user. Administrators often
use this to give their users special rights for certain applications or files.
The letter "`s`" is used instead of an "`x`". When executing such a program,
/etc/passwd
the SUID/GUID of the file owner is used.

#List the permission for user on system.


sudo -l

1
1
/etc/passwd
the SUID/GUID of the file owner is used.
#List the permission for user on system.
sudo -l
$cat /etc/passwd
test:x:0:0:root:/root:/bin/bash
#username:password:userID:groupID:userIDinfo:HomeDir:Shell

1
2
1. Username: It is used when user logs in. It should be between 1 and 32 characters in
length.
2. Password: An x character indicates that encrypted password is stored in
/etc/shadow file. Please note that you need to use the passwd command to compute
the hash of a password typed at the CLI or to store/update the hash of the password in
/etc/shadow file, in this case, the password hash is stored as an "x".
3. User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero) is reserved
for root and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-
999 are reserved by system for administrative and system accounts/groups.
4. Group ID (GID): The primary group ID (stored in /etc/group file)
5. User ID Info: The comment field. It allows you to add extra information about the
users such as user’s full name, phone number etc. This field use by finger command.
6. Home directory: The absolute path to the directory the user will be in when they log
in. If this directory does not exist then user’s directory becomes /
7. Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this
is a shell. Please note that it does not have to be a shell.

1
3

You might also like