Module14
Module
Networking
PythonFor
forCyber Security
Security
Lesson
Lesson1 1
Amit
AmitGottlib
Gottlib [email protected]
[email protected]
AMIT
AMIT GOTTLIB
GOTTLIB
Python 1
Introduction to Computer Language , Python & Pycharm
Introduction
to Computer
Language &
Python
Brief History of 1940 - 1950 Late 1950's
Computer
Birth of programming COBOL (common business
languages; Assembly language) developed for
language and Fortran for business data processing.
Languages scientific computation.
LISP (list processing)
introduced for artificial
intelligence research.
1970's 1980's 2000's-onwards
C language was Emergence of object- Rise of languages
developed (same person oriented languages like focused on ease of use
who invented C also C++ and web development,
invented UNIX) such as Python, Java,
PHP and JavaScript.
Types of Computer
Languages
Computer languages can be categorized primarily into
two types: low-level and high-level languages.
Low-Level Languages: These include assembly language and
machine language (1's 0's). They are closely tied to the architecture
of the computer's hardware and are more difficult to read and write.
They offer high performance and efficient resource usage.
High-Level Languages: These are more abstract, easier to read, and
further from machine language. Examples include Python, Java, and
C++. They are user-friendly, portable across different platforms, and
are designed to solve specific types of problems efficiently.
Basics of Python programming
Python is one of the most popular programming language in the world. It was created by Guido van Rossum, and released in
1991 Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc). Python has a simple syntax similar to the
English language. It is used for: Web Development (server-side), Software Development, Mathematics & System Scripting.
Why Python in Cyber Security?
Tasks Automation: Python enables automation of repetitive cybersecurity tasks like log analysis, scanning for
vulnerabilities, or network traffic analysis.
Data Analysis and Forensics: Python's powerful libraries enables data analysis, making it easier to handle large datasets
and perform forensic investigations.
Scripting for Security Tools: Python is used to script and enhance various security tools and frameworks, providing
customization and extended functionalities.
Adoption in the Industry: Python is widely used in the cybersecurity industry, making it essential for compatibility and
collaboration.
Handling Cybersecurity Incidents: Python is useful in developing scripts and tools for incident response and threat hunting.
TASK 1
Go to ChatGPT.com and ask it to generate a python code for a problem you
wish to solve (in work, in life, be creative).
Open a notepad, copy and paste the code and save the file as:
read_this_when_python_module_ends.py file in your Documents folder
Integrated
Text Editor Development
Environment
Simple, straightforward interface
vs More complex GUI with integrated tools
and features
Limited debugging capabilities; external
tools needed
Advanced debugging features built-in
Basic syntax highlighting
Intelligent code completion and
suggestions
Code completion not available
Compiler Interpreter
Compiles the entire program at once Translates and executes code line by line,
before execution. This means longer initial which leads to slower overall execution
waiting time, but once compiled, the but allows immediate program start.
program runs faster.
Detects all errors after the entire program
vs Finds errors one at a time, halting
execution at the first encountered error.
is compiled, not allowing the program to Subsequent errors are not revealed until
run if there are errors. the current one is fixed and the program is
Often used for production software and run again.
systems programming. Examples include Commonly used for scripting, rapid
languages like C, C++, and Rust. application development, and education.
Examples include Python, JavaScript, and
Ruby.
Understanding the Python Interpreter
The Python interpreter is a program that reads and executes
Python code. It's an essential component of Python
programming, as it allows you to run Python scripts and
interact with the Python programming environment.
Python is an interpreted language, which means that the
interpreter reads and runs code directly, without the need for
compiling it into machine language before execution. This
feature makes Python highly versatile and user-friendly for
development and testing.
The interpreter runs Python code contained in a file. You write
your Python script in a file (usually with a .py extension) and
then tell the interpreter to run the code in this file.
Python Installation Pycharm Installation
1. Download Python: 1. Download PyCharm:
Visit the Python.org Downloads page. Go to the JetBrains PyCharm download page.
Choose the latest Python version suitable for Choose Community (free) version
your operating system (Windows, macOS, or Download the version compatible with your operating
Linux). As of the latest information, Python system.
3.11.0 is available. 2. Install PyCharm:
2. Install Python on Windows: Run the downloaded installer.
Run the downloaded installer. Follow the on-screen instructions to complete the
Ensure to check the box that says “Add Python installation.
3.x to PATH” before clicking on the "Install Now" 3. Setting Up PyCharm:
button. Open PyCharm for the first time, and it will prompt you
Follow the installation instructions. to configure the environment.
Set up the interpreter by selecting the Python version
you installed earlier.
Customize other settings as per your preference, like
theme and plugins.
TASK 2
Install Python & Pycharm on your Kali VM
See you in the
next lesson!