ssh detection works
This commit is contained in:
parent
5abff544e9
commit
4368569b25
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue