Commit 40809965 authored by intrigeri's avatar intrigeri
Browse files

Test suite: really test that we don't leak "amnesia" in DHCP requests (refs: #16365)

On Tails 3.11, hostname(1) returns… "localhost.localdomain".
I assume that's been the case since #13574 and #15322.
So we were not testing whether "amnesia" leaks in DHCP requests anymore.

Let's check for both "amnesia" and whatever hostname(1) returns.
parent 462dfe57
Then /^the hostname should not have been leaked on the network$/ do
begin
hostname = $vm.execute("hostname").stdout.chomp
hostnames = ["amnesia", $vm.execute("hostname").stdout.chomp]
packets = PacketFu::PcapFile.new.file_to_array(filename: @sniffer.pcap_file)
packets.each do |p|
# if PacketFu::TCPPacket.can_parse?(p)
......@@ -12,8 +12,10 @@ Then /^the hostname should not have been leaked on the network$/ do
else
raise "Found something in the pcap file that either is non-IP, or cannot be parsed"
end
if payload.match(hostname)
raise "Hostname leak detected"
hostnames.each do |hostname|
if payload.match(hostname)
raise "Hostname leak detected: #{hostname}"
end
end
end
rescue Exception => e
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment