From c01febbe9b9de39d77d259f9704d711932c78673 Mon Sep 17 00:00:00 2001 From: Jonathan Echavarria Date: Thu, 5 Oct 2017 09:39:39 -0400 Subject: [PATCH 1/6] added pushover channel --- extensions/notifications/channels/pushover.rb | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 extensions/notifications/channels/pushover.rb diff --git a/extensions/notifications/channels/pushover.rb b/extensions/notifications/channels/pushover.rb new file mode 100644 index 000000000..9d0c7f3b2 --- /dev/null +++ b/extensions/notifications/channels/pushover.rb @@ -0,0 +1,23 @@ +require 'rushover' + +module BeEF +module Extension +module Notifications +module Channels + + class Pushover + + def initialize(message) + @config = BeEF::Core::Configuration.instance + + # Configure the Pushover Client + client = Rushover::Client.new(@config.get('beef.extension.notifications.pushover.app_key')) + + # Pushover.notification(message: message, title: "BeEF Notification") + client.notify(@config.get('beef.extension.notifications.pushover.user_key'), message) + end + end +end +end +end +end From d47303f0e7b2af37f89b6b0b89b6cac1bca4ae71 Mon Sep 17 00:00:00 2001 From: Jonathan Echavarria Date: Thu, 5 Oct 2017 09:40:36 -0400 Subject: [PATCH 2/6] changed config.yaml to add pushover support --- extensions/notifications/config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/notifications/config.yaml b/extensions/notifications/config.yaml index 4b34c1b38..e7e430592 100644 --- a/extensions/notifications/config.yaml +++ b/extensions/notifications/config.yaml @@ -23,3 +23,8 @@ beef: to_address: receipient_email_address smtp_host: 127.0.0.1 smtp_port: 25 + pushover: + enable: true + user_key: pushover_user_key + app_key: pushover_api_key + From 409d9962bb982ca0953612d81b9fcbef1e9df0ed Mon Sep 17 00:00:00 2001 From: Jonathan Echavarria Date: Thu, 5 Oct 2017 09:43:11 -0400 Subject: [PATCH 3/6] modified the notifications extenion to add pushover support --- extensions/notifications/notifications.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/notifications/notifications.rb b/extensions/notifications/notifications.rb index f2c67f5cb..58b03409e 100644 --- a/extensions/notifications/notifications.rb +++ b/extensions/notifications/notifications.rb @@ -6,6 +6,7 @@ require 'extensions/notifications/channels/tweet' require 'extensions/notifications/channels/email' +require 'extensions/notifications/channels/pushover' module BeEF module Extension @@ -39,6 +40,10 @@ module Notifications to_address = @config.get('beef.extension.notifications.email.to_address') BeEF::Extension::Notifications::Channels::Email.new(to_address,message) end + + if @config.get('beef.extension.notifications.pushover.enable') == true + BeEF::Extension::Notifications::Channels::Pushover.new(message) + end end end From 27d11668692b43ccae36c0c0838e6ad63249c58c Mon Sep 17 00:00:00 2001 From: Jonathan Echavarria Date: Thu, 5 Oct 2017 09:44:35 -0400 Subject: [PATCH 4/6] set pushover to be disabled by default --- extensions/notifications/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/notifications/config.yaml b/extensions/notifications/config.yaml index e7e430592..e12fffc66 100644 --- a/extensions/notifications/config.yaml +++ b/extensions/notifications/config.yaml @@ -24,7 +24,7 @@ beef: smtp_host: 127.0.0.1 smtp_port: 25 pushover: - enable: true + enable: false user_key: pushover_user_key app_key: pushover_api_key From 1b5e56e4a61d16e25f1557d7c586d022812d880b Mon Sep 17 00:00:00 2001 From: Jonathan Echavarria Date: Thu, 5 Oct 2017 09:45:59 -0400 Subject: [PATCH 5/6] removed debug line from pushover notification channel --- extensions/notifications/channels/pushover.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/notifications/channels/pushover.rb b/extensions/notifications/channels/pushover.rb index 9d0c7f3b2..1e546dbb0 100644 --- a/extensions/notifications/channels/pushover.rb +++ b/extensions/notifications/channels/pushover.rb @@ -13,7 +13,6 @@ module Channels # Configure the Pushover Client client = Rushover::Client.new(@config.get('beef.extension.notifications.pushover.app_key')) - # Pushover.notification(message: message, title: "BeEF Notification") client.notify(@config.get('beef.extension.notifications.pushover.user_key'), message) end end From 63e9e721948c036cfb98ff42c8d41faa3120d5ad Mon Sep 17 00:00:00 2001 From: Jonathan Echavarria Date: Thu, 5 Oct 2017 09:47:43 -0400 Subject: [PATCH 6/6] add gem install warning to notifications config --- extensions/notifications/config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/notifications/config.yaml b/extensions/notifications/config.yaml index e12fffc66..735bf329b 100644 --- a/extensions/notifications/config.yaml +++ b/extensions/notifications/config.yaml @@ -23,6 +23,7 @@ beef: to_address: receipient_email_address smtp_host: 127.0.0.1 smtp_port: 25 + # Make sure you do 'gem install rushover' before enabling this feature. pushover: enable: false user_key: pushover_user_key