Using Scapy (Python packet manipulation program)

Scapy is a Python program that enables the user to send, sniff and dissect and forge network packets. This capability allows construction of tools that can probe, scan or attack networks.

In other words, Scapy is a powerful interactive packet manipulation program. It is able to forge or decode packets of a wide number of protocols, send them on the wire, capture them, match requests and replies, and much more. Scapy can easily handle most classical tasks like scanning, tracerouting, probing, unit tests, attacks or network discovery. It can replace hping, arpspoof, arp-sk, arping, p0f and even some parts of Nmap, tcpdump, and tshark).

Online guidance for using Scapy can be found here: Link

Create Executable Python Script with PyInstaller

PyInstaller for Python can be used to create a standalone executable from a Python script.

To create the executable, Python must be installed on the local host. Python can be obtained from here. Currently as of 2018, there is Python versions 2 and 3 available to download.

Before proceeding with the environment setup, test that the pip libraries have been installed with your Python installation with the following command in the Python interpreter:

pip

This will show the command results for the pip command. For any errors with running the pip command, pip may need to be downloaded and installed manually.

Next step is to install PyInstaller. This is done by using the following command within the Python interpreter:

pip install pyinstaller

For PyInstaller on Windows environments, PyWin32 might be required and can be found here

To test Python is running in your environment, test your Python script with the following command:

python your_script.py

Once PyInstaller has been installed, within your Python script directory, the following command can be used with your Python script to create the standalone executable:

pyinstaller --onefile .py

For any other issues with installing or running pip, PyInstaller or Python scripts, you may need to set up your PATH environment variables within your operating system.

Programming Languages

Python
Paradigm: Object-oriented, imperative, functional, procedural, reflective
Typing discipline: Duck, dynamic, strong

Ruby
Paradigm: Multi-paradigm: Object-oriented, imperative, functional, reflective
Typing discipline: Duck, dynamic, strong

C
Paradigm: Imperative (procedural), structured
Typing discipline: Static, weak, manifest, nominal

C++
Paradigm: Multi-paradigm: procedural, functional, object-oriented, generic
Typing discipline: Static, nominative, partially inferred

C#
Paradigm: Structured, imperative, object-oriented, event-driven, task-driven, functional, generic, reflective, concurrent
Typing discipline: Static, dynamic, strong, safe, nominative, partially inferred

Perl
Paradigm: Multi-paradigm, functional, imperative, object-oriented (class-based), reflective, procedural, event-driven, generic
Typing discipline: Dynamic

Java
Paradigm: Multi-paradigm: object-oriented (class-based), structured, imperative, generic, reflective, concurrent
Typing discipline: Static, strong, safe, nominative, manifest

PHP
Paradigm: Imperative, functional, object-oriented, procedural, reflective
Typing discipline: Dynamic, weak

Installing Tk on Windows for Python

ActiveTcl is a precompiled distribution of the open source Tcl language. Tcl includes the Tk extension libraries for Python.

  • Install the “ActiveTcl” distribution from ActiveState – Link
  • Download the Community Edition of ActiveTcl for Windows
  • Run and complete the installer for the Community Edition of ActiveTcl for Windows
  • After the installer completes, assuming the default directory was used for installation, verify ActiveTcl has installed correctly by opening a Command Prompt window and typing C:\ActiveTcl\bin
  • An on-screen Tcl window will be displayed. This can be closed and confirms successful installation of ActiveTcl.

Connecting PyCharm (Python IDE) to GitHub via Token Authentication

  1. Open PyCharm
  2. Click “Settings”, “Version Control” and then “GitHub” menu item
  3. Leave “Host” as default: github.com
  4. Leave “Auth Type” as default: token
  5. Enter your GitHub authentication token in to the input box. For guidance on creating GitHub tokens, please see Link
  6. Click the “Test” button to test the Github authentication channel
  7. For successful authentication connections, a display message will be shown. Click “Ok” to close.
  8. PyCharm will now be authenticated to your GitHub account using your personal access token, and will be ready for version control development for your Python projects.