1 Then /^the hostname should not have been leaked on the network$/ do
2 next if @skip_steps_while_restoring_background
3 hostname = @vm.execute("hostname").stdout.chomp
4 packets = PacketFu::PcapFile.new.file_to_array(:filename => @sniffer.pcap_file)
6 # if PacketFu::TCPPacket.can_parse?(p)
7 # ipv4_tcp_packets << PacketFu::TCPPacket.parse(p)
8 if PacketFu::IPPacket.can_parse?(p)
9 payload = PacketFu::IPPacket.parse(p).payload
10 elsif PacketFu::IPv6Packet.can_parse?(p)
11 payload = PacketFu::IPv6Packet.parse(p).payload
14 raise "Found something in the pcap file that either is non-IP, or cannot be parsed"
16 if payload.match(hostname)
17 raise "Hostname leak detected"