Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a seed command which will print all non-blank comment lines that are in th

ID: 3805218 • Letter: W

Question

Write a seed command which will print all non-blank comment lines that are in the file in. ask and pipe the output into the program we. the command should be entirely 011 the command line. Assume that a comment line always has a in the first column and a blank comment line has only white space after the # [15] Your machine has been under attack so you have been running snort to monitor the Ethernet traffic for connection attempts which represent possible at hicks. Because you Eire monitoring traffic for a lot of machines you want to write a seed script which will print the lines concerning your machine in a more readable format. Your machine name is nereid and your IP address is 129.115.11.213. the lines that you want to print have your IP address as either the source or the destination and you want to replace your IP address with nereid. the relevant data lines are: 10/20-13:00:50.317940 129.115.237.66:1126 rightarrow 129.115.11.213:8080 10/20-12:53:00.760322 129.115.11.213:03602 rightarrow 129.115.98.10:161 and you want them changed to 10/20 13:00:50 129.115.237.00:1120 rightarrow nereid:8080 10/20 12:53:00 nereid:63602 rightarrow 129.115.98.10:161 [15] An ISP (Internet Service Provider) has a data file which contains a month's worth of information about users connect times and bandwidth usage as well as storage usage. There are two types of lines in the file, a connect line for each user connection which has 5 fields containing the login, start and stop times as well as the bandwidth usage broken into the number of bytes in versus the number of bytes out. Maynard 1378 2463 12379894 34563 and daily storage usage lines which contains the number of bytes 01 disk space being used by the user which has the following format: *storage* *storage* Maynard 27846439 Write an ask script to find whether the user Maynard has a total connect time exceeding 10.000 or if his total bandwidth in or his total bandwidth out exceeds 10,000.000.000 bytes or whose maximum storage for the month exceeded 10.000.000. If any of these conditions Eire valid, then print out all statistics for the user Maynard. the output should look like: Maynard Connect Time = 1085 Bandwidth in = 12314457 Bandwidth Out = 98456 Storage = 27846439

Explanation / Answer

1) sed command to print all non-blank comment lines in in.awk

$ sed -n '/^[[:blank:]]*#[[:blank:]]*[^[:blank:]]/p' in.awk

$ sed -n '/#.*[^[:blank:]]/p' in.awk

//To get the number of line

$ sed -n '/#.*[^[:blank:]]/p' in.awk | wc -l

2) To Replace the IP ADDRESS with the "NEREID"

sed -i 's/129.115.11.213/nereid/g' file.txt

Note- file.txt is the file name in which the result of snort is given. This is taken as no file name is given.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote