-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add hashcat.vm Closes #584. * add hashcat * fixed vars. Combined values for cleaner path usage * fixed installation issue. Set consoleApp true * added 7zip dependency for install process * removing the success failure json * Fixed 7zip executable call and fixed working directory * added logic to stop the install if no intel processor is detected * Fixed 7zip executable again * removed nested unnecessary try/catch. Using CIM instead of wmi --------- Co-authored-by: Menn1s <[email protected]>
- Loading branch information
1 parent
968f075
commit cdf76f9
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd"> | ||
<metadata> | ||
<id>hashcat.vm</id> | ||
<version>6.2.6</version> | ||
<authors>Jens Steube (jsteube)</authors> | ||
<description>Hashcat is a fast password recovery utility.</description> | ||
<dependencies> | ||
<dependency id="common.vm" /> | ||
<dependency id="7zip-15-05.vm"/> | ||
</dependencies> | ||
</metadata> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
$ErrorActionPreference = 'Stop' | ||
Import-Module vm.common -Force -DisableNameChecking | ||
|
||
|
||
$toolName = 'hashcat' | ||
$category = 'Credential Access' | ||
|
||
$zipUrl = 'https://github.com/hashcat/hashcat/releases/download/v6.2.6/hashcat-6.2.6.7z' | ||
$zipSha256 = '96697e9ef6a795d45863c91d61be85a9f138596e3151e7c2cd63ccf48aaa8783' | ||
$zipName = 'hashcat-6.2.6' | ||
$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} "$toolName" | ||
$workingDir = Join-Path "$toolDir" "$zipname" | ||
|
||
try { | ||
|
||
# Get the processor information | ||
$processor = Get-CimInstance Win32_Processor | ||
|
||
|
||
# Check if the manufacturer is Intel | ||
if ($processor.Manufacturer -eq "GenuineIntel") { | ||
Write-Output "Intel processor detected for hashcat." | ||
} else { | ||
Write-Output "Non-Intel processor detected. Hashcat will not work" | ||
throw "Non-Intel processor detected." | ||
} | ||
|
||
|
||
# Download the zip file | ||
$packageArgs = @{ | ||
packageName = ${Env:ChocolateyPackageName} | ||
url = $zipUrl | ||
checksum = $zipSha256 | ||
checksumType = "sha256" | ||
fileFullPath = Join-Path "${Env:USERPROFILE}\AppData\Local\Temp" ("$zipName.7z") | ||
} | ||
Get-ChocolateyWebFile @packageArgs | ||
$zipPath = $packageArgs.fileFullPath | ||
VM-Assert-Path $zipPath | ||
|
||
7zip x $zipPath -o"$toolDir" -y | ||
# Create a shortcut | ||
$executablePath = Join-Path "$workingDir" "$toolName.exe" -Resolve | ||
VM-Install-Shortcut $toolName $category $executablePath -consoleApp $true -executableDir $workingDir | ||
} catch { | ||
VM-Write-Log-Exception $_ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$ErrorActionPreference = 'Continue' | ||
Import-Module vm.common -Force -DisableNameChecking | ||
|
||
$toolName = 'hashcat' | ||
$category = 'Credential Access' | ||
|
||
VM-Uninstall $toolName $category |