add sessionrecordings for powershell/user shells #7035

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2025-05-20 20:11:34 +01:00
parent b97caabc35
commit 158107d6ae
6 changed files with 673 additions and 588 deletions

View File

@ -2890,7 +2890,7 @@
"items": { "items": {
"type": "integer" "type": "integer"
}, },
"description": "This is an array: 1 = Terminal, 2 = Desktop, 5 = Files, 100 = Intel AMT WSMAN, 101 = Intel AMT Redirection, 200 = Messenger" "description": "This is an array: 1 = Terminal, 2 = Desktop, 5 = Files, 6 = Admin Powershell, 8 = User Shell, 9 = User Powershell, 100 = Intel AMT WSMAN, 101 = Intel AMT Redirection, 200 = Messenger"
} }
}, },
"required": [ "required": [

View File

@ -42,6 +42,9 @@ const MESHRIGHT_ADMIN = 0xFFFFFFFF;
// 1 = Terminal // 1 = Terminal
// 2 = Desktop // 2 = Desktop
// 5 = Files // 5 = Files
// 6 = Admin PowerShell
// 8 = User Shell
// 9 = User PowerShell
// 10 = Web-RDP // 10 = Web-RDP
// 11 = Web-SSH // 11 = Web-SSH
// 12 = Web-VNC // 12 = Web-VNC
@ -578,7 +581,7 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) {
// Log the connection // Log the connection
if (sessionUser != null) { if (sessionUser != null) {
var msg = 'Started relay session', msgid = 13; var msg = 'Started relay session', msgid = 13;
if (obj.req.query.p == 1) { msg = 'Started terminal session'; msgid = 14; } if ([1,6,8,9].indexOf(obj.req.query.p) >= 0) { msg = 'Started terminal session'; msgid = 14; } // admin shell, admin powershell, user shell, user powershell
else if (obj.req.query.p == 2) { msg = 'Started desktop session'; msgid = 15; } else if (obj.req.query.p == 2) { msg = 'Started desktop session'; msgid = 15; }
else if (obj.req.query.p == 5) { msg = 'Started file management session'; msgid = 16; } else if (obj.req.query.p == 5) { msg = 'Started file management session'; msgid = 16; }
else if (obj.req.query.p == 200) { msg = 'Started messenger session'; msgid = 162; } else if (obj.req.query.p == 200) { msg = 'Started messenger session'; msgid = 162; }
@ -777,7 +780,7 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) {
// Log the disconnection // Log the disconnection
if (ws.time) { if (ws.time) {
var msg = 'Ended relay session', msgid = 9; var msg = 'Ended relay session', msgid = 9;
if (obj.req.query.p == 1) { msg = 'Ended terminal session', msgid = 10; } if ([1,6,8,9].indexOf(obj.req.query.p) >= 0) { msg = 'Ended terminal session', msgid = 10; } // admin shell, admin powershell, user shell, user powershell
else if (obj.req.query.p == 2) { msg = 'Ended desktop session', msgid = 11; } else if (obj.req.query.p == 2) { msg = 'Ended desktop session', msgid = 11; }
else if (obj.req.query.p == 5) { msg = 'Ended file management session', msgid = 12; } else if (obj.req.query.p == 5) { msg = 'Ended file management session', msgid = 12; }
else if (obj.req.query.p == 200) { msg = 'Ended messenger session', msgid = 112; } else if (obj.req.query.p == 200) { msg = 'Ended messenger session', msgid = 112; }

File diff suppressed because it is too large Load Diff

View File

@ -17467,6 +17467,9 @@
if (rec.protocol == 1) { sessionName += ' - ' + "Terminal Session"; } if (rec.protocol == 1) { sessionName += ' - ' + "Terminal Session"; }
if (rec.protocol == 2) { sessionName += ' - ' + "Desktop Session"; } if (rec.protocol == 2) { sessionName += ' - ' + "Desktop Session"; }
if (rec.protocol == 5) { sessionName += ' - ' + "File Transfer"; } if (rec.protocol == 5) { sessionName += ' - ' + "File Transfer"; }
if (rec.protocol == 6) { sessionName += ' - ' + "Admin PowerShell"; }
if (rec.protocol == 8) { sessionName += ' - ' + "User Shell"; }
if (rec.protocol == 9) { sessionName += ' - ' + "User PowerShell"; }
if (rec.protocol == 100) { sessionName += ' - ' + "Intel&reg; AMT WSMAN"; } if (rec.protocol == 100) { sessionName += ' - ' + "Intel&reg; AMT WSMAN"; }
if (rec.protocol == 101) { sessionName += ' - ' + "Intel&reg; AMT Redirection"; } if (rec.protocol == 101) { sessionName += ' - ' + "Intel&reg; AMT Redirection"; }
if (rec.protocol == 200) { sessionName += ' - ' + "Messenger"; } if (rec.protocol == 200) { sessionName += ' - ' + "Messenger"; }
@ -17497,6 +17500,9 @@
if (rec.protocol == 1) { protocolStr = "Terminal"; } if (rec.protocol == 1) { protocolStr = "Terminal"; }
if (rec.protocol == 2) { protocolStr = "Desktop"; } if (rec.protocol == 2) { protocolStr = "Desktop"; }
if (rec.protocol == 5) { protocolStr = "Files"; } if (rec.protocol == 5) { protocolStr = "Files"; }
if (rec.protocol == 6) { protocolStr = "Admin PowerShell"; }
if (rec.protocol == 8) { protocolStr = "User Shell"; }
if (rec.protocol == 9) { protocolStr = "User PowerShell"; }
if (rec.protocol == 100) { protocolStr = "Intel&reg; AMT WSMAN"; } if (rec.protocol == 100) { protocolStr = "Intel&reg; AMT WSMAN"; }
if (rec.protocol == 101) { protocolStr = "Intel&reg; AMT Redirection"; } if (rec.protocol == 101) { protocolStr = "Intel&reg; AMT Redirection"; }
if (rec.protocol == 200) { protocolStr = "Messenger"; } if (rec.protocol == 200) { protocolStr = "Messenger"; }
@ -17839,6 +17845,9 @@
if (v == 1) return "Terminal"; if (v == 1) return "Terminal";
if (v == 2) return "Desktop"; if (v == 2) return "Desktop";
if (v == 5) return "Files"; if (v == 5) return "Files";
if (v == 6) return "Admin PowerShell";
if (v == 8) return "User Shell";
if (v == 9) return "User PowerShell";
if (v == 100) return "AMT-WSMAN"; if (v == 100) return "AMT-WSMAN";
if (v == 101) return "AMT-Redir"; if (v == 101) return "AMT-Redir";
if (v == 200) return "Messenger"; if (v == 200) return "Messenger";
@ -17940,7 +17949,17 @@
if (v == 1) return "Terminal"; if (v == 1) return "Terminal";
if (v == 2) return "Desktop"; if (v == 2) return "Desktop";
if (v == 5) return "Files"; if (v == 5) return "Files";
return "Unknown"; if (v == 6) return "Admin PowerShell";
if (v == 8) return "User Shell";
if (v == 9) return "User PowerShell";
if (v == 100) return "AMT-WSMAN";
if (v == 101) return "AMT-Redir";
if (v == 200) return "Messenger";
if (v == 201) return "Web-RDP";
if (v == 202) return "Web-SSH";
if (v == 203) return "Web-SFTP";
if (v == 204) return "Web-VNC";
return "Unknown" + ' (' + v + ')';
} }
if (f == 'node') { if (f == 'node') {
var node = getNodeFromId(v); var node = getNodeFromId(v);

View File

@ -18733,6 +18733,9 @@
if (rec.protocol == 1) { sessionName += ' - ' + "Terminal Session"; } if (rec.protocol == 1) { sessionName += ' - ' + "Terminal Session"; }
if (rec.protocol == 2) { sessionName += ' - ' + "Desktop Session"; } if (rec.protocol == 2) { sessionName += ' - ' + "Desktop Session"; }
if (rec.protocol == 5) { sessionName += ' - ' + "File Transfer"; } if (rec.protocol == 5) { sessionName += ' - ' + "File Transfer"; }
if (rec.protocol == 6) { sessionName += ' - ' + "Admin PowerShell"; }
if (rec.protocol == 8) { sessionName += ' - ' + "User Shell"; }
if (rec.protocol == 9) { sessionName += ' - ' + "User PowerShell"; }
if (rec.protocol == 100) { sessionName += ' - ' + "Intel&reg; AMT WSMAN"; } if (rec.protocol == 100) { sessionName += ' - ' + "Intel&reg; AMT WSMAN"; }
if (rec.protocol == 101) { sessionName += ' - ' + "Intel&reg; AMT Redirection"; } if (rec.protocol == 101) { sessionName += ' - ' + "Intel&reg; AMT Redirection"; }
if (rec.protocol == 200) { sessionName += ' - ' + "Messenger"; } if (rec.protocol == 200) { sessionName += ' - ' + "Messenger"; }
@ -18763,6 +18766,9 @@
if (rec.protocol == 1) { protocolStr = "Terminal"; } if (rec.protocol == 1) { protocolStr = "Terminal"; }
if (rec.protocol == 2) { protocolStr = "Desktop"; } if (rec.protocol == 2) { protocolStr = "Desktop"; }
if (rec.protocol == 5) { protocolStr = "Files"; } if (rec.protocol == 5) { protocolStr = "Files"; }
if (rec.protocol == 6) { protocolStr = "Admin PowerShell"; }
if (rec.protocol == 8) { protocolStr = "User Shell"; }
if (rec.protocol == 9) { protocolStr = "User PowerShell"; }
if (rec.protocol == 100) { protocolStr = "Intel&reg; AMT WSMAN"; } if (rec.protocol == 100) { protocolStr = "Intel&reg; AMT WSMAN"; }
if (rec.protocol == 101) { protocolStr = "Intel&reg; AMT Redirection"; } if (rec.protocol == 101) { protocolStr = "Intel&reg; AMT Redirection"; }
if (rec.protocol == 200) { protocolStr = "Messenger"; } if (rec.protocol == 200) { protocolStr = "Messenger"; }
@ -19109,6 +19115,9 @@
if (v == 1) return "Terminal"; if (v == 1) return "Terminal";
if (v == 2) return "Desktop"; if (v == 2) return "Desktop";
if (v == 5) return "Files"; if (v == 5) return "Files";
if (v == 6) return "Admin PowerShell";
if (v == 8) return "User Shell";
if (v == 9) return "User PowerShell";
if (v == 100) return "AMT-WSMAN"; if (v == 100) return "AMT-WSMAN";
if (v == 101) return "AMT-Redir"; if (v == 101) return "AMT-Redir";
if (v == 200) return "Messenger"; if (v == 200) return "Messenger";
@ -19210,7 +19219,17 @@
if (v == 1) return "Terminal"; if (v == 1) return "Terminal";
if (v == 2) return "Desktop"; if (v == 2) return "Desktop";
if (v == 5) return "Files"; if (v == 5) return "Files";
return "Unknown"; if (v == 6) return "Admin PowerShell";
if (v == 8) return "User Shell";
if (v == 9) return "User PowerShell";
if (v == 100) return "AMT-WSMAN";
if (v == 101) return "AMT-Redir";
if (v == 200) return "Messenger";
if (v == 201) return "Web-RDP";
if (v == 202) return "Web-SSH";
if (v == 203) return "Web-SFTP";
if (v == 204) return "Web-VNC";
return "Unknown" + ' (' + v + ')';
} }
if (f == 'node') { if (f == 'node') {
var node = getNodeFromId(v); var node = getNodeFromId(v);

View File

@ -401,6 +401,9 @@
var p = recFileMetadata.protocol; var p = recFileMetadata.protocol;
if (p == 1) { p = "MeshCentral Terminal"; } if (p == 1) { p = "MeshCentral Terminal"; }
else if (p == 2) { p = "MeshCentral Desktop"; } else if (p == 2) { p = "MeshCentral Desktop"; }
else if (p == 6) { p = "Admin PowerShell"; }
else if (p == 8) { p = "User Shell"; }
else if (p == 9) { p = "User PowerShell"; }
else if (p == 100) { p = "Intel&reg; AMT WSMAN"; } else if (p == 100) { p = "Intel&reg; AMT WSMAN"; }
else if (p == 101) { p = "Intel&reg; AMT Redirection"; } else if (p == 101) { p = "Intel&reg; AMT Redirection"; }
else if ((p == 102) || (p == 200 && recFileMetadata.bpp != null)) { p = "Intel&reg; AMT KVM"; } else if ((p == 102) || (p == 200 && recFileMetadata.bpp != null)) { p = "Intel&reg; AMT KVM"; }
@ -427,7 +430,7 @@
QV('TermParent', false); QV('TermParent', false);
QV('XTermParent', false); QV('XTermParent', false);
QV('ConvertAsWebM', false); QV('ConvertAsWebM', false);
if (recFileMetadata.protocol == 1) { if ((recFileMetadata.protocol == 1) || (recFileMetadata.protocol == 6) || (recFileMetadata.protocol == 8) || (recFileMetadata.protocol == 9)) {
// MeshCentral remote terminal // MeshCentral remote terminal
recFileProtocol = 1; recFileProtocol = 1;
x += '<br /><br /><span style=color:gray>' + "Press [space] to play/pause." + '</span>'; x += '<br /><br /><span style=color:gray>' + "Press [space] to play/pause." + '</span>';