File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,9 +12,6 @@ RUN apt-get update && \
1212 curl && \
1313 rm -rf /var/lib/apt/lists/*
1414
15- # Debian Trixie ships an empty /usr/share/wireshark/init.lua — Wireshark's Lua subsystem
16- # silently skips all user -X lua_script: files when init.lua is empty/missing. Replace it
17- # with the upstream init.lua from the matching Wireshark release branch.
18- RUN curl -fsSL https://gitlab.com/wireshark/wireshark/-/raw/release-4.4/epan/wslua/init.lua \
19- -o /usr/share/wireshark/init.lua && \
20- echo 'disable_lua = false' >> /usr/share/wireshark/init.lua
15+ # Create a non-root user so tshark doesn't run as root. Wireshark's Lua subsystem refuses
16+ # to load user -X lua_script: files when running as root, with no error message.
17+ RUN useradd --create-home --shell /bin/bash tester
Original file line number Diff line number Diff line change @@ -15,22 +15,24 @@ tail -20 /usr/share/wireshark/init.lua 2>/dev/null || echo "init.lua not at expe
1515echo " --- root/superuser refs in init.lua ---"
1616grep -n -E ' running_superuser|disable_lua|superuser' /usr/share/wireshark/init.lua 2> /dev/null || echo " no matches"
1717
18- echo " --- minimal lua script test ---"
18+ echo " --- minimal lua script test (as tester user) ---"
1919cat > /tmp/probe.lua << 'EOF '
2020local f = io.open("/tmp/probe-touched.log", "w")
2121if f then f:write("trivial script ran\n"); f:close() end
2222io.stderr:write("[probe] trivial script ran (stderr)\n")
2323print("[probe] trivial script ran (print)")
2424EOF
2525rm -f /tmp/probe-touched.log
26- tshark -r " omi-data-packets/Asx/Ntp.Itch.v1.05/AddOrderMessage.pcap" -X " lua_script:/tmp/probe.lua" -T json > /dev/null 2> /tmp/probe.stderr || true
26+ chmod 777 /tmp
27+ chown -R tester:tester . || true
28+ runuser -u tester -- tshark -r " omi-data-packets/Asx/Ntp.Itch.v1.05/AddOrderMessage.pcap" -X " lua_script:/tmp/probe.lua" -T json > /dev/null 2> /tmp/probe.stderr || true
2729echo " trivial script stderr:"
2830cat /tmp/probe.stderr
2931if [ -f /tmp/probe-touched.log ]; then
30- echo " TRIVIAL PROBE RAN — Lua scripting works in this container "
32+ echo " TRIVIAL PROBE RAN — Lua scripting works as non-root user "
3133 cat /tmp/probe-touched.log
3234else
33- echo " TRIVIAL PROBE DID NOT RUN — Lua scripts are completely disabled in this tshark "
35+ echo " TRIVIAL PROBE DID NOT RUN — Lua scripts still disabled"
3436fi
3537
3638echo " --- tshark log-level debug for Lua ---"
You can’t perform that action at this time.
0 commit comments