Added Brave browser detection.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
{"name": "Get Internal IP (WebRTC)",
|
||||
"author": "antisnatchor",
|
||||
"browser": "FF",
|
||||
"browser_version": ">= 31",
|
||||
"os": "Linux",
|
||||
"browser": "C",
|
||||
"browser_version": "ALL",
|
||||
"os": "OSX",
|
||||
"os_version": "ALL",
|
||||
"modules": [
|
||||
{"name": "get_internal_ip_webrtc",
|
||||
@@ -51,6 +51,14 @@ beef.browser = {
|
||||
return (window.navigator.userAgent.match(/Odyssey Web Browser/) != null && window.navigator.userAgent.match(/OWB\/\d+\.\d/) != null);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if Brave
|
||||
* @example: beef.browser.isBrave()
|
||||
*/
|
||||
isBrave: function(){
|
||||
return (window.navigator.userAgent.match(/brave\/\d+\.\d/) != null && window.navigator.userAgent.match(/Brave\/\d+\.\d/) != null);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if IE6.
|
||||
* @example: beef.browser.isIE6()
|
||||
@@ -1979,6 +1987,10 @@ beef.browser = {
|
||||
return 'OD'
|
||||
}
|
||||
; // Odyssey any version
|
||||
if (this.isBrave()) {
|
||||
return 'BR'
|
||||
}
|
||||
; // Brave any version
|
||||
return 'UNKNOWN'; // Unknown UA
|
||||
},
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ module Constants
|
||||
A = 'A' # Avant
|
||||
MI = 'MI' # Midori
|
||||
OD = 'OD' # Odyssey
|
||||
BR = 'BR' # Brave
|
||||
ALL = 'ALL' # ALL
|
||||
UNKNOWN = 'UN' # Unknown
|
||||
|
||||
@@ -33,6 +34,7 @@ module Constants
|
||||
FRIENDLY_A_NAME = 'Avant'
|
||||
FRIENDLY_MI_NAME = 'Midori'
|
||||
FRIENDLY_OD_NAME = 'Odyssey'
|
||||
FRIENDLY_BR_NAME = 'Brave'
|
||||
FRIENDLY_UN_NAME = 'UNKNOWN'
|
||||
|
||||
# Attempt to retrieve a browser's friendly name
|
||||
@@ -51,6 +53,7 @@ module Constants
|
||||
when A ; return FRIENDLY_A_NAME
|
||||
when MI ; return FRIENDLY_MI_NAME
|
||||
when OD ; return FRIENDLY_OD_NAME
|
||||
when BR ; return FRIENDLY_BR_NAME
|
||||
when UNKNOWN; return FRIENDLY_UN_NAME
|
||||
end
|
||||
|
||||
|
||||
@@ -68,6 +68,8 @@ module Models
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_OPERA_IMG if browser.eql? 'O' # Opera
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_MIDORI_IMG if browser.eql? 'MI' # Midori
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_ODYSSEY_IMG if browser.eql? 'OD' # Odyssey
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_BRAVE_IMG if browser.eql? 'BR' # Brave
|
||||
|
||||
|
||||
BeEF::Extension::AdminUI::Constants::Agents::AGENT_UNKNOWN_IMG
|
||||
end
|
||||
@@ -123,7 +125,7 @@ module Models
|
||||
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
|
||||
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
|
||||
|
||||
|
||||
@@ -43,8 +43,7 @@ module Models
|
||||
# @return [String] String constant containing browser icon path
|
||||
def browser_icon
|
||||
agent = JSON.parse(self.httpheaders)['user-agent'].to_s || nil
|
||||
puts 'A'*100
|
||||
|
||||
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_UNKNOWN_IMG if agent.nil?
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_IE_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_IE_UA_STR
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_FIREFOX_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_FIREFOX_UA_STR
|
||||
@@ -55,7 +54,8 @@ puts 'A'*100
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_OPERA_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_OPERA_UA_STR
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_MIDORI_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_MIDORI_UA_STR
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_ODYSSEY_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_ODYSSEY_UA_STR
|
||||
|
||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_BRAVE_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_BRAVE_UA_STR
|
||||
|
||||
BeEF::Extension::AdminUI::Constants::Agents::AGENT_UNKNOWN_IMG
|
||||
end
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ module Constants
|
||||
AGENT_MIDORI_IMG = 'midori.png'
|
||||
AGENT_ODYSSEY_UA_STR = 'Odyssey Web Browser'
|
||||
AGENT_ODYSSEY_IMG = 'odyssey.png'
|
||||
AGENT_BRAVE_UA_STR = 'brave'
|
||||
AGENT_BRAVE_IMG = 'brave.png'
|
||||
|
||||
end
|
||||
|
||||
|
||||
BIN
extensions/admin_ui/media/images/icons/brave.png
Normal file
BIN
extensions/admin_ui/media/images/icons/brave.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Reference in New Issue
Block a user