aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/c_exec.go4
-rw-r--r--src/i_info.go47
2 files changed, 49 insertions, 2 deletions
diff --git a/src/c_exec.go b/src/c_exec.go
index b9990d9..d36951b 100644
--- a/src/c_exec.go
+++ b/src/c_exec.go
@@ -53,6 +53,7 @@ package main
import (
"bytes"
+ // "fmt"
"math/rand/v2"
"os"
"os/exec"
@@ -243,7 +244,7 @@ func c_redirect_ssh(host *HostNode, local_port uint16) error {
rdr_fmt = append(rdr_fmt, "-p", strconv.Itoa(int(host.Jump.Port)))
}
rdr_fmt = append(rdr_fmt, host.Jump.User + "@" + host.Jump.Host,
- "-", "sleep", "5")
+ "sleep", "5")
if err := exec.Command(rdr_fmt[0], rdr_fmt[1:]...).Run(); err != nil {
return err
}
@@ -258,7 +259,6 @@ func c_exec(host *HostNode, opts HardOpts, ui *HardUI) {
if host.Protocol == PROTOCOL_RDP && len(host.Jump.Host) != 0 {
local_host := "127.0.0.1"
local_port := uint16(rand.IntN(40000) + 4389)
- ui.s.Fini()
if err := c_redirect_ssh(host, local_port); err != nil {
c_error_mode("ssh tunneling", err, ui)
return
diff --git a/src/i_info.go b/src/i_info.go
index dc1d70b..a5860f3 100644
--- a/src/i_info.go
+++ b/src/i_info.go
@@ -295,6 +295,53 @@ func i_info_rdp(ui HardUI, host *HostNode, line int) int {
}
if line += 1; line > ui.dim[H] - 3 { return line }
}
+ // jump
+ if len(host.Jump.Host) > 0 {
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line,
+ ui.style[TITLE_STYLE], "Jump settings: ")
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 4, line, ui.dim[W] - 2, line,
+ ui.style[TITLE_STYLE], "Host: ")
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 10, line, ui.dim[W] - 2, line,
+ ui.style[DEF_STYLE], host.Jump.Host)
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 4, line, ui.dim[W] - 2, line,
+ ui.style[TITLE_STYLE], "Port: ")
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 10, line, ui.dim[W] - 2, line,
+ ui.style[DEF_STYLE], strconv.Itoa(int(host.Jump.Port)))
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 4, line, ui.dim[W] - 2, line,
+ ui.style[TITLE_STYLE], "User: ")
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 10, line, ui.dim[W] - 2, line,
+ ui.style[DEF_STYLE], host.Jump.User)
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ if len(host.Jump.Pass) > 0 {
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 4, line, ui.dim[W] - 2, line,
+ ui.style[TITLE_STYLE], "Pass: ")
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 10, line, ui.dim[W] - 2, line,
+ ui.style[DEF_STYLE], "***")
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ }
+ if len(host.Jump.Priv) > 0 {
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 4, line, ui.dim[W] - 2, line,
+ ui.style[TITLE_STYLE], "Privkey: ")
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 13, line, ui.dim[W] - 2, line,
+ ui.style[DEF_STYLE], host.Jump.Priv)
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ }
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ }
return line
}