new file: modules/generators/messages/randsom_note/ransom_note.pp

new file:   modules/generators/messages/randsom_note/secgen_local/local.rb
	new file:   modules/generators/messages/randsom_note/secgen_metadata.xml
	new file:   modules/generators/messages/randsom_note/templates/ransom_note.md.erb
Initial Push for Ransom Note
This commit is contained in:
Jack Biggs
2023-05-11 22:35:42 +01:00
parent 52658c518d
commit 5e7341783a
4 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_string_generator.rb'
require 'erb'
require 'fileutils'
class RansomNoteGenerator < StringGenerator
attr_accessor :name
LOCAL_DIR = File.expand_path('../../',__FILE__)
TEMPLATE_PATH = "#{LOCAL_DIR}/templates/ransom_note.md.erb"
def initialize
super
self.name = ''
end
def get_options_array
super + [['--name', GetoptLong::OPTIONAL_ARGUMENT]]
end
def process_options(opt, arg)
super
case opt
when '--name'
self.name << arg;
end
end
def generate
#template_out = ERB.new(File.read(TEMPLATE_PATH), 0, '<>-')
#self.outputs << template.out_result(self.get_binding)
template_out = ERB.new(File.read(TEMPLATE_PATH), 0, '<>-')
self.outputs << template_out.result(self.get_binding)
end
# Returns binding for erb files (access to variables in this classes scope)
# @return binding
def get_binding
binding
end
end
RansomNoteGenerator.new.run

View File

@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<generator xmlns="http://www.github/cliffe/SecGen/generator"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.github/cliffe/SecGen/generator">
<name>Ransom Note Generator</name>
<author>Jack Biggs</author>
<module_license>MIT</module_license>
<description>Creates a file in which a ransom note resides.</description>
<type>string_generator</type>
<type>local_calculation</type>
<platform>linux</platform>
<read_fact>name</read_fact>
<output_type>generated_strings</output_type>
</generator>

View File

@@ -0,0 +1,13 @@
#Ransom:
Dear Sir/Madam:
As you no doubt know by this time, your child, <%= self.name %> has been kidnapped. Allow us to assure you that he is at present well and safe. You need fear no physical harm for him, provided you listen up carefully to the following instructions and to such others as you will receive by future communications. Should you, however, disobey any of our instructions, even slightly, his death will be the penalty.
###1. For obvious reasons make absolutely no attempt to communicate with either police authorities or any private agency. Should you already have communicated with the police, allow them to continue their investigations, but do not mention this letter.
###2. Secure before noon today £10,000. This money must be composed entirely of old bills of the following denominations: £2000 in £20 bills, £8000 in £50 bills. The money must be old. Any attempt to include new or marked bills will render the entire venture futile.
###3. The money should be placed in a large cigar box, or if this is impossible, in a heavy cardboard box, securely closed and wrapped in white paper. The wrapping paper should be sealed at all openings with sealing wax.
###4. Have the money with you, prepared as directed above, and remain at home after one o'clock. See that the telephone is not in use."