CHAP TER 1
Introduction
INFORMATION IN THIS CHAPTER: CONTENTS
n Setting up a Development Environment for Python Introduction:
n Introduction to the Python Programming Language A Penetration Test
n An Explanation of Variables, Data types, Strings, Lists, Dictionaries, with Python..................1
Functions Setting Up Your
n Work with Networking, Iteration, Selection, Exception Handling and Development
Modules Environment.................2
Installing Third Party
n Write Your First Python Program, a Dictionary Password Cracker Libraries..............................3
n Write Your Second Python Program, a Zipfile Brute-Force Cracker Interpreted Python
Versus Interactive
Python..................................5
The Python
To me, the extraordinary aspect of martial arts lies in its simplicity. Language......................6
Variables..............................7
The easy way is also the right way, and martial arts is nothing at all
Strings..................................7
special; the closer to the true way of martial arts, the less wastage of Lists.....................................8
expression there is. Dictionaries.........................9
– Master Bruce Lee, Founder, Jeet Kune Do Networking.........................9
Selection............................10
Exception Handling..........10
INTRODUCTION: A PENETRATION TEST WITH Functions...........................12
Iteration.............................14
PYTHON File I/O...............................16
Sys Module........................17
Recently, a friend of mine penetration tested a Fortune 500 company’s computer OS Module.........................18
security system. While the company had established and maintained an
Your First Python
excellent security scheme, he eventually found a vulnerability in an unpatched Programs....................20
server. Within a few minutes, he used open source tools to compromise the Setting the Stage for
system and gained administrative access to it. He then scanned the remaining Your First Python
servers as well as the clients and did not discover any additional vulnerabilities. Program:
The Cuckoo’s Egg.............20
At this point his assessment ended and the true penetration test began.
1
Violent Python. http://dx.doi.org/10.1016/B978-1-59-749957-6.00001-6
Copyright © 2013 Elsevier Inc. All rights reserved.