DR NAS Samba permissions lab, 2026-10-04

Original training experiment, not a production runbook. Run only in a fresh
RAM-root disposable Linux VM with no existing Samba service or matching users.
The guarded driver creates drnaswriter, drnasreader and drnasteam locally,
private Samba passdb/configuration, synthetic files and its own smbd process
session. All credentials are PUBLIC SYNTHETIC TRAINING VALUES; no real secrets
are used. SMB listens only on guest 127.0.0.1:1445. No host disk is attached.
The temporary host share contains only lab inputs and evidence. User NAT has
no forwarded ports. Thirteen groups passed twice; evidence records actual
Alpine 3.24.2, kernel 6.18.52-0-virt aarch64, Samba 4.23.8 and Python 3.14.8.

The earlier NAS Impacket exercise remains separate. This Samba lab checks
local authentication, share access, underlying Unix permissions, creation
modes, rename and second-identity reading. It does not execute AD, Kerberos,
NFS, Windows, ONTAP, enterprise ACL inheritance, application processing,
network faults, crashes or performance tests. smbclient -m SMB3 specifies a
maximum; negotiated dialect and encryption were not recorded or established.
Rolling official documentation is distinct from the recorded package version.

Recorded macOS bootstrap
boot.py and guest.py retain the exact recorded path /tmp/dr-nas-samba-work.
For a replay choose a NEW empty temporary directory and change both helpers'
w paths. Do not overwrite a previous execution. Put setup.sh and run.py into
its share/ subdirectory. The recorded host used an installed UTM QEMU 7.2.0
framework, not a recommendation of the latest release. qemu-launch.c is an
original CLI loader and does not start or alter UTM user VMs. It was compiled:
clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk qemu-launch.c -Wl,-rpath,/Applications/UTM.app/Contents/Frameworks -o qemu-launch
Put the executable in the chosen work directory and inspect framework paths
in boot.py. A conventional qemu-system-aarch64 binary could replace this
loader plus framework argument; that alternative bootstrap was not tested.

Acquire the ISO and checksum using acquisition.json URLs over HTTPS. Compare
its SHA-256 to the official checksum and recorded hash; stop on mismatch.
The existing verified ISO was rehashed for this run. No signature verification
is claimed. Extract boot/vmlinuz-virt and boot/initramfs-virt with an ISO reader
(macOS bsdtar was used). The recorded kernel is EFI zboot: read offset,length
with struct.unpack_from('<II', kernel_bytes, 8), decompress the gzip bytes at
that offset/length, check bytes [56:60] are b'ARM\x64', and compare the resulting
SHA-256 to acquisition.json.kernelExtraction.uncompressedSha256. Save it as
boot/Image. This extraction is specific to that format and recorded image.

Run boot.py. It starts the owned VM, logs into its ephemeral root console,
mounts only the fresh share and runs setup.sh. Inspect share/setup.txt and
require successful installation plus /run/dr-nas-disposable. Official Alpine
v3.24 repositories may resolve newer packages on a later replay; record those
actual versions without relabelling them as this run. Then:
python3 guest.py 'python3 /mnt/dr/run.py --output /mnt/dr/evidence.json > /mnt/dr/run.txt 2>&1' 90
The DR_DONE marker must end in :0. The serial helper only prints remote status;
its own exit code alone is not proof of guest success. Require passed=13,
failed=0, failure=null and inspect all checks and commands. Repeat into distinct
report/log files. Compare script hashes and results, allowing timestamps,
temporary paths and assigned IDs to differ. Expected: wrong-password logon
failure; read-only, invalid-user, filesystem and ancestor refusals; writer
exception success and reader refusal; file mode 0o660; directory mode 0o2770;
overwrite denied after controlled chmod 0440; rename succeeds; second identity
reads 19 bytes with the same hash. Do not generalize these exact modes or
rename results to other configurations without their own checks.

Cleanup
The script stops only its owned process session, removes its own users/group,
checks original passwd/shadow/group bytes restored, removes its temporary tree
and verifies the port is free. Each successful report records those results.
If a command times out, inspect the same VM; do not blindly restart or bypass
preconditions. After collection, inspect owned Samba processes, issue poweroff
inside the guest, and confirm the exact PID in vm.json exited. Recorded PID
63496 was absent after shutdown. No UTM user machine was stopped.

worksheet.txt supports predictions, diagnosis and an English handover. It has
not been performed by a human group. Independent specialist review and target
enterprise/application acceptance remain outstanding.
