For the group activity during unit 3, you read a fictitious case study of an attack against a web server. Your group scoped a penetration test by answering the relevant questions within the ‘Scoping a Penetration Test’ document under unit 3.
The important aspect for the group task was not necessarily answering all the questions in the scoping document, but how you worked as a team in a high-pressure scenario.
Using the notes you took during the group activity, discuss and reflect upon your group exercise using no more than 250 words.
Create a script called my_new_whois.sh that utilises the provided whois_yahoo_mnt.txt file to create a script that prompts the user to perform the following tasks:
1. Obtain all unique people in the file sorted in alphabetical order and place them in the specified file.
2. Obtain all inetnums in the file sorted in ascending numerical order and place them in the specified file.
3. Obtain all unique netnames sorted in alphabetical order and place them in the specified text file.
Your script should take as arguments the whois_yahoo_mnt.txt file and a user-specified output file name to save the output of your script. An example of how your script should execute from the shell is shown below:
./my_new_whois.sh whois_yahoo_mnt.txt output.txt
A demo video of how a user interacts with the script is available on Canvas.
· Provide an adequate level of input validation. For example, if the user enters ‘4’ as an option (an invalid option) they should be prompted to enter a valid input.
· Remove leading white space from any lines of text. You will need to research sed and/or awk in order to achieve this.
· Append the date and time to the bottom of the file you created.
Rather than asking the user for the output file when running the script, dynamically create a file with the following file name structure:
option_YYYY_mm_dd_HH_MM_ss.txt
For example, if the user searched for inetnums on March 17th, 2020 at 15:01:33, the filename would be:
inetnum_2020_03_17_15_01_33.txt
Marks for this task are capped at 50. You do not necessarily need to complete the bonus extension to get 100%.
Place your complete script as an appendix, as plain text, to your portfolio and also submit the my_new_whois.sh file along with your portfolio when uploading your final submission to Canvas.
Requirement |
Mark available |
Script accepts two arguments or terminates the script with a ‘usage error’ otherwise. |
5 marks |
User friendly menu of options for the user to select from. |
5 marks |
Read user input and ensure a valid value has been entered. |
5 marks |
If a valid value has been entered, display to the user their response and what they are searching for. |
3 marks |
Using appropriate commands, parse the text file based on what the user requires to be searched. |
12 marks |
Trim leading white spaces from any lines of text. |
5 marks |
Redirect output to the user-defined file and place date and time stamp appended to file. |
5 marks |
Quality of script (indentation, comments, general good scripting practices, etc). |
5 marks |
|
Total 45 marks |