mandiant / commando-vm

Complete Mandiant Offensive VM (Commando VM), a fully customizable Windows-based pentesting virtual machine distribution. commandovm@mandiant.com
https://www.mandiant.com/resources/blog/commando-vm-windows-offensive-distribution
Apache License 2.0
6.89k stars 1.29k forks source link

BUG: Packages failing installation and no taskbar settings on Windows 10 Pro 1903 #86

Closed thereisnotime closed 4 years ago

thereisnotime commented 5 years ago

Description After few hours from the installation script finishes on a fresh Windows 10 Pro 1903 I have noticed that the search bar is in the taskbar and no programs are pinned there. The packages that seem to fail are: windbg.kenstheme.flare metasploit.flare Mimikatz.fireeye Elite.fireeye.1.0.0.1 wfuzz.fireeye PwndPasswordsNTLM.fireeye SharpSloit.fireeye

To Reproduce Steps to reproduce the behavior:

  1. Follow the standard instructions to install Commando VM.

Logs Attaching logs: choco.summary.log chocolatey.log boxstarter.log

OS Version Windows 10 Pro 1903 with latest updates (as of this moment)

day1player commented 5 years ago

Our taskbar pinning logic breaking is quite unfortunate, we will have to figure out a new solution.

Thank you for the logs. Also to see what packages have failed you can do a dir C:\ProgramData\chocolatey\lib-bad and it will list all of the packages that failed. You can then attempt to reinstall/debug them by running cinst <packagename.fireeye>

day1player commented 5 years ago

We will be pushing a check for this (probably tomorrow) but since you mentioned 1903, you might want to make sure tamper detection was turned off for windows defender.

https://www.tenforums.com/tutorials/123792-turn-off-tamper-protection-windows-defender-antivirus.html

vpzed commented 5 years ago

I just installed today on Pro 1903 as well. I did disable Tamper Protection prior to the installation (based on the install script notice - thanks), but I still have the following in lib-bad:

I tried to use the cinst command on wfuzz.fireeye and x64dbg.fireeye but got errors on both so I stopped. EDIT: I tried metasploit.flare and it is getting a 404 on the URL. I manually checked and the 20190728152617.msi it's trying to pull isn't there.

I also get a large error screen from Docker Desktop on start-up saying "Failed to start the virtual machine 'DockerDesktopVM' because one of the Hyper-V components is not running."

cyrus104 commented 5 years ago

Thank you for the post, I just tested this install on Win10 1809 and got the same issue as you are describing, with the same list of tools failing docker and metasploit being the biggest names.

Because I want to be able to rebuild this fairly frequently the base OS that I am using is from modern.ie, they provide prebuilt windows 7/8/10 VMs that have a 90 day expiration.

day1player commented 5 years ago

@vpzed For your Docker error first check to make sure you have Intel VT-x enabled in your virtual machine settings. It should be under processor settings -> advanced. Also, if you are running a Windows HOST machine, you may have to perform some additional steps. For whatever reason, VMware Workstation doesn't play well with Hyper-V in a VM.. Perhaps @htnhan could offer more insight.

Until you can get Docker working properly, both amass and spiderfoot will fail to install. We have an issue open for Wfuzz and Metasploit currently, should be an easy fix for us but in the mean time you can look to install them manually.

@cyrus104 The above should help you too.

If either of you continue having issues please open a new issue this way its easier for us to track and for others to find.

cyrus104 commented 5 years ago

@day1player That fixed the Docker issues. The other issues such as Wfuzz, Metasploit, x64dbg, and PwndPasswordsNTLM still don't work.

ccommandovm.win10.config failing is the biggest issue. The desktop doesn't changing and lots of other settings aren't taking affect.

choco.summary.log chocolatey.log

day1player commented 5 years ago

@cyrus104 try this command to reinstall the config: cinst -y commandovm.win10.config.fireeye -f

You definitely want that package installed, as you said there are a decent amount of config changes there. I am surprised PwndPasswordsNTLM is not installing. Could you run cinst -y PwnedPasswordsNTLM.fireeye and let me know the output?

cyrus104 commented 5 years ago

PS C:\Users\IEUser\Desktop> cinst -y commandovm.win10.config.fireeye -f Chocolatey v0.10.13 Installing the following packages: commandovm.win10.config.fireeye By installing you accept licenses for the packages. Progress: Downloading commandovm.win10.config.fireeye 2.0... 100%

commandovm.win10.config.fireeye v2.0 (forced) commandovm.win10.config.fireeye package files install completed. Performing other installation steps. [+] Beginning host configuration... [-] Disabling services [+] Disabled OpenVPN Services [+] Disabled Neo4j [+] Disabled OpenSSH Service [+] Cleaning up the Desktop ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Users\Public\Desktop\Boxstarter Shell.lnk' because it does not exist. The install of commandovm.win10.config.fireeye was NOT successful. Error while running 'C:\ProgramData\chocolatey\lib\commandovm.win10.config.fireeye\tools\chocolateyinstall.ps1'. See log for details.

Chocolatey installed 0/1 packages. 1 packages failed. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures

day1player commented 5 years ago

@cyrus104 please try to install the package again, looks like there was a small bug there trying to delete some desktop icons. It should execute fine now, I just tested it. Please let me know how it goes

htnhan commented 5 years ago

@cyrus104 We have just updated commandovm.config.fireeye package to 2.0.0.2. It should ignore the error if the files do not exist on the Desktop.

We also pushed a new version for metasploit to fix the 404 issue. It's a common issue for us since we try to use the latest build, which changes quite regularly.

Regarding docker issues: Please make sure your system meets all the requirement for docker and nested virtualization to work. The following official documentation from docker provides more details on requirement and VM settings to get nested virtualization working https://docs.docker.com/docker-for-windows/install/. However, please also note that they can not guarantee support for nested virtualization.

stabuu commented 5 years ago

Hi, not sure how far into this I will get I have reverted my snapshot and am having similar issues as stated above. x64dbg.fireeye PwnedPasswordsNTLM.fireeye proxycap.fireeye

I also am seeing the same issue with the commandovm.config.fireeye. Metatsploit seems to download but fails on the install. I will try the command listed above for the config either later tonight or tomorrow. Also a strange note not all parts of the script ran the first time. Upon completion and noticing the errors I re-ran the install and all of a sudden Kali linux and linux sub system started to install.

cyrus104 commented 5 years ago

@htnhan The docker seems to work fine so far with vmware workstation on windows 10 as long as I made the VT-x changes.

I'm working on the metasploit and the commandov.config now.

Is it possible for you guys to test using the windows 10 image from modern.ie on vmware. As this is free for 90 days this can be used very easily for commando-vm and it's updates.

Thanks, will update with the packages that I'm updating now.

stabuu commented 5 years ago

so for the commando config here are the results:

cinst -y commandovm.win10.config.fireeye -f Chocolatey v0.10.15 Installing the following packages: commandovm.win10.config.fireeye By installing you accept licenses for the packages. Progress: Downloading commandovm.win10.config.fireeye 2.0.0.2... 100%

commandovm.win10.config.fireeye v2.0.0.2 (forced) commandovm.win10.config.fireeye package files install completed. Performing other installation steps. [+] Beginning host configuration... [-] Disabling services [+] Disabled OpenVPN Services [+] Disabled Neo4j [+] Disabled OpenSSH Service [+] Cleaning up the Desktop [+] Timestamps added to cmd prompt and PowerShell [-] Pinning items to Taskbar [+] Renaming host to 'commando' [-] Make sure to restart the machine for this change to take effect [+] Changing Desktop Background [+] Alternative backgrounds copied to C:\Users\Commander\Pictures [+] Commando logos copied to C:\Users\Commander\Pictures [+] Copying README.txt to Desktop ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: System.Management.Automation.RemoteException Environment Vars (like PATH) have changed. Close/reopen your shell to see the changes (or in powershell/cmd.exe just type refreshenv). The install of commandovm.win10.config.fireeye was NOT successful. Error while running 'C:\ProgramData\chocolatey\lib\commandovm.win10.config.fireeye\tools\chocolateyinstall.ps1'. See log for details.

Chocolatey installed 0/1 packages. 1 packages failed. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures

stabuu commented 5 years ago

@cyrus104 I can try it tomorrow is there any particular version or just try the latest 1903? pwnedpassword worked fine after just installing separately.

proxycap and x64dbg still fail when attempting to install them separately.

Other then that thanks for a great build guys this is great I like the build in gui to Kali!

day1player commented 5 years ago

@stabuu thank you for the kind words! You can try again to install the config package, let me know again if you receive any errors.

day1player commented 5 years ago

@cyrus104 yes I do try to test install on the VMs you are referring to because that's the best place to get a legit copy of Windows. I will perform a test install again on the new version!

day1player commented 5 years ago

@stabuu can you tell me what error you get with PwnedPasswordsNTLM? cinst PwnedPasswordsNTLM.fireeye

stabuu commented 5 years ago

@day1player PwnedPasswordsNTLM.fireeye was successful after running cinst -y PwnedPasswordsNTLM.fireeye -f yesterday.

it failed during the initial installation. I can see if I can pull the logs for you today if you still need them.

metasploit, proxycap, and x64dbg would not install separately using the cinst command. I will test the config again when I get home tonight.

stabuu commented 5 years ago

the config file worked this time! only outstanding programs left to not install are: metasploit.flare proxycap.fireeye wfuzz.fireeye x64dbg.fireeye

everything else seems good. Docker keeps telling me I am out of memory to run it. Not sure whats going on with that. I will see if I can figure out whats going on. I know I enabled virtualization within the VM and have 4GB RAM allocated to the VM.

tonykarre commented 5 years ago

I'm down to three packages that won't install:

proxycap.fireeye x64dbg.fireeye wfuzz.fireeye

proxycap.fireeye consistently fails with the checksum error:

image

x64debug.fireeye consistently fails with this error: ERROR: Cannot bind argument to parameter 'Path' because it is null.

Looking in its chocolateyinstall.ps1 file, I see this:

$path = Join-Path ${Env:FLARE_START} 'Debuggers'

I definitely do NOT have FLARE_START defined in my environment. Is this missing from the JSON config used by the original install script, i.e., should it be added there?

for wfuzz.fireeye, I'm not sure why it's failing. The error I see for this is: ERROR: Command errored out with exit status 10. Error message 10 means "invalid environment". I'm not sure what we are missing here. Here is the chocolateyinstall.ps1 file:

$ErrorActionPreference = 'Stop'
$name = "wfuzz"
$packageName = "$name.fireeye"
$path = Join-Path ${Env:TOOL_LIST_DIR} 'Web Application'

$choco_tools_dir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)"
$toolsDir = Join-Path "${Env:RAW_TOOLS_DIR}" $name
if (-Not (Test-Path $toolsDir)) {
  New-Item -Path $toolsDir -ItemType Directory -Force | Out-Null
}

py -2 -m pip -qq install $name

$shortcut = Join-Path $path "$name.lnk"
$target_cmd = Join-Path ${Env:WinDir} "system32\cmd.exe"
$target_args = "/K wfuzz"
$target_dir = Join-Path ${Env:UserProfile} "Desktop"

Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $target_cmd -WorkingDirectory $target_dir -Arguments $target_args

Here are the environment variables that are seen from within the chocolateyscriptrunner (I added some code to dump the process env vars):

2019-08-17 20:36:32,983 5828 [DEBUG] - Starting env variable enumeration...
2019-08-17 20:36:33,008 5828 [DEBUG] - _NT_SYMBOL_PATH      symsrv*symsrv.dll*C:\Windows\Symbols*http://msdl.microsoft.com/download/symbols
2019-08-17 20:36:33,010 5828 [DEBUG] - ALLUSERSPROFILE      C:\ProgramData
2019-08-17 20:36:33,011 5828 [DEBUG] - APPDATA      C:\Users\tonyk\AppData\Roaming
2019-08-17 20:36:33,012 5828 [DEBUG] - CHOCOLATEY_VERSION       0.10.15.0
2019-08-17 20:36:33,013 5828 [DEBUG] - CHOCOLATEY_VERSION_PRODUCT       0.10.15
2019-08-17 20:36:33,015 5828 [DEBUG] - ChocolateyAllowEmptyChecksums        true
2019-08-17 20:36:33,017 5828 [DEBUG] - ChocolateyAllowEmptyChecksumsSecure      true
2019-08-17 20:36:33,018 5828 [DEBUG] - ChocolateyEnvironmentDebug       true
2019-08-17 20:36:33,019 5828 [DEBUG] - ChocolateyEnvironmentVerbose     true
2019-08-17 20:36:33,020 5828 [DEBUG] - ChocolateyInstall        C:\ProgramData\chocolatey
2019-08-17 20:36:33,021 5828 [DEBUG] - ChocolateyLastPathUpdate     132105645235095077
2019-08-17 20:36:33,022 5828 [DEBUG] - chocolateyPackageFolder      C:\ProgramData\chocolatey\lib\wfuzz.fireeye
2019-08-17 20:36:33,023 5828 [DEBUG] - chocolateyPackageName        wfuzz.fireeye
2019-08-17 20:36:33,024 5828 [DEBUG] - chocolateyPackageTitle       wfuzz
2019-08-17 20:36:33,025 5828 [DEBUG] - chocolateyPackageVersion     2.4.20190522.4
2019-08-17 20:36:33,026 5828 [DEBUG] - chocolateyPackageVersionPackageRelease       0
2019-08-17 20:36:33,027 5828 [DEBUG] - ChocolateyPowerShellHost     true
2019-08-17 20:36:33,028 5828 [DEBUG] - chocolateyRequestTimeout     30000
2019-08-17 20:36:33,029 5828 [DEBUG] - chocolateyResponseTimeout        2700000
2019-08-17 20:36:33,030 5828 [DEBUG] - ChocolateyToolsLocation      C:\tools
2019-08-17 20:36:33,032 5828 [DEBUG] - CLASSPATH        .;
2019-08-17 20:36:33,033 5828 [DEBUG] - CommonProgramFiles       C:\Program Files\Common Files
2019-08-17 20:36:33,034 5828 [DEBUG] - CommonProgramFiles(x86)      C:\Program Files (x86)\Common Files
2019-08-17 20:36:33,035 5828 [DEBUG] - CommonProgramW6432       C:\Program Files\Common Files
2019-08-17 20:36:33,036 5828 [DEBUG] - COMPUTERNAME     COMMANDO
2019-08-17 20:36:33,038 5828 [DEBUG] - ComSpec      C:\Windows\system32\cmd.exe
2019-08-17 20:36:33,039 5828 [DEBUG] - DOTNET_CLI_TELEMETRY_OPTOUT      1
2019-08-17 20:36:33,040 5828 [DEBUG] - DriverData       C:\Windows\System32\Drivers\DriverData
2019-08-17 20:36:33,041 5828 [DEBUG] - GOPATH       C:\Users\tonyk\go
2019-08-17 20:36:33,042 5828 [DEBUG] - HOMEDRIVE        C:
2019-08-17 20:36:33,043 5828 [DEBUG] - HOMEPATH     \Users\tonyk
2019-08-17 20:36:33,044 5828 [DEBUG] - IS_ADMIN     true
2019-08-17 20:36:33,045 5828 [DEBUG] - IS_PROCESSELEVATED       true
2019-08-17 20:36:33,047 5828 [DEBUG] - IS_REMOTE        true
2019-08-17 20:36:33,049 5828 [DEBUG] - IS_REMOTEDESKTOP     false
2019-08-17 20:36:33,050 5828 [DEBUG] - IS_SYSTEM        false
2019-08-17 20:36:33,051 5828 [DEBUG] - JAVA_HOME        C:\Program Files\Java\jdk1.8.0_221
2019-08-17 20:36:33,052 5828 [DEBUG] - LOCALAPPDATA     C:\Users\tonyk\AppData\Local
2019-08-17 20:36:33,054 5828 [DEBUG] - LOGONSERVER      \\COMMANDO
2019-08-17 20:36:33,055 5828 [DEBUG] - NEO4J_HOME       C:\tools\neo4j-community\neo4j-community-3.5.1
2019-08-17 20:36:33,056 5828 [DEBUG] - NUMBER_OF_PROCESSORS     2
2019-08-17 20:36:33,056 5828 [DEBUG] - OneDrive     C:\Users\tonyk\OneDrive
2019-08-17 20:36:33,057 5828 [DEBUG] - OS       Windows_NT
2019-08-17 20:36:33,058 5828 [DEBUG] - OS_IS64BIT       true
2019-08-17 20:36:33,058 5828 [DEBUG] - OS_NAME      Windows 10
2019-08-17 20:36:33,059 5828 [DEBUG] - OS_PLATFORM      Windows
2019-08-17 20:36:33,060 5828 [DEBUG] - OS_VERSION       10.0.17763.0
2019-08-17 20:36:33,061 5828 [DEBUG] - packageFolder        C:\ProgramData\chocolatey\lib\wfuzz.fireeye
2019-08-17 20:36:33,062 5828 [DEBUG] - packageName      wfuzz.fireeye
2019-08-17 20:36:33,063 5828 [DEBUG] - packageTitle     wfuzz
2019-08-17 20:36:33,066 5828 [DEBUG] - packageVersion       2.4.20190522.4
2019-08-17 20:36:33,067 5828 [DEBUG] - Path     C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin;C:\tools\ruby26\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Boxstarter;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\Microsoft VS Code\bin;C:\Go\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.8.0_221\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\metasploit-framework\bin\;C:\Program Files\dotnet\;C:\Users\tonyk\AppData\Local\Microsoft\WindowsApps;C:\tools\Cmder;C:\Users\tonyk\go\bin;C:\Program Files (x86)\Nmap;C:\Users\tonyk\AppData\Local\Programs\Fiddler;C:\Users\tonyk\.dotnet\tools;C:\Tools\Covenant\Covenant;C:\Tools\Elite\Elite;C:\Python37\Scripts;C:\Python37;C:\Python27\Scripts;C:\Python27;C:\Users\tonyk\AppData\Local\Microsoft\WindowsApps;C:\tools\Cmder;C:\Users\tonyk\go\bin;C:\Program Files (x86)\Nmap;C:\Users\tonyk\AppData\Local\Programs\Fiddler;C:\Users\tonyk\.dotnet\tools;C:\Tools\Covenant\Covenant;C:\Tools\Elite\Elite;C:\ProgramData\chocolatey\lib\amass.docker.fireeye\tools;
2019-08-17 20:36:33,068 5828 [DEBUG] - PATHEXT      .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.RB;.RBW;.PY;.PYW;.CPL
2019-08-17 20:36:33,069 5828 [DEBUG] - PROCESS_IS64BIT      true
2019-08-17 20:36:33,069 5828 [DEBUG] - PROCESSOR_ARCHITECTURE       AMD64
2019-08-17 20:36:33,070 5828 [DEBUG] - PROCESSOR_IDENTIFIER     Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
2019-08-17 20:36:33,072 5828 [DEBUG] - PROCESSOR_LEVEL      6
2019-08-17 20:36:33,074 5828 [DEBUG] - PROCESSOR_REVISION       4501
2019-08-17 20:36:33,075 5828 [DEBUG] - ProgramData      C:\ProgramData
2019-08-17 20:36:33,076 5828 [DEBUG] - ProgramFiles     C:\Program Files
2019-08-17 20:36:33,077 5828 [DEBUG] - ProgramFiles(x86)        C:\Program Files (x86)
2019-08-17 20:36:33,078 5828 [DEBUG] - ProgramW6432     C:\Program Files
2019-08-17 20:36:33,079 5828 [DEBUG] - PROMPT       COMMANDO$S$d$s$t$_$p$+$g
2019-08-17 20:36:33,080 5828 [DEBUG] - PSModulePath     C:\Users\tonyk\Documents\WindowsPowerShell\Modules;C:\ProgramData\FEVM;C:\ProgramData\Boxstarter;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\AutoIt3\AutoItX;
2019-08-17 20:36:33,080 5828 [DEBUG] - PUBLIC       C:\Users\Public
2019-08-17 20:36:33,081 5828 [DEBUG] - RAW_TOOLS_DIR        C:\Tools
2019-08-17 20:36:33,083 5828 [DEBUG] - SystemDrive      C:
2019-08-17 20:36:33,084 5828 [DEBUG] - SystemRoot       C:\Windows
2019-08-17 20:36:33,084 5828 [DEBUG] - TEMP     C:\Users\tonyk\AppData\Local\Temp
2019-08-17 20:36:33,085 5828 [DEBUG] - TMP      C:\Users\tonyk\AppData\Local\Temp
2019-08-17 20:36:33,086 5828 [DEBUG] - TOOL_LIST_DIR        C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Tool List
2019-08-17 20:36:33,088 5828 [DEBUG] - TOOL_LIST_SHORTCUT       C:\Users\tonyk\Desktop\Tools.lnk
2019-08-17 20:36:33,089 5828 [DEBUG] - USER_DOMAIN      COMMANDO
2019-08-17 20:36:33,090 5828 [DEBUG] - USER_NAME        tonyk
2019-08-17 20:36:33,091 5828 [DEBUG] - USERDOMAIN       COMMANDO
2019-08-17 20:36:33,092 5828 [DEBUG] - USERDOMAIN_ROAMINGPROFILE        COMMANDO
2019-08-17 20:36:33,093 5828 [DEBUG] - USERNAME     tonyk
2019-08-17 20:36:33,093 5828 [DEBUG] - USERPROFILE      C:\Users\tonyk
2019-08-17 20:36:33,094 5828 [DEBUG] - VM_COMMON_DIR        C:\ProgramData\FEVM
2019-08-17 20:36:33,095 5828 [DEBUG] - windir       C:\Windows
2019-08-17 20:36:33,096 5828 [DEBUG] - ---------------------------Script Execution---------------------------
2019-08-17 20:36:33,098 5828 [DEBUG] - Running 'ChocolateyScriptRunner' for wfuzz.fireeye v2.4.20190522.4 with packageScript 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye\Tools\chocolateyInstall.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\wfuzz.fireeye', installArguments: '', packageParameters: '',
2019-08-17 20:36:33,110 5828 [DEBUG] - Running 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye\Tools\chocolateyInstall.ps1'
2019-08-17 20:36:36,967 5828 [ERROR] - ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop:     ERROR: Command errored out with exit status 10:
2019-08-17 20:36:37,074 5828 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye\Tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '''] exited with '-1'.
2019-08-17 20:36:37,078 5828 [DEBUG] - Calling command ['"C:\Windows\System32\shutdown.exe" /a']
2019-08-17 20:36:37,176 5828 [DEBUG] - Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'
2019-08-17 20:36:37,331 5828 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye'
2019-08-17 20:36:37,334 5828 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye\wfuzz.fireeye.nupkg'
  with checksum 'B499698FE11CAB9AA9D96B5C65616325'
2019-08-17 20:36:37,335 5828 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye\wfuzz.fireeye.nuspec'
  with checksum 'C55113ED5FE2AAC8075D29BC880388D6'
2019-08-17 20:36:37,336 5828 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye\Tools\chocolateyInstall.ps1'
  with checksum '6DF7931FEBFBAF89036043A3671373A7'
2019-08-17 20:36:37,337 5828 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye\Tools\chocolateyUninstall.ps1'
  with checksum 'EC94B36440F74A21F9010995CB2BF044'
2019-08-17 20:36:37,361 5828 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\wfuzz.fireeye.2.4.20190522.4\.arguments".
2019-08-17 20:36:37,361 5828 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\wfuzz.fireeye.2.4.20190522.4\.extra".
2019-08-17 20:36:37,362 5828 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\wfuzz.fireeye.2.4.20190522.4\.version".
2019-08-17 20:36:37,363 5828 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\wfuzz.fireeye.2.4.20190522.4\.sxs".
2019-08-17 20:36:37,363 5828 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\wfuzz.fireeye.2.4.20190522.4\.pin".
2019-08-17 20:36:37,364 5828 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bad\wfuzz.fireeye".
2019-08-17 20:36:37,379 5828 [DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
2019-08-17 20:36:37,388 5828 [ERROR] - The install of wfuzz.fireeye was NOT successful.
2019-08-17 20:36:37,396 5828 [ERROR] - Error while running 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye\Tools\chocolateyInstall.ps1'.
 See log for details.
2019-08-17 20:36:37,415 5828 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye'
 to 'C:\ProgramData\chocolatey\lib-bad\wfuzz.fireeye'
2019-08-17 20:36:39,429 5828 [DEBUG] - Attempting to delete file "C:\Users\tonyk\AppData\Local\NuGet\Cache\wfuzz.fireeye.2.4.20190522.4.nupkg".
2019-08-17 20:36:39,441 5828 [WARN ] - 
Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2019-08-17 20:36:39,447 5828 [INFO ] - 
2019-08-17 20:36:39,450 5828 [ERROR] - Failures
2019-08-17 20:36:39,454 5828 [ERROR] -  - wfuzz.fireeye (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\wfuzz.fireeye\Tools\chocolateyInstall.ps1'.
 See log for details.
2019-08-17 20:36:39,461 5828 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2019-08-17 20:36:39,538 5828 [DEBUG] - Exiting with -1
ifly53e commented 4 years ago

Wfuzz relies on pycurl.

Pycurl won't install cleanly on windows. https://stackoverflow.com/questions/22754649/cant-install-pycurl-with-pip/54146998

https://stackoverflow.com/questions/507927/how-do-i-install-pycurl The above link suggested downloading and installing pycurl from here: https://bintray.com/pycurl/pycurl/pycurl/view#files

I installed this on my 64bit windows: https://bintray.com/pycurl/pycurl/download_file?file_path=pycurl-7.43.0.2.win-amd64-py2.7.msi

I then ran: cinst wfuzz.fireeye

Chocolatey installed 1/1 packages

ifly53e commented 4 years ago

This modified chocolateyInstall.ps1 worked for a manual install of x64dbg on a fresh install.

I had to change some logic in the checks for previous x64dbg installs since my install was fresh so you may have to modify line 49 for your install to work.

There were still some NULL path errors for the uninstall functions but the at least the install appeared to work.

As @tonykarre identified, issue was no FLARE_START variable so I changed it to TOOL_LIST_DIR to match with the other debuggers installed (windbg).

BTW: Choco upgrade x64dbg.fireeye still fails even after this install...

  # Allows you to run the installer script directly
Import-Module C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1

$ErrorActionPreference = 'Stop'
$packageName = 'x64dbg'
  #$path = Join-Path ${Env:FLARE_START} 'Debuggers'
  # will give a null path error if no FLARE_START so give it a path it knows about...
$path = Join-Path ${Env:TOOL_LIST_DIR} 'Debuggers'

function Uninstall-ChocolateyZipPackage-WithFlare {
<#
.SYNOPSIS
Remove previous files from last Install-ChocolateyZipPackage.
.DESCRIPTION
Remove previous files from last Install-ChocolateyZipPackage.
.NOTES
Doing it manually until chocolatey v10.12 is out due to bug in Uninstall-ChocolateyZipPackage.
See: https://github.com/chocolatey/choco/issues/1546
Using similar code from https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/helpers/functions/UnInstall-ChocolateyZipPackage.ps1
.PARAMETER ZipFileName
This is the zip filename that was previously installed.
#>
param(
  [parameter(Mandatory=$true, Position=0)][string] $zipFileName
)

  $packagelibPath = ${Env:chocolateyPackageFolder}
  $zipContentFile = (Join-Path $packagelibPath $zipFileName) + "Install.zip.txt"

    # The Zip Content File may have previously existed under a different
    # name.  If *Install.txt doesn't exist, check for the old name
  if(-Not (Test-Path -Path $zipContentFile)) {
    $zipContentFile = (Join-Path $packagelibPath -ChildPath $zipFileName) + ".txt"
  }

  if ((Test-Path -path $zipContentFile)) {
    $zipContents = Get-Content $zipContentFile
    foreach ($fileInZip in $zipContents) {
      if ($fileInZip -ne $null -and $fileInZip.Trim() -ne '') {
        Remove-Item -Path "$fileInZip" -ErrorAction SilentlyContinue -Recurse -Force
      }
    }
  }
}

  # List of all previously installed zip files
$previousZipFileNames = @("snapshot_2019-03-10_00-50.zip", "snapshot_2019-01-20_22-50.zip, snapshot_2018-10-29_13-49.zip")
  #wrap it in an if statement to check for null zips (what if this is a fresh install?)
if(-Not ($previousZipFileNames)){
    foreach ($zipFileName in $previousZipFileNames) {
    #will give an null path error if no zips found
    Uninstall-ChocolateyZipPackage-WithFlare $zipFileName
    }
}

  # Retrieve URL for the latest released on github. The releases are frequent!
  # NOTE: Requires PS3+ for this to work.
  #$r = Invoke-WebRequest 'https://api.github.com/repos/x64dbg/x64dbg/releases/latest'
  #$j = $r | ConvertFrom-Json
  #$url = $j.assets.browser_download_url

$snapshotDate = '2019-03-10_00-52'
$hash = '09E7A9944379789FCAA57164DCB5341DC9302E03843F52041251E85F5E145636'
$url = 'https://sourceforge.net/projects/x64dbg/files/snapshots/snapshot_{0}.zip' -f $snapshotDate

$toolsDir = ${Env:ProgramFiles}
$toolsDir = Join-Path $toolsDir $packageName

$packageArgs = @{
  packageName   = $packageName
  unzipLocation = $toolsDir
  url           = $url
  checksum      = $hash
  checksumType  = 'sha256'
}
Install-ChocolateyZipPackage @packageArgs

$target32 = Join-Path $toolsDir "release\x32\x32dbg.exe"
$shortcut32 = Join-Path $path "x32dbg.lnk"
Install-ChocolateyShortcut -shortcutFilePath $shortcut32 -targetPath $target32 -RunAsAdmin
Install-BinFile -Name 'x32dbg' -Path $target32

$target64 = Join-Path $toolsDir "release\x64\x64dbg.exe"
$shortcut64 = Join-Path $path "x64dbg.lnk"
Install-ChocolateyShortcut -shortcutFilePath $shortcut64 -targetPath $target64 -RunAsAdmin
Install-BinFile -Name 'x64dbg' -Path $target64
day1player commented 4 years ago

Fixed in #147