diff --git a/app/views/cli/core/banner.erb b/app/views/cli/core/banner.erb index a9323711..ea40726f 100644 --- a/app/views/cli/core/banner.erb +++ b/app/views/cli/core/banner.erb @@ -8,7 +8,7 @@ _______________________________________________________________ WordPress Security Scanner by the WPScan Team Version <%= WPScan::VERSION %> - Sponsored by Sucuri - https://sucuri.net +<%= ' ' * ((63 - WPScan::DB::Sponsor.text.length)/2) + WPScan::DB::Sponsor.text %> @_WPScan_, @ethicalhack3r, @erwan_lr, @_FireFart_ _______________________________________________________________ diff --git a/app/views/json/core/banner.erb b/app/views/json/core/banner.erb index 6a6daf37..be224777 100644 --- a/app/views/json/core/banner.erb +++ b/app/views/json/core/banner.erb @@ -7,5 +7,5 @@ "@erwan_lr", "@_FireFart_" ], - "sponsored_by": "Sucuri - https://sucuri.net" + "sponsor": <%= WPScan::DB::Sponsor.text.to_json %> }, diff --git a/lib/wpscan/db.rb b/lib/wpscan/db.rb index 3dbd5fb0..3dfe966b 100644 --- a/lib/wpscan/db.rb +++ b/lib/wpscan/db.rb @@ -7,6 +7,7 @@ require_relative 'db/plugins' require_relative 'db/themes' require_relative 'db/plugin' require_relative 'db/theme' +require_relative 'db/sponsor' require_relative 'db/wp_version' require_relative 'db/fingerprints' diff --git a/lib/wpscan/db/sponsor.rb b/lib/wpscan/db/sponsor.rb new file mode 100644 index 00000000..5e8dd321 --- /dev/null +++ b/lib/wpscan/db/sponsor.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module WPScan + module DB + class Sponsor + # @return [ Hash ] + def self.text + @text ||= file_path.exist? ? File.read(file_path).chomp : '' + end + + def self.file_path + @file_path ||= DB_DIR.join('sponsor.txt') + end + end + end +end diff --git a/lib/wpscan/db/updater.rb b/lib/wpscan/db/updater.rb index e177ac01..7e910eb8 100644 --- a/lib/wpscan/db/updater.rb +++ b/lib/wpscan/db/updater.rb @@ -9,7 +9,7 @@ module WPScan FILES = %w[ metadata.json wp_fingerprints.json timthumbs-v3.txt config_backups.txt db_exports.txt - dynamic_finders.yml LICENSE + dynamic_finders.yml LICENSE sponsor.txt ].freeze OLD_FILES = %w[ diff --git a/spec/fixtures/db/sponsor.txt b/spec/fixtures/db/sponsor.txt new file mode 100644 index 00000000..241e6d29 --- /dev/null +++ b/spec/fixtures/db/sponsor.txt @@ -0,0 +1 @@ +Sponsored By Kittens \ No newline at end of file