function build_main() { $conf_upd = new multi_config("kaspersky.updater"); $conf_scan = new multi_config("kaspersky.server"); $MilterTimeout = $conf_scan->GET("MilterTimeout"); if ($MilterTimeout == null) { $MilterTimeout = 600; } $MaxScanRequests = $conf_scan->GET("MaxScanRequests"); if ($MaxScanRequests == null) { $MaxScanRequests = 0; } $MaxScanTime = $conf_scan->GET("MaxScanTime"); if ($MaxScanTime == null) { $MaxScanTime = 10; } $ScanPacked = $conf_scan->GET("ScanPacked"); if ($ScanPacked == null) { $ScanPacked = "yes"; } $ScanArchives = $conf_scan->GET("ScanArchives"); if ($ScanArchives == null) { $ScanArchives = "yes"; } $ScanCodeanalyzer = $conf_scan->GET("ScanCodeanalyzer"); if ($ScanCodeanalyzer == null) { $ScanCodeanalyzer = "yes"; } $UseAVBasesSet = $conf_scan->GET("UseAVBasesSet"); if ($UseAVBasesSet == null) { $UseAVBasesSet = "extended"; } $ldap = new clladp(); $hash = $ldap->hash_get_all_domains(); while (list($num, $val) = each($hash)) { $doms[] = $num; } if (is_array($doms)) { $domains = implode(",", $doms); } $conf[] = "[kav4lms:server.settings]"; $conf[] = "RunAsUser=postfix"; $conf[] = "RunAsGroup=postfix"; $conf[] = "ServiceSocket=local:/var/run/kav4lms/kavmd.sock"; $conf[] = "ServiceSocketPerms=0600"; $conf[] = "AdminSocket=local:/var/run/kav4lms/kavmdctl.sock"; $conf[] = "AdminSocketPerms=0600"; $conf[] = "MaxWatchdogRetries=10"; $conf[] = "MaxClientRequests=20"; $conf[] = "MaxScanRequests={$MaxScanRequests}"; $conf[] = "LicensedUsersDomains={$domains}"; $conf[] = ""; $conf[] = "[kav4lms:server.log]"; $conf[] = ""; $conf[] = "Options=all"; $conf[] = "Destination=syslog:kavmd@mail"; $conf[] = "Append=yes"; $conf[] = "RotateRounds=10"; $conf[] = "RotateSize=1M"; $conf[] = ""; $conf[] = "[kav4lms:server.statistics]"; $conf[] = "Options=all"; $conf[] = "Format=txt"; $conf[] = "Destination=file:/var/opt/kaspersky/kav4lms/stats/statistics.xml"; $conf[] = "RawDestination=file:/var/opt/kaspersky/kav4lms/stats/statistics.raw"; $conf[] = ""; $conf[] = "[kav4lms:server.notifications]"; $conf[] = "ProductAdmins=postmaster"; $conf[] = "ProductNotify=all"; $conf[] = "Subject=Anti-virus notification message"; $conf[] = "Charset=us-ascii"; $conf[] = "TransferEncoding=7bit"; $conf[] = "NotifierRelay=smtp:127.0.0.1:25"; $conf[] = "NotifierQueue=/var/opt/kaspersky/kav4lms/nqueue/"; $conf[] = "NotifierTimeout=5"; $conf[] = "NotifierPersistence=no"; $conf[] = "Templates=/etc/opt/kaspersky/kav4lms/templates-admin/en"; $conf[] = ""; $conf[] = "[kav4lms:server.snmp]"; $conf[] = "SNMPServices=none"; $conf[] = "SNMPTraps=none"; $conf[] = "AlertThreshold=10"; $conf[] = "Socket=inet:705@127.0.0.1"; $conf[] = "PingInterval=30"; $conf[] = "Timeout=5"; $conf[] = "Retries=10"; $conf[] = ""; $conf[] = "[kav4lms:filter]"; $conf[] = ""; $conf[] = "[kav4lms:filter.settings]"; $conf[] = "RunAsUser=postfix"; $conf[] = "RunAsGroup=postfix"; $conf[] = "FilterSocket=inet:1052@127.0.0.1"; $conf[] = "FilterSocketPerms=0600"; $conf[] = "ServiceSocket=local:/var/run/kav4lms/kavmd.sock"; $conf[] = "ForwardSocket=inet:10026@127.0.0.1"; $conf[] = "FilterTimeout=600"; $conf[] = "FilterThreads=10"; $conf[] = "MaxMilterThreads=0"; $conf[] = "AdminSocket=local:/var/run/kav4lms/filterctl.sock"; $conf[] = "AdminSocketPerms=0600"; $conf[] = ""; $conf[] = "[kav4lms:filter.log]"; $conf[] = "Options=all"; $conf[] = "Destination=syslog:kav4lms-filters@mail"; $conf[] = "Append=yes"; $conf[] = "RotateRounds=10"; $conf[] = "RotateSize=1M"; $conf[] = ""; $conf[] = "[kav4lms:groups]"; $conf[] = "_includes = kav4lms/groups.d/"; $conf[] = "[path]"; $conf[] = "BasesPath=/var/opt/kaspersky/kav4lms/bases/"; $conf[] = "LicensePath=/var/opt/kaspersky/kav4lms/licenses/"; $conf[] = "TempPath=/var/tmp/"; $conf[] = "PidPath=/var/run/kav4lms/"; $conf[] = "iCheckerDBFile=/var/opt/kaspersky/kav4lms/iChecker.db"; $conf[] = ""; $conf[] = "[locale]"; $conf[] = "DateFormat=%Y-%m-%d"; $conf[] = "TimeFormat=%H:%M:%S"; $conf[] = "Strings=locale.d/strings.en"; $conf[] = ""; $conf[] = "[options]"; $conf[] = "User=postfix"; $conf[] = "Group=postfix"; $conf[] = ""; $conf[] = "[updater]"; $conf[] = "[updater.path]"; $conf[] = "BackUpPath=/var/opt/kaspersky/kav4lms/bases.backup/"; $conf[] = ""; $conf[] = "[updater.options]"; $conf[] = "UpdateComponentsList=AVS, AVS_OLD, CORE, Updater, BLST"; $conf[] = "RetranslateComponentsList="; $conf[] = "KeepSilent=no"; $UseUpdateServerUrl = $conf_upd->GET("UseUpdateServerUrl"); $UseUpdateServerUrlOnly = $conf_upd->GET("UseUpdateServerUrlOnly"); $UpdateServerUrl = $conf_upd->GET("UpdateServerUrl"); $RegionSettings = $conf_upd->GET("RegionSettings"); $UseProxy = $conf_upd->GET("UseProxy"); if ($UseProxy == null) { $UseProxy = "no"; } if ($UseUpdateServerUrlOnly == null) { $UseUpdateServerUrlOnly = "no"; } if ($RegionSettings == null) { $RegionSettings = "eu"; } if ($UseUpdateServerUrl == null) { $UseUpdateServerUrl = "no"; } $conf[] = "UseUpdateServerUrl={$UseUpdateServerUrl}"; $conf[] = "UseUpdateServerUrlOnly={$UseUpdateServerUrlOnly}"; $conf[] = "UpdateServerUrl={$UpdateServerUrl}"; $conf[] = "RegionSettings={$RegionSettings}"; $conf[] = "ConnectTimeout=30"; $conf[] = "ProxyAddress={$conf_upd->GET("ProxyAddress")}"; $conf[] = "PassiveFtp=yes"; $conf[] = "UseProxy={$UseProxy}"; $conf[] = "Index=u0607g.xml"; $conf[] = "IndexRelativeServerPath=index/6"; $conf[] = ""; $conf[] = "[updater.report]"; $conf[] = "Append=no"; $conf[] = "ReportFileName=/var/log/kaspersky/kav4lms/keepup2date.log"; $conf[] = "ReportLevel=3"; $conf[] = ""; $conf[] = "[updater.actions]"; $conf[] = "OnAny=/opt/kaspersky/kav4lms/bin/kav4lms-cmd -m update -e %EVENT_NAME% -w '%AVS_UPDATE_DATE%' >/dev/null"; $conf[] = "OnStarted="; $conf[] = "OnUpdated=/opt/kaspersky/kav4lms/bin/kav4lms-cmd -x bases"; $conf[] = "OnRetranslated="; $conf[] = "OnNotUpdated="; $conf[] = "OnFailed="; $conf[] = "OnRolledback=/opt/kaspersky/kav4lms/bin/kav4lms-cmd -x bases"; $conf[] = "OnBasesCheck=/opt/kaspersky/kav4lms/lib/bin/avbasestest %TEMP_BASES_PATH% %BASES_PATH%"; $conf[] = "[scanner.display]"; $conf[] = "ShowContainerResultOnly=false"; $conf[] = "ShowProgress=true"; $conf[] = "ShowOk=true"; $conf[] = "ShowObjectResultOnly=false"; $conf[] = ""; $conf[] = "[scanner.options]"; $conf[] = "SelfExtArchives=yes"; $conf[] = "ExcludeDirs=/dev:/udev:/proc:/sys"; $conf[] = "MailBases=yes"; $conf[] = "Archives={$ScanArchives}"; $conf[] = "Packed={$ScanPacked}"; $conf[] = "#ExcludeMask="; $conf[] = "UseAVbasesSet={$UseAVBasesSet}"; $conf[] = "#MaxLoadAvg="; $conf[] = "LocalFS=false"; $conf[] = "Cure=yes"; $conf[] = "MailPlain=yes"; $conf[] = "Heuristic=yes"; $conf[] = "Recursion=true"; $conf[] = "Ichecker=yes"; $conf[] = "FollowSymlinks=true"; $conf[] = ""; $conf[] = ""; $conf[] = "[scanner.report]"; $conf[] = "Append=true"; $conf[] = "ShowContainerResultOnly=false"; $conf[] = "ShowOk=true"; $conf[] = "ReportLevel=4"; $conf[] = "ShowObjectResultOnly=false"; $conf[] = "ReportFileName=/var/log/kaspersky/kav4lms/kavscanner.log"; $conf[] = ""; $conf[] = ""; $conf[] = "[scanner.container]"; $conf[] = "#OnProtected="; $conf[] = "#OnWarning="; $conf[] = "#OnSuspicion="; $conf[] = "#OnCorrupted="; $conf[] = "#OnInfected="; $conf[] = "#OnError="; $conf[] = "#OnCured="; $conf[] = ""; $conf[] = ""; $conf[] = "[scanner.path]"; $conf[] = "#BackupPath="; $conf[] = ""; $conf[] = "[scanner.object]"; $conf[] = "#OnProtected="; $conf[] = "#OnWarning="; $conf[] = "#OnSuspicion="; $conf[] = "#OnCorrupted="; $conf[] = "#OnInfected="; $conf[] = "#OnError="; $conf[] = "#OnCured="; $conf[] = ""; @file_put_contents("/etc/opt/kaspersky/kav4lms.conf", implode("\n", $conf)); }
function Update() { $page = CurrentPageName(); $conf = new multi_config("kaspersky.updater"); $artica = new artica_general(); $UseProxy = Field_yesno_checkbox("UseProxy", $conf->GET("UseProxy")); $ProxyAddress = Field_text('ProxyAddress', $conf->GET("ProxyAddress"), 'width:250px'); if ($artica->ArticaProxyServerEnabled == 'yes') { $UseProxy = "<strong>Yes</strong><input type='hidden' name='UseProxy' value='yes'>"; $ProxyAddress = "<strong>{$artica->ArticaCompiledProxyUri}</strong><input type='hidden' name='ProxyAddress' value='{$artica->ArticaProxyServerEnabled}'>"; } $script = "<script>\n\tvar X_KavUpdaterSettings= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);}\n\t\tRefreshTab('main_config_kav4lms');\n\t\t}\n\t\t\t\n\t\n\t\n\tfunction KavUpdaterSettings(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(document.getElementById('UseUpdateServerUrl').checked){XHR.appendData('UseUpdateServerUrl','yes');}else{XHR.appendData('UseUpdateServerUrl','no');}\n\t\t\tif(document.getElementById('UseUpdateServerUrlOnly').checked){XHR.appendData('UseUpdateServerUrlOnly','yes');}else{XHR.appendData('UseUpdateServerUrlOnly','no');}\n\t\t\tXHR.appendData('UpdateServerUrl',document.getElementById('UpdateServerUrl').value);\n\t\t\tXHR.appendData('RegionSettings',document.getElementById('RegionSettings').value);\n\t\t\tif(document.getElementById('UseProxy').checked){XHR.appendData('UseProxy','yes');}else{XHR.appendData('UseProxy','no');}\n\t\t\tXHR.appendData('ProxyAddress',document.getElementById('ProxyAddress').value);\n\t\t\tdocument.getElementById('dialog2').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',X_KavUpdaterSettings);\t\t\n\t\t\n\t}\n</script>"; $arr = "\n\n<table style=width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t<td class=legend>{UseUpdateServerUrl}:</strong></td>\n\t\t\t\t\t<td align='left'>" . Field_yesno_checkbox("UseUpdateServerUrl", $conf->GET("UseUpdateServerUrl")) . "</td>\n\t\t\t\t<td align='left'>" . help_icon('{UseUpdateServerUrl_text}') . "</td>\n\t\t\t\t</tr>\t\n\t\t\t\t<tr>\n\t\t\t\t<td class=legend>{UseUpdateServerUrlOnly}:</strong></td>\n\t\t\t\t\t<td align='left'>" . Field_yesno_checkbox("UseUpdateServerUrlOnly", $conf->GET("UseUpdateServerUrlOnly")) . "</td>\n\t\t\t\t<td align='left'>" . help_icon('{UseUpdateServerUrlOnly_text}') . "</td>\n\t\t\t\t</tr>\t\t\n\t\t\t\t<tr>\n\t\t\t\t<td class=legend>{UpdateServerUrl}:</strong></td>\n\t\t\t\t<td align='left'>" . Field_text('UpdateServerUrl', $conf->GET("UpdateServerUrl"), 'width:250px') . "</td>\n\t\t\t\t<td align='left'>" . help_icon('{UpdateServerUrl_text}') . "</td>\n\t\t\t\t</tr>\t\n\t\t\t\t<tr>\n\t\t\t\t<td class=legend>{RegionSettings}:</strong></td>\n\t\t\t\t<td align='left'>" . Field_array_Hash(array("Russia" => "Russia", "Europe" => "Europe", "America" => "America", "China" => "China", "Japan" => "Japan", "Korea" => "Korea"), 'RegionSettings', $conf->GET("RegionSettings")) . "</td>\n\t\t\t\t<td align='left'>" . help_icon('{RegionSettings_text}') . "</td>\n\t\t\t\t</tr>\t\n\t\t\t\t<tr>\n\t\t\t\t<td class=legend>{UseProxy}:</strong></td>\n\t\t\t\t\t<td align='left'>{$UseProxy}</td>\n\t\t\t\t<td align='left'> </td>\n\t\t\t\t</tr>\t\t\n\t\t\t\t<tr>\n\t\t\t\t<td class=legend>{ProxyAddress}:</strong></td>\n\t\t\t\t<td align='left'>{$ProxyAddress}</td>\n\t\t\t\t<td align='left'>" . help_icon('{ProxyAddress_text}') . "</td>\n\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t</table>"; $update_kaspersky = Paragraphe('kaspersky-update-64.png', '{UPDATE_ANTIVIRUS}', '{APP_KAVMILTER}<br>{UPDATE_ANTIVIRUS_TEXT}', "javascript:Loadjs('squid.newbee.php?update-kav=yes&type=milter')"); $html = "{$script}<div id='KavUpdaterSettingsid'>\n\t<form name='ffm1'>\n\t<table STYLE='width:100%;'>\n\t\t<tr>\n\t<td valign='top' >{$arr}</td>\n\t<td valign='top' >{$arr3}</td>\n\t</tr>\n\t<td colspan=2 align='right'><hr>" . button("{edit}", "KavUpdaterSettings()") . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t{$update_kaspersky}\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html, 'squid.newbee.php'); }
function build_main() { $sock = new sockets(); $conf_upd = new multi_config("kaspersky.updater"); $conf_scan = new multi_config("kaspersky.server"); $sock = new sockets(); $bases = "/var/db/kav/5.6/kavmilter/bases/"; if ($sock->GET_INFO("RetranslatorEnabled") == 1) { echo "Starting......: Kaspersky Mail server using retranslator for pattern databases.\n"; $bases = "/var/db/kav/databases/bases/av/avc/i386/"; } else { echo "Starting......: Kaspersky Mail server retranslator is not enabled.\n"; } $MilterTimeout = $conf_scan->GET("MilterTimeout"); if ($MilterTimeout == null) { $MilterTimeout = 600; } $MaxScanRequests = $conf_scan->GET("MaxScanRequests"); if ($MaxScanRequests == null) { $MaxScanRequests = 0; } $MaxScanTime = $conf_scan->GET("MaxScanTime"); if ($MaxScanTime == null) { $MaxScanTime = 10; } $ScanPacked = $conf_scan->GET("ScanPacked"); if ($ScanPacked == null) { $ScanPacked = "yes"; } $ScanArchives = $conf_scan->GET("ScanArchives"); if ($ScanArchives == null) { $ScanArchives = "yes"; } $ScanCodeanalyzer = $conf_scan->GET("ScanCodeanalyzer"); if ($ScanCodeanalyzer == null) { $ScanCodeanalyzer = "yes"; } $UseAVBasesSet = $conf_scan->GET("UseAVBasesSet"); if ($UseAVBasesSet == null) { $UseAVBasesSet = "extended"; } $ldap = new clladp(); $hash = $ldap->hash_get_all_domains(); $sock = new sockets(); $SendmailPath = trim(base64_decode($sock->getFrameWork("cmd.php?SendmailPath=yes"))); $ldap = new clladp(); $hash = $ldap->hash_get_all_domains(); $conf[] = "[kavmilter.global]"; $conf[] = "RunAsUid=kav"; $conf[] = "RunAsGid=kav"; $conf[] = "ServiceSocket=inet:1052@localhost"; $conf[] = "MilterTimeout={$MilterTimeout}"; $conf[] = "WatchdogMaxRetries=10"; $conf[] = "TempDir=/var/db/kav/5.6/kavmilter/tmp/"; while (list($num, $val) = each($hash)) { if ($num == null) { continue; } $conf[] = "LicensedUsersDomains={$num}"; } $conf[] = ""; $conf[] = ""; $conf[] = "[kavmilter.snmp]"; $conf[] = "SNMPServices=none"; $conf[] = "SNMPTraps=none"; $conf[] = "AlertThreshold=10"; $conf[] = ""; $conf[] = ""; $conf[] = "[kavmilter.agentx]"; $conf[] = "Socket=/var/agentx/master"; $conf[] = "PingInterval=30"; $conf[] = "Timeout=5"; $conf[] = "Retries=10"; $conf[] = ""; $conf[] = ""; $conf[] = "[kavmilter.engine]"; $conf[] = "MaxScanRequests={$MaxScanRequests}"; $conf[] = "MaxScanTime={$MaxScanTime}"; $conf[] = "ScanArchives={$ScanArchives}"; $conf[] = "ScanPacked={$ScanPacked}"; $conf[] = "ScanCodeanalyzer={$ScanCodeanalyzer}"; $conf[] = "UseAVBasesSet={$UseAVBasesSet}"; $conf[] = ""; $conf[] = ""; $conf[] = "[kavmilter.log]"; $conf[] = "LogFacility=syslog"; $conf[] = "LogFilepath=/var/log/kav/5.6/kavmilter/kavmilter.log"; $conf[] = "LogOption=all"; $conf[] = "LogOption=-all.debug"; $conf[] = "LogRotate=yes"; $conf[] = "RotateSize=5MB"; $conf[] = "RotateRounds=5"; $conf[] = ""; $conf[] = ""; $conf[] = "[kavmilter.statistics]"; $conf[] = "TrackStatistics=all"; $conf[] = "DataFormat=text"; $conf[] = "DataFile=/var/log/kav/5.6/kavmilter/statistics.data"; $conf[] = "MessageStatistics=/var/log/kav/5.6/kavmilter/message-statistics.data"; $conf[] = ""; $conf[] = ""; $conf[] = "[path]"; $conf[] = "BasesPath={$bases}"; $conf[] = "LicensePath=/var/db/kav/5.6/kavmilter/licenses/"; $conf[] = ""; $conf[] = ""; $conf[] = "[locale]"; $conf[] = "DateFormat=%Y-%m-%d"; $conf[] = "TimeFormat=%H:%M:%S"; $conf[] = ""; $conf[] = ""; $conf[] = "[updater.path]"; $conf[] = "UploadPatchPath=/var/db/kav/5.6/kavmilter/patches/"; $conf[] = "BackUpPath=/var/db/kav/5.6/kavmilter/bases/backup/"; $conf[] = "AVBasesTestPath=/opt/kav/5.6/kavmilter/bin/avbasestest"; $conf[] = ""; $conf[] = ""; $conf[] = "[updater.options]"; $conf[] = "KeepSilent=no"; $UseUpdateServerUrl = $conf_upd->GET("UseUpdateServerUrl"); $UseUpdateServerUrlOnly = $conf_upd->GET("UseUpdateServerUrlOnly"); $UpdateServerUrl = $conf_upd->GET("UpdateServerUrl"); $RegionSettings = $conf_upd->GET("RegionSettings"); $UseProxy = $conf_upd->GET("UseProxy"); if ($UseProxy == null) { $UseProxy = "no"; } if ($UseUpdateServerUrlOnly == null) { $UseUpdateServerUrlOnly = "no"; } if ($RegionSettings == null) { $RegionSettings = "eu"; } if ($UseUpdateServerUrl == null) { $UseUpdateServerUrl = "no"; } $conf[] = "UseUpdateServerUrl={$UseUpdateServerUrl}"; $conf[] = "UseUpdateServerUrlOnly={$UseUpdateServerUrlOnly}"; $conf[] = "UpdateServerUrl={$UseUpdateServerUrl}"; $conf[] = "RegionSettings={$RegionSettings}"; $conf[] = "ConnectTimeout=30"; $conf[] = "ProxyAddress={$conf_upd->GET("ProxyAddress")}"; $conf[] = "PassiveFtp=yes"; $conf[] = "PostUpdateCmd=/opt/kav/5.6/kavmilter/bin/kavmilter -r bases"; $conf[] = "ConnectTimeout=30"; $conf[] = "UseProxy={$UseProxy}"; $conf[] = ""; $conf[] = ""; $conf[] = "[updater.report]"; $conf[] = "Append=no"; $conf[] = "ReportFileName=/var/log/kav/5.6/kavmilter/keepup2date.log"; $conf[] = "ReportLevel=3"; @file_put_contents("/etc/kav/5.6/kavmilter/kavmilter.conf", implode("\n", $conf)); }