diff --git a/lib/constants.rb b/lib/constants.rb index 145825fe3..00af3249f 100644 --- a/lib/constants.rb +++ b/lib/constants.rb @@ -81,8 +81,10 @@ module Constants OS_LINUX_IMG = 'linux.png' OS_MAC_UA_STR = 'Mac' OS_MAC_IMG = 'mac.png' + OS_IPHONE_UA_STR = 'iPhone' + OS_IPHONE_IMG = 'iphone.png' end end -end \ No newline at end of file +end diff --git a/lib/model/browserdetails.rb b/lib/model/browserdetails.rb index f4e127cce..6a62ad6bd 100644 --- a/lib/model/browserdetails.rb +++ b/lib/model/browserdetails.rb @@ -82,6 +82,7 @@ class BrowserDetails return BeEF::Constants::Os::OS_UNKNOWN_IMG if ua_string.nil? # Unknown return BeEF::Constants::Os::OS_WINDOWS_IMG if ua_string.include? BeEF::Constants::Os::OS_WINDOWS_UA_STR # Windows return BeEF::Constants::Os::OS_LINUX_IMG if ua_string.include? BeEF::Constants::Os::OS_LINUX_UA_STR # Linux + return BeEF::Constants::Os::OS_IPHONE_IMG if ua_string.include? BeEF::Constants::Os::OS_IPHONE_UA_STR # iPhone - do this before Mac, because it includes Mac return BeEF::Constants::Os::OS_MAC_IMG if ua_string.include? BeEF::Constants::Os::OS_MAC_UA_STR # Mac OS X BeEF::Constants::Os::OS_UNKNOWN_IMG @@ -90,4 +91,4 @@ class BrowserDetails end end -end \ No newline at end of file +end diff --git a/modules/beefjs/os.js b/modules/beefjs/os.js index 668a1a42e..f7efd172f 100644 --- a/modules/beefjs/os.js +++ b/modules/beefjs/os.js @@ -58,6 +58,10 @@ beef.os = { return (this.ua.match('(Mac_PowerPC)|(Macintosh)|(MacIntel)')) ? true : false; }, + isIphone: function() { + return (this.ua.indexOf('iPhone') != -1) ? true : false; + }, + isQNX: function() { return (this.ua.indexOf('QNX')) ? true : false; }, @@ -83,6 +87,9 @@ beef.os = { //linux if(this.isLinux()) return 'Linux'; if(this.isSunOS()) return 'Sun OS'; + + //iPhone + if (this.isIphone()) return 'iPhone'; //macintosh if(this.isMacintosh()) { @@ -100,4 +107,4 @@ beef.os = { } }; -beef.regCmp('beef.net.os'); \ No newline at end of file +beef.regCmp('beef.net.os'); diff --git a/public/images/icons/iphone.png b/public/images/icons/iphone.png new file mode 100644 index 000000000..ab4a8cc31 Binary files /dev/null and b/public/images/icons/iphone.png differ