Hide

Problem A
Find the Malicious Bytes part 1

Background

A company named VitaminC has the job of detecting current and new variations of network viruses and exploits. They have been given access to client companies’ networks so that IP traffic may be monitored for malicious data traversing the network. They detect this malicious data by looking for virus signatures (a sequence of bytes that have been linked to a known virus).

VitaminC has recently been tasked with identifying IP addresses that are potentially sending malicious packets for further analysis. They have been provided a virus signature (byte sequence) for a known virus that they want to flag within network traffic. The network traffic they have received has been parsed out in such that the only fields available are the IP address and some data bytes.

Objective

The objective is to find the IP addresses that are associated with the target malicious bytes.

Input

The first line is a sequence of bytes separated by a space character. This is the target malicious byte sequence. The second line is blank. Each remaining line contains an IP address and a byte sequence, separated by a space. These are the byte sequences to search.

Output

Output is a list of one or more IP addresses (one per line) that contain the target byte sequence in their data.

Sample Input 1 Sample Output 1
23 79 ab
   
192.168.0.23 0a 23 74 ab fe 12 34 56
192.168.0.23 0a 23 69 ab fe 12 34 56
192.168.0.23 0a 23 77 ab fe 12 34 56
192.168.0.23 0a 23 74 ab fe 12 34 56
192.168.0.27 0a 79 79 ab 23 79 ab 56
192.168.0.25 0a 23 79 fe ab 12 34 56
192.168.0.30 0a ab 79 23 79 ab ab 79
192.168.0.27
192.168.0.30

Please log in to submit a solution to this problem

Log in