Add 'mode' input to encrypted zip file and update init.pp to handle mode parameter

This commit is contained in:
Z. Cliffe Schreuders
2025-04-05 00:10:03 +01:00
parent 8b5899172d
commit e0cf7ae2ff
2 changed files with 8 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ class zip_file::init {
$leaked_filename = $secgen_parameters['leaked_filename'][0]
$base64_file = $secgen_parameters['base64_file'][0]
$mode = $secgen_parameters['mode'][0] # default is 0600
if $secgen_parameters['account'] and $secgen_parameters['account'] != '' {
$account = parsejson($secgen_parameters['account'][0])
@@ -19,5 +20,6 @@ class zip_file::init {
base64_file => $base64_file,
owner => $username,
group => $username,
mode => $mode,
}
}
}

View File

@@ -21,6 +21,7 @@
<read_fact>leaked_filename</read_fact>
<read_fact>account</read_fact>
<read_fact>storage_directory</read_fact>
<read_fact>mode</read_fact>
<default_input into="base64_file">
<generator type="zip_file_generator">
@@ -42,6 +43,10 @@
<value>/var/log</value>
</default_input>
<default_input into="mode">
<value>0600</value>
</default_input>
<hint>A zip file has been leaked with a flag.</hint>
<hint>If using a password, use the default dictionary from '/usr/share/john/password.lst'.</hint>
<solution>Use the following command: fcrackzip -u -D -p /usr/share/john/password.lst filename.zip</solution>