Skip to content

Commit

Permalink
Added Web based RDP support with NLA, #3867 and #3914
Browse files Browse the repository at this point in the history
  • Loading branch information
Ylianst committed Apr 29, 2022
1 parent f88d306 commit db06ec1
Show file tree
Hide file tree
Showing 37 changed files with 28,171 additions and 41 deletions.
40 changes: 40 additions & 0 deletions MeshCentralServer.njsproj
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,37 @@
<Compile Include="public\novnc\vendor\promise.js" />
<Compile Include="public\scripts\agent-redir-rtc-0.1.0.js" />
<Compile Include="public\serviceworker.js" />
<Compile Include="rdp\asn1\ber.js" />
<Compile Include="rdp\asn1\index.js" />
<Compile Include="rdp\asn1\spec.js" />
<Compile Include="rdp\asn1\univ.js" />
<Compile Include="rdp\core\error.js" />
<Compile Include="rdp\core\index.js" />
<Compile Include="rdp\core\layer.js" />
<Compile Include="rdp\core\log.js" />
<Compile Include="rdp\core\rle.js" />
<Compile Include="rdp\core\type.js" />
<Compile Include="rdp\index.js" />
<Compile Include="rdp\protocol\cert.js" />
<Compile Include="rdp\protocol\index.js" />
<Compile Include="rdp\protocol\nla.js" />
<Compile Include="rdp\protocol\pdu\caps.js" />
<Compile Include="rdp\protocol\pdu\data.js" />
<Compile Include="rdp\protocol\pdu\global.js" />
<Compile Include="rdp\protocol\pdu\index.js" />
<Compile Include="rdp\protocol\pdu\lic.js" />
<Compile Include="rdp\protocol\pdu\sec.js" />
<Compile Include="rdp\protocol\rdp.js" />
<Compile Include="rdp\protocol\t125\gcc.js" />
<Compile Include="rdp\protocol\t125\index.js" />
<Compile Include="rdp\protocol\t125\mcs.js" />
<Compile Include="rdp\protocol\t125\per.js" />
<Compile Include="rdp\protocol\tpkt.js" />
<Compile Include="rdp\protocol\x224.js" />
<Compile Include="rdp\security\index.js" />
<Compile Include="rdp\security\jsbn.js" />
<Compile Include="rdp\security\rsa.js" />
<Compile Include="rdp\security\x509.js" />
<Compile Include="swarmserver.js" />
<Compile Include="multiserver.js" />
<Compile Include="pass.js" />
Expand Down Expand Up @@ -550,6 +581,8 @@
<Content Include="public\styles\style.css" />
<Content Include="public\translate.bat" />
<Content Include="public\translator.htm" />
<Content Include="rdp\LICENSE" />
<Content Include="rdp\README.md" />
<Content Include="readme.md" />
<Content Include="sample-config-advanced.json" />
<Content Include="sample-config.json" />
Expand Down Expand Up @@ -624,6 +657,13 @@
<Folder Include="public\styles\font-awesome\fonts\" />
<Folder Include="public\styles\font-awesome\less\" />
<Folder Include="public\styles\font-awesome\scss\" />
<Folder Include="rdp\" />
<Folder Include="rdp\asn1\" />
<Folder Include="rdp\core\" />
<Folder Include="rdp\protocol\" />
<Folder Include="rdp\protocol\pdu\" />
<Folder Include="rdp\protocol\t125\" />
<Folder Include="rdp\security\" />
<Folder Include="translate\" />
<Folder Include="typings\" />
<Folder Include="typings\globals\" />
Expand Down
5 changes: 3 additions & 2 deletions apprelays.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ module.exports.CreateMstscRelay = function (parent, db, ws, req, args, domain) {
function startRdp(port) {
parent.parent.debug('relay', 'RDP: Starting RDP client on loopback port ' + port);
try {
rdpClient = require('node-rdpjs-2').createClient({
logLevel: 'ERROR',
//rdpClient = require('node-rdpjs-2').createClient({
rdpClient = require('./rdp').createClient({
logLevel: 'NONE', // 'ERROR',
domain: obj.infos.domain,
userName: obj.infos.username,
password: obj.infos.password,
Expand Down
8 changes: 5 additions & 3 deletions meshcentral.js
Original file line number Diff line number Diff line change
Expand Up @@ -3478,13 +3478,16 @@ function mainStart() {
const verSplit = process.version.substring(1).split('.');
var nodeVersion = parseInt(verSplit[0]) + (parseInt(verSplit[1]) / 100);

// Check if RDP support if present
var mstsc = true;
try { require('./rdp') } catch (ex) { mstsc = false; }

// Check if Windows SSPI, LDAP, Passport and YubiKey OTP will be used
var sspi = false;
var ldap = false;
var passport = null;
var allsspi = true;
var yubikey = false;
var mstsc = false;
var ssh = false;
var sessionRecording = false;
var domainCount = 0;
Expand All @@ -3499,7 +3502,7 @@ function mainStart() {
if (config.domains[i].sendgrid != null) { sendgrid = true; }
if (config.domains[i].yubikey != null) { yubikey = true; }
if (config.domains[i].auth == 'ldap') { ldap = true; }
if (config.domains[i].mstsc == true) { mstsc = true; }
if (mstsc == false) { config.domains[i].mstsc = false; }
if (config.domains[i].ssh == true) { if (nodeVersion < 11) { config.domains[i].ssh = false; } ssh = true; }
if ((typeof config.domains[i].authstrategies == 'object')) {
if (passport == null) { passport = ['passport']; }
Expand All @@ -3519,7 +3522,6 @@ function mainStart() {
var modules = ['[email protected]', '[email protected]', '@yetzt/nedb', 'https', 'yauzl', 'ipcheck', 'express', '[email protected]', 'multiparty', 'node-forge', '[email protected]', 'compression', 'body-parser', '[email protected]', 'express-handlebars'];
if (require('os').platform() == 'win32') { modules.push('[email protected]'); modules.push('loadavg-windows'); if (sspi == true) { modules.push('node-sspi'); } } // Add Windows modules
if (ldap == true) { modules.push('ldapauth-fork'); }
if (mstsc == true) { modules.push('node-rdpjs-2'); }
if (ssh == true) { if (nodeVersion < 11) { addServerWarning('MeshCentral SSH support requires NodeJS 11 or higher.', 1); } else { modules.push('ssh2'); } }
if (passport != null) { modules.push(...passport); }
if (sessionRecording == true) { modules.push('image-size'); } // Need to get the remote desktop JPEG sizes to index the recodring file.
Expand Down
Loading

0 comments on commit db06ec1

Please sign in to comment.