How To Install ejabberd-mod-shcommands on Kali Linux

In this tutorial we learn how to install ejabberd-mod-shcommands on Kali Linux. ejabberd-mod-shcommands is ejabberd module to execute shell commands via XMPP (dangerous!)

Introduction

In this tutorial we learn how to install ejabberd-mod-shcommands on Kali Linux.

What is ejabberd-mod-shcommands

ejabberd-mod-shcommands is:

WARNING: USE THIS MODULE AT YOUR OWN RISK !!! This module allows ejabberd administrators to remotely execute shell commands which could compromise both the ejabberd server and the whole machine.

This module provides the ejabberd server administrator a method to remotely execute shell commands through the ejabberd server.

It provides a page in the ejabberd Web Admin which only the administrators of the whole server can access.

Three types of commands are possible:

  • ejabberd_ctl: makes a call to ejabberd_ctl;
  • erlang shell: executes an erlang command;
  • system shell: executes a command on the system shell. The result of the execution will be shown.

In the system shell, only non-interactive commands will work correctly, for example this will work: ps -all Don’t use commands that start an interactive mode: DON’T TRY THIS: top DON’T TRY THIS: vim readme.txt

This module does not check if the commands are dangerous or problematic, so this module is only recommended for experienced ejabberd and Erlang/OTP administrators. USE THIS MODULE AT YOUR OWN RISK !!!

There are three methods to install ejabberd-mod-shcommands 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 ejabberd-mod-shcommands Using apt-get

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

sudo apt-get update

After updating apt database, We can install ejabberd-mod-shcommands using apt-get by running the following command:

sudo apt-get -y install ejabberd-mod-shcommands

Install ejabberd-mod-shcommands Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install ejabberd-mod-shcommands using apt by running the following command:

sudo apt -y install ejabberd-mod-shcommands

Install ejabberd-mod-shcommands 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 ejabberd-mod-shcommands using aptitude by running the following command:

sudo aptitude -y install ejabberd-mod-shcommands

How To Uninstall ejabberd-mod-shcommands on Kali Linux

To uninstall only the ejabberd-mod-shcommands package we can use the following command:

sudo apt-get remove ejabberd-mod-shcommands

Uninstall ejabberd-mod-shcommands And Its Dependencies

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

sudo apt-get -y autoremove ejabberd-mod-shcommands

Remove ejabberd-mod-shcommands Configurations and Data

To remove ejabberd-mod-shcommands configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge ejabberd-mod-shcommands

Remove ejabberd-mod-shcommands configuration, data, and all of its dependencies

We can use the following command to remove ejabberd-mod-shcommands configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge ejabberd-mod-shcommands

Dependencies

ejabberd-mod-shcommands have the following dependencies:

References

Summary

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