8
B A S H S C R I P T I N G
Any self-respecting
hacker must be able
to write scripts. For that matter, any self-
respecting Linux administrator must be
able to script. Hackers often need to automate
commands,
sometimes from multiple tools, and this
is most efficiently done through short programs they
write themselves.
In this chapter, we build a few simple bash shell
scripts to start you off
with scripting. We’ll add capabilities and features as we progress, eventually
building a script capable of finding potential attack targets over a range of
IP addresses.
To become an
elite hacker, you also need the
ability to script in one of
the widely used scripting languages, such as Ruby (Metasploit exploits are
written in Ruby), Python (many hacking tools are Python scripts), or Perl
(Perl is the best text-manipulation scripting language).
I give a brief intro-
duction to Python scripting in Chapter 17.