mandiant / flare-vm

A collection of software installations scripts for Windows systems that allows you to easily setup and maintain a reverse engineering environment on a VM.
Apache License 2.0
6.35k stars 896 forks source link

Installation fails if username has a space in it #480

Closed landoncrabtree closed 1 year ago

landoncrabtree commented 1 year ago

Description

FLAREVM installation fails if the username has a space in it.

Boxstarter: Disabling Automatic Updates from Windows Update
++ Boxstarter starting Calling Chocolatey to install flarevm.installer.vm. This may take several minutes to complete...
Chocolatey v2.2.2
Installing the following packages:
flarevm.installer.vm;Crabtree\Desktop;.;https://www.myget.org/F/vm-packages/api/v2;https://myget.org/F/vm-packages/api/v2;https://chocolatey.org/api/v2
By installing, you accept licenses for the packages.
Unable to connect to source 'C:\Users\Landon':
 - https://www.myget.org/F/vm-packages/api/v2 - https://www.myget.org/F/vm-packages/api/v2 not installed. The package was not found with the source(s) listed.
 Source(s): 'C:\ProgramData\boxstarter\BuildPackages;C:\Users\Landon'
 NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify `--pre`,
 the package may not be found.
Please see https://docs.chocolatey.org/en-us/troubleshooting for more
 assistance.
++ Boxstarter finished Calling Chocolatey to install flarevm.installer.vm. This may take several minutes to complete... 00:00:03.0833292
True
Boxstarter: Restore Automatic Updates from Windows Update
Boxstarter: Enabling UAC
Type ENTER to exit:

Steps to Reproduce

Fresh Windows 10 installation with a username like 'John Doe' Install FLAREVM Fails

Expected behavior:

Installation should work as intended.

Actual behavior:

Installation fails and terminates.

Environment

2023/08/12 21:03:49 vm.common.psm1 [+] INFO : Host Information

VM OS version and Service Pack
-----

Version                 : 10.0.19045
BuildNumber             : 19045
OSArchitecture          : 64-bit
ServicePackMajorVersion : 0
Caption                 : Microsoft Windows 10 Home

VM OS RAM (MB)
-----
6144

VM OS HDD Space / Usage
-----

DeviceID DriveType ProviderName VolumeName Size        FreeSpace
-------- --------- ------------ ---------- ----        ---------
C:       3                                 85226405888 64359456768
D:       5                      ESD-ISO    4809971712  0

VM AV Details
-----
AntiVirusProduct classname does not exist...

VM PowerShell Version
-----
5.1.19041.2673

VM CLR Version
-----
4.0.30319.42000

VM Chocolatey Version
-----
2.2.2

VM Boxstarter Version
-----

Boxstarter|3.0.2
Boxstarter.Bootstrapper|3.0.2
Boxstarter.Chocolatey|3.0.2
Boxstarter.Common|3.0.2
Boxstarter.HyperV|3.0.2
Boxstarter.WinConfig|3.0.2

VM Installed Packages
-----
Boxstarter|3.0.2
Boxstarter.Bootstrapper|3.0.2
Boxstarter.Chocolatey|3.0.2
Boxstarter.Common|3.0.2
Boxstarter.HyperV|3.0.2
Boxstarter.WinConfig|3.0.2
chocolatey|2.2.2
common.vm|0.0.0.20230714

Common Environment Variables
-----
VM_COMMON_DIR: C:\ProgramData\_VM
TOOL_LIST_DIR: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Tools
TOOL_LIST_SHORTCUT: C:\Users\Landon Crabtree\Desktop\Tools.lnk
RAW_TOOLS_DIR: C:\Tools

Additional Information

Creating a new user with a simple username resolved the issue. This issue might be a non-issue, since it doesn't look like it affects many people, but seems to be a bug regardless.

mr-tz commented 1 year ago

Per the installation steps: "Avoiding usernames containing a space or other special characters".

This comes up regularly, so let's use this issue to at least add a warning to the install script, @mandiant/flare-vm?

stevemk14ebr commented 1 year ago

Most tools and even windows itself will have issues if you use a username with a space. I made the unfortunate mistake a year or so ago while re-imaging my laptop and was shocked how much broke. Eventually I had to re-image.

I'd say suggest we should actually abort installation if there is a space in the username with a big red error message.

HuskyHacks commented 1 year ago

Hoping to add this in https://github.com/mandiant/flare-vm/pull/485

mr-tz commented 1 year ago

Closed in #485, thanks @HuskyHacks!