From c6780f4a9ed60933e67cecd6b017159b47807ff6 Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Sun, 15 Jan 2017 16:12:08 +0000 Subject: [PATCH] flag{generated_flag} format for flags --- modules/generators/flag/flag_base64/secgen_local/local.rb | 2 +- modules/generators/flag/flag_hex/secgen_local/local.rb | 2 +- modules/generators/flag/flag_words/secgen_local/local.rb | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/generators/flag/flag_base64/secgen_local/local.rb b/modules/generators/flag/flag_base64/secgen_local/local.rb index efd41593e..bd273a113 100644 --- a/modules/generators/flag/flag_base64/secgen_local/local.rb +++ b/modules/generators/flag/flag_base64/secgen_local/local.rb @@ -8,7 +8,7 @@ class Base64FlagGenerator < StringGenerator def generate require 'securerandom' - self.outputs << "flag:#{SecureRandom.base64}" + self.outputs << "flag{#{SecureRandom.base64}}" end end diff --git a/modules/generators/flag/flag_hex/secgen_local/local.rb b/modules/generators/flag/flag_hex/secgen_local/local.rb index 96ac2510d..b148d8225 100644 --- a/modules/generators/flag/flag_hex/secgen_local/local.rb +++ b/modules/generators/flag/flag_hex/secgen_local/local.rb @@ -8,7 +8,7 @@ class HexGenerator < StringGenerator def generate require 'securerandom' - self.outputs << "flag:#{SecureRandom.hex}" + self.outputs << "flag{#{SecureRandom.hex}}" end end diff --git a/modules/generators/flag/flag_words/secgen_local/local.rb b/modules/generators/flag/flag_words/secgen_local/local.rb index e2a281810..fd4887d44 100644 --- a/modules/generators/flag/flag_words/secgen_local/local.rb +++ b/modules/generators/flag/flag_words/secgen_local/local.rb @@ -9,8 +9,7 @@ class WordGenerator < StringGenerator def generate file = File.readlines("#{ROOT_DIR}/lib/resources/wordlists/wordlist") - self.outputs << "flag:" + file.sample.chomp + file.sample.chomp + file.sample.chomp + file.sample.chomp + file.sample.chomp - + self.outputs << 'flag{' + file.sample.chomp + file.sample.chomp + file.sample.chomp + file.sample.chomp + file.sample.chomp + '}' end end