0301 | Introductions
Disclaimer | Attribution
This short "Introduction to Python" is based on my own notes taken during the TCM Security - Python 101 for Hackers video course by Riley Kidd.
I highly recommend this course as a great starting point for learning about Python; it was instrumental in my own understanding of the subject. I would like to extend a big thank you to the TCM Security Team for providing such valuable resources!
Welcome and course introduction
- Project: https://247CTF.com/
What is Python
- dynamic, interpreted, object-oriented, high-level language
- enables cross-platform rapid prototyping and scripting
- relatively simply, easy to learn syntax
- general purpose and versatile, with mature standard library
- extensible, actively used with a large community
Why learn Python as a hacker
- understand how scripts or proof of concepts work
- debug, modify and run scripts or proof of concepts
- create your own scripts or proof of concepts
- "Easy" first programming language for beginners
- Understanding how an application could work makes it easier to anticipate how it could break (you can also think about fixes too)
Python2 vs Python3
- Python2 is no longer under development - but people still use it
- Python2 code will (mostly) not run in a Python3 environment
- Python3 stores strings as unicode by default (not ascii)
- If you don't know how to run a script - try both (or try to print)
- If you have a choice - use Python3 (Python2 is End of Life)