These tools will help you perform basic tests such as scanning target IPs for open ports with services running on them using NMAP, launching Metasploit Framework to exploit known vulnerabilities, performing dictionary-based attacks against authentication services using Hydra, cracking password hashes using John the Ripper tool, recovering WEP/WPA/WPS keys from wireless network packets captured by Aircrack-ng and airodump-ng tools, brute-forcing attacks against WPS pins to recover WPA/WPA2 passphrases using Reaver, recovering deleted files from disk images using Foremost tool, and analyzing volatile memory dumps to uncover artifacts related to malicious activities using Volatility Framework.
To build just the Linux kernel image, you can do this:
make $(make -s image_name | awk -F ‘/’ ‘{print $4}’)
Targets for clean-up
In case you want to clean build artifacts up, you can use either of the following targets to achieve what you want:
clean: Remove almost everything except for the .config file.
mrproper: Everything that make clean does, but also delete the .config file.
distclean: Everything that make mrproper does but also remove any patch files.
Installation
Once the Linux kernel has been compiled, it is time to install a few things. “A few things?” Yes. We build at least 2 different things, 3 if you are on ARM or RISC-V. I will explain as we proceed.
Though I will inform you about different methods of installing, especially about changing the default installation path, it is not recommended to do it unless you know what you are doing! Please understand that if you go a custom route, you are on your own. These defaults exist for a reason 😉
Install the kernel modules
There are parts of the Linux kernel that are not necessary during booting. These parts are built as loadable modules (i.e. loaded and unloaded when necessary). So, let’s install these modules. This can be achieved with the modules_install target. The use of sudo is necessary since the modules will be installed in /lib/modules/
This will not only install the kernel modules but also sign them. So it will take some time. The good news is that you can parallelize this using the previously discussed -j$(nproc) option 😉
sudo make modules_install -j$(nproc)
Note for developers: You can specify a different path where the Linux modules are stored (instead of /lib/modules/
sudo make modules_install INSTALL_MOD_STRIP=1
Another note for developers: You can use the INSTALL_MOD_STRIP variable to specify if the modules should be stripped of debug symbols or not. The debug symbols are not stripped if it is undefined. When set to 1, they are stripped using the –strip-debug option, which is then passed to the strip (or llvm-strip if Clang is used) utility.
If you intend to use this kernel with out-of-tree modules, like ZFS or Nvidia DKMS, or try writing your own modules, you will most likely need the
To uninstall a previously installed Linux kernel version, follow these steps:
1. Remove kernel modules using rm -rf /lib/modules/
2. Remove device-tree binaries using rm -rf /boot/dtb-
3. Remove the Linux kernel itself using rm -vf /boot/{config,System,vmlinuz}-
Quite an adventure! But finally, it is concluded. We have looked at the entire process of what it takes to manually compile the Linux kernel. It involved installing the dependencies, fetching the source, verifying it, extracting it, configuring the Linux kernel, building the Linux kernel and then installing it.
If you liked this detailed step-by-step guide, please comment and let me know. If you faced any issues, comment and let me know!