ssh2shell 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ssh2shell.js +1024 -1021
- package/package.json +2 -2
- package/src/ssh2shell.coffee +9 -2
- package/Lots of commands.log +0 -445
- package/first.log +0 -30
- package/second.log +0 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ssh2shell",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"author": "cmp-202",
|
|
5
5
|
"description": "A wrapper class for ssh2 to run multiple sequential commands in an SSH shell session, handle command responses, and tunnel through to other hosts using nested host objects",
|
|
6
6
|
"main": "./lib/ssh2shell.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
],
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|
|
47
|
-
"url": "
|
|
47
|
+
"url": "git+ssh://git@github.com/cmp-202/ssh2shell.git"
|
|
48
48
|
},
|
|
49
49
|
"bugs": {
|
|
50
50
|
"url": "https://github.com/cmp-202/ssh2shell/issues"
|
package/src/ssh2shell.coffee
CHANGED
|
@@ -323,7 +323,6 @@ class SSH2Shell extends Stream
|
|
|
323
323
|
sshFlags += "T" if @sshObj.server.ssh.disablePseudoTTY
|
|
324
324
|
sshFlags += "t" if @sshObj.server.ssh.forcePseudoTTY
|
|
325
325
|
sshFlags += "v" if @sshObj.server.ssh.verbose
|
|
326
|
-
|
|
327
326
|
sshOptions += " -c " + @sshObj.server.ssh.cipherSpec if @sshObj.server.ssh.cipherSpec
|
|
328
327
|
sshOptions += " -e " + @sshObj.server.ssh.escape if @sshObj.server.ssh.escape
|
|
329
328
|
sshOptions += " -E " + @sshObj.server.ssh.logFile if @sshObj.server.ssh.logFile
|
|
@@ -331,7 +330,15 @@ class SSH2Shell extends Stream
|
|
|
331
330
|
sshOptions += " -i " + @sshObj.server.ssh.identityFile if @sshObj.server.ssh.identityFile
|
|
332
331
|
sshOptions += " -l " + @sshObj.server.ssh.loginName if @sshObj.server.ssh.loginName
|
|
333
332
|
sshOptions += " -m " + @sshObj.server.ssh.macSpec if @sshObj.server.ssh.macSpec
|
|
334
|
-
|
|
333
|
+
shellQuote = (value) -> "'" + String(value).replace(/'/g, "'\\''") + "'"
|
|
334
|
+
shellControlChars = /[;&|`$\n\r]/
|
|
335
|
+
for option, value of (@sshObj.server.ssh.options or {})
|
|
336
|
+
if shellControlChars.test(option) or shellControlChars.test(value)
|
|
337
|
+
@.emit 'error',"Malicious characters detected in SSH options.","Security Alert",true
|
|
338
|
+
return
|
|
339
|
+
safeOption = String(option).replace(/[^a-zA-Z0-9]/g, "")
|
|
340
|
+
safeValue = shellQuote(value)
|
|
341
|
+
sshOptions += " -o #{safeOption}=#{safeValue}"
|
|
335
342
|
sshOptions += ' -o "StrictHostKeyChecking=no"'
|
|
336
343
|
sshOptions += " -p #{@sshObj.server.port}"
|
|
337
344
|
@sshObj.sshAuth = false
|