Terminal-and-Bash 3.3 Sticking to the Script Overview Day 2 • Overview: • Discuss three benefits of text processing programs over programming languages for a security professional • Use sed to make substitutions to a file. • Use awk to isolate data points from a complex log file. • • • Edits the contents of a file using nano Design an IP lookup shell script by passing arguments Demo Video (On-gitlab) • sed • awk • Shell script Terminal-and-Bash 3.3 Sticking to the Script Activities Day 2 • • • • • 02_warmup : In this activity, you are playing the role of security analyst at Wonka Corp. You are tasked with gathering additional information specified in the subpoena – 20 min Suggested 06_sed_activity: In this activity, you are playing the role of security analyst at Wonka Corp. You are tasked with combining two access logs into a single file, and then use text processing to make the “failed login” data consistent. – 20 min Suggested 09_awk_activity: In this activity, you are playing the role of security analyst at Wonka Corp. You are tasked with isolating several fields from the log file to determine the primary username being used to login. – 20 min Suggested 14_shell_scripting: In this activity, you are playing the role of security analyst at Wonka Corp You are tasked with using nano to create a shell script with the awk and sed commands to analyze a log file.. – 25 min Suggested 17_ip_lookup_actitvy: In this activity, you are playing the role of security analyst at Wonka Corp . You are tasked with designing a script that can look up countries of several IP addresses pulled from the logs. – 25 min Suggested Terminal-and-Bash 3.3 Sticking to the Script Key Terms Day 2 • Command Definitions: (cut, sed, awk, nano). Please see slides 18, 27, 50, from student slide deck for more definition. • cut: A unix command for cutting out the sections from each line of files and writing the result to standard output. It can be used to cut parts of a line by byte position, character and field. Basically the cut command slices a line and extracts the text. It is necessary to specify option with command otherwise it gives error. If more than one file name is provided then data from each file is not precedes by its file name https://www.geeksforgeeks.org/cut-command-linux-examples/