How To Install python-pefile on Debian 9

In this tutorial we learn how to install python-pefile on Debian 9. python-pefile is Portable Executable (PE) parsing module for Python

Introduction

In this tutorial we learn how to install python-pefile on Debian 9.

What is python-pefile

python-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 python-pefile on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python-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 python-pefile using apt-get by running the following command:

sudo apt-get -y install python-pefile

Install python-pefile Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-pefile

Install python-pefile Using aptitude

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

sudo aptitude update

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

sudo aptitude -y install python-pefile

How To Uninstall python-pefile on Debian 9

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

sudo apt-get remove python-pefile

Uninstall python-pefile And Its Dependencies

To uninstall python-pefile and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove python-pefile

Remove python-pefile Configurations and Data

To remove python-pefile configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge python-pefile

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

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

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

Dependencies

python-pefile have the following dependencies:

References

Summary

In this tutorial we learn how to install python-pefile package on Debian 9 using different package management tools: apt, apt-get and aptitude.