forked from PowerShellMafia/PowerSploit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPowerSploitInstall.ps1
More file actions
24 lines (24 loc) · 1.18 KB
/
Copy pathPowerSploitInstall.ps1
File metadata and controls
24 lines (24 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Make sure the module is not loaded
Remove-Module PowerSploit -ErrorAction SilentlyContinue
# Download latest version
$webclient = New-Object System.Net.WebClient
$url = "https://github.com/opexxx/PowerSploit/archive/master.zip"
Write-Host "Downloading latest version of PowerSploit from $url" -ForegroundColor Cyan
$file = "$($env:TEMP)\PowerSploit.zip"
$webclient.DownloadFile($url,$file)
Write-Host "File saved to $file" -ForegroundColor Green
# Unblock and Decompress
Unblock-File -Path $file
$targetondisk = "$([System.Environment]::GetFolderPath('MyDocuments'))\WindowsPowerShell\Modules"
New-Item -ItemType Directory -Force -Path $targetondisk | out-null
$shell_app=new-object -com shell.application
$zip_file = $shell_app.namespace($file)
Write-Host "Uncompressing the Zip file to $($targetondisk)" -ForegroundColor Cyan
$destination = $shell_app.namespace($targetondisk)
$destination.Copyhere($zip_file.items(), 0x10)
# Rename and import
Write-Host "Renaming folder" -ForegroundColor Cyan
Rename-Item -Path ($targetondisk+"\PowerSploit-master") -NewName "PowerSploit" -Force
Write-Host "Module has been installed" -ForegroundColor Green
Import-Module -Name PowerSploit
Get-Command -Module PowerSploit