[go: up one dir, main page]

0% found this document useful (0 votes)
6 views36 pages

Linux Basics

The document provides an overview of basic networking concepts, including the functions of routers and switches, as well as common networking ports and protocols. It also discusses the Linux operating system, its structure, and essential commands for managing files and directories. Additionally, it highlights the significance of package managers and command chaining in Linux environments.

Uploaded by

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

Linux Basics

The document provides an overview of basic networking concepts, including the functions of routers and switches, as well as common networking ports and protocols. It also discusses the Linux operating system, its structure, and essential commands for managing files and directories. Additionally, it highlights the significance of package managers and command chaining in Linux environments.

Uploaded by

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

NETORKING

BASICS
PRESENTED BY GAD OWOLA
COMMON NETWORKING
DEVICES
ROUTERS
SWITCHES
FIREWALLS
What is a Router ?
A router is a device that connects two or more packet-
switched networks or subnetworks. It serves two primary
functions: managing traffic between these networks by
forwarding data packets to their intended IP addresses,
and allowing multiple devices to use the same Internet
connection.
What is a switch ?
A network switch connects devices within a network
(often a local area network, or LAN*) and forwards data
packets to and from those devices. Unlike a router, a
switch only sends data to the single device it is intended
for (which may be another switch, a router, or a user's
computer), not to networks of multiple devices
Difference between a switch
and a router
Routers select paths for data packets to cross networks and reach their
destinations. Routers do this by connecting with different networks and
forwarding data from network to network — including LANs, wide area networks
(WANs), or autonomous systems, which are the large networks that make up the
Internet.
In practice, what this means is that routers are necessary for an Internet
connection, while switches are only used for interconnecting devices. Homes
and small offices need routers for Internet access, but most do not need a
network switch, unless they require a large amount of Ethernet* ports.
However, large offices, networks, and data centers with dozens or hundreds of
computers usually do require switches.
*Ethernet is a layer 2 protocol for sending data between devices. Unlike
WiFi, Ethernet requires a physical connection via an Ethernet cable.
There are 65,535 possible port numbers, although not all are in common use. Some of the most commonly used
ports, along with their associated networking protocol, are:

Ports 20 and 21: File Transfer Protocol (FTP). FTP is for transferring files between a client and a server.
Port 22: Secure Shell (SSH). SSH is one of many tunneling protocols that create secure network connections.
Port 25: Historically, Simple Mail Transfer Protocol (SMTP). SMTP is used for email.
Port 53: Domain Name System (DNS). DNS is an essential process for the modern Internet; it matches human-
readable domain names to machine-readable IP addresses, enabling users to load websites and applications
without memorizing a long list of IP addresses.
Port 80: Hypertext Transfer Protocol (HTTP). HTTP is the protocol that makes the World Wide Web possible.
Port 123: Network Time Protocol (NTP). NTP allows computer clocks to sync with each other, a process that is
essential for encryption.
Port 179: Border Gateway Protocol (BGP). BGP is essential for establishing efficient routes between the large
networks that make up the Internet (these large networks are called autonomous systems). Autonomous systems
use BGP to broadcast which IP addresses they control.
Port 443: HTTP Secure (HTTPS). HTTPS is the secure and encrypted version of HTTP. All HTTPS web traffic goes to
port 443. Network services that use HTTPS for encryption, such as DNS over HTTPS, also connect at this port.
Port 500: Internet Security Association and Key Management Protocol (ISAKMP), which is part of the process of
setting up secure IPsec connections.
Port 587: Modern, secure SMTP that uses encryption.
Port 3389: Remote Desktop Protocol (RDP). RDP enables users to remotely connect to their desktop computers
from another device.
The Linux kernel was created by Linus Torvalds in 1991. What
makes it an operating system are the additions to the kernel
such as a package manager, desktop environment, a shell, and
a bootloader, among other components.

Because Linux is open-source, there are many customisations


that have been made to the operating system. Each specific
combination of customisations is called a distribution or
distro for short
Ubuntu (Most common)
Elementary OS (One of the most beautiful)
Debian (Neat and classy)
Arch Linux (For linux bosses)
Red Hat Enterprise Linux (Commercial and costly
💰 )
Linux is the choice OS of many hackers. Why,
you may ask? Because it’s open-source, less
prone to malware, lightweight, portable, and
very compatible with multiple hacking tools.
😎
1. Gnome (The best )
2. KDE Plasma (A Windows doppelganger)
3. Xfce (For geeks)
4. Mate (Hardware resource-efficient)
A package manager is software used
to manage software that is
downloaded and installed. You may
have heard of at least one of the
following package managers:
Apt (Linux)
Chocolatey (Windows)
MacPorts (MacOS)
Pip (Python)
Npm (Javascript)
Gradle (Java)
Composer (PHP)
linux file structure
/bin : binary or executable programs (nice place for keeping persistent
scripts)
/etc : system configuration files (an awesome place to obtain credentials)
/home : home directory (the default current directory when you open up
the terminal)
/opt : optional or third-party software
/tmp : temporary space, usually cleared on reboot (a great place to store
enumeration scripts)
/usr : User related programs
/var : log files (the perfect place to frustrate a forensic analyst)
A shell is a text-based interface for
controlling a Linux computer. Similar to
Microsofts’ Powershell or cmd, it is the
interface between the user and the kernel,
aside from the GUI (Graphical User
Interface).
Some common shells include:

The Bourne shell (sh)


The GNU-Bourne Again shell (bash)
The Z shell (zsh)
The C shell (csh)
The Korn shell (ksh)
Quick lesson: The words ‘terminal’ and ‘shell’ are
used interchangeably in the cybersecurity world.
But, they are different. The terminal is the
program that lets you access the shell via a
graphical interface.
whoami, pwd, ls, cd, touch,
cat, nano, operators, mv and
cp, mkdir, rm and rmdir,
stat, echo, grep, the ‘help’
flag and man pages.
How to use the whoami command
You use this command to check which user
you are. On a personal computer, you are most
likely to have only two accounts: the one
created when installing the OS and root. If you
are in the terminal as a normal user (account),
you can try it out.
How to use the pwd command
The Present Working Directory (pwd)
command informs you of where you
currently are in the directory tree. By
default this usually is the home
directory.
How to use the ls command
You use the ls command to list the
contents of a directory. It lets you
know what files are inside a
directory without a GUI.
How to use the cd command
You use the Change
Directory (cd) command to
transverse across the
directory tree.
How to use the cat, more, and less commands
All the commands above are output commands. You use
them to display the content of files to the terminal.

But there are notable differences here. cat is commonly used


for files with small amounts of text. less and more are likely
to be used for files with large amounts of text and output can
be controlled with the arrow keys.
How to use the touch command
You use the touch command to create
files. You can write to these files in a
number of ways, such as using a text
editor or piping input into it (more on that
later).
How to use the nano command
Nano is a popular built-in text editor in Linux.
It’s very common because it's easy to use and
it's supported in many CLI environments.
Other common text editors are Vim (very
😫
annoying ) and gedit (as simple as Notepad
🙃 ).
Command Chaining Operators
‘Chaining’ commands is the concept of writing multiple commands together
and executing them in a variety of ways. You usually do this with the use of
special characters. Examples include:

Ampersand (&): To run a program in the background


Logical AND (&&): The following command will run only if the previous one
successfully ran
Pipe (|): The output of the previous command acts as input for the next
command
Overwrite (>): Overwrites the content of a file with the output of the previous
one
Append (>>): Appends the output from the previous command to a file
How to use the mv and cp commands
These are two commands that are quite
similar but have notable differences. You use
mv to move a file to another location. You use
cp to copy a file to another location.
How to use the mkdir command
The mkdir command makes directories. You
could use this to make a custom directory
that only you can access on a compromised
system to keep scripts or tools for
persistence.
How to use the rm and rmdir commands
You might be able to figure this one out
yourself. rm is the command to remove files,
and rmdir is the command to remove
directories.
How to use the stat
command
You use the stat command
to give information about a
file.
How to use the echo command
You use the echo command to print out input.
Let’s use an example to make things clearer
How to use the grep command
Let’s take things up a notch. You use the grep
command to extract specified text from a file
using the pipe operator.
How to use the ‘help’ flag and man pages
Last on our list are ‘help’ and man. The
‘help’ flag isn’t necessarily a command but
it is a great aid if you are confused about an
app or tool.
man, on the other hand,
gives you all documented
information about the app.
updating linux
sudo apt update

sudo apt full-upgrade

You might also like