Skip to content

Feat: Add BuildVuln Engine for Automated Vulnerability Lab Creation#21192

Open
Ganesh-abc wants to merge 9 commits intorapid7:masterfrom
Ganesh-abc:feature/build-vuln-core
Open

Feat: Add BuildVuln Engine for Automated Vulnerability Lab Creation#21192
Ganesh-abc wants to merge 9 commits intorapid7:masterfrom
Ganesh-abc:feature/build-vuln-core

Conversation

@Ganesh-abc
Copy link
Copy Markdown

@Ganesh-abc Ganesh-abc commented Mar 28, 2026

Summary

This PR introduces a prototype implementation of a BuildVuln engine for automating Docker-based vulnerable environments within Metasploit.

The goal is to provide repeatable, isolated vulnerability labs for exploit development and testing.

Key Features

  • New core library: lib/msf/core/build_vuln.rb
  • Docker container lifecycle automation
  • Automatic service discovery and port mapping
  • Vulnerability verification workflow
  • Cleanup logic to prevent orphan containers

Prototype Implementation

A Vim Modeline RCE lab was implemented to validate:

  • Container build
  • Runtime verification
  • Exploit execution
  • Cleanup handling

Verification

Steps to test:

  1. Start msfconsole
  2. Run build_vuln prototype
  3. Verify container launches
  4. Confirm exploit execution
  5. Confirm cleanup removes container

Notes

This is an early prototype to validate architecture for the proposed build_vuln feature for GSoC.

Feedback on architecture and integration approach is welcome.

Update:

Added fail-safe cleanup logic using Ruby ensure block.

Verified container teardown during Ctrl+C interruption.

This prevents orphan containers and improves framework stability.

@h00die
Copy link
Copy Markdown
Contributor

h00die commented Mar 28, 2026

This looks suspiciously like the GSoC project which has not had a proposal picked. I would highly recommend avoiding putting time into a project before a proposal is picked. Jumping the gun does not help increase your odds of having your proposal selected.

@Ganesh-abc
Copy link
Copy Markdown
Author

Thanks for the guidance — this PR is intended as an early architecture prototype to gather feedback before submitting the GSoC proposal.

I'll avoid further large changes until the proposal selection phase and instead focus on refining the design and documentation.

Appreciate the feedback and looking forward to suggestions on the architecture direction.

@Ganesh-abc
Copy link
Copy Markdown
Author

Thanks for the feedback!

This work is part of my Google Summer of Code proposal for a BuildVuln Engine to provide automated vulnerability lab environments within Metasploit.

Proposal Draft:
https://gist.github.com/Ganesh-abc/11be36686094562ddd10d40d3ce95d77

Architecture Draft:
https://gist.github.com/Ganesh-abc/e57ad60d4f265df5b63e7d5567bd7a46

Implementation Plan:
https://gist.github.com/Ganesh-abc/32eaaddea4e42856df23d58380d7e642

This PR is intended as an early prototype to gather architectural feedback before the GSoC proposal selection.

I'll avoid expanding the feature further for now and instead focus on refining based on maintainer guidance.

Would maintainers prefer this functionality implemented as:

  • Core library
  • Plugin
  • Auxiliary module
  • Alternative architecture

Appreciate the guidance and feedback!

@Ganesh-abc Ganesh-abc force-pushed the feature/build-vuln-core branch from 65fab46 to 6f9ce83 Compare April 1, 2026 13:56
@smcintyre-r7 smcintyre-r7 added the GSoC Google Summer of Code project PRs label Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Google Summer of Code project PRs

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants