mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-21 11:18:06 +00:00
encoders/string/binary: ASCII to Binary encoder
This commit is contained in:
0
modules/encoders/string/binary/binary.pp
Normal file
0
modules/encoders/string/binary/binary.pp
Normal file
0
modules/encoders/string/binary/manifests/.no_puppet
Normal file
0
modules/encoders/string/binary/manifests/.no_puppet
Normal file
15
modules/encoders/string/binary/secgen_local/local.rb
Normal file
15
modules/encoders/string/binary/secgen_local/local.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/ruby
|
||||
require 'base64'
|
||||
require_relative '../../../../../lib/objects/local_string_encoder.rb'
|
||||
class BinaryEncoder < StringEncoder
|
||||
def initialize
|
||||
super
|
||||
self.module_name = 'Binary Encoder'
|
||||
end
|
||||
|
||||
def encode(str)
|
||||
str.unpack('B*').first
|
||||
end
|
||||
end
|
||||
|
||||
BinaryEncoder.new.run
|
||||
20
modules/encoders/string/binary/secgen_metadata.xml
Normal file
20
modules/encoders/string/binary/secgen_metadata.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<encoder xmlns="http://www.github/cliffe/SecGen/encoder"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.github/cliffe/SecGen/encoder">
|
||||
<name>Binary Encoder</name>
|
||||
<author>Thomas Shaw</author>
|
||||
<module_license>MIT</module_license>
|
||||
<description>Converts a String to Binary.</description>
|
||||
|
||||
<type>ascii_reversable</type>
|
||||
<type>binary_encoder</type>
|
||||
<type>string_encoder</type>
|
||||
<platform>linux</platform>
|
||||
<platform>windows</platform>
|
||||
|
||||
<read_fact>strings_to_encode</read_fact>
|
||||
|
||||
<output_type>encoded_strings</output_type>
|
||||
</encoder>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<scenario xmlns="http://www.github/cliffe/SecGen/scenario"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.github/cliffe/SecGen/scenario">
|
||||
|
||||
<system>
|
||||
<system_name>example_server</system_name>
|
||||
<base platform="linux"/>
|
||||
|
||||
<!--select a vulnerability that leaks strings-->
|
||||
<vulnerability read_fact="strings_to_leak">
|
||||
<!--direct the output from below into strings_to_leak-->
|
||||
<input into="strings_to_leak">
|
||||
<encoder type="binary_encoder">
|
||||
<input into="strings_to_encode">
|
||||
<generator type="flag_generator"/>
|
||||
</input>
|
||||
</encoder>
|
||||
</input>
|
||||
</vulnerability>
|
||||
|
||||
<network type="private_network" range="dhcp"/>
|
||||
</system>
|
||||
|
||||
</scenario>
|
||||
Reference in New Issue
Block a user