vulnerabilities/vsftpd_234_backdoor: now uses organisations

This commit is contained in:
thomashaw
2017-08-19 13:44:16 +01:00
parent 458eb3be81
commit 8b2a92915e
3 changed files with 14 additions and 9 deletions

View File

@@ -1,6 +1,14 @@
class vsftpd_234_backdoor::config {
$json_inputs = base64('decode', $::base64_inputs)
$secgen_parameters = parsejson($json_inputs)
$raw_org = $secgen_parameters['organisation']
if $raw_org and $raw_org[0] and $raw_org[0] != '' {
$organisation = parsejson($raw_org[0])
} else {
$organisation = ''
}
# Config files + manuals
file { ['/usr/local/man/man5/vsftpd.conf.5']:
require => File['/usr/local/src/vsftpd-2.3.4/Makefile'],

View File

@@ -20,11 +20,8 @@
<read_fact>ftpd_banner</read_fact>
<read_fact>port</read_fact>
<!-- Team project selectors -->
<read_fact>business_name</read_fact>
<!--TODO: Remove below + match only on business_name? Currently does nothing.-->
<read_fact>business_domain</read_fact>
<read_fact>person</read_fact>
<!-- No organisation by default, overrides other values if provided through scenario. -->
<read_fact>organisation</read_fact>
<default_input into="anonymous_ftp">
<value>false</value>

View File

@@ -3,11 +3,11 @@
$port = $secgen_parameters['port'].first
$raw_anonymous_ftp = $secgen_parameters['anonymous_ftp'].first
$anonymous_ftp = $raw_anonymous_ftp ? 'YES' : 'NO'
$ftpd_banner = $secgen_parameters['ftpd_banner'].first
if $secgen_parameters['business_name']
$business_name = $secgen_parameters['business_name'].first
$ftpd_banner = "Welcome to the #{$business_name} FTP server!"
if @organisation and @organisation != ''
$ftpd_banner = "Welcome to the #{@organisation['business_name']} FTP server!"
else
$ftpd_banner = $secgen_parameters['ftpd_banner'].first
end
%>
# Example config file /etc/vsftpd.conf