From 4b5804819857ddb5679395bfdc899b5162d86ba2 Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Tue, 18 Apr 2023 20:30:40 +0200 Subject: [PATCH] Update browsers with msie and Opera --- plugins/display/browsers.py | 2 ++ plugins/display/subdomains.py | 2 -- plugins/post_analysis/browsers.py | 29 ++++++++++++++++++++++------- resources/icon/browser/msie.png | Bin 0 -> 236 bytes resources/icon/browser/opera.png | Bin 0 -> 222 bytes 5 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 resources/icon/browser/msie.png create mode 100644 resources/icon/browser/opera.png diff --git a/plugins/display/browsers.py b/plugins/display/browsers.py index 56cf975..cb88e17 100644 --- a/plugins/display/browsers.py +++ b/plugins/display/browsers.py @@ -60,6 +60,8 @@ browser_icons = { 'Safari':'safari', 'Firefox':'firefox', 'Mozilla':'mozilla', + 'Internet Explorer':'msie', + 'Opera':'opera', } class IWLADisplayBrowsers(IPlugin): diff --git a/plugins/display/subdomains.py b/plugins/display/subdomains.py index 84cb1dd..6c127bf 100644 --- a/plugins/display/subdomains.py +++ b/plugins/display/subdomains.py @@ -22,8 +22,6 @@ from iwla import IWLA from iplugin import IPlugin from display import * -import awstats_data - """ Display hook diff --git a/plugins/post_analysis/browsers.py b/plugins/post_analysis/browsers.py index 2191135..ea5adff 100644 --- a/plugins/post_analysis/browsers.py +++ b/plugins/post_analysis/browsers.py @@ -23,8 +23,6 @@ import re from iwla import IWLA from iplugin import IPlugin -import awstats_data - """ Post analysis hook @@ -55,15 +53,18 @@ Statistics deletion : None """ -browser_order = ['android', 'iphone', 'xbox', 'edge', 'chrome', 'safari', 'firefox', 'curl', 'wget', 'w3m'] +browser_order = ['android', 'iphone', 'xbox', 'edge', 'opera', 'chrome', 'safari', 'firefox', 'ie', 'mozilla', 'curl', 'wget', 'w3m'] browser_hashid = { 'android':'Android', 'iphone':'iPhone', 'edge':'Edg', - 'chrome':'Chrom', + 'chrome':['Chrom', 'Chrome'], 'safari':'Safari', 'firefox':'Firefox', + 'ie':'MSIE', + 'mozilla':'Mozilla', + 'opera':'OPR', 'xbox':'Xbox', 'curl':'curl', 'wget':'Wget', @@ -77,6 +78,9 @@ browser_name = { 'chrome':'Chrome', 'safari':'Safari', 'firefox':'Firefox', + 'ie':'Internet Explorer', + 'mozilla':'Mozilla', + 'opera':'Opera', 'xbox':'Xbox', 'curl':'Curl', 'wget':'Wget', @@ -101,9 +105,20 @@ class IWLAPostAnalysisBrowsers(IPlugin): name = 'Unknown' for browser in browser_order: - if browser_hashid[browser] in user_agent: - name = browser_name[browser] - break + reference = browser_hashid[browser] + if type(reference) == list: + for ref in reference: + if ref in user_agent: + name = browser_name[browser] + break + if name != 'Unknown': + break + else: + if browser_hashid[browser] in user_agent: + name = browser_name[browser] + break + if name == 'Unknown' and 'Macintosh' in user_agent: + name = 'Safari' super_hit['browser'] = name break else: diff --git a/resources/icon/browser/msie.png b/resources/icon/browser/msie.png new file mode 100644 index 0000000000000000000000000000000000000000..dce382c5120f971f2a06adaf6933062de363e1bf GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^d?3ui3?$#C89V|~x&b~RuK)l4|Ni~|$!l+Grd^+~ z{LaSH-yL$FNA$ctcl(E4_<_o;-#6|(ZyPpUGxp)jj~~NZZyf+?WGo5t3ubV5b|VeQ z$@O$`45?sDW?**YSovlZ!;+@UUD8aE5)m