mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-21 11:18:06 +00:00
added check to verify if leaked files is empty
This commit is contained in:
BIN
lib/.DS_Store
vendored
BIN
lib/.DS_Store
vendored
Binary file not shown.
BIN
lib/templates/.DS_Store
vendored
BIN
lib/templates/.DS_Store
vendored
Binary file not shown.
@@ -1,20 +1,22 @@
|
||||
define secgen_functions::leak_file($leaked_filename, $storage_directory, $strings_to_leak, $owner = 'root', $group = 'root', $mode = '0777', $leaked_from = '' ) {
|
||||
$path_to_leak = "$storage_directory/$leaked_filename"
|
||||
if ($leaked_filename != ''){
|
||||
$path_to_leak = "$storage_directory/$leaked_filename"
|
||||
|
||||
# If the file already exists append to it, otherwise create it.
|
||||
if (defined(File[$path_to_leak])){
|
||||
notice("File with that name already defined, appending leaked strings instead...")
|
||||
exec { "$leaked_from-$path_to_leak":
|
||||
path => ['/bin', '/usr/bin', '/usr/local/bin', '/sbin', '/usr/sbin'],
|
||||
command => "echo $strings_to_leak >> $path_to_leak",
|
||||
}
|
||||
} else {
|
||||
file { $path_to_leak:
|
||||
ensure => present,
|
||||
owner => $owner,
|
||||
group => $group,
|
||||
mode => $mode,
|
||||
content => template('secgen_functions/overshare.erb')
|
||||
# If the file already exists append to it, otherwise create it.
|
||||
if (defined(File[$path_to_leak])){
|
||||
notice("File with that name already defined, appending leaked strings instead...")
|
||||
exec { "$leaked_from-$path_to_leak":
|
||||
path => ['/bin', '/usr/bin', '/usr/local/bin', '/sbin', '/usr/sbin'],
|
||||
command => "echo $strings_to_leak >> $path_to_leak",
|
||||
}
|
||||
} else {
|
||||
file { $path_to_leak:
|
||||
ensure => present,
|
||||
owner => $owner,
|
||||
group => $group,
|
||||
mode => $mode,
|
||||
content => template('secgen_functions/overshare.erb')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class NameBasedUsernameGenerator < StringEncoder
|
||||
|
||||
# Generate a username based on a random adjective and a random noun
|
||||
def encode_all
|
||||
self.outputs << Faker::Internet.user_name(self.name, %w(- _))
|
||||
self.outputs << Faker::Internet.user_name(self.name, %w(nil _))
|
||||
end
|
||||
|
||||
def get_options_array
|
||||
|
||||
@@ -6,10 +6,18 @@
|
||||
<!-- an example remote storage system, with a remotely exploitable vulnerability that can then be escalated to root -->
|
||||
<system>
|
||||
<system_name>storage_server</system_name>
|
||||
<base platform="linux"/>
|
||||
|
||||
<vulnerability module_path=".*parameterised_accounts"/>
|
||||
<base platform="linux" distro="Debian 7.8"/>
|
||||
|
||||
<vulnerability module_path=".*parameterised_accounts">
|
||||
<input into="accounts">
|
||||
<generator type="account">
|
||||
<input into="username">
|
||||
<value>example_username</value>
|
||||
</input>
|
||||
</generator>
|
||||
</input>
|
||||
</vulnerability>
|
||||
|
||||
<network type="private_network" range="dhcp"/>
|
||||
</system>
|
||||
</scenario>
|
||||
|
||||
Reference in New Issue
Block a user