Cybersecurity Ops with Bash: Defensive (Ch.9)

Hi guys, we are back to the series of Cybersecurity Ops with Bash: Defensive workshop solution.

Note: This is only workshop solution, NOT A SUMMARY OF DEFENSIVE BASH!!! I do not own the book, I am just reading/learning it and published the solution ONLY.

Before you read the workshop solution, it is good if you have read the Defensive chapter of the book, so it gives you an idea what the chapter is about.

Chapter 9

  1. When comparing two scan files, account for files of different lengths or with a different set of IP addresses/hostnames.

    Comparing the file, I will take the easy route which is comparing the length of the 2 files.
    qn1
    Using wc command to count the number of lines in the file to determine the difference in length of the 2 files.

  2. Use /dev/tcp to create a rudimentary Simple Mail Transfer Protocol (SMTP) client so the script does not need the mail command.

    I didn’t really use /dev/tcp, what I really did was to use ssmtp command to send the email to the intended receiver.
    qn2

Hope you have a nice day and that this solution will help you in the journey of bash scripting.

Author: Derek

Published by bsderek

We are just 2 new authors doing writeup on related Cybersecurity topics to educate ourselves. We encourage you to leave a comment in areas where we can improve in terms of skills/knowledge. If we are incorrect in our writeup , please informed us and send us article to read to better educate ourselves. Feel free to leave a comment behind. Hope you have a nice day!! And don’t forget to hack your life away!!! Peace (00)

Leave a comment

Design a site like this with WordPress.com
Get started