Scripting and Penetration Testing
Let’s begin by taking a look at four scripting languages that are commonly used by penetration testers. You’ll want to choose the right language for each penetration-testing task that you face, by considering several important criteria:
- Standards within your organization
- Operating system(s) of the devices that will run the scripts you create
- Availability of libraries and packages that support your work
- Personal preference
The four languages that are most commonly used during penetration tests are Bash, PowerShell, Ruby, and Python. We’ll begin our explorations of these languages by writing a simple “Hello, world!” script in each language. “Hello, world!” is the first script that most developers write when exploring a new language. It simply prints that phrase on the screen when it is run. It’s a useful exercise to make sure that you’re set up and running properly.
Bash
The Bourne-again...