From f3ed57c354212befd217aa091cf7b71da7ec2175 Mon Sep 17 00:00:00 2001 From: roeea Date: Fri, 23 Jun 2023 11:41:01 +0300 Subject: [PATCH] 1.391.155 --- CHANGELOG.md | 3 ++ README-zh-CN.md | 5 ++- README.md | 5 ++- bin/lpm_install.sh | 2 +- ...e5c.app.js => 7fa460a8b95add180df3.app.js} | 20 ++++++++-- bin/pub/index.html | 2 +- extensions/timezone/manifest.json | 2 +- extensions/webrtc/manifest.json | 2 +- lib/cluster_mgr.js | 1 + lib/manager.js | 14 +++++++ lib/router.js | 14 +++++++ lib/rules.js | 40 +++++++++++++++++-- lib/server.js | 7 +++- lib/swagger.json | 2 +- package.json | 4 +- src/pub/proxy_edit/fields.js | 5 +++ src/pub/proxy_edit/general.js | 17 +++++++- util/lpm_api_models.js | 1 + util/lpm_config_static.js | 2 + versions.json | 10 +++++ www/util/pub/user_agent_gen.json | 28 ++++++------- zon_config.json | 4 +- 22 files changed, 155 insertions(+), 35 deletions(-) rename bin/pub/{6229cea1d65262c2de5c.app.js => 7fa460a8b95add180df3.app.js} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ffa3b88..55158768 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ Proxy manager - Change Log +## 1.391.155 Stable +- :star: Checking traffic for malware option on cloud lpm agents + ## 1.390.445 Stable - :bug: fix unable update port to number less then UI port - :bug: fix wrong responce for CONNECT request errors diff --git a/README-zh-CN.md b/README-zh-CN.md index 3bcb6417..e80e9ca4 100755 --- a/README-zh-CN.md +++ b/README-zh-CN.md @@ -39,7 +39,7 @@ - Node.js 6+版 ### Windows -下载 代理管理安装器. +下载 代理管理安装器. ### Linux/MacOS - 安装 Node.js 10.15.3版 (最好用x @@ -100,6 +100,8 @@ Options: --ssl Enable SSL analyzing [boolean] [default: false] --tls_lib SSL library [string] [default: "open_ssl"] + --av_check Enable antivirus check + [boolean] [default: false] --iface Interface or IP to listen on [string] --customer Customer name [string] --zone Zone name [string] [default: "static"] @@ -245,6 +247,7 @@ Options: --proxy_country [default: ""] --resolve_proxies_interval [default: 10000] --info [default: false] + --av_server [default: false] --cn [default: false] --api_body_limit [default: "2mb"] --api_domain_fallback [default: "l-lpm.com"] diff --git a/README.md b/README.md index f7c75b2e..2c83c8da 100755 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Please report issues or bugs to your account manager or from our [help center](h ## Installation ### Windows -Download the [Proxy Manager installer](https://github.com/luminati-io/luminati-proxy/releases/download/v1.390.445/luminati-proxy-manager-v1.390.445-setup.exe) +Download the [Proxy Manager installer](https://github.com/luminati-io/luminati-proxy/releases/download/v1.391.155/luminati-proxy-manager-v1.391.155-setup.exe) ### Linux/MacOS - Install script - Run the setup script to install @@ -152,6 +152,8 @@ Options: --ssl Enable SSL analyzing [boolean] [default: false] --tls_lib SSL library [string] [default: "open_ssl"] + --av_check Enable antivirus check + [boolean] [default: false] --iface Interface or IP to listen on [string] --customer Customer name [string] --zone Zone name [string] [default: "static"] @@ -297,6 +299,7 @@ Options: --proxy_country [default: ""] --resolve_proxies_interval [default: 10000] --info [default: false] + --av_server [default: false] --cn [default: false] --api_body_limit [default: "2mb"] --api_domain_fallback [default: "l-lpm.com"] diff --git a/bin/lpm_install.sh b/bin/lpm_install.sh index b2b44c6a..bdbb5305 100755 --- a/bin/lpm_install.sh +++ b/bin/lpm_install.sh @@ -7,7 +7,7 @@ if [ $(id -u) = 0 ]; then IS_ROOT=1 fi LUM=0 -VERSION="1.390.445" +VERSION="1.391.155" if [ -f "/usr/local/hola/zon_config.sh" ]; then LUM=1 fi diff --git a/bin/pub/6229cea1d65262c2de5c.app.js b/bin/pub/7fa460a8b95add180df3.app.js similarity index 99% rename from bin/pub/6229cea1d65262c2de5c.app.js rename to bin/pub/7fa460a8b95add180df3.app.js index 21f506a1..8029d36c 100755 --- a/bin/pub/6229cea1d65262c2de5c.app.js +++ b/bin/pub/7fa460a8b95add180df3.app.js @@ -57448,6 +57448,11 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_ tooltip: "Choose a specific SSL library for sending HTTPS\n requests. It affects the SSL fingerprint seen by the target\n site. OpenSSL can be detected as suspicious traffic because\n no browser uses it. Use BoringSSL if you need to keep using\n SSL analyzing and you are getting blocked", ext: true }, + av_check: { + label: 'Antivirus check', + tooltip: "Checking traffic for malware", + ext: true + }, proxy_connection_type: { label: 'Connection to Super Proxy', tooltip: "Connection type between Proxy Manager and Super\n Proxy" @@ -124824,7 +124829,9 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_ _this.set_field('multiply', 1); }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "ssl_changed", function (val) { - return !val && _this.set_field('tls_lib', 'open_ssl'); + if (val) return; + _this.set_field('tls_lib', 'open_ssl'); + _this.set_field('av_check', false); }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "open_static_modal", function () { return (0, _jquery["default"])('#allocated_ips').modal('show'); @@ -124887,7 +124894,9 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_ value: function render() { var _this3 = this; if (!this.state.form || !this.state.proxy || !this.state.settings) return null; - var zagent = this.state.settings.zagent; + var _this$state$settings = this.state.settings, + zagent = _this$state$settings.zagent, + av_server = _this$state$settings.av_server; // XXX krzysztof: cleanup type (index.js rotation.js general.js) var curr_plan = this.get_curr_plan(); var is_render_plan = curr_plan.type == 'unblocker' || !!curr_plan.serp; @@ -124970,6 +124979,11 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_ disabled: !zagent, note: !zagent && /*#__PURE__*/_react["default"].createElement(Limit_zagent_note, null), data: tls_lib_opt + }), form.ssl && av_server && /*#__PURE__*/_react["default"].createElement(_common2.Config, { + type: "yes_no", + id: "av_check", + note: !zagent && /*#__PURE__*/_react["default"].createElement(Limit_zagent_note, null), + disabled: !zagent }), /*#__PURE__*/_react["default"].createElement(_common2.Config, { type: "select", data: route_err_opt, @@ -128313,7 +128327,7 @@ module.exports = JSON.parse("{\"version\":\"2020a\",\"zones\":[\"Africa/Abidjan| /* 1002 */ /***/ (function(module) { -module.exports = JSON.parse("[{\"label\":\"Chrome 115 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36\"},{\"label\":\"Chrome 87 Windows 7\",\"value\":\"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36\"},{\"label\":\"Chrome 114 Android 10\",\"value\":\"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36\"},{\"label\":\"Chrome 114 OSX 10.15.7\",\"value\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"},{\"label\":\"Chrome 114 Linux\",\"value\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"},{\"label\":\"Chrome 114 iOS 17.0\",\"value\":\"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/114.0.5735.99 Mobile/15E148 Safari/604.1\"},{\"label\":\"Chrome 114 Chromium OS 14541.0.0\",\"value\":\"Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"},{\"label\":\"Opera 99 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 OPR/99.0.0.0\"},{\"label\":\"Opera 75 Android 13\",\"value\":\"Mozilla/5.0 (Linux; Android 13; SM-G990E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.5615.135 Mobile Safari/537.36 OPR/75.4.3978.72990\"},{\"label\":\"Opera 99 Linux\",\"value\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 OPR/99.0.0.0\"},{\"label\":\"Firefox 110 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:110.0) Gecko/20100101 Firefox/110.0\"},{\"label\":\"Safari 16 OSX 10.15.7\",\"value\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15\"},{\"label\":\"Mobile Safari 16 iOS 16.6\",\"value\":\"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1\"},{\"label\":\"Edge 114 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.43\"},{\"label\":\"Edge 114 OSX 10.15.7\",\"value\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37\"},{\"label\":\"Whale 3 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Whale/3.21.192.15 Safari/537.36\"},{\"label\":\"Falkon 3 Linux\",\"value\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Falkon/3.1.0 Chrome/83.0.4103.122 Safari/537.36\"},{\"label\":\"Yandex 23 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 YaBrowser/23.5.1.714 Yowser/2.5 Safari/537.36\"},{\"label\":\"Yandex 23 Linux\",\"value\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 YaBrowser/23.3.3.764 Yowser/2.5 Safari/537.36\"},{\"label\":\"GSA 267 iOS 16.5\",\"value\":\"Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/267.0.537056344 Mobile/15E148 Safari/604.1\"}]"); +module.exports = JSON.parse("[{\"label\":\"Chrome 114 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"},{\"label\":\"Chrome 87 Windows 7\",\"value\":\"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36\"},{\"label\":\"Chrome 114 Android 10\",\"value\":\"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36\"},{\"label\":\"Chrome 114 OSX 10.15.7\",\"value\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"},{\"label\":\"Chrome 114 Linux\",\"value\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"},{\"label\":\"Chrome 114 iOS 16.6\",\"value\":\"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/114.0.5735.99 Mobile/15E148 Safari/604.1\"},{\"label\":\"Chrome 114 Chromium OS 14541.0.0\",\"value\":\"Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"},{\"label\":\"Opera 99 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 OPR/99.0.0.0\"},{\"label\":\"Opera 75 Android 9\",\"value\":\"Mozilla/5.0 (Linux; Android 9; ONEPLUS A3003) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.5615.135 Mobile Safari/537.36 OPR/75.4.3978.72990\"},{\"label\":\"Opera 99 Linux\",\"value\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 OPR/99.0.0.0\"},{\"label\":\"Firefox 109 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0\"},{\"label\":\"Safari 16 OSX 10.15.7\",\"value\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15\"},{\"label\":\"Mobile Safari 16 iOS 16.5\",\"value\":\"Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Mobile/15E148 Safari/604.1\"},{\"label\":\"Edge 114 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.51\"},{\"label\":\"Edge 114 OSX 10.15.7\",\"value\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.51\"},{\"label\":\"Whale 3 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Whale/3.21.192.15 Safari/537.36\"},{\"label\":\"Falkon 3 Linux\",\"value\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Falkon/3.1.0 Chrome/83.0.4103.122 Safari/537.36\"},{\"label\":\"Yandex 23 Windows 10\",\"value\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 YaBrowser/23.5.1.714 Yowser/2.5 Safari/537.36\"},{\"label\":\"Yandex 23 Linux\",\"value\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 YaBrowser/23.5.1.750 Yowser/2.5 Safari/537.36\"},{\"label\":\"GSA 267 iOS 16.5\",\"value\":\"Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/267.0.537056344 Mobile/15E148 Safari/604.1\"}]"); /***/ }), /* 1003 */ diff --git a/bin/pub/index.html b/bin/pub/index.html index 45eb1bc1..290ffcce 100755 --- a/bin/pub/index.html +++ b/bin/pub/index.html @@ -1 +1 @@ -Proxy Manager
\ No newline at end of file +Proxy Manager
\ No newline at end of file diff --git a/extensions/timezone/manifest.json b/extensions/timezone/manifest.json index 3c5ef515..6536e503 100755 --- a/extensions/timezone/manifest.json +++ b/extensions/timezone/manifest.json @@ -24,5 +24,5 @@ "*://*/*", "webNavigation" ], - "version": "1.390.445" + "version": "1.391.155" } \ No newline at end of file diff --git a/extensions/webrtc/manifest.json b/extensions/webrtc/manifest.json index 0ba6e195..e607e039 100755 --- a/extensions/webrtc/manifest.json +++ b/extensions/webrtc/manifest.json @@ -10,5 +10,5 @@ "permissions": [ "privacy" ], - "version": "1.390.445" + "version": "1.391.155" } \ No newline at end of file diff --git a/lib/cluster_mgr.js b/lib/cluster_mgr.js index f4d76902..f7d1dfbe 100755 --- a/lib/cluster_mgr.js +++ b/lib/cluster_mgr.js @@ -86,6 +86,7 @@ class Cluster_mgr { ca: this.mgr.get_ssl_ca(), keys, zagent: this.mgr.argv.zagent, + av_server: this.mgr.argv.av_server, no_usage_stats: this.mgr.argv.no_usage_stats, extra_ssl_ips: [...new Set([ ...this.mgr._defaults.extra_ssl_ips||[], diff --git a/lib/manager.js b/lib/manager.js index 5fa7f2ce..2c610d77 100755 --- a/lib/manager.js +++ b/lib/manager.js @@ -180,14 +180,18 @@ function Manager(argv, run_config={}){ logger.system('Updated server configuration'); let zone_auth_wl_diff = []; let super_proxy_ports_diff = []; + let av_server_url_diff = !this.server_conf; let new_super_proxy_ports = this.get_super_proxy_ports( server_conf); + let new_av_server_url = this.get_av_server_url(server_conf); if (this.server_conf) { zone_auth_wl_diff = _.xor(server_conf.zone_auth_type_whitelist, this.server_conf.zone_auth_type_whitelist); super_proxy_ports_diff = _.xor(new_super_proxy_ports, this.get_super_proxy_ports(this.server_conf)); + av_server_url_diff = this.get_av_server_url(this.server_conf)!= + new_av_server_url; } this.server_conf = server_conf; let port = _this.check_proxy_port(server_conf.cloud); @@ -197,6 +201,8 @@ function Manager(argv, run_config={}){ _this.update_zone_auth_wl(); if (super_proxy_ports_diff.length) _this.update_opt({super_proxy_ports: new_super_proxy_ports}); + if (av_server_url_diff) + _this.update_opt({av_server_url: new_av_server_url}); }); this.lpm_f.on('i18n_update_available', ()=> this.lang_cache.delete()); @@ -668,6 +674,12 @@ E.prototype.get_super_proxy_ports = function(server_conf){ }, []); }; +E.prototype.get_av_server_url = function(server_conf){ + if (!server_conf || !server_conf.cloud || !server_conf.cloud.av_server_url) + return '127.0.0.1:1343'; + return server_conf.cloud.av_server_url; +}; + E.prototype.complete_proxy_config = function(conf){ const c = assign({}, E.default, this._defaults, conf); const zone = this.zones_mgr.get_obj(c.zone); @@ -821,6 +833,7 @@ E.prototype.update_proxy_fields = function(proxy){ conf.mobile = this.zones_mgr.is_mobile(zone_name); conf.unblock = this.zones_mgr.is_unblocker(zone_name); conf.super_proxy_ports = this.get_super_proxy_ports(this.server_conf); + conf.av_server_url = this.get_av_server_url(this.server_conf); return conf; }; @@ -1973,6 +1986,7 @@ E.prototype.get_settings = function(){ pending_ips: [...this.pending_ips], pending_www_ips: [...this.pending_www_ips], zagent: this.argv.zagent, + av_server: this.argv.av_server, reseller: this.is_reseller(), sync_config: this._defaults.sync_config, ask_sync_config: this._defaults.ask_sync_config, diff --git a/lib/router.js b/lib/router.js index fdfcc1c1..9a44a17d 100755 --- a/lib/router.js +++ b/lib/router.js @@ -22,6 +22,20 @@ class Router { req.ctx.response.status_message = 'NULL'; return req.ctx.response; } + send_malware_detected_response(req, res, malware={}){ + const status_code = 451, status_message = `Malware detected`; + const headers = { + 'x-threat-type': malware.threat_type||'unknown', + 'x-threat-name': malware.threat_name||'unknown', + }; + write_http_reply(res, {statusCode: status_code, + statusMessage: status_message}, headers, this.opt); + res.end(); + req.ctx.response.headers = headers; + req.ctx.response.status_code = status_code; + req.ctx.response.status_message = status_message; + return req.ctx.response; + } send_cached(req, res, cached){ const {res_data, headers} = cached; write_http_reply(res, {statusCode: 200, statusMessage: 'OK'}, headers, diff --git a/lib/rules.js b/lib/rules.js index efd11651..92028759 100755 --- a/lib/rules.js +++ b/lib/rules.js @@ -5,12 +5,22 @@ const zutil = require('../util/util.js'); const {migrate_trigger} = require('../util/rules_util.js'); const etask = require('../util/etask.js'); const zurl = require('../util/url.js'); +const zws = require('../util/ws.js'); +const date = require('../util/date.js'); const logger = require('./logger.js').child({category: 'Rules'}); const lutil = require('./util.js'); class Rules { - constructor(server, rules=[]){ + constructor(server, rules=[], av_server_url=''){ + this.id = Math.random(); this.server = server; + if (av_server_url) + { + this.av_client = new zws.Client(`ws://${av_server_url}`, { + label: `av_client`, + ipc_client: {scan: {type: 'call', timeout: 2*date.ms.MIN}}, + }); + } this.rules = zutil.clone_deep(rules); if (!Array.isArray(this.rules)) this.rules = []; @@ -32,6 +42,12 @@ class Rules { return rule_to_priority(a)-rule_to_priority(b); }); } + close_av_client(){ + if (!this.av_client) + return; + this.av_client.close(); + delete this.av_client; + } has_reserve_session_rules(){ return this.rules.some(r=>r.action && r.action.reserve_session); } @@ -102,6 +118,15 @@ class Rules { e.message, req.ctx.url); return; } + if (this.av_client && this.av_client.connected) + { + let scan_result = yield this.av_client.ipc.scan({file: _body}); + if (['infected', 'suspicious'].includes(scan_result.result||'')) + { + return yield this.action(req, res, head, + {action: {malware: 1}}, {_res, malware: scan_result}); + } + } for (let i=0; i - rule.type=='after_body' && rule.active!==false); + return this.av_client && this.av_client.connected || + this.will_cache(req, proxy_res) || + this.rules.some(rule=>rule.type=='after_body' && + rule.active!==false); } check_req_time_range(req, rule){ if (!rule.max_req_time && !rule.min_req_time) @@ -214,6 +241,13 @@ class Rules { } if (req.ctx && req.ctx.rule_executed) req.ctx.rule_executed(rule); + if (rule.action.malware) + { + req.ctx.is_malware = true; + req.ctx.init_stats(); + return this.server.router.send_malware_detected_response(req, res, + opt.malware); + } if (rule.action.null_response) { req.ctx.is_null_response = true; diff --git a/lib/server.js b/lib/server.js index c730b135..4b93eee8 100755 --- a/lib/server.js +++ b/lib/server.js @@ -180,7 +180,9 @@ E.prototype.update_config = function(opt){ this.update_hosts(this.opt.hosts, this.opt.cn_hosts); this.requester = requester.create_requester(this.opt); this.router = new Router(opt); - this.rules = new Rules(this, opt.rules); + if (this.rules && this.rules.av_client) + this.rules.close_av_client(); + this.rules = new Rules(this, opt.rules, opt.av_check && opt.av_server_url); this.session_mgr = new sessions.Sess_mgr(this, opt); this.banlist = new Ip_cache(opt.banlist); this.throttle_mgr = Throttle_mgr.init(this, opt.throttle); @@ -1041,7 +1043,8 @@ E.prototype.prepare_resp = function(req, resp){ resp.context = 'PROXY TESTER TOOL'; resp.rules = req.ctx.get_rules_executed(); resp.lum_traffic = !req.ctx.is_bypass_proxy && !this.opt.ext_proxies && - !req.ctx.is_from_cache && !req.ctx.is_null_response; + !req.ctx.is_from_cache && !req.ctx.is_null_response && + !req.ctx.is_malware; resp.lpm_auth_type = req.lpm_auth_type; }; diff --git a/lib/swagger.json b/lib/swagger.json index bc6eebea..b18362db 100755 --- a/lib/swagger.json +++ b/lib/swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.390.445", + "version": "1.391.155", "title": "Proxy Manager", "license": { "name": "MIT", diff --git a/package.json b/package.json index e266a4c3..1d135129 100755 --- a/package.json +++ b/package.json @@ -417,7 +417,7 @@ "webpack.dev.js", "webpack.prod.js" ], - "md5": "57dceea6659f137cd78e905c33e280b1" + "md5": "0dc914829a663245ac7f13380c4eaa97" }, "main": "bin/index.js", "name": "@luminati-io/luminati-proxy", @@ -449,5 +449,5 @@ "build": "webpack --env production", "dev": "webpack --env development" }, - "version": "1.390.445" + "version": "1.391.155" } \ No newline at end of file diff --git a/src/pub/proxy_edit/fields.js b/src/pub/proxy_edit/fields.js index e9287974..f53daabd 100755 --- a/src/pub/proxy_edit/fields.js +++ b/src/pub/proxy_edit/fields.js @@ -272,6 +272,11 @@ export const tabs = { SSL analyzing and you are getting blocked`, ext: true, }, + av_check: { + label: 'Antivirus check', + tooltip: `Checking traffic for malware`, + ext: true, + }, proxy_connection_type: { label: 'Connection to Super Proxy', tooltip: `Connection type between Proxy Manager and Super diff --git a/src/pub/proxy_edit/general.js b/src/pub/proxy_edit/general.js index 587947d2..9962d343 100755 --- a/src/pub/proxy_edit/general.js +++ b/src/pub/proxy_edit/general.js @@ -106,14 +106,19 @@ export default class General extends Pure_component { this.set_field('pool_size', size); this.set_field('multiply', 1); }; - ssl_changed = val=>!val && this.set_field('tls_lib', 'open_ssl'); + ssl_changed = val=>{ + if (val) + return; + this.set_field('tls_lib', 'open_ssl'); + this.set_field('av_check', false); + }; open_static_modal = ()=>$('#allocated_ips').modal('show'); open_users_modal = ()=>$('#users_modal').modal('show'); open_bw_limit_modal = ()=>$('#bw_limit_modal').modal('show'); render(){ if (!this.state.form || !this.state.proxy || !this.state.settings) return null; - const {zagent} = this.state.settings; + const {zagent, av_server} = this.state.settings; // XXX krzysztof: cleanup type (index.js rotation.js general.js) const curr_plan = this.get_curr_plan(); const is_render_plan = curr_plan.type=='unblocker' || !!curr_plan.serp; @@ -187,6 +192,14 @@ export default class General extends Pure_component { data={tls_lib_opt} /> } + {form.ssl && av_server && + } + disabled={!zagent} + /> + } diff --git a/util/lpm_api_models.js b/util/lpm_api_models.js index a71ec44f..c710c0b3 100755 --- a/util/lpm_api_models.js +++ b/util/lpm_api_models.js @@ -26,6 +26,7 @@ E.proxy_fields = { ssl: {type: 'boolean', desc: 'Enable SSL analyzing'}, tls_lib: {type: 'string', desc: 'SSL library', values: 'open_ssl|flex_tls'}, + av_check: {type: 'boolean', desc: 'Enable antivirus check'}, iface: {type: 'string', desc: 'Interface or IP to listen on'}, customer: {type: 'string', desc: 'Customer name'}, zone: {type: 'string', desc: 'Zone name'}, diff --git a/util/lpm_config_static.js b/util/lpm_config_static.js index ba40298a..5f8e7587 100755 --- a/util/lpm_config_static.js +++ b/util/lpm_config_static.js @@ -63,6 +63,7 @@ conf.server_default = { proxy_connection_type: 'http', ssl: false, tls_lib: 'open_ssl', + av_check: false, test_url: 'http://lumtest.com/myip.json', proxy: 'zproxy.lum-superproxy.io', proxy_port: 22225, @@ -110,6 +111,7 @@ conf.manager_default = Object.assign({}, conf.server_default, { cluster: true, read_only: false, zagent: false, + av_server: false, reseller: false, sync_config: false, sync_zones: true, diff --git a/versions.json b/versions.json index 6a786659..5547ec3d 100755 --- a/versions.json +++ b/versions.json @@ -1,4 +1,14 @@ [ + { + "ver": "1.391.155", + "type": "stable", + "changes": [ + { + "type": "star", + "text": "Checking traffic for malware option on cloud lpm agents" + } + ] + }, { "ver": "1.390.445", "type": "stable", diff --git a/www/util/pub/user_agent_gen.json b/www/util/pub/user_agent_gen.json index 6285b0bc..15fb4a32 100755 --- a/www/util/pub/user_agent_gen.json +++ b/www/util/pub/user_agent_gen.json @@ -1,7 +1,7 @@ [ { - "label": "Chrome 115 Windows 10", - "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" + "label": "Chrome 114 Windows 10", + "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" }, { "label": "Chrome 87 Windows 7", @@ -20,8 +20,8 @@ "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" }, { - "label": "Chrome 114 iOS 17.0", - "value": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/114.0.5735.99 Mobile/15E148 Safari/604.1" + "label": "Chrome 114 iOS 16.6", + "value": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/114.0.5735.99 Mobile/15E148 Safari/604.1" }, { "label": "Chrome 114 Chromium OS 14541.0.0", @@ -32,32 +32,32 @@ "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 OPR/99.0.0.0" }, { - "label": "Opera 75 Android 13", - "value": "Mozilla/5.0 (Linux; Android 13; SM-G990E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.5615.135 Mobile Safari/537.36 OPR/75.4.3978.72990" + "label": "Opera 75 Android 9", + "value": "Mozilla/5.0 (Linux; Android 9; ONEPLUS A3003) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.5615.135 Mobile Safari/537.36 OPR/75.4.3978.72990" }, { "label": "Opera 99 Linux", "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 OPR/99.0.0.0" }, { - "label": "Firefox 110 Windows 10", - "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:110.0) Gecko/20100101 Firefox/110.0" + "label": "Firefox 109 Windows 10", + "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0" }, { "label": "Safari 16 OSX 10.15.7", - "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15" + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15" }, { - "label": "Mobile Safari 16 iOS 16.6", - "value": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1" + "label": "Mobile Safari 16 iOS 16.5", + "value": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Mobile/15E148 Safari/604.1" }, { "label": "Edge 114 Windows 10", - "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.43" + "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.51" }, { "label": "Edge 114 OSX 10.15.7", - "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37" + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.51" }, { "label": "Whale 3 Windows 10", @@ -73,7 +73,7 @@ }, { "label": "Yandex 23 Linux", - "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 YaBrowser/23.3.3.764 Yowser/2.5 Safari/537.36" + "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 YaBrowser/23.5.1.750 Yowser/2.5 Safari/537.36" }, { "label": "GSA 267 iOS 16.5", diff --git a/zon_config.json b/zon_config.json index 24a6cb59..0f89b0a4 100755 --- a/zon_config.json +++ b/zon_config.json @@ -1,5 +1,5 @@ { - "ZON_VERSION": "1.390.445", + "ZON_VERSION": "1.391.155", "CONFIG_MAKEFLAGS": "DIST=APP RELEASE=y CC64_32=y CONFIG_LPM=y CONFIG_BATREQ=y CONFIG_BAT_CYCLE=y CONFIG_BAT_PLATFORM=app_win32_lpm", - "CONFIG_BUILD_DATE": "21-Jun-23 10:45:33" + "CONFIG_BUILD_DATE": "23-Jun-23 07:44:04" } \ No newline at end of file