From b3313ba0a279435f67d9dd4677b0c75539eb955a Mon Sep 17 00:00:00 2001 From: Elliot Chernofsky <35854880+emtuls@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:43:48 -0500 Subject: [PATCH] Create Pinnable CyberChef that uses Chrome --- packages/cyberchef.vm/cyberchef.vm.nuspec | 3 ++- packages/cyberchef.vm/tools/chocolateyinstall.ps1 | 14 +++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/cyberchef.vm/cyberchef.vm.nuspec b/packages/cyberchef.vm/cyberchef.vm.nuspec index 895580585..472214d18 100644 --- a/packages/cyberchef.vm/cyberchef.vm.nuspec +++ b/packages/cyberchef.vm/cyberchef.vm.nuspec @@ -2,11 +2,12 @@ cyberchef.vm - 10.5.2.20230823 + 10.5.2.20240117 GCHQ The Cyber Swiss Army Knife - a web app for encryption, encoding, compression, data analysis, and more. + diff --git a/packages/cyberchef.vm/tools/chocolateyinstall.ps1 b/packages/cyberchef.vm/tools/chocolateyinstall.ps1 index 9c0d9c0cd..ad9468889 100644 --- a/packages/cyberchef.vm/tools/chocolateyinstall.ps1 +++ b/packages/cyberchef.vm/tools/chocolateyinstall.ps1 @@ -5,8 +5,9 @@ try { VM-Remove-PreviousZipPackage ${Env:chocolateyPackageFolder} $category = 'Utilities' + $toolName = 'CyberChef' $shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category - $toolDir = Join-Path ${Env:RAW_TOOLS_DIR} 'cyberchef' + $toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName $packageArgs = @{ packageName = ${Env:ChocolateyPackageName} @@ -18,9 +19,16 @@ try { Install-ChocolateyZipPackage @packageArgs VM-Assert-Path $toolDir + $shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category + $shortcut = Join-Path $shortcutDir "$toolName.lnk" + $executableCmd = Join-Path ${Env:WinDir} "system32\cmd.exe" -Resolve $htmlPath = Join-Path $toolDir "CyberChef_v10.5.2.html" -Resolve - $shortcut = Join-Path $shortcutDir "CyberChef.lnk" - Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $htmlPath + $arguments = "start chrome $htmlPath && exit" + $executableArgs = "/C $arguments" + $iconLocation = "%ProgramFiles%\Google\Chrome\Application\chrome.exe" + + Install-ChocolateyShortcut -ShortcutFilePath $shortcut -TargetPath $executableCmd -Arguments $executableArgs -WorkingDirectory $toolDir -WindowStyle 7 -IconLocation $iconLocation + VM-Assert-Path $shortcut } catch { VM-Write-Log-Exception $_