Fix bug with throttlespeed in ssh conn
This commit is contained in:
parent
e9d2f3581c
commit
ca96115fe2
@ -21,7 +21,7 @@ HostKeyPath = ""
|
|||||||
# Log level for SSH Honeypot
|
# Log level for SSH Honeypot
|
||||||
# Must be either "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "NONE"
|
# Must be either "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "NONE"
|
||||||
# Default: "INFO"
|
# Default: "INFO"
|
||||||
LogLevel = "INFO"
|
LogLevel = "DEBUG"
|
||||||
# Address and port to listen to
|
# Address and port to listen to
|
||||||
# Default: ":2222"
|
# Default: ":2222"
|
||||||
ListenAddr = ":2222"
|
ListenAddr = ":2222"
|
||||||
|
@ -60,6 +60,8 @@ func NewHoneypotServer(cfg config.HoneypotConfig, store store.LoginAttemptStore)
|
|||||||
hs.sshServer.AddHostKey(signer)
|
hs.sshServer.AddHostKey(signer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hs.throttleSpeed = 1024 * 1024
|
||||||
|
|
||||||
return &hs, nil
|
return &hs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +118,6 @@ func (hs *HoneypotServer) passwordHandler(ctx sshlib.Context, password string) b
|
|||||||
|
|
||||||
func (s *HoneypotServer) connCallback(ctx sshlib.Context, conn net.Conn) net.Conn {
|
func (s *HoneypotServer) connCallback(ctx sshlib.Context, conn net.Conn) net.Conn {
|
||||||
s.Logger.Debugw("Connection received.", "remote_addr", conn.RemoteAddr())
|
s.Logger.Debugw("Connection received.", "remote_addr", conn.RemoteAddr())
|
||||||
conn.RemoteAddr()
|
|
||||||
|
|
||||||
throttledConn := newThrottledConn(conn)
|
throttledConn := newThrottledConn(conn)
|
||||||
throttledConn.SetSpeed(s.throttleSpeed)
|
throttledConn.SetSpeed(s.throttleSpeed)
|
||||||
|
Loading…
Reference in New Issue
Block a user