Question 6 of 32 from exam 300-215-CBRFIR: Conducting Forensic Analysis and Incident Response Using Cisco Technologies for CyberOps

Question 6 of 32 from exam 300-215-CBRFIR: Conducting Forensic Analysis and Incident Response Using Cisco Technologies for CyberOps

Question

Which scripts will search a log file for the IP address of 192.168.100.100 and create an output file named parsed_host.log while printing results to the console? A.

import os
import re
line_regex = re.compile("".*fwd=\'192.168.100.100\". *S")
output_filename = os path.normpath( “output/parsed_host.log")
with open(output filename, “w’) as out_file:
out _file.write()
with open(output_filename, “a”) as out_file:
with open( ‘parsed_host.log’, “r’) as in_file”
for line in in_file:
if (ine_regex.search(line)):
print line
‘out_file.write(line)

B.

import os
import re
line_regex = re.compile("".*fwd=\'192.168.100.100\". *S")
output_filename = os.path.normpath( “output/parsed_hosts.log")
with open(output filename, “w’) as out_file:
out _file.write()
with open(output_filename, “a”) as out_file:
with open( ‘test_og.log’, “r’) as in_file”
for line in in_file:
if (ine_regex.search(line)):
print line
out _file.write(line)

C.

import os
import re
line_regex = re.compile("’.*fwd=\"192.168.100.10\". *S")
output_filename = os path.normpath( “output/parsed_host log’)
with open(output filename, “w’) as out_file:
out _file.write()
with open(output_filename, “a”) as out_file:
with open( ‘parsed_host.log’, “r’) as in_file”
for line in in_file:
if (ine_regex.search(line)):
print line
‘out_file write(line)

D.

import os
import re
line_regex = re.compile("".*fwd=\'192.168.100.100\". *S")
output_filename = os.path.normpath( “output/parsed_host log’)
with open(output_filename, ‘w’) as out file:
out _file.write()
with open(output_filename, ‘a”) as out_file:
with open( ‘test_og.log’, “r’) as in_file”
for line in in_file:
if (ine_regex.search(line)):
print line
‘out_file write(line)

Explanations

A.