Skip to content
Merged
127 changes: 127 additions & 0 deletions .github/workflows/test_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: test_env CI Validation

on:
push:
branches: [ master, vulnenv, vulnenv-week11, vulnenv-week12 ]
pull_request:
branches: [ master, vulnenv ]


jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
include:
# =============================================================
# EXPLOIT MODULES
# =============================================================

# ActiveMQ shared definition — HTTP/Jolokia (authenticated)
- id: activemq-jolokia
module: exploit/multi/http/apache_activemq_jolokia_rce
definition: activemq
variant: "5.18.6"
profile: default
desc: "ActiveMQ Jolokia RCE — shared def, HTTP health, auth"

# ActiveMQ shared definition — OpenWire (unauthenticated)
- id: activemq-openwire
module: exploit/multi/misc/apache_activemq_rce_cve_2023_46604
definition: activemq
variant: "5.18.2"
profile: broker-only
desc: "ActiveMQ OpenWire RCE — shared def, TCP health, unauth"

# WordPress — provision + verify pipeline
- id: wordpress
module: exploit/unix/webapp/wp_admin_shell_upload
definition: wordpress
variant: latest
profile: default
desc: "WordPress Admin Shell — provision+verify, custom payload"

# =============================================================
# AUXILIARY MODULES (shared definitions)
# =============================================================

# httpd shared definition — 3 independent scanner modules
- id: httpd-version
module: auxiliary/scanner/http/http_version
definition: httpd
variant: "2.4.57"
profile: default
desc: "HTTP Version Scanner — auxiliary, shared httpd def"

- id: httpd-header
module: auxiliary/scanner/http/http_header
definition: httpd
variant: "2.4.57"
profile: default
desc: "HTTP Header Scanner — auxiliary, shared httpd def"

- id: httpd-robots
module: auxiliary/scanner/http/robots_txt
definition: httpd
variant: "2.4.57"
profile: default
desc: "HTTP Robots.txt Scanner — auxiliary, shared httpd def"

# openssh — SSH scanner with TCP health check
- id: openssh-version
module: auxiliary/scanner/ssh/ssh_version
definition: openssh
variant: "7.2"
profile: default
desc: "SSH Version Scanner — auxiliary, TCP health"

name: ${{ matrix.desc }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install system build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libpq-dev libsqlite3-dev libpcap-dev

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
# bundler-cache: true removed — we run bundle install manually
# after system libraries are present

- name: Verify Docker runtime
run: |
docker --version
docker info
docker run --rm hello-world

- name: Ensure CI runner is executable
run: chmod +x ./scripts/ci_runner.sh

- name: Install framework dependencies
run: |
gem install bundler --no-document
bundle install --jobs 4 --retry 3

- name: Run test_env validation
run: |
./scripts/ci_runner.sh \
"${{ matrix.module }}" \
"${{ matrix.variant }}" \
"${{ matrix.profile }}"
timeout-minutes: 15

- name: Upload logs on completion
if: always()
uses: actions/upload-artifact@v4
with:
name: msf-logs-${{ matrix.id }}
path: /tmp/test_env_*.log
if-no-files-found: warn
5 changes: 4 additions & 1 deletion data/vuln_envs/activemq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ profiles:
broker-only:
description: Web console not assumed reachable; only the broker port is health-checked
health_check:
type: tcp
type: tcp
ci:
exploit:
force_exploit: true
1 change: 1 addition & 0 deletions data/vuln_envs/httpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ shared:
ci:
validation:
expected_session: false
expected_output: "Apache"

profiles:
default:
Expand Down
3 changes: 3 additions & 0 deletions data/vuln_envs/openssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ shared:
retries: 10

ci:
exploit:
force_exploit: true
validation:
expected_session: false
expected_output: "SSH"

profiles:
default:
Expand Down
Loading
Loading