Auteur Sujet: [FireEye]Commando VM 2.0: Customization, Containers, and Kali, Oh My!  (Lu 160 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne igor51

  • Admin
  • Mega Power Members
  • *****
  • Messages: 10351
Commando VM 2.0: Customization, Containers, and Kali, Oh My!

The Complete Mandiant Offensive Virtual Machine (“    href="">Commando VM”)
  swept the penetration testing community by storm when it debuted in
  early 2019 at Black Hat Asia Arsenal. Our     href="/content/fireeye-www/en_US/blog/threat-research/2019/03/commando-vm-windows-offensive-distribution.html">1.0
  release made headway featuring more than 140 tools. Well now we
  are back again for another spectacular release, this time at Black Hat
  USA Arsenal 2019! In this 2.0 release we’ve listened to the community
  and implemented some new must have features: Kali Linux, Docker
  containers, and package customization.


About Commando VM


Penetration testers commonly use their own variants of Windows
  machines when assessing Active Directory environments. We specifically
  designed Commando VM to be the go-to platform for performing internal
  penetration tests. The benefits of using Commando VM include native
  support for Windows and Active Directory, using your VM as a staging
  area for command and control (C2) frameworks, more easily (and
  interactively) browsing network shares, and using tools such as   href="">PowerView
  and BloodHound without any worry
  about placing output files on client assets.


Commando VM uses Boxstarter,
    Chocolatey, and   href="">MyGet packages to install software and
  delivers many tools and utilities to support penetration testing. With
  over 170 tools and growing, Commando VM aims to be the de facto
  Windows machine for every penetration tester and red teamer.


Recent Updates


Since its initial release at Black Hat Asia Arsenal in March 2019,
  Commando VM has received three additional updates, including new tools
  and/or bug fixes. We closed 61 issues on GitHub and added 26 new
  tools. Version 2.0 brings three major new features, more tools, bug
  fixes, and much more!




Kali Linux


In 2016 Microsoft released the     href="">Windows
    Subsystem for Linux (WSL). Since then, pentesters have been
  trying to leverage this capability to squeeze more productivity out of
  their Window systems. The fewer Virtual Machines you need to run, the
  better. With WSL you can install Linux distributions from the Windows
  Store and run common Linux commands in a terminal such as starting up
  an SSH, MySQL or Apache server, automating mundane tasks with common
  scripting languages, and utilizing many other Linux applications
  within the same Windows system.


In January 2018, Offensive Security announced support for     href="">Kali
    Linux in WSL. With our 2.0 release, Commando VM officially
  supports Kali Linux on WSL. To get the most out of Kali, we've also
  included   href="">VcXsrv, an X
  Server that allows us to display the entire Linux GUI on the Windows
  Desktop (Figure 1). Displaying the Linux GUI and passing windows to
  Windows had been     href="">previously
    documented by Offensive Security and other   href="">professionals,
  and we have combined these to include the GUI as well as shortcuts to
  take advantage of popular programs such as   href="">Terminator (Figure 2) and
      href="">DirBuster (Figure 3).


 Figure 1: Kali XFCE on WSL with VcXsrv


 Figure 2: Terminator on Commando VM –
    Kali WSL with VcXsrv


 Figure 3: DirBuster on Commando VM – Kali
    WSL with VcXsrv




Docker is becoming increasingly popular within the penetration
  testing community. Multiple blog posts exist detailing     href="">interesting
  functionality using     href="">Docker
    for pentesting. Based on its popularity     href="">Docker
    has been on our roadmap since the 1.0 release in March 2019, and
  we now support it with our release of Commando VM 2.0. We pull tools
  such as Amass and   href="">SpiderFoot and
  provide scripts to launch the containers for each tool. Figure 4 shows
  an example of SpiderFoot running within Docker.


 Figure 4: Impacket container running on Docker


For command line docker containers, such as Amass, we created a
  PowerShell script to automatically run Amass commands through docker.
  This script is also added to the PATH, so users can call   class="code">amass from anywhere. This script is shown in
  Figure 5. We encourage users to come up with their own scripts to do
  more creative things with Docker.


 Figure 5: Amass.ps1 script


This script is also executed when the shortcut is opened.


 Figure 6: Amass Docker container executed
    via PowerShell script




Not everyone needs all of the tools all of the time. Some tools can
  extend the installation process by hours, take up many gigabytes of
  hard drive space, or come with unsuitable licenses and user
  agreements. On the other hand, maybe you would like to install
  additional reversing tools available within our popular     href="">FLARE VM; or you
  would prefer one of the many alternative text editors or browsers
  available from the
community feed
  Either way, we would like to provide the option to selectively install
  only the packages you desire. Through customization you and your
  organization can also share or distribute the profile to make sure
  your entire team has the same VM environment. To provide for these
  scenarios, the last big change for Commando 2.0 is the support for
  installation customization. We recommend using our     href="">default
  profile, and removing or adding tools to it as you see fit. Please
  read the following section to see how.


How to Create a Custom Install


Before we start, please note that after customizing your own edition
  of Commando VM, the
    cup all
command will only upgrade
  packages pre-installed within your customized distribution. New
  packages released by our team in the future will not be installed or
  upgraded automatically with
    cup all
. When needed, these new
  packages can always be installed manually using the
    choco install
command, or by adding
  them to your profile before a new install.


Simple Instructions

  1. Download the zip from     href="">
        into your Downloads folder.
  2. Decompress the zip and edit the
        file by removing tools or adding tools in the “packages” section.
        Tools are available from our       href="">package
        list or from the       href="">chocolatey
  3. Open an administrative PowerShell window and
        enable script execution.

    •         Set-ExecutionPolicy Unrestricted
  4. Change to the unzipped project

    •         cd

  5. Execute the install with the -profile_file

    •         .\install.ps1 -profile_file


Detailed Instructions


To start customizing your own distribution, you need the following
  three items* from our public     href="">GitHub repository:

  1. Our

  3. Our       href="">sample
  4. An
        installation template. We recommend using
                    href="">  class="code">commandovm.win10.install.fireeye


*Note: If you download the project ZIP from GitHub it will contain
  all three items.


The install script will now support an optional
argument, which
  specifies a JSON profile. Without the
argument, running
will install the default
  Commando VM distribution. To customize your edition of Commando VM,
  you need to create a profile in JSON format, and then pass that to the
argument. Let us explore
  the sample
profile (Figure 7).


 Figure 7: profile.json profile


This JSON profile starts with the
dictionary which specifies many
  environment variables used by the installer. These environment
  variables can, and should, be left to their default values. Here is a
  list of the supported environment variables:


    specifies where the
        shared libraries should be installed on the VM. After a successful
        install, you will find a
    directory within
        this location. This contains a PowerShell module that is shared by
        our packages.

    specify which
        directory contains the list of all installed packages within the
        Start Menu and the name of the desktop shortcut, respectively.

    environment variable
        specifies the location where some tools will be installed.
        Chocolatey defaults to installing tools in
    . This
        environment variable by default points to
    , allowing you to
        more easily access some tools on the command line.
  • And,
    specifies a template
        package directory relative to where

        is on disk. We strongly recommend using the

        package available on our GitHub repository as the template. If your
        VM is running Windows 7, please switch to the appropriate

        package. If you are feeling “hacky” and adventurous, feel free to
        customize the installer further by modifying the
        within the
    directory of the template.
        Note that a proper template will be a folder containing at least 5
        things: (1) a properly formatted nuspec
        file, (2) a “tools” folder that contains (3) a     class="code">chocolateyinstall.ps1 file, (4) a     class="code">chocolateyuninstall.ps1 file, and (5) a     class="code">profile.json file. If you use our template, the
        only thing you need to change is the packages.json file. The easiest
        way to do this is just download and extract the commando-vm zip file
        from GitHub.


With the packages variables set, you can now specify which packages
  to install on your own distribution. Some packages accept additional
  installation arguments. You can see an example of this by looking at
entry. For a complete
  list of packages available from our feed, please see our     href="">package list.


Once you finish modifying your profile, you are ready for
  installation. Run
with elevated
  privileges and execute the following commands to install your own
  edition of Commando VM, assuming you saved your version of the profile
(Figure 8).


 Figure 8: Example myprofile.json


file can then be shared
  and distributed throughout your entire organization to ensure everyone
  has the same VM environment when installing Commando VM.




Commando VM was originally designed to be the de facto Windows
  machine for every penetration tester and red teamer. Now, with the
  addition of Kali Linux support, Docker and installation customization,
  we hope it will be the one machine for all penetration testers
  and red teamers. For a complete list of tools, and for the
  installation script, please see the     href="">Commando VM GitHub
  repository. We look forward to addressing user feedback, adding
  more tools and features, and creating many more enhancements for this
  Windows attack platform.

Source: Commando VM 2.0: Customization, Containers, and Kali, Oh My!