Chapter 3. Programming

In this chapter we will look at some basic examples of computer programming. We will look at writing programs to automate various useful tasks in multiple programming languages. Even though we use prebuilt software for the majority of this book, it is useful to be able to create your own programs.

Bash Scripting

In this section we’ll look at using Bash scripts to run several commands at once. Bash scripts, or shell scripts, are files that include multiple terminal commands to be run. Any command we can run in a terminal can be run in a script.


We’ll call our first script When it runs, this script will perform a ping sweep on our local network that sends Internet Control Message Protocol (ICMP) messages ...

Get Penetration Testing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.