Assume the following scenario: A cyberattack on a web server has happened. The attackers
stole some files from the server. Your task is to identify and extract the files which have
been downloaded. You are given the following:
(a) A web server access log file where each line has the following format:
<IP address> [<timestamp>] “<http_method> <resource>” <STATUS_CODE>
(b) A list of IP addresses.
(c) The name of a directory containing files and directories.
(d) The name of an output directory.
Write a Perl script that:
(a) Can be called as follows:
./task1.pl <log_file> <dir1> <dir2> <ip_list>
(b) finds all files in <dir1> that have been successfully (status code 200) accessed with
GET by any of the IP addresses in <ip_list> and copies them to <dir2>,
(c) prints out a warning on STDERR for every file that has been downloaded but cannot
be found in <dir1>,
(d) does not copy any files that have not been downloaded by any of the IP addresses in
(e) is well-structured and understandable.
Your program must handle errors correctly.
For this task, you are given an example in the file task1-example-1.zip. This archive contains
the following files and directories (the directories www/ and 18.104.22.168-accessed/ contain
When you run task1.pl is run in example-1/ as follows:
./task1.pl access.log www 22.214.171.124-accessed-2 126.96.36.199
the directory 188.8.131.52-accessed-2 should be created and contain exactly the same files as
Your script must run on lapis.cs.cf.ac.uk without installing any additional libraries or
programs. IF YOUR SCRIPT DOES NOT RUN AS SPECIFIED, NO ATTEMPT TO MAKE IT RUN
WILL BE MADE AND YOU WILL RECEIVE 0 MARKS.
本网站支持淘宝 支付宝 微信支付 paypal等等交易。如果不放心可以用淘宝交易！
E-mail: firstname.lastname@example.org 微信:itcsdx