Linux Foreground Process

When working within the Linux terminal and issuing a command to launch an application, the terminal will continue to run that application and it may seem the need to spawn a new terminal window. However, with using the command shortcut to foreground a process (ctrl + z), this will take the current application within terminal and place it as a background process:

root@kali:~# maltego
Config File path = /root/.maltego/v4.2.3/etc/maltego.conf
canonical: /usr/lib/jvm/java-8-openjdk-amd64/jre
javaHome: /usr/lib/jvm/java-8-openjdk-amd64/jre
resource:com/paterva/maltego/java/config/jre/TestJDK.class -> /tmp/temp397219231743671113628418889499750/TestJDK.class
executing: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -classpath /tmp/temp397219231743671113628418889499750 TestJDK, in: .
result: 0
command execution finished
out: 1.8.0_212, 25.212-b01, Oracle Corporation, Linux, amd64
jdkhome: /usr/lib/jvm/java-8-openjdk-amd64/jre
canonical: /usr/lib/jvm/java-8-openjdk-amd64/jre
javaHome: /usr/lib/jvm/java-8-openjdk-amd64/jre
executing: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -classpath /tmp/temp397219231743671113628418889499750 TestJDK, in: .
result: 0
command execution finished
out: 1.8.0_212, 25.212-b01, Oracle Corporation, Linux, amd64
jdkhome: /usr/lib/jvm/java-8-openjdk-amd64/jre
Checking for updates Sat Jan 04 00:24:29 GMT 2020
Found 0 updates.

When the background a process command shortcut is issued, the current process is backgrounded and awaits for further input from the user. You will now notice the application may seem unresponsive. To resume the process, you will need to bring the process to the foreground using the fg command, e.g.:

root@kali:~# fg 1
maltego

To obtain the number ID for the backgrounded process to restore as a foreground process, you can issue the jobs command:

root@kali:~# jobs
[1]+ Stopped maltego

Clicking on Places in Linux displays CHIRPS message

When clicking on Places in Linux, a message is displayed advising of disabling error reporting under a CHIRPS message. This can be a result of a corrupted file manager within the GNOME Desktop configuration, i.e. uninstalled file manager dependencies during a previously issued apt-get autoremove or equivalent command.

To fix this issue, you will need to reinstall the GNOME file manager packages in Linux:

1. Download the lib files for GNOME desktop:
wget http://ftp.br.debian.org/debian/pool/main/g/gnome-desktop3/libgnome-desktop-3-18_3.34.1-1_amd64.deb

2. Download the data files for GNOME desktop:
wget http://ftp.br.debian.org/debian/pool/main/g/gnome-desktop3/gnome-desktop3-data_3.34.1-1_all.deb

3. Install GNOME data files package:
dpkg -i gnome-desktop3-data_3.34.1-1_all.deb

4. Install GNOME lib files package:
dpkg -i libgnome-desktop-3-18_3.34.1-1_amd64.deb

5. Install Nautilus file manager with apt:
apt install nautilus

With file manager now installed, clicking on Places should now result in the correct action.

Fix “Could not validate this preference file” in Nessus

If you receive the below error message when downloading the latest Nessus plugin updates, the following fix may help:

/opt/nessus/sbin/nessuscli update --plugins-only

----- Fetching the newest updates from nessus.org -----

Could not validate this preference file. Have installation files been copied from another system?
Nessus Plugins: Failed

The first step to fix the error, is to request a new activation code from Tenable for the Nessus program: Link.

Then you will need to register your new activation key, received by email and associate to Nessus:
/opt/nessus/sbin/nessuscli fetch --register

How to install Hyperion in Linux

Hyperion is a runtime encrypter for 32-bit portable executables. It is a reference implementation and bases on the paper “Hyperion: Implementation of a PE-Crypter”.

Hyperion is not included in Kali Linux repositories. To install Hyperion in Linux, run the following commands:

Download the files from Github:
wget https://github.com/nullsecuritynet/tools/raw/master/binary/hyperion/release/Hyperion-1.2.zip

Unzip the archive file:
unzip Hyperion-1.2.zip

Invoke the MingGW compiler to compile Hyperion in to a executable file:
i686-w64-mingw32-c++ Hyperion-1.2/Src/Crypter/*.cpp -o hyperion.exe

How to install Ming C compiler in Linux

MinGW, a contraction of “Minimalist GNU for Windows”, is a minimalist development environment for native Microsoft Windows applications.

MinGW provides a complete Open Source programming tool set which is suitable for the development of native MS-Windows applications, and which do not depend on any 3rd-party C-Runtime DLLs. (It does depend on a number of DLLs provided by Microsoft themselves, as components of the operating system; most notable among these is MSVCRT.DLL, the Microsoft C runtime library. Additionally, threaded applications must ship with a freely distributable thread support DLL, provided as part of MinGW itself).

The Ming compiler is included in Kali Linux repositories, but is not installed by default. To install Ming C compiler in Linux, run the following command:

apt-get install mingw-w64

MinGW (mingw-w64) is the successor to mingw32.

Kali Linux: Ruby Gem Bundler Errors (Ruby libraries) for Metasploit

An error occurred while installing pcaprub (0.12.4), and Bundler cannot
continue.
Make sure that `gem install pcaprub -v '0.12.4'` succeeds before bundling.

This occurs during the installation process for Bundled Gems in Metasploit and within its local Git repository, e.g.:

cd ~/git/metasploit-framework/
bundle install

Note, ~/git/metasploit-framework/ is my locally defined directory for my Github repository in Kali Linux.

In the top example (see above), the error effects the “pcaprub” Gem. To fix this issue, run the following command:

sudo apt-get install libpcap-dev

This will install the package for libpcap-dev (development library for libpcap) – libpcap-dev Debian package

Once the libpcap-dev package has been installed, the bundle install command can be ran:

cd ~/git/metasploit-framework/
bundle install

Note, for other Gem installation errors during bundle install, it is likely to be an issue with missing packages in your system. The missing packages can be installed via sudo apt-get install [package_name].

Fix the Linux Login Loop

1. While on the login screen:
Press Ctrl + Alt + F1
or Ctrl + Alt + F2 (Virtual instance)

2. Login to the shell prompt with username and password

3. Type the following commands:
dpkg --configure -a (fix any corrupted packages)
sudo apt-get update (update package repository)
sudo apt-get upgrade (upgrade the package repository)
sudo reboot (reboot the system)

Adding a new user in Kali Linux

Open a terminal using Ctrl+Alt+T or clicking on the icon – logged in as root

From the console issue the add user command with “-m” to create user home directory – #useradd -m

Create a password for the user – #passwd

Add user to sudo group – #usermod -a -G sudo

Change default shell of user to bash – #chsh -s /bin/bash