mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-20 01:50:22 -05:00
add windows defender signature version
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
@@ -6047,13 +6047,10 @@ function sendPeriodicServerUpdate(flags, force) {
|
||||
} catch (ex) { }
|
||||
}
|
||||
|
||||
// Get Defender for Windows Server
|
||||
try {
|
||||
var d = require('win-info').defender();
|
||||
d.then(function(res){
|
||||
meshCoreObj.defender = res;
|
||||
meshCoreObjChanged();
|
||||
});
|
||||
// Get Defender Information
|
||||
try {
|
||||
meshCoreObj.defender = require('win-info').defender();
|
||||
meshCoreObjChanged();
|
||||
} catch (ex) { }
|
||||
}
|
||||
|
||||
|
||||
@@ -241,24 +241,16 @@ function installedApps()
|
||||
}
|
||||
|
||||
function defender(){
|
||||
var promise = require('promise');
|
||||
var ret = new promise(function (a, r) { this._resolve = a; this._reject = r; });
|
||||
ret.child = require('child_process').execFile(process.env['windir'] + '\\System32\\WindowsPowerShell\\v1.0\\powershell.exe', ['powershell', '-noprofile', '-nologo', '-command', '-'], {});
|
||||
ret.child.promise = ret;
|
||||
ret.child.stdout.str = ''; ret.child.stdout.on('data', function (c) { this.str += c.toString(); });
|
||||
ret.child.stderr.str = ''; ret.child.stderr.on('data', function (c) { this.str += c.toString(); });
|
||||
ret.child.stdin.write('Get-MpComputerStatus | Select-Object RealTimeProtectionEnabled,IsTamperProtected | ConvertTo-JSON\r\n');
|
||||
ret.child.stdin.write('exit\r\n');
|
||||
ret.child.on('exit', function (c) {
|
||||
if (this.stdout.str == '') { this.promise._resolve({}); return; }
|
||||
try {
|
||||
var abc = JSON.parse(this.stdout.str.trim());
|
||||
this.promise._resolve({ RealTimeProtection: abc.RealTimeProtectionEnabled, TamperProtected: abc.IsTamperProtected });
|
||||
} catch (ex) {
|
||||
this.promise._resolve({}); return;
|
||||
try {
|
||||
var tokens = require('win-wmi').query('ROOT\\Microsoft\\Windows\\Defender', 'SELECT * FROM MSFT_MpComputerStatus', ['RealTimeProtectionEnabled','IsTamperProtected','AntivirusSignatureVersion','AntivirusSignatureLastUpdated']);
|
||||
if (tokens[0]){
|
||||
return ({ RealTimeProtection: tokens[0].RealTimeProtectionEnabled, TamperProtected: tokens[0].IsTamperProtected, AntivirusSignatureVersion: tokens[0].AntivirusSignatureVersion, AntivirusSignatureLastUpdated: tokens[0].AntivirusSignatureLastUpdated });
|
||||
} else {
|
||||
return ({});
|
||||
}
|
||||
});
|
||||
return (ret);
|
||||
} catch (ex) {
|
||||
return ({});
|
||||
}
|
||||
}
|
||||
|
||||
if (process.platform == 'win32')
|
||||
|
||||
201056
translate/translate.json
201056
translate/translate.json
File diff suppressed because it is too large
Load Diff
@@ -6345,6 +6345,7 @@
|
||||
var y = [];
|
||||
if (node.defender.RealTimeProtection != null) { if (node.defender.RealTimeProtection == true) { y.push("RealTimeProtection" + ' - <span style=color:green>' + "On" + '</span>'); } else { y.push("RealTimeProtection" + ' - <span style=color:red>' + "Off" + '</span>'); } }
|
||||
if (node.defender.TamperProtected != null) { if (node.defender.TamperProtected == true) { y.push("TamperProtection" + ' - <span style=color:green>' + "On" + '</span>'); } else { y.push("TamperProtection" + ' - <span style=color:red>' + "Off" + '</span>'); } }
|
||||
if (node.defender.AntivirusSignatureVersion != null) { y.push("SignatureVersion" + ' - <span style=color:green>' + EscapeHtml(node.defender.AntivirusSignatureVersion) + '</span>'); }
|
||||
if (y.length > 0) x += addDetailItem("Windows Defender", y.join(', '));
|
||||
}
|
||||
|
||||
|
||||
@@ -7689,6 +7689,7 @@
|
||||
var y = [];
|
||||
if (node.defender.RealTimeProtection != null) { if (node.defender.RealTimeProtection == true) { y.push("RealTimeProtection" + ' - <span style=color:green>' + "On" + '</span>'); } else { y.push("RealTimeProtection" + ' - <span style=color:red>' + "Off" + '</span>'); } }
|
||||
if (node.defender.TamperProtected != null) { if (node.defender.TamperProtected == true) { y.push("TamperProtection" + ' - <span style=color:green>' + "On" + '</span>'); } else { y.push("TamperProtection" + ' - <span style=color:red>' + "Off" + '</span>'); } }
|
||||
if (node.defender.AntivirusSignatureVersion != null) { y.push("SignatureVersion" + ' - <span style=color:green>' + EscapeHtml(node.defender.AntivirusSignatureVersion) + '</span>'); }
|
||||
if (y.length > 0) x += addDeviceAttribute("Windows Defender", y.join(', '));
|
||||
}
|
||||
|
||||
|
||||
@@ -8550,6 +8550,7 @@
|
||||
var y = [];
|
||||
if (node.defender.RealTimeProtection != null) { if (node.defender.RealTimeProtection == true) { y.push("RealTimeProtection" + ' - <span style=color:green>' + "On" + '</span>'); } else { y.push("RealTimeProtection" + ' - <span style=color:red>' + "Off" + '</span>'); } }
|
||||
if (node.defender.TamperProtected != null) { if (node.defender.TamperProtected == true) { y.push("TamperProtection" + ' - <span style=color:green>' + "On" + '</span>'); } else { y.push("TamperProtection" + ' - <span style=color:red>' + "Off" + '</span>'); } }
|
||||
if (node.defender.AntivirusSignatureVersion != null) { y.push("SignatureVersion" + ' - <span style=color:green>' + EscapeHtml(node.defender.AntivirusSignatureVersion) + '</span>'); }
|
||||
if (y.length > 0) x += addDeviceAttribute("Windows Defender", y.join(', '));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user