Bash Scripting

Get introduced to Bash scripting, which is an essential skill for a pentester.

Introduction to Bash scripting

Every hacker, pentester, or system administrator must be able to write scripts that can be used in the automation of the different tasks.

The shell is an application interface between an operating system and the user. It enables the user to run commands to control the different programs in the Linux operating system. It’s also a scripting language interpreter.

For the successful creation and running of shell scripts, we need to keep in mind the following general steps:

  1. Write a script as ordinary text files. Ensure that they have the .sh extension. Complicated and long scripts will require the use of an editor like Vim, which we discussed in a previous lesson.

  2. Make the script file executable by giving permissions to allow execution. This can be accomplished by using chmod.

  3. Ensure that other necessary files and dependencies are available with the proper paths.

  4. Execute the script and enjoy your free time. Or read the logs.

Get hands-on with 1200+ tech skills courses.