
FreeBSD and Linux kernel modules that rewrite TCP/IP and ICMPv6 fields so hosts and jails/containers answer Nmap, p0f and JA4T as a different operating system.
A kernel module that makes a host answer OS fingerprinting tools as if it ran a different operating system. There is one for FreeBSD and one for Linux.
The first version was a modified FreeBSD 4.3 kernel, described in a 2001 paper.
This repository holds a rewrite for FreeBSD 15.1 as a loadable module, and a
version for Linux built from the same personality table. The patch and source
tree of the old version were recovered later and are kept in legacy/.
| Directory | Contents |
|---|---|
freebsd/ | The module for FreeBSD 15.1 (pfil(9) hooks, no change to the kernel source) |
freebsd/jail/ | Giving each jail its own personality |
linux/ | The module for Linux (netfilter hooks; written against Linux 7.0) |
linux/lxc/ | Giving each container its own personality |
common/ | The personality definitions shared by both modules |
test/ | The scripts used for the measurements (scripts/) and the raw Nmap output (results/) |
legacy/ | The 2001 patch for FreeBSD 4.3, its source tree, and the WIT2001 paper and slides |
The tables in this section were measured with the FreeBSD module on the host.
With the module loaded and a personality selected, the tools report:
net.inet.tcp.emu_kind | Personality | Nmap 7.98 -O | p0f 3.09b (outbound SYN) |
|---|---|---|---|
| 0 | off | no exact match (guesses FreeBSD 12–13) | FreeBSD |
| 6 | Linux, as in the Nmap database | exact: Linux 4.15 – 5.19, usually with other Linux-based entries (see below) | Linux 2.2.x-3.x |
| 7 | Linux, as measured on Ubuntu 26.04.1 | no exact match; best guess Linux 4.15 – 5.19 (97%) | Linux 2.2.x-3.x |
| 8 | Windows 11 | exact: Microsoft Windows 10 1703 or Windows 11 21H2 | Windows NT kernel |
Each personality was compared with a real host on the same test network:
test/results/kind6-rerun/ holds six such runs.With personality 8, FIN, NULL and Xmas scans show every port as closed, as they do against Windows. SYN and connect scans show the true state with every personality.
Both modules also work on IPv6. Nmap identifies IPv6 hosts with a separate
classifier whose known systems are older than those of its IPv4 database, so
the names differ from the table above. Each row is five scans with
nmap -6 -O; all five gave the same verdict.
| Target | Personality | Nmap 7.98 -6 -O |
|---|---|---|
| FreeBSD 15.1 with the module | 0, off | no match (guess: FreeBSD 12, 91%) |
| 6, Linux | exact: Linux 4.19 | |
| 8, Windows 11 | exact: Microsoft Windows Vista, Windows 7 SP1, Windows Server 2008 R2 or Windows 8.1 | |
| Ubuntu 26.04.1 with the module | 0, off | exact: Linux 4.19 |
| 8, Windows 11 | exact: Microsoft Windows Vista, Windows 7 SP1, Windows Server 2008 R2 or Windows 8.1 | |
| a real Windows 11 (build 22621) | exact: Microsoft Windows Vista, Windows 7 SP1, Windows Server 2008 R2 or Windows 8.1 |
Personality 8 gets the verdict that the real Windows 11 gets, and personality 6 on FreeBSD gets the verdict of the real Linux host. Before the IPv6 hooks were added, a FreeBSD host set to 8 was still reported as FreeBSD over IPv6 while it was reported as Windows over IPv4.
A jail with its own network stack (FreeBSD) and a network namespace (Linux)
keep their own personality over IPv6 as well. The IPv4 verdicts did not
change. The raw output is in test/results/ipv6/.
Values 1 to 5 are the personalities of the 2001 version (FreeBSD, NetBSD, Windows, Windows 2000, Cisco). They are kept for reference and do not match anything in a current Nmap database: those systems generated initial sequence numbers in recognizable ways, and this module does not change sequence numbers.
On FreeBSD 15.1 with the kernel sources in /usr/src:
cd freebsd
make
kldload ./aod.ko
sysctl net.inet.tcp.emu_kind=8
To stop: sysctl net.inet.tcp.emu_kind=0, then kldunload aod.
While a personality is active the module turns off per-connection TCP timestamp
offsets (net.inet.tcp.ts_offset_per_conn). The previous value is restored
when the personality is switched off or the module is unloaded.
The setting is kept per network stack. A jail with its own stack can have a
personality of its own, and can be kept from changing it; see
freebsd/jail/.
With the kernel headers installed:
cd linux
make
insmod ./aod_linux.ko
sysctl -w net.ipv4.tcp_emu_kind=8
To stop: sysctl -w net.ipv4.tcp_emu_kind=0, then rmmod aod_linux.
While a personality is active the module changes tcp_timestamps and
tcp_ecn of the namespace, and puts them back afterwards. The setting is kept
per network namespace; see linux/lxc/ for containers.
The Linux module was tested with personality 8 only. On an Ubuntu 26.04.1 host (Linux 7.0) and in a container on it, Nmap 7.98 reports an exact match: Microsoft Windows 10 1703 or Windows 11 21H2. The IPv6 result is in the table above. The other numbers in "What it does" and "Cost" were not measured with it.
Two hooks are registered on the IPv4 pfil head of each network stack and
two on the IPv6 head (on Linux, netfilter hooks in each network namespace).
The module keeps no per-connection state.
Measured in a QEMU/KVM guest (8 vCPU) against the host over a virtual link; medians of five rounds. Differences below about ten percent are not resolved by this setup.
| Condition | receive Gbit/s | send Gbit/s | connections/s |
|---|---|---|---|
| no module | 2.50 | 16.64 | 14828 |
| loaded, off | 2.53 | 16.01 | 14483 |
| 6 Linux (database) | 2.49 | 16.03 | 16537 |
| 7 Linux (as measured) | 2.49 | 16.13 | 14252 |
| 8 Windows 11 | 2.51 | 16.28 | 16747 |
An earlier Windows variant that used no TCP timestamps at all sent about 9% slower with TSO and LRO disabled. The same drop appears without the module when timestamps are disabled in the stock kernel, so it comes from running without timestamps, not from the module. Personality 8 does without timestamps only on the connections the host opens.