- ComputerTricks

Latest

BANNER 728X90

Tuesday, March 12, 2019


Black Hat Python

Python Programming Hackers and Pentesters

Setting Up Your Python Environment

This is the least fun — but nevertheless critical — part of the book, where we walk through setting up an environment in which to write and test Python. We are going to do a crash course in setting up a Kali Linux virtual machine (VM) and installing a nice IDE so that you have everything you need to develop code. By the end of this chapter, you should be ready to tackle the exercises and code examples in the remainder of the book. Before you get started, go ahead and download and install VMWare Player. I also recommend that you have some Windows VMs at the ready as well, including Windows XP and Windows 7, preferably 32-bit in both cases


Installing Kali Linux


Kali is the successor to the BackTrack Linux distribution, designed by Offensive Security from the ground up as a penetration testing operating system. It comes with a number of tools preinstalled and is based on Debian Linux, so you’ll also be able to install a wide variety of additional tools and libraries beyond what’s on the OS to start.


First, grab a Kali VM image from the following URL: http://images.offensive-security.com/kalilinux-1.0.9-vm-i486.7z. Download and decompress the image, and then double-click it to make VMWare Player fire it up. The default username is root and the password is toor. This should get you into the full Kali desktop environment as shown in >>Figure 1-1 .

The first thing we are going to do is ensure that the correct version of Python is installed. This book will use Python 2.7 throughout. In the shell (Applications ‣ Accessories ‣ Terminal), execute the following:

root@kali:~#
python --version
Python 2.7.3
root@kali:~#


If you downloaded the exact image that I recommended above, Python 2.7 will be automatically installed. Please note that using a different version of Python might break some of the code examples in this book. You have been warned.

1 comment: