This series is going to teach you the concepts, and functions of the Python programming language, it will help you build an understanding of the language. Gradually we will base the series on security related issues, with the focus of ethical hacking and penetration testing.:~$ whoamiAslam Admani
That's me!Well, why Python you ask? Python is an easy-to-learn language, which is versatile, well supported, and resourceful. It comes pre-installed on multiple operating systems and is used by many including hackers, data scientists, network admins, web developers and more. So why not learn it?Let's begin by identifying the requirements:
- You will need a PC, be it a laptop/desktop
- If you do not have access to these items, it will be harder to learn, however, there are some mobile apps that support Python. If you have android you can download programming hub (within the app search for Python), Python ide and a few others. As for ios powered devices you could just search for Python, and read reviews (I'm on android, so I wouldn't know what's best for apple users).
- You will need to be self-motivated, find what you want to do, why you want to learn Python and be persistent.
Assuming you have what's required, let's start.I use kali linux, on which Python comes pre-installed. If you don't have kali linux installed, I would highly recommend it, if you are into computer security/hacking and so fourth. If you don't have kali linux, and you would like to install it, there are hundreds of tutorials you could find on the web. I', not going to go over it in great detail, however here are the steps:
- download vmware player, or virtualbox (if you don't have it)
- download a Kali Linux iso file
- install and configure the virtual image (Kali Linux) using the VMWare or VBox
- you're good to go!
If you wish to proceed using windows and you don't have python installed, that's absolutely fine, you could download it from the following website: https://www.python.org/downloads/
- We will be using Python 2, however if you wish you can download python 3. There are a few distinctions between the both, and throughout the course I will point them out.
- Next go to: https://notepad-plus-plus.org/download/v7.4.1.html to download notepad ++
If you're on windows and you have these installed, you're ready to go.If you've downloaded and configured Kali linux you're ready to go.Note:
All Python files must end with a .py
extension for your PC to identify that it's a python file. You will also be able to access Python in interactive mode by going either on to the terminal or command prompt and typing in Python. If you're unaware of what these are, go on to your search bar on Windows and type in 'cmd'. If you get an error: http://pythoncentral.io/add-python-to-path-python-is-not-recognized-as-an-internal-or-external-command/
follow this tutorial to be able to run python on your command prompt .Or if you're on Linux, on your search bar, type in 'terminal'.OUR FIRST PROGRAM
Open up a text editor - notepad ++ for windows, gedit, or nano for linux and do the following:Type in:
IF YOU ARE RUNNING PYTHON 3.X:
- The standard syntax is: print ('hello world')
Okay, next go to save as. Save the file name as My_first_program.py
Then run it by entering: python My_first_program.py
- From this you should see the output: 'hello world'
- Now try the same program however instead of using ' ', try using " text ", and ''' ''', or """ text in here """. Play around with these!
Next replace hello world with other things, print your name out, print your date of birth out, play around with it.This is the end of the first lesson. The point of this blog was (if on windows) to get you to install the python framework, download notepadd ++, enable the python command on terminal and to write your first little program, otherwise encourage you to get a copy of kali linux, and write the same program on that.As we go through this series, I will upload code and tasks for you on my github: https://github.com/c0d14k/Python-Cybrary-Code