The BlackArch Linux Guide
-
Upload
soran-ibrahim -
Category
Documents
-
view
228 -
download
0
Transcript of The BlackArch Linux Guide
-
7/25/2019 The BlackArch Linux Guide
1/20
The BlackArch Linux Guide
https://www.blackarch.org/
-
7/25/2019 The BlackArch Linux Guide
2/20
Contents
1 Introduction 4
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2 What is BlackArch Linux?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 History of BlackArch Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.4 Supported platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.5 Get involved . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 User Guide 6
2.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.1.1 Installing on top of ArchLinux . . . . . . . . . . . . . . . . . . . . . . . . . 62.1.2 Installing packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.1.3 Installing packages from source . . . . . . . . . . . . . . . . . . . . . . . . . 72.1.4 Basic Blackman usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.1.5 Installing from live-, netinstall- ISO or ArchLinux . . . . . . . . . . . . . . . 8
3 Developer Guide 9
3.1 Archs Build System and Repositories . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 Blackarch PKGBUILD standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.1 Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2.1.1 blackarch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2.1.2 blackarch-anti-forensic . . . . . . . . . . . . . . . . . . . . . . . . 103.2.1.3 blackarch-automation . . . . . . . . . . . . . . . . . . . . . . . . . 103.2.1.4 blackarch-backdoor . . . . . . . . . . . . . . . . . . . . . . . . . . 103.2.1.5 blackarch-binary. . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.2.1.6 blackarch-bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.1.7 blackarch-code-audit . . . . . . . . . . . . . . . . . . . . . . . . . 103.2.1.8 blackarch-cracker . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.2.1.9 blackarch-crypto . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.2.1.10 blackarch-database . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2.1.11 blackarch-debugger . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2.1.12 blackarch-decompiler . . . . . . . . . . . . . . . . . . . . . . . . . 113.2.1.13 blackarch-defensive . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2.1.14 blackarch-disassembler . . . . . . . . . . . . . . . . . . . . . . . . 113.2.1.15 blackarch-dos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2.1.16 blackarch-drone . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2.1.17 blackarch-exploitation. . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.1.18 blackarch-fingerprint . . . . . . . . . . . . . . . . . . . . . . . . . 123.2.1.19 blackarch-firmware . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2.1.20 blackarch-forensic . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2.1.21 blackarch-fuzzer. . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2
-
7/25/2019 The BlackArch Linux Guide
3/20
3.2.1.22 blackarch-hardware . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2.1.23 blackarch-honeypot . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2.1.24 blackarch-keylogger . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2.1.25 blackarch-malware . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2.1.26 blackarch-misc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.2.1.27 blackarch-mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.2.1.28 blackarch-networking . . . . . . . . . . . . . . . . . . . . . . . . . 133.2.1.29 blackarch-nfc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.2.1.30 blackarch-packer . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.2.1.31 blackarch-proxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.2.1.32 blackarch-recon . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.2.1.33 blackarch-reversing . . . . . . . . . . . . . . . . . . . . . . . . . . 133.2.1.34 blackarch-scanner . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2.1.35 blackarch-sniffer. . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2.1.36 blackarch-social . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2.1.37 blackarch-spoof . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2.1.38 blackarch-threat-model . . . . . . . . . . . . . . . . . . . . . . . . 143.2.1.39 blackarch-tunnel . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2.1.40 blackarch-unpacker . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2.1.41 blackarch-voip. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2.1.42 blackarch-webapp . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.2.1.43 blackarch-windows . . . . . . . . . . . . . . . . . . . . . . . . . . 153.2.1.44 blackarch-wireless . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Repository structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.3.1 Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4 Contributing to repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.4.1 Required tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.4.2 Steps for contributing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.4.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.4.3.1 Fetch PKGBUILD. . . . . . . . . . . . . . . . . . . . . . . . . . . 173.4.3.2 Clean up PKGBUILD . . . . . . . . . . . . . . . . . . . . . . . . . 173.4.3.3 Adjust PKGBUILD . . . . . . . . . . . . . . . . . . . . . . . . . . 183.4.3.4 Build the package. . . . . . . . . . . . . . . . . . . . . . . . . . . 183.4.3.5 Install and test the package . . . . . . . . . . . . . . . . . . . . . 183.4.3.6 Add, commit and push package . . . . . . . . . . . . . . . . . . . 183.4.3.7 Create a pull request . . . . . . . . . . . . . . . . . . . . . . . . . 193.4.3.8 Adding a remote for upstream . . . . . . . . . . . . . . . . . . . . 19
3.4.4 Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.4.5 General tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4 Tools Guide 20
4.1 Coming Soon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
-
7/25/2019 The BlackArch Linux Guide
4/20
Chapter 1
Introduction
1.1 Overview
The BlackArch Linux guide is divided into several parts:
Introduction - Provides a broad overview, introduction, and additional helpful project informa-tion
User Guide - Everything a typical user needs to know to effectively use BlackArch
Developer Guide - How to get started developing for and contributing to BlackArch
Tool Guide - In-depth tool details along example usages (WIP)
1.2 What is BlackArch Linux?
BlackArch is a complete Linux distribution for penetration testers and security researchers. It is derivedfromArchLinuxand users can install BlackArch components individually or in groups directly on topof it.
The toolset is distributed as an Arch Linuxunofficial user repositoryso you can install BlackArch ontop of an existing Arch Linux installation. Packages may be installed individually or by category.
The constantly expanding repository currently includes over 1300 tools. All tools are thoroughlytested before being added to the codebase to maintain the quality of the repository.
1.3 History of BlackArch Linux
Coming soon...
1.4 Supported platforms
Coming soon...
4
https://www.archlinux.org/https://wiki.archlinux.org/index.php/Unofficial_User_Repositorieshttps://www.blackarch.org/tools.htmlhttps://www.blackarch.org/tools.htmlhttps://wiki.archlinux.org/index.php/Unofficial_User_Repositorieshttps://www.archlinux.org/ -
7/25/2019 The BlackArch Linux Guide
5/20
The BlackArch Linux Guide
1.5 Get involved
You can get in touch with the BlackArch team using the following avenues:
Website: https://www.blackarch.org/
Mail:[email protected]
IRC: irc://irc.freenode.net/blackarch
Twitter: https://twitter.com/blackarchlinux
Github: https://github.com/Blackarch/
5
https://www.blackarch.org/mailto:[email protected]://irc//irc.freenode.net/blackarchhttps://twitter.com/blackarchlinuxhttps://github.com/Blackarch/https://github.com/Blackarch/https://twitter.com/blackarchlinuxhttp://irc//irc.freenode.net/blackarchmailto:[email protected]://www.blackarch.org/ -
7/25/2019 The BlackArch Linux Guide
6/20
Chapter 2
User Guide
2.1 Installation
The following sections will show you how to setup the BlackArch repository and install packages.BlackArch supports both, installing from the repository using binary packages as well as compilingand installing from sources.
BlackArch is compatible with normal Arch installations. It acts as an unofficial user repository. If youwant an ISO instead, see the Live ISOsection.
2.1.1 Installing on top of ArchLinux
Runstrap.shas root and follow the instructions. See the following example.
curl - k - O h t t p s : / / b l a c k ar c h . o r g / s t r a p . s h
sha1sum strap.sh # s h o u l d m a t c h : 8 6 e b 4 e f b 6 8 9 1 8 d b fd d 1 e 2 2 8 6 2 a 4 8 f d a2 0 a 8 1 4 5 f f
sudo ./strap.sh
Now download a fresh copy of the master package list and synchronize packages:
s u d o p a c m an -Syyu
2.1.2 Installing packages
You may now install tools from the blackarch repository.
1. To list all of the available tools, run
pacman - Sg g | grep b l a c ka r ch | cu t - d - f 2 | sort -u
2. To install all of the tools, run
pacman - S b l a c k ar c h
3. To install a category of tools, run
6
https://www.blackarch.org/downloads.html#isohttps://blackarch.org/strap.shhttps://blackarch.org/strap.shhttps://www.blackarch.org/downloads.html#iso -
7/25/2019 The BlackArch Linux Guide
7/20
The BlackArch Linux Guide
pacman -S blackarch -
4. To see the blackarch categories, run
pacman - Sg | grep blackarch
2.1.3 Installing packages from source
As part of an alternative method of installation, you can build the BlackArch packages from source.You can find the PKGBUILDs ongithub. To build the entire repo, you can use the Blackmantool.
First, you have to install Blackman. If the BlackArch package repository is setup on yourmachine, you can install Blackman:
pacman -S blackman
You can build and install Blackman from source:
mk di r blackman
c d b l a c k ma n
wget h t t ps : / / r a w 2 . g i t h u b . c o m / B l a c k A r ch / b l a c k a r c h / m a s t e r / p a c k a g e s / blackman / P K G B U I L D
# M ak e s ur e t he P KG BU IL D h as n ot b ee n m a li ci o us ly t am pe re d w it h .
makep kg -s
Or you can install Blackman from the AUR:< w ha te ve r A UR h el pe r y ou u se > - S blackman
2.1.4 Basic Blackman usage
Blackman is very simple to use, though the flags are different from what you would typically expectfrom something like pacman. Basic usage has been outlined below.
Download, compile and install packages:
s u d o b l a c k ma n - i p a ck a ge
Download, compile and install whole category:
s u d o b l a c k ma n - g g r ou p
Download, compile and install all of the BlackArch tools:
s u d o b l a c k ma n -a
To list the blackarch categories:
blackman -l
To list category tools:
blackman - p c a t e g or y
7
https://github.com/BlackArch/blackarch/tree/master/packageshttps://github.com/BlackArch/blackmanhttps://github.com/BlackArch/blackmanhttps://github.com/BlackArch/blackarch/tree/master/packages -
7/25/2019 The BlackArch Linux Guide
8/20
The BlackArch Linux Guide
2.1.5 Installing from live-, netinstall- ISO or ArchLinux
You can install BlackArch Linux from one of our live- or netinstall-ISOs.See https://www.blackarch.org/download.html#iso. The following steps are required after theISO boot up.
Install blackarch-install-scripts package:
s u d o p a c m an -S blackarch -install -scripts
Run
sudo blackarch -install
8
https://www.blackarch.org/download.html#isohttps://www.blackarch.org/download.html#iso -
7/25/2019 The BlackArch Linux Guide
9/20
Chapter 3
Developer Guide
3.1 Archs Build System and Repositories
PKGBUILD files are build scripts. Each one tells makepkg(1) how to create a package. PKGBUILDfiles are written in Bash.
For more information, read (or skim through) the following:
Arch Wiki: Creating Packages
Arch Wiki: makepkg
Arch Wiki: PKGBUILD
Arch Wiki: Arch Packaging Standards
3.2 Blackarch PKGBUILD standards
For the sake of simplicity, our PKGBUILDs are similar to that of the AUR ones, with a few smalldifferences outlined below. Every package must belong to blackarch at the minimum, there will also
be a lot of crossover with multiple packages belonging to multiple groups.
3.2.1 Groups
To allow users to install a specific range of packages quickly and easily, packages have been separatedinto groups. Groups allow users to simply go pacman -S group name in order to pull a lot ofpackages.
3.2.1.1 blackarch
The blackarch group is the base group that all packages must belong too. This allows users to installevery package with ease.
What should be in here: Everything.
9
https://wiki.archlinux.org/index.php/Creating_Packageshttps://wiki.archlinux.org/index.php/Makepkghttps://wiki.archlinux.org/index.php/PKGBUILDhttps://wiki.archlinux.org/index.php/Arch_Packaging_Standardshttps://wiki.archlinux.org/index.php/Arch_Packaging_Standardshttps://wiki.archlinux.org/index.php/PKGBUILDhttps://wiki.archlinux.org/index.php/Makepkghttps://wiki.archlinux.org/index.php/Creating_Packages -
7/25/2019 The BlackArch Linux Guide
10/20
The BlackArch Linux Guide
3.2.1.2 blackarch-anti-forensic
Packages that are used for countering forensic activities, including encryption, steganography, andanything that modifies files/file attributes. This all includes tools to work with anything in generalthat makes changes to a system for the purposes of hiding information.
Examples: luks, TrueCrypt, Timestomp, dd, ropeadope, secure-delete
3.2.1.3 blackarch-automation
Packages that are used for tool or workflow automation.
Examples: blueranger, tiger, wiffy
3.2.1.4 blackarch-backdoor
Packages that exploit or open backdoors on already vulnerable systems.
Examples: backdoor-factory, rrs, weevely
3.2.1.5 blackarch-binary
Packages that operate on binary files in some form.
Examples: binwally, packerid
3.2.1.6 blackarch-bluetooth
Packages that exploit anything concerning the Bluetooth standard (802.15.1).
Examples: ubertooth, tbear, redfang
3.2.1.7 blackarch-code-audit
Packages that audit existing source code for vulnerability analysis.
Examples: flawfinder, pscan
3.2.1.8 blackarch-cracker
Packages used for cracking cryptographic functions, ie hashes.
Examples: hashcat, john, crunch
3.2.1.9 blackarch-crypto
Packages that work with cryptography, with the exception of cracking.
Examples: ciphertest, xortool, sbd
10
-
7/25/2019 The BlackArch Linux Guide
11/20
The BlackArch Linux Guide
3.2.1.10 blackarch-database
Packages that involve database exploitations on any level.
Examples: metacoretex, blindsql
3.2.1.11 blackarch-debugger
Packages that allow the user to view what a particular program is doing in realtime.
Examples: radare2, shellnoob
3.2.1.12 blackarch-decompiler
Packages that attempt to reverse a compiled program into source code.
Examples: flasm, jd-gui
3.2.1.13 blackarch-defensive
Packages that are used to protect a user from malware & attacks from other users.
Examples: arpon, chkrootkit, sniffjoke
3.2.1.14 blackarch-disassembler
This is similar to blackarch-decompiler, and there will probably be a lot of programs that fall intoboth, however these packages produce assembly output rather than the raw source code.
Examples: inguma, radare2
3.2.1.15 blackarch-dos
Packages that use DoS (Denial of Service) attacks.Examples: 42zip, nkiller2
3.2.1.16 blackarch-drone
Packages that are used for managing physically engineered drones.
Examples: meshdeck, skyjack
3.2.1.17 blackarch-exploitation
Packages that takes advantages of exploits in other programs or services.
Examples: armitage, metasploit, zarp
11
-
7/25/2019 The BlackArch Linux Guide
12/20
The BlackArch Linux Guide
3.2.1.18 blackarch-fingerprint
Packages that exploit fingerprint biometric equipment.
Examples: dns-map, p0f, httprint
3.2.1.19 blackarch-firmware
Packages that exploit vulnerabilities in firmware
Examples: None yet, amend asap.
3.2.1.20 blackarch-forensic
Packages that are used to find data on physical disks or embedded memory.
Examples: aesfix, nfex, wyd
3.2.1.21 blackarch-fuzzer
Packages that use the fuzz testing principle, ie throwing random inputs at the subject to see whathappens.
Examples: msf, mdk3, wfuzz
3.2.1.22 blackarch-hardware
Packages that exploit or manage anything to do with physical hardware.
Examples: arduino, smali
3.2.1.23 blackarch-honeypot
Packages that act as honeypots, ie programs that appear to be vulnerable services used to attracthackers into a trap.
Examples: artillery, bluepot, wifi-honey
3.2.1.24 blackarch-keylogger
Packages that record and retain keystrokes on another system.
Examples: None yet, amend asap.
3.2.1.25 blackarch-malware
Packages that count as any type of malicious software or malware detection.
Examples: malwaredetect, peepdf, yara
12
-
7/25/2019 The BlackArch Linux Guide
13/20
The BlackArch Linux Guide
3.2.1.26 blackarch-misc
Packages that dont particularly fit into any categories.
Examples: oh-my-zsh-git, winexe, stompy
3.2.1.27 blackarch-mobile
Packages that manipulate mobile platforms.
Examples: android-sdk-platform-tools, android-udev-rules
3.2.1.28 blackarch-networking
Package that involve IP networking.
Examples: Anything pretty much
3.2.1.29 blackarch-nfc
Packages that use nfc (near-field communications).
Examples: nfcutils
3.2.1.30 blackarch-packer
Packages that operate on or invlove packers.
/textifpackers are programs that embed malware within other executables.
Examples: packerid
3.2.1.31 blackarch-proxy
Packages that acts as a proxy, ie redirecting traffic through another node on the internet.
Examples: burpsuite, ratproxy, sslnuke
3.2.1.32 blackarch-recon
Packages that actively seeks vulnerable exploits in the wild. More of an umbrella group for similarpackages.
Examples: canri, dnsrecon, netmask
3.2.1.33 blackarch-reversing
This is an umbrella group for any decompiler, disassembler or any similar program.
Examples: capstone, radare2, zerowine
13
-
7/25/2019 The BlackArch Linux Guide
14/20
The BlackArch Linux Guide
3.2.1.34 blackarch-scanner
Packages that scan selected systems for vulnerabilities.
Examples: scanssh, tiger, zmap
3.2.1.35 blackarch-sniffer
Packages that involve analyzing network traffic.
Examples: hexinject, pytactle, xspy
3.2.1.36 blackarch-social
Packages that primarily attack social networking sites.
Examples: jigsaw, websploit
3.2.1.37 blackarch-spoof
Packages that attempt to spoof the attacker such, in that the attacker doesnt show up as an attackerto the victim.
Examples: arpoison, lans, netcommander
3.2.1.38 blackarch-threat-model
Packages that would be used for reporting/recording the threat model outlined in a particular scenario.
Examples: magictree
3.2.1.39 blackarch-tunnel
Packages that are used to tunnel network traffic on a given network.Examples: ctunnel, iodine, ptunnel
3.2.1.40 blackarch-unpacker
Packages that are used to extract pre-packed malware from an executable.
Examples: js-beautify
3.2.1.41 blackarch-voip
Packages that operate on voip programs and protocols.
Examples: iaxflood, rtp-flood, teardown
14
-
7/25/2019 The BlackArch Linux Guide
15/20
The BlackArch Linux Guide
3.2.1.42 blackarch-webapp
Packages that operate on internet-facing applications.
Examples: metoscan, whatweb, zaproxy
3.2.1.43 blackarch-windows
This group is for any native Windows package that runs via wine.
Examples: 3proxy-win32, pwdump, winexe
3.2.1.44 blackarch-wireless
Packages that operates on wireless networks on any level.
Examples: airpwn, mdk3, wiffy
3.3 Repository structure
You can find the main BlackArch git repo here:https://github.com/BlackArch/blackarch.There arealso several secondary repos here:https://github.com/BlackArch.
Within the main git repo, there are three important directories:
docs - Documentation.
packages - PKGBUILD files.
scripts - Useful little scripts.
3.3.1 Scripts
Here is a reference for scripts in the scripts/ directory:
baaur - Soon, this will upload packages to the AUR.
babuild - Build a package.
bachroot - Manage a chroot for testing.
baclean - Clean old .pkg.tar.xz files from the package repo.
baconflict - Soon this will replace scripts/conflicts.
bad-files - Find bad files in built packages.
balock - Obtain or release the package repo lock.
banotify - Notify IRC about package pushes.
15
https://github.com/BlackArch/blackarchhttps://github.com/BlackArch/blackarchhttps://github.com/BlackArchhttps://github.com/BlackArchhttps://github.com/BlackArch/blackarch -
7/25/2019 The BlackArch Linux Guide
16/20
The BlackArch Linux Guide
barelease - Release packages to the package repo.
baright - Print the BlackArch copyright info.
basign - Sign packages.
basign-key - Sign a key.
blackman - This behaves sort of like pacman but builds from git (not to be confused with nrzsBlackman).
check-groups - Check groups.
checkpkgs - Check packages for errors.
conflicts - Check for file conflicts.
dbmod - Modify a package database.
depth-list - Create a list sorted by dependency depth.
deptree - Create a dependency tree, listing only blackarch-provided packages.
get-blackarch-deps - Get a list of blackarch dependencies for a package.
get-official - Get official packages for release.
list-loose-packages - List packages that are not in groups and are not dependencies for other
packages. list-needed - List missing dependencies.
list-removed - List packages that are in the package repo but not in git.
list-tools - List tools.
outdated - Look for packages that are out-dated in the package repo relative to the git repo.
pkgmod - Modify a build package.
pkgrel - Increment pkgrel in a package.
prep - Clean up a PKGBUILD files style and find errors.
sitesync - Sync between a local copy of the package repo and a remote copy.
size-hunt - Hunt for large packages.
source-backup - Backup package source files.
3.4 Contributing to repository
This section shows you how to contribute to the BlackArch Linux project. We accept pull requests
of all sizes, from tiny typo fixes to new packages.For help, suggestions, or questions feel free to contact us.
Everyone is welcome to contribute. All contributions are appreciated.
16
-
7/25/2019 The BlackArch Linux Guide
17/20
The BlackArch Linux Guide
3.4.1 Required tutorials
Please read the following tutorials before contributing:
Arch Packaging Standards
Creating Packages
PKGBUILD
Makepkg
3.4.2 Steps for contributing
In order to submit your changes to the BlackArchLinux project, follow these steps:
1. Fork the repository from https://github.com/BlackArchLinux/blackarchlinux
2. Hack the necessary files, (e.g. PKGBUILD, .patch files, etc).
3. Commit your changes.
4. Push your changes.
5. Ask us to merge in your changes, preferably through a pull request.
3.4.3 Example
The following example demonstrates submitting a new package to the BlackArch project. We useyaourt(you can use pacaur as well) to fetch a pre-existing PKGBUILD file for nfsshellfrom theAURand adjust it according to our needs.
3.4.3.1 Fetch PKGBUILD
Fetch the PKGBUILDfile using yaourt or pacaur:u s e r@ b l ac k a rc h l in u x $ y a ou r t - G n f ss h el l
= = > D o wn l oa d n f ss h el l s o ur c es
x L I CE N SE
x P K GB U IL D
x g cc . p a t ch
u s e r @ b l a c ka r c h l i n u x $ cd n f s s h e l l /
3.4.3.2 Clean up PKGBUILD
Clean up the PKGBUILDfile and save some time:
17
https://wiki.archlinux.org/index.php/Arch_Packaging_Standards)https://wiki.archlinux.org/index.php/Creating_Packageshttps://wiki.archlinux.org/index.php/PKGBUILDhttps://wiki.archlinux.org/index.php/Makepkghttps://github.com/BlackArchLinux/blackarchlinuxhttps://wiki.archlinux.org/index.php/yaourthttps://aur.archlinux.org/https://aur.archlinux.org/https://wiki.archlinux.org/index.php/yaourthttps://github.com/BlackArchLinux/blackarchlinuxhttps://wiki.archlinux.org/index.php/Makepkghttps://wiki.archlinux.org/index.php/PKGBUILDhttps://wiki.archlinux.org/index.php/Creating_Packageshttps://wiki.archlinux.org/index.php/Arch_Packaging_Standards) -
7/25/2019 The BlackArch Linux Guide
18/20
The BlackArch Linux Guide
u s e r @ b l a c ka r c h l i n u x n f s s h el l $ . / b l a r c k ar c h / s c r i p t s / p r e p P K G B U IL D
cleaning PKGBUILD ...e x p a n d in g t a b s . ..
r e m o v in g v i m m o d e l in e . . .
r e mo v in g i d c o mm e nt . . .
r e mo v in g c o nt r i bu t o r a nd m a i nt a in e r c o mm e nt s . . .
s q u ee z in g e x tr a b l an k l i ne s . . .
r e m o v in g || return...
r e mo v in g l e ad i ng b l an k l i ne . . .
r e m o v in g $ p k g n am e . . .
r e m o v in g t r a i l in g w h i t e s pa c e . . .
3.4.3.3 Adjust PKGBUILD
Adjust the PKGBUILD file:
u s e r@ b l ac k a rc h l in u x n f ss h el l $ v i P K GB U IL D
3.4.3.4 Build the package
Build the package:
= => M ak in g p ac ka ge : n fs sh el l 1 99 80 51 9 - 1 ( M o n D ec 2 1 7: 23 :5 1 C ET 2 01 3)
= = > C h ec k in g r u nt i me d e pe n d en c i es . . .
= = > C h ec k in g b u il d t im e d e p en d e nc i e s . ..= = > R e tr i e vi n g s o ur c es . . .
- > D o w n l o a d i n g n f s s h el l . t a r . g z . . .
% Total % Received % Xferd Average Speed Time Time Time
Cur rent Dloa d Upload Total Spent Left Speed100 29213 100 29213 0
0 48150 0 - -: --: -- - -: --: -- - -: --: -- 48206
- > F o un d g cc . p a t ch
- > F o un d L I CE N SE
.. .
< l o ts o f b u il d p r oc e ss a nd c o mp i le r o u tp u t h er e >
.. .
= = > L e av i ng f a ke r oo t e n vi r o nm e n t .
= => F in is he d m ak in g : n fs sh el l 1 99 80 51 9 - 1 ( M on D ec 2 1 7: 23 :5 3 C ET 2 01 3)
3.4.3.5 Install and test the package
Install and test the package:
u s e r @ b l a c ka r c h l i n u x n f s s h el l $ pacman - U n f s sh e l l - 1 9 98 0 5 19 - 1 - x 8 6 _ 6 4 . p k g . t a r . x z
u s e r @ b l a c ka r c h l i n u x n f s s h el l $ n f s s h el l # t es t i t
3.4.3.6 Add, commit and push package
Add, commit and push the package
u s e r@ b l ac k a rc h l in u x ~ / b l a ck a r ch l i nu x / p a c ka g es $ m v ~ / n f ss h el l .
u s e r@ b l ac k a rc h l in u x ~ / b l a ck a r ch l i nu x / p a c ka g es $ g it c o mm i t - a m n f ss h el l & & g i t p u sh
18
-
7/25/2019 The BlackArch Linux Guide
19/20
The BlackArch Linux Guide
3.4.3.7 Create a pull request
Create a pull request on github.com
f i r e f ox h t t p s : / / g i t hu b . c o m / < c o n t r ib u t o r > / b l a c k a r c h l in u x
3.4.3.8 Adding a remote for upstream
A smart thing to do if youre working upstream and on a fork is to pull your own fork and add themain ba repo as a remote
u s e r@ b l ac k a rc h l in u x ~ / b l ac k a rc h l in u x $ g it r e mo t e - v
o ri gi n < t he u rl o f y ou r f or k > ( f et ch )
o ri gi n < t he u rl o f y ou r f or k > ( p us h )u s e r@ b l ac k a rc h l in u x ~ / b l ac k a rc h l in u x $ g it r e mo t e a dd u p st r ea m h t tp s : / / g it h ub . c o m / b la c ka r ch
u s e r@ b l ac k a rc h l in u x ~ / b l ac k a rc h l in u x $ g it r e mo t e - v
o ri gi n < t he u rl o f y ou r f or k > ( f et ch )
o ri gi n < t he u rl o f y ou r f or k > ( p us h )
u p s t r ea m h t t p s : // g i t h u b . c o m / b l a c k a r c h / b l a c k a rc h ( f e t c h )
u p s t r ea m h t t p s : // g i t h u b . c o m / b l a c k a r c h / b l a c k a rc h ( p u s h )
By default, git should push straight to origin, but make sure your git config is configured correctly.This wont be an issue unless you have commit rights as you wont be able to push upstream withoutthem.
If you do have the ability to commit, you might have more success [email protected]:blackarch/blackarch.gitbut its up to you.
3.4.4 Requests
1. Dont add Maintainer or Contributor comments to PKGBUILD files. Add maintainer andcontributor names to the AUTHORS section of BlackArch guide.
2. For the sake of consistency, please follow the general style of the otherPKGBUILDfiles in therepo and use two-space indentation.
3.4.5 General tips
namcapcan check packages for errors.
19
https://github.com/http://wiki.archlinux.org/index.php/Namcaphttp://wiki.archlinux.org/index.php/Namcaphttps://github.com/ -
7/25/2019 The BlackArch Linux Guide
20/20
Chapter 4
Tools Guide
Coming soon...
4.1 Coming Soon
Coming soon...