1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-22 11:13:21 +00:00

Updated user session enumeration for linux, to include more metadata

This commit is contained in:
Bryan Roe
2022-03-16 19:36:12 -07:00
parent fb0ae1221d
commit b0f0ac24b3
2 changed files with 13 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -648,7 +648,9 @@ function UserSessions()
child.stdin.write(' if((tok[2]+0)>=' + min + ')'); child.stdin.write(' if((tok[2]+0)>=' + min + ')');
child.stdin.write(' {'); child.stdin.write(' {');
child.stdin.write(' if(tok[4]=="") { continue; }'); child.stdin.write(' if(tok[4]=="") { continue; }');
child.stdin.write(' printf "%s{\\"Username\\": \\"%s\\", \\"SessionId\\": \\"%s\\", \\"State\\": \\"Online\\", \\"uid\\": \\"%s\\"}", del, tok[3], tok[1], tok[2];'); child.stdin.write(' station="Console";');
child.stdin.write(' if(tok[4]~/^pts\\//) { station=tok[4]; }');
child.stdin.write(' printf "%s{\\"Username\\": \\"%s\\", \\"Domain\\":\\"\\", \\"SessionId\\": \\"%s\\", \\"State\\": \\"Online\\", \\"uid\\": \\"%s\\", \\"StationName\\": \\"%s\\"}", del, tok[3], tok[1], tok[2], station;');
child.stdin.write(' del=",";'); child.stdin.write(' del=",";');
child.stdin.write(' }'); child.stdin.write(' }');
child.stdin.write('}'); child.stdin.write('}');
@@ -695,6 +697,15 @@ function UserSessions()
{ {
} }
} }
var vids = this.virtualUids();
for (i in vids)
{
var u = this.getUsername(vids[i].uid);
ret[i] = { Username: u, SessionId: vids[i].pid, State: 'Connected', uid: vids[i].uid, StationName: 'Xvfb-' + vids[i].uid };
}
Object.defineProperty(ret, 'Active', { value: showActiveOnly(ret) }); Object.defineProperty(ret, 'Active', { value: showActiveOnly(ret) });
if (cb) if (cb)