View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005290||Kali Linux||[All Projects] Feature Requests||public||2019-03-04 15:31||2022-03-25 13:58|
|Target Version||Fixed in Version|
|Summary||0005290: Build powershell packages from sources|
|Description||For the past several months I have been working on maintaining the packages for Powershell Core to be working on Kali Linux. It appears that other distributions are now pushing Powershell to their Linux Distributions as well. Since other distributions are pushing Powershell on their Linux distributions I thought it would be fantastic if Kali Linux could also have it built-in to its operating system. Powershell is one of the most powerful languages for windows systems and many people are starting to use it now more then ever. |
Please let me know if you decide to take this feature request into consideration because I absolutely love to help you all get Powershell working and installed by default on Kali Linux.
|Steps To Reproduce||I have tested this in Kali Linux 2019.1 and it works very well!|
First, we need to download and add the public repository GPG key so APT will trust the packages and alert you to any issues with package signatures:
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
Second, Once the GPG key has been added, we need to add the Microsoft package repository to its own package list file under /etc/apt/sources.list.d/ This will allow us to also pull any updated packages that the PowerShell team will release in the future:
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/PowerShell.list
Third we will need to install the following dependency packages below to continue the installation. You can download the package here:
Once the packages have been installed we can then install powershell on Kali Linux:
root@kali:~# apt-get install powershell
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 32 not upgraded.
Need to get 58.0 MB of archives.
After this operation, 157 MB of additional disk space will be used.
Get:1 https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch/main amd64 powershell amd64 6.1.3-1.debian.9 [58.0 MB]
Fetched 58.0 MB in 3s (20.1 MB/s)
Selecting previously unselected package powershell.
(Reading database ... 419462 files and directories currently installed.)
Preparing to unpack .../powershell_6.1.3-1.debian.9_amd64.deb ...
Unpacking powershell (6.1.3-1.debian.9) ...
Setting up powershell (6.1.3-1.debian.9) ...
Processing triggers for man-db (2.8.5-2) ...
Copyright (c) Microsoft Corporation. All rights reserved.
Type 'help' to get help.
Proof of Powershell.PNG (65,114 bytes)
Proof of Powershell.PNG (65,114 bytes)
||Neat. So would this allow .PS1 files to be run and executed within the context of Kali?|
||@akozlov Yep and even to import modules as well. However, powershell for linux uses .net core instead of .net framework but I do not think there are any big differences. Still testing that out :D|
||You say " It appears that other distributions are now pushing Powershell to their Linux Distributions as well.". Can you give us pointers related to this? If others are working on this, it might make sense to cooperate instead of doing it alone on our side. So please share any link/information that you might have.|
||FWIW, we are definitely interested in having powershell available as a first-class package in our repository. We will be working on it and I will keep this bug updated. But it will require some significant work, we will see.|
@rhertzog Microsoft Published an article on how you can install powershell for different Linux distributions shown here: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6
In the past, the instructions for installing Kali Linux are incorrect. That's why I created a guide back in September that covers step by step on installing PowerShell for Kali Linux.
As of now, the latest version of Ubuntu contains a snap in package that you can select to have PowerShell automatically install on your Ubuntu System. I do not know if there is one for debian based systems but it is definitely something we should look into further to see what process they have created already for adding powershell to Kali.
||powershell is now in kali-rolling for amd64|
Sharing information gathered from MS: to build Powershell from source, we also need to build .NET Core from source. The latter can be done through https://github.com/dotnet/core-sdk
`Start-PSBuild` will look for `dotnet` CLI executable in the PATH, so if we build it ourselves and have it in the PATH, the build script should find it and use it.
|2019-03-04 15:31||tjnull||New Issue|
|2019-03-04 15:31||tjnull||File Added: Proof of Powershell.PNG|
|2019-03-05 18:48||akozlov||Note Added: 0010395|
|2019-03-07 16:04||tjnull||Note Added: 0010400|
|2019-04-25 14:37||rhertzog||Assigned To||=> rhertzog|
|2019-04-25 14:37||rhertzog||Status||new => assigned|
|2019-04-25 14:47||rhertzog||Note Added: 0010534|
|2019-04-25 15:00||rhertzog||Note Added: 0010535|
|2019-05-02 12:12||tjnull||Note Added: 0010549|
|2019-08-15 13:48||rhertzog||Relationship added||has duplicate 0005624|
|2019-09-12 08:24||sbrun||Note Added: 0011081|
|2019-10-22 16:52||rhertzog||Note Added: 0011217|
|2019-12-12 08:53||rhertzog||Priority||urgent => low|
|2019-12-12 08:53||rhertzog||Summary||Adding Powershell Core to be in the main installation of Kali Linux => Build powershell packages from sources|
|2019-12-12 08:53||rhertzog||Description Updated||View Revisions|
|2019-12-12 08:53||rhertzog||Steps to Reproduce Updated||View Revisions|
|2022-03-25 13:58||g0tmi1k||Severity||feature => minor|