Kali linux net installer

Kali linux net installer

In this section, we will describe the process of installing Kali Linux on 32-bit and 64-bit hardware using the images published on the Kali Linux download page.

Content

Which Image to Choose

The Kali Linux download page offers different image types (Installer, NetInstaller and Live) for download, each available for both 32-bit and 64-bit architectures. Additionally, there is an Everything flavor of the Installer and Live images, for 64-bit architectures only.

If in doubt, use the “Installer” image. You will need to check your system architecture to know whether to get 32-bit or 64-bit. If you don’t know it, you’re best to research how to find out (As a rule of thumb, if your machine’s newer than 2005 you should be okay with amd64/x64/64-bit)

Installer

This is the recommended image to install Kali Linux. It contains a local copy of the (meta)packages listed (top10, default & large) so it can be used for complete offline installations without the need of a network connection.

This image cannot be used to boot a live system (such as directly running Kali from a USB). It is only an installer image.

NetInstaller

This image can be used if you want the latest package every time you install Kali Linux or the standard installer image is too big to download. This image is very small because it does not contain a local copy of (meta)packages to install. They will all be downloaded during installation, so as a result this requires a network connection which will slow down the installation time.

Only use this image if you have reasons not to use the standard installer image above.

This image cannot be used to boot a live system (such as directly running Kali from a USB). It is only an installer image.

Live

This image is for running Kali Linux without installing it first so it is perfect for running off a USB drive (or a CD/DVD).

You are able to install Kali Linux in its default configuration from this image but you will not be able to choose between desktop environments or to specify additional (meta)packages to install.

Everything

This image is meant for offline scenarios, when you want to use Kali Linux in a place that has no network connectivity. The image is huge (more than 9GB), as it contains nearly all of Kali’s tools already. It’s only available for the 64-bit architecture, and it can be downloaded via BitTorrent only.

Kali “everything” is not exactly an image, it’s a flavor. You can download either the Installer Everything image or the Live Everything image. In both case, all the tools are already there, no need for an Internet connection.

Читайте также:  Очистить кэш обновлений linux

Which Desktop Environment and (Meta)Packages to Choose During Installation:

Each Kali Linux installer image (not live) allows the user to select the preferred “Desktop Environment (DE)” and software collection (metapackages) to be installed with operating system (Kali Linux).

We recommend sticking with the default selections and add further packages after the installation as required. Xfce is the default desktop environment, and kali-linux-top10 and kali-linux-default are the tools which get installed at the same time.

At this screen, you may wish to not install a desktop environment, then Kali Linux becomes “headless” (no graphic interface) which uses less system resources up and commonly found on servers, dropboxes, low powered ARM devices, and the cloud. This is meant for people who are completely comfortable with the command line. You are able to install multiple Desktop Environments, allowing you to switch, we wouldn’t recommend it. You may change your mind and switch desktop environments at a later date.

May wish to not to install any of the pre-defined software packages/bundles/collections (metapackages), giving you a finer degree of control of manually installing exactly what software you want. Alternatively you may want to be more prepared and install more than the default toolset. Please be aware, that there are more tools available in Kali which has be manually installed after the setup (as they all cannot be stored in the setup image).

Overall, these extra choices are for a more efficient installation experience, meant for advanced users. Please be aware of their pitfalls.

The following sections in the “Kali Documentation Installation” of this documentation, will be using the “Installer” image for the guides unless stated otherwise.

Updated on: 2023-Mar-06
Author: Re4son

Источник

Kali linux net installer

It is possible to boot and installing Kali Linux over the network, using Preboot eXecution Environment (PXE). There is a range of environments where this beneficial such as a single laptop install with no CDROM or USB ports, to enterprise deployments supporting pre-seeding of the Kali Linux installation.

By using a “slimed down” image, network booting (Netboot), it only has the essential packages in order for the setup to work. Everything else is pulled down during installation, making sure everything is fully up-to-date after the installation.

We will cover a few different ways of using PXE. The first way will be how to manually set up PXE with dnsmasq. The final way will utilize netbootxyz, which hosts the PXE files and uses a separate DNS server to properly direct computers.

Manually setting up a PXE Server with dnsmasq

First, we need to install dnsmasq which will provide the DHCP/TFTP service:

[email protected]:~$ sudo apt install -y dnsmasq [. ] [email protected]:~$ 

In dnsmasq.conf , enable DHCP, TFTP and PXE booting and set the dhcp-range to match your environment (we are using 192.168.101.100-200). If needed you can also define your DNS servers ( 8.8.8.8 & 8.8.4.4 ) and gateway ( 192.168.101.1 ) with the dhcp-option directive as shown below:

Now in our above example, we used /tftpboot/ for the home directory of TFTP, which we now need to create, as this will hold the Kali Linux Netboot image:

[email protected]:~$ sudo mkdir -pv /tftpboot/ mkdir: created directory '/tftpboot/' [email protected]:~$ 

With the edits in place, the dnsmasq service needs to be restarted in order for the changes to take effect:

[email protected]:~$ sudo systemctl restart dnsmasq [email protected]:~$ [email protected]:~$ sudo systemctl enable dnsmasq [email protected]:~$ [email protected]:~$ sudo systemctl status dnsmasq [. ] [email protected]:~$ 

Download Kali PXE Netboot Images

We can now download the Kali Netboot image we wish to serve. Please pick ONE of the images below, either 64-bit OR 32-bit:

Читайте также:  На чем зарабатывают программисты linux

The last step is to extract the contents and do a little bit of house keeping:

[email protected]:~$ sudo tar -zxpvf /tftpboot/netboot.tar.gz -C /tftpboot [. ] [email protected]:~$ [email protected]:~$ sudo rm -v /tftpboot/netboot.tar.gz removed '/tftpboot/netboot.tar.gz' [email protected]:~$ 

Configure Target to Boot From Network

With everything configured, you can now boot your target system and configure it to boot from the network. It should get an IP address from your PXE server and begin booting Kali Linux.

Depending on the manufacture, will depending on the keyboard shortcut required to bring up the boot menu. Common keys are: ESC , F2 , F8 and F12 :

Afterwards, select the network card:

Boot Menu

If everything works right, you should shortly see a screen similar to the following. Please note, it may take a few seconds in order to get an IP address:

Finally, you should see the Netboot GRUB:

NetBoot Grub

Troubleshooting

If you see either of the following screens, it could be due to the machine unable to get an IP address from the PXE service:

Boot Error

The first thing would be to check the status of dnsmasq:

[email protected]:~$ sudo systemctl status dnsmasq [. ] Active: active (running) since Wed 2023-06-07 13:48:15 BST; 17s ago [. ] Jun 07 13:48:15 kali dnsmasq-dhcp[1960]: DHCP, IP range 192.168.101.100 -- 192.168.101.200, lease time 12h Jun 07 13:48:15 kali dnsmasq-tftp[1960]: TFTP root is /tftpboot/ Jun 07 13:48:15 kali dnsmasq[1960]: reading /etc/resolv.conf Jun 07 13:48:15 kali dnsmasq[1960]: using nameserver 8.8.8.8#53 [. ] Jun 07 13:48:31 kali dnsmasq-dhcp[1960]: no address range available for DHCP request via eth0 lines 1-23/23 (END) 

The line which sticks out here is:

no address range available for DHCP request via eth0

A possible reason for this is the IP range ( 192.168.101.100 -> 192.168.101.200 ) is outside of the range used by the interface ( 192.168.0.3 ):

[email protected]:~$ ip a [. ] 2: eth0: mtu 1500 qdisc mq state UP group default qlen 1000 [. ] inet 192.168.0.3/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0 [. ] [email protected]:~$ 

We can have a go at dynamically, generating the configuration:

[email protected]:~$ interface=eth0 [email protected]:~$ [email protected]:~$ network=$( ip -4 addr show dev $ | grep -oP '(?<=inet\s)\d+(\.\d+)<2>' ) [email protected]:~$ [email protected]:~$ cat <)' ) dhcp-option=6,8.8.8.8,8.8.4.4 EOF [email protected]:~$ [email protected]:~$ sudo systemctl restart dnsmasq [email protected]:~$ [email protected]:~$ sudo systemctl status dnsmasq [. ] 

Please note, you will need to disable your existing DHCP service, else there will be a race in which service is able to response quicker.

Post Installation

Now that you’ve completed installing Kali Linux, it’s time to customize your system. The General Use section has more information and you can also find tips on how to get the most out of Kali Linux in our User Forums.

Auto Updating

One last thing we need to do if we want to use this system in the future is set up a cron job to pull in the new Netboot images regularly in case of kernel updates. We will create a simple script and set its permissions:

[email protected]:~$ sudo mkdir -pv /opt/pxe/ mkdir: created directory '/opt/pxe/' [email protected]:~$ [email protected]:~$ cat "/* ## Download the newest version wget "https://http.kali.org/kali/dists/kali-rolling/main/installer-$/current/images/netboot/netboot.tar.gz" -O "$/netboot.tar.gz" ## Exract tar -zxpvf /tftpboot/netboot.tar.gz -C "$" ## Clean up rm -v "$/netboot.tar.gz" EOF [email protected]:~$ [email protected]:~$ sudo chmod 0700 /opt/pxe/tftpboot.sh [email protected]:~$ [email protected]:~$ sudo chown root: /opt/pxe/tftpboot.sh 

As we are going to quickly make a new user, tftp and set both folders permissions:

[email protected]:~$ sudo adduser --system --home /opt/pxe/ tftp adduser: Warning: The home dir /opt/pxe/ you specified already exists. Adding system user `tftp' (UID 117) . Adding new user `tftp' (UID 117) with group `nogroup' . adduser: The home directory `/opt/pxe/' already exists. Not touching this directory. adduser: Warning: The home directory `/opt/pxe/' does not belong to the user you are currently creating. [email protected]:~$ [email protected]:~$ sudo chown -R tftp: /opt/pxe/ /tftpboot/ [email protected]:~$ 

The last item left is to setup a schedule task. We will use cron:

[email protected]:~$ sudo crontab -u tftp -e [. ] 0 5 * * 2 /opt/pxe/tftpboot.sh >/dev/null [email protected]:~$ 

Now, every Tuesday at 05:00, our Netboot image should self-update!

Pre-seeding PXE

Pre-seed file

We can use the following pre-seed file to automatically install our Kali instance. Be sure to change package selection, user information, region information, and hard drive to match what you are using. Alternatively, should you want to be prompted for any of those, just comment out the line:

Pre-seed integration to initrd

To incorporate this into our initrd to automatically run we must do the following:

Please note, we are using 64-bit/AMD64.

[email protected]:~$ cd /tftpboot/debian-installer/amd64/ [email protected]:/tftpboot/debian-installer/amd64$ [email protected]:/tftpboot/debian-installer/amd64$ sudo gunzip initrd.gz [email protected]:/tftpboot/debian-installer/amd64$ [email protected]:/tftpboot/debian-installer/amd64$ sudo cp -v /opt/pxe/preseed.cfg preseed.cfg '/opt/pxe/preseed.cfg' -> './preseed.cfg' [email protected]:/tftpboot/debian-installer/amd64$ [email protected]:/tftpboot/debian-installer/amd64$ echo preseed.cfg | sudo cpio -H newc -o -A -F initrd 6 blocks [email protected]:/tftpboot/debian-installer/amd64$ sudo gzip initrd [email protected]:/tftpboot/debian-installer/amd64$ 

Now all that is left to-do, is boot from network, and select “Install” and watch the unattended setup progress!

Using netbootxyz to host our PXE files

To install and use netbootxyz we recommend to follow the official documentation. This will allow us to set up a server and use our existing DHCP server to point to it, rather than creating a new DHCP server, as well as having a web interface to manage items.

Источник

Оцените статью
Adblock
detector