From a7ee6830f7784bec5d29d70bfa8d02669cd38e54 Mon Sep 17 00:00:00 2001 From: Colby Farley Date: Wed, 28 Feb 2018 11:32:07 -0600 Subject: [PATCH] Removed PowerShell payload --- .../DownloadPowerShell/getPowershell.py | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 Mac/Payloads/DownloadPowerShell/getPowershell.py diff --git a/Mac/Payloads/DownloadPowerShell/getPowershell.py b/Mac/Payloads/DownloadPowerShell/getPowershell.py deleted file mode 100644 index 405b32c6..00000000 --- a/Mac/Payloads/DownloadPowerShell/getPowershell.py +++ /dev/null @@ -1,47 +0,0 @@ -# Simple script to download PowerShell from Github and then extract, make, install, and run. -# Then output 'Hello World' in PowerShell - - -import requests -import tarfile -import os -import pexpect - -# Grabs the current user for saving to user defined directories -currentuser = os.getlogin() - -# Such as the User's Downloads directory on MacOS -savedirectory = '/Users/' + currentuser + '/Downloads/powershell.tar.gz' - -url = 'https://github.com/PowerShell/PowerShell/releases/download/v6.0.1/powershell-6.0.1-osx-x64.tar.gz' -response = requests.get(url) - -# Downloads and saves the file to directory -with open(savedirectory, 'wb') as f: - f.write(response.content) - -print("Successfully saved file to " + savedirectory) -print("Extracting file now") - -# Sets up where to extract the tar file -tarpath = '/Users/' + currentuser + '/Downloads/powershell/' - -with tarfile.open(savedirectory) as tar: - tar.extractall(path=tarpath) - -psexec = tarpath + 'pwsh' -print(psexec) - -# On Mac the file pwsh is a shell script to run PowerShell. -# This essentially does chmod +x to run pwsh -print("Changing permissions on powershell executable") -os.chmod(psexec, 0o755) - -# Using pexpect to run an interactive session of PowerShell -with open('log', 'ab') as fout: - p = pexpect.spawn(psexec) - p.logfile = fout - p.interact() - - -