Question: Task 04 (20 points) Write a piped command using grep and cut to read the provided data file, find the entries that use UDP protocol

Task 04 (20 points)

Write a piped command using grep and cut to read the provided data file, find the entries that use UDP protocol to transmit packets less than 100 bytes, and print the port number of those entries.

Input file (lab0202.csv)

Expected output of script

date time protocol ip-address port packet-size

2018-01-01 19:27:19 TCP 11.101.6.64 22 44

2018-04-17 01:35:12 UDP 10.101.7.69 2135 83

2018-05-05 04:26:05 UDP 11.101.6.65 2160 104

2018-08-20 15:43:16 TCP 10.101.7.64 22 113

2018-02-10 02:28:02 UDP 11.101.6.65 2089 68

2018-03-22 00:05:32 TCP 9.101.7.65 23 92

2018-04-24 19:32:47 TCP 9.100.8.65 22 93

2018-05-19 01:22:06 TCP 10.100.7.64 2107 29

2018-04-13 03:51:33 TCP 9.102.8.64 22 32

2018-08-16 21:02:36 UDP 11.100.8.65 2190 17

2018-06-27 00:44:54 UDP 11.101.6.65 2109 73

2018-01-08 07:39:00 TCP 10.101.8.65 22 74

2018-01-22 07:08:54 UDP 9.101.7.65 2165 27

2018-01-11 07:17:44 TCP 11.101.6.65 22 110

2018-01-10 13:14:41 TCP 10.101.7.64 22 89

2018-08-23 13:47:24 UDP 11.100.6.65 2187 93

2018-08-17 06:29:35 TCP 11.101.6.65 2114 66

2018-11-23 02:22:22 UDP 9.100.7.64 2142 118

2018-09-22 22:06:47 TCP 11.101.6.65 22 9

2018-04-04 09:41:43 UDP 9.102.7.64 2116 34

2135

2160

2089

2190

2109

2165

2187

2142

2116

Note: Remember that it is ok to use grep multiple times in your piped command. Dont try to fit everyone in one!

Task 05 (20 points)

Write a piped command using grep and cut to read the provided data file, find the entries that occurred in January at or before noon and used port 22, and print the IP address number of those entries.

Input file (lab0202.csv)

Expected output of script

date time protocol ip-address port packet-size

2018-01-01 19:27:19 TCP 11.101.6.64 22 44

2018-04-17 01:35:12 UDP 10.101.7.69 2135 83

2018-05-05 04:26:05 UDP 11.101.6.65 2160 104

2018-08-20 15:43:16 TCP 10.101.7.64 22 113

2018-02-10 02:28:02 UDP 11.101.6.65 2089 68

2018-03-22 00:05:32 TCP 9.101.7.65 23 92

2018-04-24 19:32:47 TCP 9.100.8.65 22 93

2018-05-19 01:22:06 TCP 10.100.7.64 2107 29

2018-04-13 03:51:33 TCP 9.102.8.64 22 32

2018-08-16 21:02:36 UDP 11.100.8.65 2190 17

2018-06-27 00:44:54 UDP 11.101.6.65 2109 73

2018-01-08 07:39:00 TCP 10.101.8.65 22 74

2018-01-22 07:08:54 UDP 9.101.7.65 2165 27

2018-01-11 07:17:44 TCP 11.101.6.65 22 110

2018-01-10 13:14:41 TCP 10.101.7.64 22 89

2018-08-23 13:47:24 UDP 11.100.6.65 2187 93

2018-08-17 06:29:35 TCP 11.101.6.65 2114 66

2018-11-23 02:22:22 UDP 9.100.7.64 2142 118

2018-09-22 22:06:47 TCP 11.101.6.65 22 9

2018-04-04 09:41:43 UDP 9.102.7.64 2116 34

10.101.8.65

11.101.6.65

Note: for this one, youll need to figure out how to match before noon and exactly noon, not a minute later than 12 oclock.

Task 06 (20 points)

Write a piped command using grep, sort, uniq, tail, wc, and cut to read the provided data file and return the number of unique IP addresses that match the following criteria:

  • IP address begins with 11
  • Occurred before August 2018
  • Occurred at an even numbered hour
  • Has a size less than or equal to 100

Input file (lab0202.csv)

Expected output of script

date time protocol ip-address port packet-size

2018-01-01 19:27:19 TCP 11.101.6.64 22 44

2018-04-17 01:35:12 UDP 10.101.7.69 2135 83

2018-05-05 04:26:05 UDP 11.101.6.65 2160 104

2018-08-20 15:43:16 TCP 10.101.7.64 22 113

2018-02-10 02:28:02 UDP 11.101.6.65 2089 68

2018-03-22 00:05:32 TCP 9.101.7.65 23 92

2018-04-24 19:32:47 TCP 9.100.8.65 22 93

2018-05-19 01:22:06 TCP 10.100.7.64 2107 29

2018-04-13 03:51:33 TCP 9.102.8.64 22 32

2018-08-16 21:02:36 UDP 11.100.8.65 2190 17

2018-06-27 00:44:54 UDP 11.101.6.65 2109 73

2018-01-08 07:39:00 TCP 10.101.8.65 22 74

2018-01-22 07:08:54 UDP 9.101.7.65 2165 27

2018-01-11 07:17:44 TCP 11.101.6.65 22 110

2018-01-10 13:14:41 TCP 10.101.7.64 22 89

2018-08-23 13:47:24 UDP 11.100.6.65 2187 93

2018-08-17 06:29:35 TCP 11.101.6.65 2114 66

2018-11-23 02:22:22 UDP 9.100.7.64 2142 118

2018-09-22 22:06:47 TCP 11.101.6.65 22 9

2018-04-04 09:41:43 UDP 9.102.7.64 2116 34

1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!