|
@@ -41,6 +41,15 @@ func HandleCreateProxySession(w http.ResponseWriter, r *http.Request) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ if !*allowSshLoopback {
|
|
|
+ //Not allow loopback connections
|
|
|
+ if strings.EqualFold(strings.TrimSpace(ipaddr), "localhost") || strings.TrimSpace(ipaddr) == "127.0.0.1" {
|
|
|
+ //Request target is loopback
|
|
|
+ utils.SendErrorResponse(w, "loopback web ssh connection is not enabled on this host")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//Check if the target is a valid ssh endpoint
|
|
|
if !sshprox.IsSSHConnectable(ipaddr, port) {
|
|
|
utils.SendErrorResponse(w, ipaddr+":"+strconv.Itoa(port)+" is not a valid SSH server")
|