installation(1)
Installation
Building, installing, loading and removing Wrong Boot and a reference for every Makefile target. Wrong Boot builds as a standard out-of-tree kernel module.
5 of 11
Requirements
- Root on the machine. Installing, loading and removing the module need it.
- Headers for the running kernel:
linux-headerson Arch andlinux-headers-$(uname -r)on Debian and Ubuntu. gccandmake.paholeon kernels built with BTF (Arch, Fedora and recent Ubuntu). Debian and Ubuntu ship it indwarves. The module link fails without it.
The build reads its configuration with the kernel's own Kconfig tool (scripts/kconfig/conf). Distribution header packages ship it prebuilt and nothing else needs installing.
1. Clone the repository
$ git clone https://github.com/0x48piraj/wrong8007.git
$ cd wrong8007/
2. Build the module
Build it with every trigger:
$ make
The first build copies the default profile configs/defconfig to .config. That profile compiles in every trigger and holds no secrets.
Pick your own triggers with the menu:
$ make menuconfig
A trigger you leave out adds no code to your kernel. The menu needs a writable kernel build tree. Run it as root or point KDIR at a kernel tree you own. Editing .config by hand and running make works too. Configuration lists every option.
3. Write the parameters
Install the parameter template as a root-only file:
$ make params-init
It creates /etc/wrong8007/ with mode 0700 and the file with mode 0600. An existing file stays as it is. Fill it in:
$ sudoedit /etc/wrong8007/wrong8007.conf
Check it against your build:
$ make params-check
exec is required. The other parameters arm triggers and params-check wants at least one armed. Configuration covers the file format and every parameter. Payloads covers the executable exec points at.
4. Install and load
Install the module into the running kernel's module tree:
$ make install
Load it:
$ make load-installed
It runs params-check first and then modprobe -C /etc/wrong8007/wrong8007.conf wrong8007. A plain modprobe wrong8007 reads no parameters and the module refuses to load without exec.
The kernel log confirms it. With only a phrase set in the default profile:
$ sudo dmesg | grep wrong8007
wrong8007: keyboard trigger initialized
wrong8007: USB trigger disabled (no USB rules)
wrong8007: network trigger disabled (no network parameters)
wrong8007: loaded
Run make install again after every kernel upgrade. The module is built for one kernel version and there is no DKMS support yet.
Loading a build without installing it
For development you can load the module you just built:
$ make load
It checks the parameters and passes them to insmod on the command line. Other users can briefly read them in the process list. Keep it for test machines. make reload unloads the module and runs make load again.
Unloading and uninstalling
Unload the module:
$ make remove
It does nothing when the module isn't loaded. A real failure (a module still in use) stops it with an error.
Remove the installed module:
$ make uninstall
It unloads the module first through make remove. A module that can't be unloaded stops the uninstall before any file goes. A loaded module is never left armed with its files gone. It then removes every installed copy and refreshes the module index.
Unloading never waits for a running payload and never stops one. See design.
The companion tool
wrong8007ctl sends the network trigger's magic packet and heartbeats and lists USB devices with their IDs. Build it:
$ make -C tools
Install it to /usr/local/bin (optional):
$ sudo make -C tools install
Activation triggers shows each command in use.
Makefile reference
| target | what it does |
|---|---|
all, build | Generates the configuration and builds wrong8007.ko. A profile with CONFIG_WRONG8007 off builds nothing and cleans the tree. |
config | Turns .config into the files the build reads. A missing .config comes from $(CONFIG). Every build runs it. |
defconfig | Copies $(CONFIG) to .config, regenerates and prints a summary of the profile. |
menuconfig, nconfig, oldconfig | The kernel's configuration interfaces for .config. They need a writable kernel build tree. Each regenerates and validates afterwards. |
validate | Checks the build profile. A profile with no trigger fails. |
params-init | Installs the parameter template at $(PARAMS) with mode 0600 in a 0700 directory. Never overwrites. |
params-check | Checks $(PARAMS) against the build profile. |
install | Builds, installs the module into the running kernel's module tree and refreshes the module index. |
load-installed | Runs params-check and loads the installed module with modprobe -C $(PARAMS). |
load | Builds, checks the parameters and loads the local build with insmod. Development only. |
remove | Unloads the module when it is loaded. |
uninstall | Runs remove, removes every installed copy and refreshes the module index. |
reload | Runs remove and then load. |
clean | Removes build artifacts and the generated configuration files. |
Variables
| variable | default | use |
|---|---|---|
KDIR | /lib/modules/$(uname -r)/build | Kernel build tree to build against |
CONFIG | configs/defconfig | Profile that seeds .config (make defconfig CONFIG=myprofile) |
PARAMS | /etc/wrong8007/wrong8007.conf | Parameter file for params-*, load and load-installed |
WB_EXTRA_CFLAGS | empty | Extra compiler flags for the module's own sources (CI passes -Werror) |
Notes
- Configuration without root.
configruns the prebuiltconfbinary from your kernel headers and writes every generated file inside the repository. It needs no write access to the kernel tree. A missing binary stops it with the command that builds one. - Where the module lands. Kernels before 6.3 install external modules to
extra/and later ones toupdates/. A kernel built with module compression adds.zst,.xzor.gz.uninstallfinds every one of them. modprobe -Cwith a file. The kmod manual describes-Cas a configuration directory. kmod has accepted a single file since version 17 (2014) and every current distribution ships a later one. A file makesmodproberead exactly whatparams-checkvalidated and nothing else.
Secure Boot
The module isn't signed. A kernel that requires signed modules refuses to load it until you sign it with a key enrolled in your machine's MOK list. Secure Boot often turns that requirement on. The kernel's scripts/sign-file does the signing.
Known limitations
- No DKMS support. Rebuild and install after every kernel upgrade.
- Not packaged for any distribution.
- Not signed for Secure Boot.