diff --git a/core/main/client/hardware.js b/core/main/client/hardware.js index f498c53ac..3376aceea 100644 --- a/core/main/client/hardware.js +++ b/core/main/client/hardware.js @@ -49,25 +49,42 @@ beef.hardware = { return (this.ua.match('Kindle')) ? true : false; }, + isHtc: function() { + return (this.ua.match('HTC')) ? true : false; + }, + + isEricsson: function() { + return (this.ua.match('Ericsson')) ? true : false; + }, + + isNokia: function() { + return (this.ua.match('Nokia')) ? true : false; + }, + + isMotorola: function() { + return (this.ua.match('Motorola')) ? true : false; + }, + + isGoogle: function() { + return (this.ua.match('Nexus One')) ? true : false; + }, + getName: function() { - if(this.isNokia()) { - - if (this.ua.indexOf('Maemo Browser') != -1) return 'Maemo'; - if (this.ua.match('(SymbianOS)|(Symbian OS)')) return 'SymbianOS'; - if (this.ua.indexOf('Symbian') != -1) return 'Symbian'; - - //return 'Nokia'; - } - + if (this.isNokia()) return 'Nokia'; if (this.isWinPhone()) return 'Windows Phone'; if (this.isBlackBerry()) return 'BlackBerry'; if (this.isIphone()) return 'iPhone'; if (this.isIpad()) return 'iPad'; if (this.isIpod()) return 'iPod'; if (this.isKindle()) return 'Kindle'; + if (this.isHtc()) return 'HTC'; + if (this.isMotorola()) return 'Motorola'; + if (this.isZune()) return 'Zune'; + if (this.isGoogle()) return 'Google'; + if (this.isEricsson()) return 'Ericsson'; - return 'unknown'; + return 'Unknown'; } }; diff --git a/core/main/constants/hardware.rb b/core/main/constants/hardware.rb index 63958a210..12386ef78 100644 --- a/core/main/constants/hardware.rb +++ b/core/main/constants/hardware.rb @@ -30,15 +30,23 @@ module Constants HW_IPOD_IMG = 'ipod.jpg' HW_BLACKBERRY_UA_STR = 'BlackBerry' HW_BLACKBERRY_IMG = 'blackberry.png' - HW_ANDROID_UA_STR = 'Android' - HW_ANDROID_IMG = 'android.png' HW_WINPHONE_UA_STR = 'Windows Phone' HW_WINPHONE_IMG = 'win.png' HW_ZUNE_UA_STR = 'ZuneWP7' HW_ZUNE_IMG = 'zune.gif' HW_KINDLE_UA_STR = 'Kindle' HW_KINDLE_IMG = 'kindle.png' - HW_ALL_UA_STR = 'All' + HW_NOKIA_UA_STR = 'Nokia' + HW_NOKIA_IMG = 'nokia.ico' + HW_HTC_UA_STR = 'HTC' + HW_HTC_IMG = 'htc.ico' + HW_MOTOROLA_UA_STR = 'motorola' + HW_MOTOROLA_IMG = 'motorola.png' + HW_GOOGLE_UA_STR = 'Nexus One' + HE_GOOGLE_IM = 'nexus.png' + HW_ERICSSON_UA_STR = 'Ericsson' + HW_ERICSSON_IMG = 'sony_ericsson.png' + HW_ALL_UA_STR = 'All' # Attempt to match operating system string to constant # @param [String] name Name of operating system @@ -53,14 +61,22 @@ module Constants HW_IPOD_UA_STR when /blackberry/ HW_BLACKBERRY_UA_STR - when /android/ - HW_ANDROID_UA_STR when /windows phone/ HW_WINPHONE_UA_STR when /zune/ HW_ZUNE_UA_STR when /kindle/ HW_KINDLE_UA_STR + when /nokia/ + HW_NOKIA_UA_STR + when /motorola/ + HW_MOTOROLA_UA_STR + when /htc/ + HW_HTC_UA_STR + when /google/ + HW_GOOGLE_UA_STR + when /ericsson/ + HW_ERICSSON_UA_STR else 'ALL' end diff --git a/core/main/models/browserdetails.rb b/core/main/models/browserdetails.rb index ae3868691..3ac2cd2af 100644 --- a/core/main/models/browserdetails.rb +++ b/core/main/models/browserdetails.rb @@ -118,9 +118,16 @@ module Models return BeEF::Core::Constants::Hardware::HW_WINPHONE_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_WINPHONE_UA_STR return BeEF::Core::Constants::Hardware::HW_ZUNE_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_ZUNE_UA_STR + return BeEF::Core::Constants::Hardware::HW_BLACKBERRY_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_BLACKBERRY_UA_STR return BeEF::Core::Constants::Hardware::HW_IPHONE_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_IPHONE_UA_STR return BeEF::Core::Constants::Hardware::HW_IPAD_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_IPAD_UA_STR return BeEF::Core::Constants::Hardware::HW_IPOD_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_IPOD_UA_STR + return BeEF::Core::Constants::Hardware::HW_KINDLE_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_KINDLE_UA_STR + return BeEF::Core::Constants::Hardware::HW_NOKIA_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_NOKIA_UA_STR + return BeEF::Core::Constants::Hardware::HW_MOTOROLA_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_MOTOROLA_UA_STR + return BeEF::Core::Constants::Hardware::HW_HTC_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_HTC_UA_STR + return BeEF::Core::Constants::Hardware::HW_GOOGLE_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_GOOGLE_UA_STR + return BeEF::Core::Constants::Hardware::HW_ERICSSON_IMG if ua_string.include? BeEF::Core::Constants::Hardware::HW_ERICSSON_UA_STR BeEF::Core::Constants::Hardware::HW_UNKNOWN_IMG diff --git a/extensions/admin_ui/media/images/icons/htc.ico b/extensions/admin_ui/media/images/icons/htc.ico new file mode 100644 index 000000000..a4b722423 Binary files /dev/null and b/extensions/admin_ui/media/images/icons/htc.ico differ diff --git a/extensions/admin_ui/media/images/icons/motorola.png b/extensions/admin_ui/media/images/icons/motorola.png new file mode 100644 index 000000000..fee6d6e65 Binary files /dev/null and b/extensions/admin_ui/media/images/icons/motorola.png differ diff --git a/extensions/admin_ui/media/images/icons/nexus.png b/extensions/admin_ui/media/images/icons/nexus.png new file mode 100644 index 000000000..16ffc743b Binary files /dev/null and b/extensions/admin_ui/media/images/icons/nexus.png differ diff --git a/extensions/admin_ui/media/images/icons/nokia.ico b/extensions/admin_ui/media/images/icons/nokia.ico new file mode 100644 index 000000000..fe5497301 Binary files /dev/null and b/extensions/admin_ui/media/images/icons/nokia.ico differ diff --git a/extensions/admin_ui/media/images/icons/sony_ericsson.png b/extensions/admin_ui/media/images/icons/sony_ericsson.png new file mode 100644 index 000000000..1dab4a8d2 Binary files /dev/null and b/extensions/admin_ui/media/images/icons/sony_ericsson.png differ