Skip to content

Commit

Permalink
Updates user agent detection in client library.
Browse files Browse the repository at this point in the history
  • Loading branch information
JB Lebrun committed Sep 11, 2018
1 parent b34fd0d commit ec4e7cb
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 39 deletions.
16 changes: 8 additions & 8 deletions engine/lib/tool/client.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @details Engine / Tool Library
* @file engine/lib/tool/client.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.32
* @version 1.0.33
* @date Creation: Jun 2007
* @date Modification: Sep 2018
* @copyright 2007 - 2018 CaMykS Team
Expand Down Expand Up @@ -1415,7 +1415,7 @@ function client_getUAInfos($ua=false) {
}

/* check Chrome/Safari/Firefox/Explorer compatible browsers, to be tested before usual browsers */
elseif (preg_match('/(YaBrowser|OPR|IceDragon|Dragon|CriOS|Adventurer|Sleipnir|BoBrowser|Dolfin|ChromePlus|Phoenix|Shiretoko|NS8|MiuiBrowser|SamsungBrowser\/CrossApp|SamsungBrowser|Vivaldi|Qt|Iceweasel|Puffin|Firebird|FBAV|app-ipad-CoteMaison|QQBrowser|PaleMoon|Arora|Edge|Cheshire|MicroMessenger|Getter|Dooble|amaya|Roccat|QupZilla|MMS|Iron|ACHEETAHI|OPiOS|Beonex|LibertyBrowser|LinkedIn|SeaMonkey|Cyberfox|Focus|Fennec|K-Meleon|CoolNovo|QuickLook|GSA|Electron|NG|FxiOS|Lotus-Notes|Chimera|Epiphany|Iridium|HeadlessChrome|QwantiOS|Blazer|TenFourFox|Silk|SailfishBrowser|coc_coc_browser|MZBrowser)\/([a-z0-9\._]*)?/i', $ua, $matches)) {
elseif (preg_match('/(YaBrowser|OPR|IceDragon|Dragon|CriOS|Adventurer|Sleipnir|BoBrowser|Dolfin|ChromePlus|Phoenix|Shiretoko|NS8|MiuiBrowser|SamsungBrowser\/CrossApp|SamsungBrowser|Vivaldi|Qt|Iceweasel|Puffin|Firebird|FBAV|app-ipad-CoteMaison|QQBrowser|PaleMoon|Arora|Edge|Cheshire|MicroMessenger|Getter|Dooble|amaya|Roccat|QupZilla|MMS|Iron|ACHEETAHI|OPiOS|Beonex|LibertyBrowser|LinkedIn|SeaMonkey|Cyberfox|Focus|Fennec|K-Meleon|CoolNovo|QuickLook|GSA|Electron|NG|FxiOS|Lotus-Notes|Chimera|Epiphany|Iridium|HeadlessChrome|QwantiOS|Blazer|TenFourFox|Silk|SailfishBrowser|coc_coc_browser|MZBrowser|2345Explorer)\/([a-z0-9\._]*)?/i', $ua, $matches)) {
$rep = array('OPR'=>'Opera', 'CriOS'=>'Chrome', 'Dragon'=>'IceDragon', 'NS8'=>'Netscape', 'Firebird'=>'Thunderbird', 'FBAV'=>'Facebook App', 'app-ipad-CoteMaison'=>'C&ocirc;t&eacute; Maison App', 'amaya'=>'Amaya', 'MMS'=>'Opera Neon', 'ACHEETAHI'=>'CM Browser', 'OPiOS'=>'Opera mini', 'Focus'=>'Firefox Focus', 'GSA'=>'Google Search App', 'NG'=>'Browser NG', 'FxiOS'=>'Firefox', 'Lotus-Notes'=>'Lotus Notes', 'QwantiOS'=>'Qwant', 'Blazer'=> 'Palm Blazer', 'MicroMessenger' => 'WeChat', 'SailfishBrowser' => 'Sailfish Browser', 'coc_coc_browser'=>'C&ocirc;c c&ocirc;c', 'MZBrowser' => 'Meizu Browser');
$infos = array_merge($infos, array(
'browser_title' => isset($rep[$matches[1]])?$rep[$matches[1]]:$matches[1],
Expand Down Expand Up @@ -2188,17 +2188,17 @@ function _client_getUAPropertiesMaxVersions() {
return array(
'system' => array(
'Mac OS X' => '10.15.0', // current is 10.13.x
'iOS' => '13', // current is 11.x
'Android' => '10', // current is 8.x.x
'iOS' => '14', // current is 12.x (beta)
'Android' => '11', // current is 9.x.x
),
'browser' => array(
'Firefox' => '64', // current is 61
'Chrome' => '71', // current is 69
'Chromium' => '71', // current is 69
'Firefox' => '65', // current is 62
'Chrome' => '72', // current is 69
'Chromium' => '72', // current is 69
'Internet Explorer' => '11.0.50', // latest
'Edge' => '45', // current is 40
'Opera' => '58', // current is 55
'Safari' => '14', // current is 11
'Safari' => '15', // current is 12 (beta)
),
);
}
Expand Down
12 changes: 11 additions & 1 deletion engine/lib/tool/clientBots/Bots.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @details Engine / Bot Library
* @file engine/lib/tool/clientBots/Bots.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.14
* @version 1.0.15
* @date Creation: May 2018
* @date Modification: Sep 2018
* @copyright 2018 CaMykS Team
Expand Down Expand Up @@ -3974,6 +3974,16 @@ function _client_getKnownBots() {
'engine_url' => 'http://www.seekport.com',
);

/* Qirina Hurdler */
$knownBots['qirina hurdler'] = array(
'platform_type' => 'bot',
'platform_format' => 'desktop',
'bot_title' => 'Qirina Hurdler',
'bot_url' => 'http://www.qirina.com/hurdler.html',
'engine_title' => 'Qirina',
'engine_url' => 'http://www.qirina.com/',
);

/* unknown bots */

/* SEOBulls - unknown bot */
Expand Down
14 changes: 12 additions & 2 deletions engine/lib/tool/clientBots/Generics.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientBots/Generics.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.4
* @version 1.0.5
* @date Creation: May 2018
* @date Modification: Jul 2018
* @date Modification: Sep 2018
* @copyright 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Expand Down Expand Up @@ -601,6 +601,16 @@ function _client_getKnownGenerics() {
'engine_url' => '',
);

/* akka-http */
$knownGenerics['akka-http'] = array(
'platform_type' => 'bot',
'platform_format' => 'desktop',
'bot_title' => 'akka-http',
'bot_url' => '',
'engine_title' => 'akka',
'engine_url' => 'https://akka.io/',
);

/* obot */
$knownGenerics[' obot'] = array(
'platform_type' => 'bot',
Expand Down
40 changes: 23 additions & 17 deletions engine/lib/tool/clientBots/Hacks.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientBots/Hacks.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.1
* @version 1.0.2
* @date Creation: May 2018
* @date Modification: Jun 2018
* @date Modification: Sep 2018
* @copyright 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* @warning This library is not loaded with CaMykS initialisation.
*/
Expand All @@ -20,80 +20,86 @@
*/
function _client_getKnownHacks() {
$knownHacks = array();

/* Joomla Exploit */
$knownHacks['jdatabasedrivermysqli'] = array(
'platform_type' => 'hack',
'hack_info' => 'Joomla Exploit',
);

/* Joomla Exploit */
$knownHacks['bot/0.1 (bot for jce)'] = array(
'platform_type' => 'hack',
'hack_info' => 'Joomla JCE Exploit',
);

/* Bash Exploit */
$knownHacks['() { foo;};echo; /bin/bash'] = array(
'platform_type' => 'hack',
'hack_info' => 'Bash Exploit',
);

/* Bash Exploit */
$knownHacks['() { :; }; echo'] = array(
'platform_type' => 'hack',
'hack_info' => 'Bash Exploit',
);

/* Bash Exploit */
$knownHacks['() { :;};'] = array(
'platform_type' => 'hack',
'hack_info' => 'Bash Exploit',
);

/* Drupal Fckeditor exploit */
$knownHacks['webfuck v2.1 t0phackteam www.t0p.xyz'] = array(
'platform_type' => 'hack',
'hack_info' => 'Drupal Fckeditor exploit',
);

/* betaBot : should be in bot list with a trustee level to "unwanted" */
$knownHacks['betabot'] = array(
'platform_type' => 'hack',
'hack_info' => 'Unwanted bot',
);

/* PHP Exploit */
$knownHacks['php system'] = array(
'platform_type' => 'hack',
'hack_info' => 'PHP Exploit',
);

/* PHP Exploit */
$knownHacks['<'.'?'.'php'] = array(
'platform_type' => 'hack',
'hack_info' => 'PHP Exploit',
);

/* PHP Exploit */
$knownHacks['<'.'?'.'='] = array(
'platform_type' => 'hack',
'hack_info' => 'PHP Exploit',
);

/* PHP Exploit */
$knownHacks['{${'] = array(
'platform_type' => 'hack',
'hack_info' => 'PHP Exploit',
);

/* the beast malware */
$knownHacks['the beast'] = array(
'platform_type' => 'hack',
'hack_info' => 'the beast malware',
);


/* unknown hack */
$knownHacks['ua.tools.random'] = array(
'platform_type' => 'hack',
'hack_info' => 'Unknown hack',
);

/* return list */
return $knownHacks;
}
?>
?>
6 changes: 3 additions & 3 deletions engine/lib/tool/clientDevices/Google.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Google.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0
* @version 1.0.1
* @date Creation: Aug 2018
* @date Modification: Aug 2018
* @date Modification: Sep 2018
* @copyright 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Expand All @@ -21,7 +21,7 @@
function get_GoogleClientDevice($deviceCode='') {
$deviceList = array(
'Nexus' => array('platform_year' => 2010),

'Nexus 5X' => array('platform_year' => 2015),
'Pixel 2' => array('platform_year' => 2017),
'Pixel 3' => array('platform_year' => 2018),
);
Expand Down
5 changes: 3 additions & 2 deletions engine/lib/tool/clientDevices/Huawei.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Huawei.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.11
* @version 1.0.12
* @date Creation: Apr 2018
* @date Modification: Aug 2018
* @date Modification: Sep 2018
* @copyright 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Expand Down Expand Up @@ -77,6 +77,7 @@ function get_HuaweiClientDevice($deviceCode='') {
'Y520-U22' => array('platform_model' => 'Ascend Y520', 'platform_year' => 2014),
'Y600-U151' => array('platform_model' => 'Ascend Y600', 'platform_year' => 2014),
'Y360-U03' => array('platform_model' => 'Y3', 'platform_year' => 2015),
'Y635-L21' => array('platform_model' => 'Y635', 'platform_year' => 2015),
'CUN-L21' => array('platform_model' => 'Y5', 'platform_year' => 2016),
'CUN-L03' => array('platform_model' => 'Y5 II', 'platform_year' => 2016),
'SCL-L01' => array('platform_model' => 'Y6', 'platform_year' => 2015),
Expand Down
9 changes: 5 additions & 4 deletions engine/lib/tool/clientDevices/LG.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/LG.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.2
* @version 1.0.3
* @date Creation: Apr 2018
* @date Modification: Jun 2018
* @date Modification: Sep 2018
* @copyright 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* @warning This library is not loaded with CaMykS initialisation.
*/
Expand All @@ -30,6 +30,7 @@ function get_LGClientDevice($deviceCode='') {
'D722' => array('platform_model' => 'G3 S', 'platform_year' => 2014),
'D802' => array('platform_model' => 'Nexus 5', 'platform_year' => 2013),
'D821' => array('platform_model' => 'G2', 'platform_year' => 2013),
'D852' => array('platform_model' => 'G3', 'platform_year' => 2014),
'D855' => array('platform_model' => 'G3', 'platform_year' => 2014),
'D855' => array('platform_model' => 'G Flex', 'platform_year' => 2014),
'E410' => array('platform_model' => 'Optimus L1 II', 'platform_year' => 2013),
Expand Down Expand Up @@ -68,4 +69,4 @@ function get_LGClientDevice($deviceCode='') {
/* Return result. */
return array_merge($result, $deviceList[$deviceCode]);
}
?>
?>
4 changes: 3 additions & 1 deletion engine/lib/tool/clientDevices/Sony.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Sony.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.8
* @version 1.0.9
* @date Creation: Apr 2018
* @date Modification: Sep 2018
* @copyright 2018 CaMykS Team
Expand Down Expand Up @@ -48,7 +48,9 @@ function get_SonyClientDevice($deviceCode='') {
'G3121' => array('platform_model' => 'Xperia XA1', 'platform_year' => 2017),
'G8141' => array('platform_model' => 'Xperia XZ Premium', 'platform_year' => 2017),
'H3311' => array('platform_model' => 'Xperia L2', 'platform_year' => 2018),
'H3113' => array('platform_model' => 'Xperia XA2', 'platform_year' => 2018),
'H4113' => array('platform_model' => 'Xperia XA2', 'platform_year' => 2018),
'H8314' => array('platform_model' => 'Xperia XZ2', 'platform_year' => 2018),

'SOV31' => array('platform_model' => 'Xperia Z4', 'platform_year' => 2015),
'SOV32' => array('platform_model' => 'Xperia Z5', 'platform_year' => 2015),
Expand Down
3 changes: 2 additions & 1 deletion engine/lib/tool/clientDevices/Xiaomi.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Xiaomi.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.5
* @version 1.0.6
* @date Creation: May 2018
* @date Modification: Sep 2018
* @copyright 2018 CaMykS Team
Expand Down Expand Up @@ -34,6 +34,7 @@ function get_XiaomiClientDevice($deviceCode='') {
'redmi note 3' => array('platform_model' => 'Redmi Note 3', 'platform_year' => 2015),
'redmi note 4' => array('platform_model' => 'Redmi Note 4', 'platform_year' => 2016),
'redmi note 4x' => array('platform_model' => 'Redmi Note 4X', 'platform_year' => 2017),
'redmi note 5' => array('platform_model' => 'Redmi Note 5', 'platform_year' => 2018),
'redmi 5a' => array('platform_model' => 'Redmi 5A', 'platform_year' => 2017),
'redmi 5 plus' => array('platform_model' => 'Redmi 5 Plus', 'platform_year' => 2018),
);
Expand Down

0 comments on commit ec4e7cb

Please sign in to comment.