Обновить python linux kali

How to Install Python 3 on Kali Linux

In this tutorial, you will learn how to get the latest version of Python and pip installed on Kali Linux. Python can be installed from the Kali software repository with apt command, or we can get the latest Python release or pre-release from Python.org. We’ll cover both methods below.

Install From Kali Repo

Step 1. To check what version of Python is installed in your system:

$ python3 --version Python 3.10.8

Step 2. To install the latest version of Python, execute the following command:

$ sudo apt update $ sudo apt install python3

Step 3. To install pip on Kali (the package installer for Python):

$ sudo apt install python3-pip

Step 4. To launch Python, simply execute the next command:

Install Latest Version From Official Download

The next method takes a few additional steps, but ensures that you download and install the absolute latest Python release.

Step 1. Before installing Python, always make sure that you have your system up to date:

$ sudo apt update $ sudo apt upgrade

Step 2. Next, we’ll install the dependencies:

$ sudo apt install build-essential pkg-config zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev

Step 3. Navigate to the Python download page and choose from either the latest stable release or pre-release version. Download either the compressed gzipped tarball, or the xz tarball.

Step 4. Extract the downloaded file with tar command:

$ cd ~/Downloads $ tar -xf Python-*

Step 5. Change into the directory where the Python source was extracted:

Step 6. Optimize the Python build process by executing:

$ ./configure --enable-optimizations

Step 7. Once done, we build the Python source with the make command followed by the -j parameter and the number of CPU cores you want to dedicate to the process. You can check how many CPU cores you have in your system by running the nproc command.

Step 8. Finally, proceed to install Python:

Note: the altinstall option is necessary to ensure that the system-default Python files won’t be touched.

Step 9. To verify that the installation was successful, execute the following command and you should see the expected version number:

Note: Replace 3.11 with the version number that you installed.

Источник

How to Update Python in Kali Linux?

Kali Linux comes with Python3 installed, but you need to make sure it’s updated as older versions of python may not work any longer.

Before Updating the kali Linux, first, determine what python version is currently installed in it. For this, open the Kali Linux terminal, and type Python — version. Hit enter to run this command and it will show the version of python in your kali Linux.

As of now (2022, 20th October) The latest version of python is Python 3.9.15. Or verify the latest python version from the official website. Less than this version means it’s older and thus needed an upgrade.

Now start updating python in Kali Linux. Open the Terminal Again. And write this command, sudo apt-get install python3. Hit enter and then enter the password of your Kali Linux to execute this command. An automatic process will start that will download all the essential libraries, and files. Wait for a few minutes to let the process finish.

After this simple step, your python should update if there is nothing wrong with the system from your side.

Troubleshooting.

Make sure you’ve written the correct command (sudo apt-get install python3) without brackets, there should be no extra spaces, commas, or alphabetical mistakes.

Make sure your Kali Linux is updated, otherwise chances of getting an error are normal.

Источник

How To Install Python on Kali Linux (2023 Guide)

Follow this step-by-step guide to Install or Update Python on your favorite hacking distro, Kali Linux!

How To Install Python on Kali Linux

Kali Linux is a secure distribution of Linux which has been derived from Debian and designed especially for system forensics, hacking and advanced penetration testing. It was developed through the rewriting of BackTrack which is now discontinued. It carries different tools which are designed for different information security tasks like testing, penetration, security research, reverse engineering and computer forensics. This article covers all the steps on how to Install Python on Kali Linux.

If you have Python 3.9, 3.8 or 3.7 already installed, we also show you how to upgrade Python on Kali Linux if you want to go to Python 3.10.

Why Install and use Python on Kali Linux

Kali Linux is an operating system specifically developed for ethical hackers. It is used by thousands of hackers and companies around the world to penetration test and breaks into their networks. It is popular among such audiences due to the various hacking tools it comes packaged with such as Wireshark and Nmap.

This is a bold distribution that has to be disproven. It has more than 580 pre-installed penetration-testing apps in order to discover. Every program comes with its unique flexibility and uses case.

Python is used a lot of scripting and automation and it has various libraries that work with Linux, hence why many security professionals use Python to create scripts used for hacking purposes that they may create based on a vulnerability.

Below are four different categories of the security professional where Python is used:

  1. Black hat hackers use Python to discover and exploit vulnerabilities, it comes with many network, malware analysis and security libraries that can be utilized by them to compromise an individual or organization. They can also download such applications off the shelf to use to get into a server or device.
  2. Forensic engineers, propose a forensic mode through which they can perform data discovery and recovery in some instances. Python has a famous imaging library called “PIL” which stands for “Python Imaging Library” which is used in AI/ML imaging applications.
  3. Security administrators or IT admins are responsible to safeguard both the information and data of their institution so doing this involves running security tests. What they do is use ready-made and custom Python scripts to review the environment and make sure that there are no vulnerabilities that are discovered easily. Many have automated scripts that they run for example to check for missing patches, open ports and out-of-date software.
  4. Penetration testers working independently or for bug bounty programs use Kali to perform monitoring and social engineering on businesses. They can check for vulnerabilities, default admin accounts, backups that are not encrypted and passwords, and pages open to the public that shouldn’t be!

How to Install or Upgrade Python on Kali Linux (Python 3.9, 3.8, 3.7)

One of the widely used high-level and object-oriented languages has become famous for beginners and experienced programmers for being simple and open-source for a big community. With this, you can build all kinds of apps, from small, simple scripts to complex machine learning-based issues.

Version 3.7 which is old can be installed using the apt package manager directly. Python 3.9 which is stable has been launched with improvements and security updates. The company has added different new modules and extended the existing modules with extra features.

A gentle reminder, Python 3.9 can’t be installed from standard Kali Linux repositories but can be installed from the original source once you add it.

Let’s see how to install Python 3.9 on Kali Linux from the terminal. All the commands shall be implemented in the Kali terminal so it is the same for you. So, you need to open the terminal app by clicking Ctrl + Alt + t from the keyboard in Kali.

Step 1: Install necessary packages in Kali core:

You first need to install all the packages and dependencies which are needed to build the source of python, so, to install the required packages follow the command below:

Python Packages for Kali Linux

Now you need to upgrade Python on Kali Linux:

Upgrade Python on Kali Linux

Step 2: Download the latest Python release for Kali Linux:

You need to have the latest python release from the python download page, for this you need to use the “curl” command to download the python release or alternatively the way shown in the image:

Download Python 3.9 for Kali Linux

[email protected]:~#curl https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz 

Step 3: Extract the installer file

Once the process of download has been completed, the file shall be saved into the tar extension. Extract the file by using the command below with Tar or you can use alternatives such as p7zip.

You need to navigate to the following directory of Python

By executing this, run the following configuration script in order to prepare your system for Python source code compilation

[email protected]:~#./configure –enable-optimizations 

If you have issues running it, please run the below command to fix the permissions:

[email protected]:~#chmod +x ./configure –enable-optimizations 

This shall perform many checks to ensure that all the dependencies are installed on the system. The -enable-optimization is used here to optimize the Python binary by executing many different tests. This sets various variables according to best practices identified by the Python community over the years.

Step 4: Finally, now install Python on Kali Linux

At this point you need to start with the build process by running the command mentioned below:

You shall modify –j in accordance with the cores of the processor. My own laptop has a quad-core so it will be -j4 for me.

Install Python Binaries on Kali Linux

As the build process is completed, you need to run altinstall in order to Install python binaries on Kali Linux:

Keep in mind to never use “make install” to install binaries as it will automatically overwrite the binary files.

Finished! Python has now been installed on Kali Linux. You can now check the version by running the command below if you want to verify it:

Similar Python installation articles:

Conclusion

This article covered extensively all the major instructions required to Install Python on Kali Linux. Python is without a doubt a very powerful scripting language but it still isn’t available or installed by default with operating systems, hence you have to manually install it.

Do let me know in the comments area below how easy you find the above and why you choose Python over any other language.

Источник

Читайте также:  GRM Logistics App
Оцените статью