diff --git a/modules/vulnerabilities/unix/http/apache_druid_rce/manifests/install.pp b/modules/vulnerabilities/unix/http/apache_druid_rce/manifests/install.pp index 87b4ff67f..8a6fc7571 100644 --- a/modules/vulnerabilities/unix/http/apache_druid_rce/manifests/install.pp +++ b/modules/vulnerabilities/unix/http/apache_druid_rce/manifests/install.pp @@ -16,21 +16,31 @@ home => $user_home, managehome => true, } - - # This generates a repo file so we can get packages from debian stretch - file { '/etc/apt/sources.list.d/stretch.list': - ensure => file, - source => "puppet:///modules/${modulename}/stretch.list" + exec { 'download-jdk8': + cwd => '/tmp', + command => 'wget -O jdk8.tar.gz https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u432-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u432b06.tar.gz', + creates => '/tmp/jdk8.tar.gz', + timeout => 300, + } + -> exec { 'extract-jdk8': + cwd => '/tmp', + command => 'tar -xzf jdk8.tar.gz', + creates => '/tmp/jdk8u432-b06', } - -> exec { 'update-packages': - command => 'apt update' + -> exec { 'mkdir-jvm': + cwd => '/tmp', + command => 'sudo mkdir /usr/lib/jvm;', + } + -> exec { 'install-jdk8': + cwd => '/tmp', + command => 'mv jdk8u432-b06 /usr/lib/jvm/java-8-openjdk', + creates => '/usr/lib/jvm/java-8-openjdk', } - -> package { 'install-jdk8': - ensure => 'installed', - name => 'openjdk-8-jdk', + -> file { '/etc/profile.d/java8.sh': + ensure => file, + content => "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk\nexport PATH=\$JAVA_HOME/bin:\$PATH\n", + mode => '0644', } - # openjdk8 is required. Since we are buster, we need the repos within stretch for this - #ensure_packages(['openjdk-8-jdk'], { ensure => 'installed'}) $releasename = "${modulename}.tar.gz" $currentsource = ["${releasename}.partaa", diff --git a/modules/vulnerabilities/unix/http/apache_druid_rce/templates/druid.service.erb b/modules/vulnerabilities/unix/http/apache_druid_rce/templates/druid.service.erb index 63b067cd5..c605c43d0 100644 --- a/modules/vulnerabilities/unix/http/apache_druid_rce/templates/druid.service.erb +++ b/modules/vulnerabilities/unix/http/apache_druid_rce/templates/druid.service.erb @@ -9,6 +9,9 @@ WorkingDirectory=/usr/local/apache-druid/ ExecStart=/usr/local/apache-druid/bin/start-nano-quickstart Restart=always RestartSec=1 +Environment="JAVA_HOME=/usr/lib/jvm/java-8-openjdk" +Environment="PATH=/usr/lib/jvm/java-8-openjdk/bin:/usr/bin:/bin" +Environment="DRUID_SKIP_JAVA_CHECK=1" [Install] WantedBy=multi-user.target \ No newline at end of file diff --git a/scenarios/ctf/eventful_data.xml b/scenarios/ctf/eventful_data.xml index 0b7fe5f21..237707586 100644 --- a/scenarios/ctf/eventful_data.xml +++ b/scenarios/ctf/eventful_data.xml @@ -91,13 +91,16 @@ server - + - + + + + @@ -106,8 +109,6 @@ - - IP_addresses