From e76712e393dc01480980c825ca7e5c8704ffca28 Mon Sep 17 00:00:00 2001 From: sanchezzzhak Date: Fri, 21 Oct 2022 20:53:00 +0300 Subject: [PATCH 1/3] feat(os) detect os ZorinOS feat(os) detect Android by OMDroid prefix feat(client) detect apps: Microsoft Office, Microsoft Office Mobile, Microsoft Office Visio, Microsoft Office Word, Microsoft Lync ref #7275 --- Parser/OperatingSystem.php | 3 +- Tests/Parser/Client/fixtures/pim.yml | 6 ++ Tests/Parser/fixtures/oss.yml | 8 +++ Tests/fixtures/mobile_apps.yml | 96 ++++++++++++++++++++++++++++ regexes/client/mobile_apps.yml | 13 +++- regexes/oss.yml | 8 ++- 6 files changed, 129 insertions(+), 5 deletions(-) diff --git a/Parser/OperatingSystem.php b/Parser/OperatingSystem.php index d2fbbe5e95..9d6e12a866 100644 --- a/Parser/OperatingSystem.php +++ b/Parser/OperatingSystem.php @@ -166,6 +166,7 @@ class OperatingSystem extends AbstractParser 'XBT' => 'Xubuntu', 'YNS' => 'YunOS', 'ZEN' => 'Zenwalk', + 'ZOR' => 'ZorinOS', 'IOS' => 'iOS', 'POS' => 'palmOS', 'WOS' => 'webOS', @@ -198,7 +199,7 @@ class OperatingSystem extends AbstractParser 'ORD', 'TOS', 'RSO', 'DEE', 'FRE', 'MAG', 'FEN', 'CAI', 'PCL', 'HAS', 'LOS', 'DVK', 'ROK', 'OWR', 'OTV', 'KTV', 'PUR', 'PLA', 'FUC', 'PAR', 'FOR', 'MON', 'KAN', 'ZEN', 'LND', 'LNS', 'CHN', 'AMZ', 'TEN', 'CST', - 'NOV', 'ROU', + 'NOV', 'ROU', 'ZOR' ], 'Mac' => ['MAC'], 'Mobile Gaming Console' => ['PSP', 'NDS', 'XBX'], diff --git a/Tests/Parser/Client/fixtures/pim.yml b/Tests/Parser/Client/fixtures/pim.yml index a88b803d02..7d69e21d98 100644 --- a/Tests/Parser/Client/fixtures/pim.yml +++ b/Tests/Parser/Client/fixtures/pim.yml @@ -227,3 +227,9 @@ type: pim name: NAVER Mail version: 2.2.2 +- + user_agent: Microsoft Office/16.0 (Microsoft Outlook 16.0.12329; Pro), Mozilla/4.0 (compatible; ms-office; MSOffice 16) + client: + type: pim + name: Microsoft Outlook + version: 16.0.12329 diff --git a/Tests/Parser/fixtures/oss.yml b/Tests/Parser/fixtures/oss.yml index 4d3e1542d8..2ef7dfdd1c 100644 --- a/Tests/Parser/fixtures/oss.yml +++ b/Tests/Parser/fixtures/oss.yml @@ -3590,3 +3590,11 @@ Sec-CH-UA-Full-Version: "92.0.4515.105" Sec-CH-UA-Platform-Version: "10; HarmonyOS" Sec-CH-UA-Model: "MGA-AL00" +- + user_agent: Mozilla/5.0 (X11; Linux i686; Zorin OS 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.0 Maxthon/1.0.5.3 Safari/537.36 + os: + name: ZorinOS + hort_name: ZOR + version: "9" + platform: x86 + family: GNU/Linux diff --git a/Tests/fixtures/mobile_apps.yml b/Tests/fixtures/mobile_apps.yml index 1ac9bfcc17..f19ee7d9c6 100644 --- a/Tests/fixtures/mobile_apps.yml +++ b/Tests/fixtures/mobile_apps.yml @@ -1789,3 +1789,99 @@ model: NXT-CL00 os_family: Android browser_family: Unknown +- + user_agent: Mozilla/4.0 (compatible; ms-office; MSOffice 16) + os: + name: Windows + version: "" + platform: "" + client: + type: mobile app + name: Microsoft Office + version: "16" + device: + type: desktop + brand: "" + model: "" + os_family: Windows + browser_family: Unknown +- + user_agent: Microsoft Office/16.0 (OMDroid 12; officemobile 16.0.15629; Pro) + os: + name: Android + version: "12" + platform: "" + client: + type: mobile app + name: Microsoft Office Mobile + version: 16.0.15629 + device: + type: "" + brand: "" + model: "" + os_family: Android + browser_family: Unknown +- + user_agent: Microsoft Office/16.0 (Windows NT 6.2; Microsoft Office SyncProc 16.0.5056; Pro) + os: + name: Windows + version: "8" + platform: "" + client: + type: mobile app + name: Microsoft Office + version: 16.0.5056 + device: + type: desktop + brand: "" + model: "" + os_family: Windows + browser_family: Unknown +- + user_agent: Microsoft Office Visio 2013 (15.0.4693) Windows NT 6.2 + os: + name: Windows + version: "8" + platform: "" + client: + type: mobile app + name: Microsoft Office Visio + version: 15.0.4693 + device: + type: desktop + brand: "" + model: "" + os_family: Windows + browser_family: Unknown +- + user_agent: Microsoft Office Word 2013 (15.0.4693) Windows NT 6.2 + os: + name: Windows + version: "8" + platform: "" + client: + type: mobile app + name: Microsoft Office Word + version: 15.0.4693 + device: + type: desktop + brand: "" + model: "" + os_family: Windows + browser_family: Unknown +- + user_agent: Microsoft Office/15.0 (Windows NT 6.2; Microsoft Lync 15.0.4675; Pro) + os: + name: Windows + version: "8" + platform: "" + client: + type: mobile app + name: Microsoft Lync + version: 15.0.4675 + device: + type: desktop + brand: "" + model: "" + os_family: Windows + browser_family: Unknown diff --git a/regexes/client/mobile_apps.yml b/regexes/client/mobile_apps.yml index fa23ac511e..2d1c0e135e 100644 --- a/regexes/client/mobile_apps.yml +++ b/regexes/client/mobile_apps.yml @@ -417,9 +417,18 @@ name: '1Password' version: '$1' -- regex: '(?:Microsoft Office )?(Access|Excel|OneDrive for Business|OneNote|PowerPoint|Project|Publisher|Visio|Word)[ /](\d+\.[\d.]*)' +- regex: '(?:Microsoft Office )?(Access|Excel|OneDrive for Business|OneNote|PowerPoint|Project|Publisher|Visio|Word)(?: 20\d{2})?[ /]\(?(\d+\.[\d.]*)' name: 'Microsoft Office $1' version: '$2' +- regex: '^Mozilla/4\.0 \(compatible; ms-office; MSOffice[ /]([\d\.]+)' + name: 'Microsoft Office' + version: '$1' +- regex: 'Microsoft Office SyncProc ([\d\.]+)' + name: 'Microsoft Office' + version: '$1' +- regex: 'Microsoft Lync ([\d\.]+)' + name: 'Microsoft Lync' + version: '$1' # https://play.google.com/store/apps/details?id=cn.wps.moffice_eng - regex: 'WpsM?office/([\d\.]+)' @@ -435,7 +444,7 @@ name: 'Microsoft Office' version: '' -- regex: 'Microsoft Office Mobile/([\d\.]+)' +- regex: '(?:Microsoft Office Mobile|officemobile)[ /]([\d\.]+)' name: 'Microsoft Office Mobile' version: '$1' diff --git a/regexes/oss.yml b/regexes/oss.yml index fc7cabf95b..dffe314e0f 100644 --- a/regexes/oss.yml +++ b/regexes/oss.yml @@ -316,7 +316,7 @@ name: 'Android' version: '' -- regex: 'Android OS/(\d+[\.\d]*)' +- regex: '(?:Android OS|OMDroid)[ /](\d+[\.\d]*)' name: 'Android' version: '$1' @@ -541,6 +541,10 @@ name: 'Mint' version: '$1' +- regex: 'Zorin OS (\d+)' + name: 'ZorinOS' + version: '$1' + - regex: 'Linux; .*((?:Debian|Knoppix|Mint|Ubuntu|Kubuntu|Xubuntu|Lubuntu|Fedora|Red Hat|Mandriva|Gentoo|Sabayon|Slackware|SUSE|CentOS|BackTrack))[ /](\d+[\.\d]+)' name: '$1' version: '$2' @@ -676,7 +680,7 @@ name: 'Windows' version: '3.1' -- regex: 'Windows|.+win32|Win64|MSDW|HandBrake Win Upd|Microsoft BITS' +- regex: 'Windows|.+win32|Win64|MSDW|HandBrake Win Upd|Microsoft BITS|ms-office; MSOffice' name: 'Windows' version: '' From 6973af3947323a41d5247f00c00121cbec6b11ea Mon Sep 17 00:00:00 2001 From: sanchezzzhak Date: Fri, 21 Oct 2022 20:57:11 +0300 Subject: [PATCH 2/3] fix: PHPCS --- Parser/OperatingSystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parser/OperatingSystem.php b/Parser/OperatingSystem.php index 9d6e12a866..cfaae2f75c 100644 --- a/Parser/OperatingSystem.php +++ b/Parser/OperatingSystem.php @@ -199,7 +199,7 @@ class OperatingSystem extends AbstractParser 'ORD', 'TOS', 'RSO', 'DEE', 'FRE', 'MAG', 'FEN', 'CAI', 'PCL', 'HAS', 'LOS', 'DVK', 'ROK', 'OWR', 'OTV', 'KTV', 'PUR', 'PLA', 'FUC', 'PAR', 'FOR', 'MON', 'KAN', 'ZEN', 'LND', 'LNS', 'CHN', 'AMZ', 'TEN', 'CST', - 'NOV', 'ROU', 'ZOR' + 'NOV', 'ROU', 'ZOR', ], 'Mac' => ['MAC'], 'Mobile Gaming Console' => ['PSP', 'NDS', 'XBX'], From 89713e5283adcb6678536135f347faf8ca1f5070 Mon Sep 17 00:00:00 2001 From: sanchezzzhak Date: Fri, 21 Oct 2022 21:04:39 +0300 Subject: [PATCH 3/3] fix: test --- Tests/Parser/fixtures/oss.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Parser/fixtures/oss.yml b/Tests/Parser/fixtures/oss.yml index 2ef7dfdd1c..5db254fa1b 100644 --- a/Tests/Parser/fixtures/oss.yml +++ b/Tests/Parser/fixtures/oss.yml @@ -3594,7 +3594,7 @@ user_agent: Mozilla/5.0 (X11; Linux i686; Zorin OS 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.0 Maxthon/1.0.5.3 Safari/537.36 os: name: ZorinOS - hort_name: ZOR + short_name: ZOR version: "9" platform: x86 family: GNU/Linux