Skip to content

Automate customized REMnux builds #693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 16, 2025
Merged

Automate customized REMnux builds #693

merged 2 commits into from
May 16, 2025

Conversation

Ana06
Copy link
Member

@Ana06 Ana06 commented Apr 30, 2025

Introduce a new script, vbox-build-remnux.py, to automate the building and exporting of customized REMnux virtual machines. The script utilizes a YAML configuration file (remnux.yaml) to define the VM name, export settings, and a series of commands to execute within the guest VM.

The code and logic are similar to the existing vbox-build-flare-vm.py, ensuring consistency between the two build processes. To avoid code duplication, several common functions, such as control_guest, take_snapshot, and rename_old_snapshot, have been moved to the vboxcommon.py module.

The REMnux build process includes:

  • Restoring a base snapshot.
  • Optionally upgrading the REMnux distribution and copying required files into the guest.
  • Executing a series of commands defined in the remnux.yaml configuration. These commands can include installing additional packages, configuring the environment, and installing tools like IDA Pro and GNOME extensions (e.g., Dash to Panel).
  • Taking multiple snapshots throughout the build process for potential debugging.
  • Setting the network adapter to host-only.
  • Taking a final snapshot with a configurable extension and description.
  • Exporting the final snapshot as an OVA file.

Also fix a bug I encountered during testing becase the aborted VM state was not properly handled in the shutdown check.

@Ana06 Ana06 added 💎 enhancement It is working, but it could be better 🖥️ virtualbox labels Apr 30, 2025
@Ana06 Ana06 self-assigned this Apr 30, 2025
Ana06 added 2 commits April 30, 2025 22:20
This commit introduces a new script, `vbox-build-remnux.py`, to automate
the building and exporting of customized REMnux virtual machines. The
script utilizes a YAML configuration file (`remnux.yaml`) to define the
VM name, export settings, and a series of commands to execute within the
guest VM.

The code and logic are similar to the existing `vbox-build-flare-vm.py`,
ensuring consistency between the two build processes. To avoid code
duplication, several common functions, such as `control_guest`,
`take_snapshot`, and `rename_old_snapshot`, have been moved to the
`vboxcommon.py` module.

The REMnux build process includes:
- Restoring a base snapshot.
- Optionally upgrading the REMnux distribution and copying required
  files into the guest.
- Executing a series of commands defined in the `remnux.yaml`
  configuration. These commands can include installing additional
  packages, configuring the environment, and installing tools like IDA Pro
  and GNOME extensions (e.g., Dash to Panel).
- Taking multiple snapshots throughout the build process for potential
  debugging.
- Setting the network adapter to host-only.
- Taking a final snapshot with a configurable extension and description.
- Exporting the final snapshot as an OVA file.
`ensure_vm_shutdown` now handles the `aborted` VM state, preventing
failed shutdown attempts.
@Ana06 Ana06 merged commit 43b69f7 into mandiant:main May 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖥️ virtualbox 💎 enhancement It is working, but it could be better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant