Exercise 1, Chapter 9 - Forking a Kali Package
1. Fork the kali-meta package.
2. Include a new metapackage which contains only 3 of your favorite tools.
3. Create the binary deb files for later use.
Asciinema solution (copy and paste from video permitted):
Text solution:
1. First, let's update the sources file to include source packages:
1 2 3 |
apt-get install devscripts # To install dch nano /etc/apt/sources.list # Uncomment this line: deb-src http://http.kali.org/kali kali-rolling main non-free contrib |
Next, grab the source. Note that your version numbers may differ:
1 2 3 4 5 6 |
apt-get update apt source kali-meta # This installs all kali-linux-* packages. cd kali-meta-2017.2.0/ ls -l nano debian/control |
2. Change the control file. Include your custom package:
1 2 3 4 5 6 7 8 9 10 11 12 |
Package: kali-linux-muts Architecture: any Depends: ${misc:Depends}, kali-linux, aircrack-ng, nmap, sqlmap, Description: Kali Linux Custom tools for muts This is Kali Linux, the most advanced penetration testing and security auditing distribution. . This metapackage depends on few of muts' favorites. |
Change the package version number so the rebuilt packages can be distinguished from the originals:
1 2 3 |
root@kali:~/kali-meta-2017.2.0# head -1 debian/changelog root@kali:~/kali-meta-2017.2.0# dch --local muts -m "Added a new metapackage" root@kali:~/kali-meta-2017.2.0# head -1 debian/changelog # Check that the changes were made |
3. Finally, build the package:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
root@kali:~/kali-meta-2017.2.0# dpkg-buildpackage -us -uc -b # Disable signatures (-us -uc), binary-only build (-b) root@kali:~/kali-meta-2017.2.0# ls -l ../*muts* -rw-r--r-- 1 root root 6804 Aug 28 13:42 gqrx_2017.2.0muts1_all.deb -rw-r--r-- 1 root root 6948 Aug 28 13:42 kali-desktop-common_2017.2.0muts1_all.deb -rw-r--r-- 1 root root 6972 Aug 28 13:42 kali-desktop-gnome_2017.2.0muts1_all.deb -rw-r--r-- 1 root root 6796 Aug 28 13:42 kali-desktop-kde_2017.2.0muts1_all.deb -rw-r--r-- 1 root root 6920 Aug 28 13:42 kali-desktop-live_2017.2.0muts1_all.deb -rw-r--r-- 1 root root 6812 Aug 28 13:42 kali-desktop-lxde_2017.2.0muts1_all.deb -rw-r--r-- 1 root root 6868 Aug 28 13:42 kali-desktop-xfce_2017.2.0muts1_all.deb -rw-r--r-- 1 root root 7068 Aug 28 13:42 kali-linux_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 7062 Aug 28 13:42 kali-linux-all_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 7290 Aug 28 13:42 kali-linux-forensic_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 8732 Aug 28 13:42 kali-linux-full_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 6850 Aug 28 13:42 kali-linux-gpu_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 6844 Aug 28 13:42 kali-linux-muts_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 7298 Aug 28 13:42 kali-linux-nethunter_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 7088 Aug 28 13:42 kali-linux-pwtools_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 6864 Aug 28 13:42 kali-linux-rfid_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 6908 Aug 28 13:42 kali-linux-sdr_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 6924 Aug 28 13:42 kali-linux-top10_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 6942 Aug 28 13:42 kali-linux-voip_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 7360 Aug 28 13:42 kali-linux-web_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 7058 Aug 28 13:42 kali-linux-wireless_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 10312 Aug 28 13:42 kali-meta_2017.2.0muts1_amd64.buildinfo -rw-r--r-- 1 root root 8343 Aug 28 13:42 kali-meta_2017.2.0muts1_amd64.changes root@kali:~/kali-meta-2017.2.0# ls -l ../kali-linux-muts_2017.2.0muts1_amd64.deb -rw-r--r-- 1 root root 6852 Aug 28 14:05 ../kali-linux-muts_2017.2.0muts1_amd64.deb |