Install PowerShell on Kali Linux

I tried to install PowerShell on Kali Linux Rolling by following instructions on the GitHub page as well as other articles I found online and none of them worked. I’m going to tell you what worked for me.

In the past I’ve stuck to Bash and Python for all of my scripting needs because they work cross platform. My work issued laptop runs Windows 10 and I use Git Bash to run my simple shell scripts that I use mainly to slice, dice, and reformat data, and Python for everything else. I’m a big fan of using one cross platform scripting language when possible.

Lately I’ve found a need to dive into PowerShell to be able to understand a complex script that I took over from a departing coworker. I was really surprised at how easy it is to work with XML using PowerShell after struggling to read XML with Python and xmlstarlet. Add in some Unicode and dependency problems while switching back and forth between Python 2.7 and 3.5 and I knew is was time to give PowerShell a chance. This had me thinking about starting a personal project to create a cross platform script in PowerShell to manage pentests and reporting.

Let’s get started installing PowerShell on Kali.

Edit: Updated 9/25/2018

apt -y install apt-transport-https curl gnupg
curl | apt-key add -
dpkg -i libicu57_57.1-6_amd64.deb
echo "deb [arch=amd64] stretch main" > /etc/apt/sources.list.d/powershell.list
apt-get update && apt -y install powershell

Now start PowerShell:

If you get any errors when using certain PowerShell commands, like curl for example, check your aliases. Some common aliases that work by default on Windows aren’t set here. You’ll need to either use the expanded name or set a new alias.

Kali Configure BeEF for Metasploit Integration

This works on Kali version 2016.2.

Edit /usr/share/beef-xss/config.yaml line 156 and change false to true. Edit /usr/share/beef-xss/extensions/metasploit/config.yaml and change host and callback_host from to your IP address. Restart BeEF by entering the command “service beef-xss restart”. Start Metsploit and at the msf> prompt enter “load msgrpc ServerHost=<IP address> Pass=abc123”, using your IP address.

How to Install Kali Nethunter 3 on a Nexus 7

The steps outlined at Offensive Security’s Nethunter wiki were incomplete or vague in some spots so I’m going to outline what worked for me. I’m using a 2013 Nexus 7 in my instructions.

Put your device in Developer Mode:

This is done by navigating to Settings -> About and tapping on the Build number field 7 times until you receive the notification that developer mode has been enabled. Go back to the main settings page and you will have a new section titled Developer options. Tap on the new Developer options section and enable both the Advanced Reboot and Android Debugging options.

Unlocking and Rooting Your Android Device:

For first time installations, it is usually best to completely flash your device “to stock” and bring it to a known-good state. This will ensure as painless an installation as possible, removing many of the variables that would cause an incomplete or failed installation. While there are many ways to unlock and root your Android devices, we chose to use the Windows based “Boot Rootkit” by WugFresh.

Download the Nexus Root Toolkit.

Download and install the NRT and execute it for the first time. Once loaded, click the Full Driver Installation Guide button. A Window with installation instructions will pop up – it is vital you read these instructions very carefully and follow them slowly. Once you have successfully completed a Full Driver Test in Step 4, proceed with the next step.

Flashing Back to Stock:

I found this post that said use Android 5.1.1 build LMY48M if you want to use Nethunter 3.0.

I used the NRT and chose Restore/Upgrade/Downgrade, and Device is on/Normal. I chose the build referenced above and let it download and install for me.

Now you need to go back and follow the steps above to unlock and root the device again. Make sure that “And also flash: Custom Recover” is checked.

Now download the appropriate Nethunter installation package from here. For my 2013 Nexus 7 running Android 5.1.1 build LMY48M I chose Nexus 7 2013 Lollipop. After its finished downloading, you need to copy it to the root of the Nexus file system.

Shutdown the device and hold down the power and volume down button it will boot into the boot loader. Use volume buttons to navigate to recovery and power to enter. After booting into recovery select install button,select the swipe to flash and wait until it finishes. You’ll be promted to install some packages. Choose the ones you want and accept the defaults. You can’t go wrong here.

When it’s finished, it will say “Zip Install Complete” near the top. Press the button to “Reboot System”.

Enjoy Kali Nethunter on your Nexus 7!

Kali Linux 1.1 image for Raspberry Pi 2

There has been a lot of talk around (Reddit) about Kali Linux 1.1 for the latest Raspberry Pi version 2. There were instructions around on how to build it yourself. If you want to download the official image from Offensive Security, get it here.

The image doesn’t have raspi-config preinstalled. If you’re not familiar, raspi-config is a configuration tool that makes it easy to expand your filesystem, overclock, activate a camera, set the hostname, and more.

To install raspi-config:

dpkg -i triggerhappy_0.3.4-2_armhf.deb
dpkg -i lua5.1_5.1.5-4+deb7u1_armhf.deb
dpkg -i raspi-config_20150131-1_all.deb

Once you’ve run raspi-config, expanded your filesystem and restarted, you may want to install more Kali packages as the image comes with very little preinstalled and it doesn’t have the traditional Kali menu. Here’s how to add Kali metapackages.

Update: I’m finding broken applications after an “apt-get install kali-linux-full”. I ran “service metasploit start” and got an error “unknown service”. Running “apt-get install metasploit” should fix that, even though metasploit was already in the Kali menu.