ssh detection works

This commit is contained in:
AJ ONeal 2018-06-01 02:10:27 -06:00
parent 9239153681
commit e85bd78905
1 changed files with 17 additions and 0 deletions

View File

@ -284,6 +284,23 @@ module.exports.assign = function (state, tun, cb) {
return;
}
function trySsh(tun) {
// https://security.stackexchange.com/questions/43231/plausibly-deniable-ssh-does-it-make-sense?rq=1
// https://tools.ietf.org/html/rfc4253#section-4.2
if ('SSH-2.0-' !== tun.data.slice(0, 8).toString()) {
return false;
}
cb(null, getNetConn(state.config.sshPort || 22));
return true;
}
if ('tcp' === tun.service) {
if (trySsh(tun)) { return; }
cb(new Error("No TCP handler"));
}
console.warn("Unknown service '" + tun.service + "'");
/*
var portList = state.services[service];
var port;