Capital City Christian Church
PluggedIn IT Ministry



Linux

Linux is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged in a Linux distribution.

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name "GNU/Linux" to emphasize the importance of GNU software, causing some controversy.

Popular Linux distributions include Debian, Fedora, and Ubuntu. Commercial distributions include Red Hat Enterprise Linux and SUSE Linux Enterprise Server. Desktop Linux distributions include a windowing system such as X11 or Wayland, and a desktop environment such as GNOME or KDE Plasma. Distributions intended for servers may omit graphics altogether, or include a solution stack such as LAMP. Because Linux is freely redistributable, anyone may create a distribution for any purpose.

Linux was originally developed for personal computers based on the Intel x86 architecture, but has since been ported to more platforms than any other operating system. Because of the dominance of the Linux-based Android on smartphones, Linux also has the largest installed base of all general-purpose operating systems. Although it is used by only around 2.3 percent of desktop computers, the Chromebook, which runs the Linux kernel-based Chrome OS, dominates the US K–12 education market and represents nearly 20 percent of sub-$300 notebook sales in the US. Linux is the leading operating system on servers (over 96.4% of the top 1 million web servers' operating systems are Linux), leads other big iron systems such as mainframe computers, and is the only OS used on TOP500 supercomputers (since November 2017, having gradually eliminated all competitors).

Linux also runs on embedded systems, i.e. devices whose operating system is typically built into the firmware and is highly tailored to the system. This includes routers, automation controls, smart home technology (like Google Nest), televisions (Samsung and LG Smart TVs use Tizen and WebOS, respectively), automobiles (for example, Tesla, Audi, Mercedes-Benz, Hyundai, and Toyota all rely on Linux), digital video recorders, video game consoles, and smartwatches. The Falcon 9's and the Dragon 2's avionics use a customized version of Linux.

Linux is one of the most prominent examples of free and open-source software collaboration. The source code may be used, modified and distributed commercially or non-commercially by anyone under the terms of its respective licenses, such as the GNU General Public License.

90% of all cloud infrastructure is powered by Linux including supercomputers and cloud providers. 74% of smartphones in the world are Linux-based.

https://en.wikipedia.org/wiki/Linux - as of Fri 08.20.2021 16:17:19


Booting Up Linux

You can run Linux from the local hard drive, a DVD, or a USB drive. For the most part, we will run Linux from a USB.

For our purposes, these are the steps for powering up a laptop booting from a USB drive.

  1. Plug the USB drive into a USB port on the computer
  2. Turn on the power to the laptop
  3. When the logo appears press the F12 key. I often start pressing it repeatedly even before the logo and keep pressing the F12 key repeatedly until a message about 'Boot up' appears on the screen. Then I just wait a few moments until the boot menu appears.
  4. On the boot menu, use the up and down arrow keys to select the option for a 'USB' drive. Then press the enter key.
  5. The screen will likely go black and a few text messages will appear at the top left of the screen. After awhile you will see the Kali Linux logo (a dragon).
  6. If any of your partitions are encrypted you will be prompted for their pass phrases.
  7. Then after a moment you will see a screen that prompts you for the user account and password. Type them in and press enter.
  8. Next you will be at the Linux desktop where you can begin to work.

Navigation

Click on the image below to expand it's size (clicking toggles it's size). Then notice the different area's of navigation.


Getting Help About Applications

Linux comes with detailed documentation and information about practically every program within the system. Every time you install new software, it's documentation is also installed.

In many cases, a program will contain consise information about how to run. You can display that information without actually doing whatever the program by using the '--help' parameter, or in some cases '-h'.

In the case of the 'host' program, you can see below the type of information it provides.

--help

┌──(parth㉿parth)-[~]
└─$ host --help
host: illegal option -- -
Usage: host [-aCdilrTvVw] [-c class] [-N ndots] [-t type] [-W time]
            [-R number] [-m flag] [-p port] hostname [server]
       -a is equivalent to -v -t ANY
       -A is like -a but omits RRSIG, NSEC, NSEC3
       -c specifies query class for non-IN data
       -C compares SOA records on authoritative nameservers
       -d is equivalent to -v
       -l lists all hosts in a domain, using AXFR
       -m set memory debugging flag (trace|record|usage)
       -N changes the number of dots allowed before root lookup is done
       -p specifies the port on the server to query
       -r disables recursive processing
       -R specifies number of retries for UDP packets
       -s a SERVFAIL response should stop query
       -t specifies the query type
       -T enables TCP/IP mode
       -U enables UDP mode
       -v enables verbose output
       -V print version number and exit
       -w specifies to wait forever for a reply
       -W specifies how long to wait for a reply
       -4 use IPv4 query transport only
       -6 use IPv6 query transport only

which

┌──(parth㉿parth)-[~]
└─$ which host
/usr/bin/host

apropos

┌──(parth㉿parth)-[~]
└─$ apropos arp
CGI::Carp (3pm)      - CGI routines for writing to the HTTPD (or other) error log
arp (7)              - Linux ARP kernel module.
arp (8)              - manipulate the system ARP cache
arp-fingerprint (1)  - Fingerprint a system using ARP
arp-scan (1)         - The ARP scanner
arp2ethers (8)       - convert arpwatch address database to ethers file format
arpd (8)             - userspace arp daemon.
arpfetch (8)         - obtain ethernet/ip address pairings via snmp
arping (8)           - sends arp and/or ip pings to a given host
arpsnmp (8)          - keep track of ethernet/ip address pairings
arpspoof (8)         - intercept packets on a switched LAN
arptables-nft (8)    - ARP table administration (nft-based)
arptables-nft-restore (8) - Restore ARP Tables (nft-based)
arptables-nft-save (8) - dump arptables rules to stdout (nft-based)
arpwatch (8)         - keep track of ethernet/ip address pairings
get-iab (1)          - Fetch the arp-scan IAB file from the IEEE website
get-oui (1)          - Fetch the arp-scan OUI file from the IEEE website (on Debian and Debia...
ip-neighbour (8)     - neighbour/arp tables management.
mac-vendor (5)       - Ethernet vendor file for arp-scan
massagevendor (8)    - convert the ethernet vendor codes master list to arpwatch format
netdiscover (8)      - active/passive ARP reconnaissance tool
NetPacket::ARP (3pm) - Assemble and disassemble ARP (Address Resolution Protocol) packets.
packetforge-ng (1)   - forge packets: ARP, UDP, ICMP or custom packets.
Perl::Critic::Policy::ErrorHandling::RequireC... (3pm) - Use functions from Carp instead of "...
rarp (8)             - manipulate the system RARP table
sane-ma1509 (5)      - SANE backend for Mustek BearPaw 1200F USB scanner
sane-sharp (5)       - SANE backend for SHARP scanners
sane-u12 (5)         - SANE backend for Plustek USB flatbed scanners, based on older parport ...

┌──(parth㉿parth)-[~]
└─$

man

NAME
       arp - manipulate the system ARP cache

SYNOPSIS
       arp [-vn] [-H type] [-i if] [-ae] [hostname]

       arp [-v] [-i if] -d hostname [pub]

       arp [-v] [-H type] [-i if] -s hostname hw_addr [temp]

       arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub

       arp [-v] [-H type] [-i if] -Ds hostname ifname [netmask nm] pub

       arp [-vnD] [-H type] [-i if] -f [filename]

DESCRIPTION
       Arp  manipulates or displays the kernel's IPv4 network neighbour cache.
       It can add entries to the table, delete one or display the current content.

       ARP stands for Address Resolution Protocol, which is used to find the
       media access control address of a network neighbour for a given IPv4
       Address.

MODES
       arp with no mode specifier will print the current content of the table.
       It is possible to limit the number of entries printed, by specifying
       an hardware address type, interface name or host address.

       arp  -d  address will delete a ARP table entry. Root or netadmin
       privilege is required to do this. The entry is found by IP address.
       If a hostname is given, it will  be  re‐

Manual page arp(8) line 1 (press h for help or q to quit)

Update and Install Software

There several programs that help you install, uninstall, and update software on a Linux system. Each distribution tends to settle on one as its preferred method. In the case of Ubuntu and Kali, it is the 'apt' system.

The Linux community keeps repositories of available software for installation and updating. The 'apt' program is what we use in Kali (and many other distors) to install and update most software. Repositories are servers which contain sets of packages.

The 'apt' program(s) must be run by root, so you will want to use the 'sudo' program to run privileged programs like 'apt' as root while logged in as your own account.

Repositories may be standard or non-standard. Once a non-standard repository has been added to your system's list of repositories, the system can install software from it, as well as from the standard ones; otherwise, it cannot. In general, adding a non-standard repository is a simple step. The sudo apt-add-repository command on Ubuntu, for example, can be used to add a repository. The --help option for the apt-add-repository command shows these command examples: (https://www.networkworld.com/article/3305810/how-to-list-repositories-on-linux.html)

    apt-add-repository 'deb http://myserver/path/to/repo stable myrepo'
    apt-add-repository 'http://myserver/path/to/repo myrepo'
    apt-add-repository 'https://packages.medibuntu.org free non-free'
    apt-add-repository http://extras.ubuntu.com/ubuntu
    apt-add-repository ppa:user/repository
    apt-add-repository ppa:user/distro/repository
    apt-add-repository multiverse

You can list the repositories your system uses with the following 2 commands

┌──(parth㉿parth)-[~]
└─$ sudo apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 https://download.sublimetext.com apt/stable/ Packages
     release o=Sublime Text,a=apt/stable,l=Sublime Text APT Repository,c=
     origin download.sublimetext.com
 500 https://brave-browser-apt-release.s3.brave.com stable/main amd64 Packages
     release o=Brave Software,a=stable,n=stable,l=Brave Browser,c=main,b=amd64
     origin brave-browser-apt-release.s3.brave.com
 500 http://http.kali.org/kali kali-rolling/contrib amd64 Packages
     release o=Kali,a=kali-rolling,n=kali-rolling,c=contrib,b=amd64
     origin http.kali.org
 500 http://http.kali.org/kali kali-rolling/non-free amd64 Packages
     release o=Kali,a=kali-rolling,n=kali-rolling,c=non-free,b=amd64
     origin http.kali.org
 500 http://http.kali.org/kali kali-rolling/main amd64 Packages
     release o=Kali,a=kali-rolling,n=kali-rolling,c=main,b=amd64
     origin http.kali.org
Pinned packages:

┌──(parth㉿parth)-[~]
└─$ sudo grep -Erh ^deb /etc/apt/sources.list*
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64]
   https://brave-browser-apt-release.s3.brave.com/ stable main
deb https://download.sublimetext.com/ apt/stable/

See https://ostechnix.com/find-list-installed-repositories-commandline-linux/ for more information on repositories and adding or removing them.

As with most programs, the '-h' or '--help' parameter will provide information about that program.

┌──(parth㉿parth)-[~]
└─$ sudo apt -h
[sudo] password for parth:
apt 2.2.4 (amd64)
Usage: apt [options] command

apt is a commandline package manager and provides commands for
searching and managing as well as querying information about packages.
It provides the same functionality as the specialized APT tools,
like apt-get and apt-cache, but enables options more suitable for
interactive use by default.

Most used commands:
  list - list packages based on package names
  search - search in package descriptions
  show - show package details
  install - install packages
  reinstall - reinstall packages
  remove - remove packages
  autoremove - Remove automatically all unused packages
  update - update list of available packages
  upgrade - upgrade the system by installing/upgrading packages
  full-upgrade - upgrade the system by removing/installing/upgrading packages
  edit-sources - edit the source information file
  satisfy - satisfy dependency strings

See apt(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
                                This APT has Super Cow Powers.

Updating currently installed software

┌──(parth㉿parth)-[~]
└─$ sudo apt update
Hit:1 https://brave-browser-apt-release.s3.brave.com stable InRelease
Hit:2 https://download.sublimetext.com apt/stable/ InRelease
Hit:3 http://kali.download/kali kali-rolling InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.

Upgrading Software

┌──(parth㉿parth)-[~]
└─$ sudo apt upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  autossh device-pharmer hostapd isc-dhcp-server kali-linux-nethunter libirs-export161
  libisccfg-export163 libssl-dev linux-headers-5.10.0-kali7-amd64
  linux-headers-5.10.0-kali7-common linux-image-5.10.0-kali7-amd64 nethunter-utils
  policycoreutils python3-gevent python3-gevent-websocket python3-greenlet python3-m2crypto
  python3-parameterized python3-plotly python3-zope.event selinux-utils tcptrace tinyproxy
  tinyproxy-bin wipe xplot-xplot.org
Use 'sudo apt autoremove' to remove them.
The following packages have been kept back:
  plocate
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

Search for available software by keyword

┌──(parth㉿parth)-[~]
└─$ sudo apt search igmp
Sorting... Done
Full Text Search... Done
igmpproxy/kali-rolling 0.3-1 amd64
  IGMP multicast routing daemon

ostinato/kali-rolling 1.1-1+b1 amd64
  Packet/Traffic Generator and Analyzer

packeth/kali-rolling 1.6.5-2.1 amd64
  Ethernet packet generator

smcroute/kali-rolling 2.4.4-3 amd64
  static multicast router daemon

t50/kali-rolling,now 5.8.7-2 amd64 [installed,automatic]
  Multi-protocol packet injector tool

tcpdump/kali-rolling,now 4.99.0-2 amd64 [installed,automatic]
  command-line network traffic analyzer

Reference Using apt Commands in Linux (https://itsfoss.com/apt-command-guide/)


Programs to Install

As you have time, install the following software.

You will need to have a good Internet connection.

Before updating or installing any software, make sure to first update/upgrade the apt database and installed applications. Below is an example of how that is done. Note that if you are going to install several packages, you only need to update/upgrade one before installing a number of programs.

┌──(parth㉿parth)-[~]
└─$ sudo apt update
Hit:1 https://brave-browser-apt-release.s3.brave.com stable InRelease
Hit:2 https://download.sublimetext.com apt/stable/ InRelease
Hit:3 http://kali.download/kali kali-rolling InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.


┌──(parth㉿parth)-[~]
└─$ sudo apt upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  kali-linux-large udisks2
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

The programs to install are;