How To Install python3-pefile on Kali Linux

In this tutorial we learn how to install python3-pefile on Kali Linux. python3-pefile is Portable Executable (PE) parsing module for Python

Introduction

In this tutorial we learn how to install python3-pefile on Kali Linux.

What is python3-pefile

python3-pefile is:

pefile is a Python module to read and work with Portable Executable (PE) files. Most of the information in the PE header is accessible, as well as all the sections, section information and data.

All the basic PE file structures are available with their default names as attributes of the returned instance.

Processed elements such as the import table are made available with lowercase names, to differentiate them from the upper case basic structure names.

pefile has been tested against the limits of valid PE headers; that is, Windows malware. Lots of packed malware attempt to abuse the format beyond its standard use.

Some of the tasks that pefile makes possible are:

  • Modifying and writing back to the PE image
  • Header inspection
  • Section analysis
  • Retrieving data
  • Warnings for suspicious and malformed values
  • Packer detection with PEiD signatures
  • PEiD signature generation

There are three methods to install python3-pefile on Kali Linux. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python3-pefile Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python3-pefile using apt-get by running the following command:

sudo apt-get -y install python3-pefile

Install python3-pefile Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python3-pefile using apt by running the following command:

sudo apt -y install python3-pefile

Install python3-pefile Using aptitude

If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python3-pefile using aptitude by running the following command:

sudo aptitude -y install python3-pefile

How To Uninstall python3-pefile on Kali Linux

To uninstall only the python3-pefile package we can use the following command:

sudo apt-get remove python3-pefile

Uninstall python3-pefile And Its Dependencies

To uninstall python3-pefile and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove python3-pefile

Remove python3-pefile Configurations and Data

To remove python3-pefile configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge python3-pefile

Remove python3-pefile configuration, data, and all of its dependencies

We can use the following command to remove python3-pefile configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python3-pefile

Dependencies

python3-pefile have the following dependencies:

References

Summary

In this tutorial we learn how to install python3-pefile package on Kali Linux using different package management tools: apt, apt-get and aptitude.