Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh爆破问题 #246

Open
i11us0ry opened this issue Jul 13, 2021 · 3 comments
Open

ssh爆破问题 #246

i11us0ry opened this issue Jul 13, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@i11us0ry
Copy link

i11us0ry commented Jul 13, 2021

微信图片_20210713103345

如图,goby爆ssh显示成功,但实际上账户密码是错误的,我想goby和很多ssh爆破工具、脚本都是通过建立Session来判断是否爆破成功。但实际上某些设备你使用错误账号密码登录时好像也会建立session,导致误报。以65.187.136.4为例,ssh.Dial()和client.NewSession()结果err都是nil,但实际上这个session是让你继续输入正确账户密码而不是登录成功的session。因此我觉得可以在建立session后发送一个指令来判断ssh是否爆破成功,如下:

client, err := ssh.Dial("tcp", host, config)
if err == nil {
	defer client.Close()
	session, err := client.NewSession()
	if err == nil {
		defer session.Close()
		combo, _ := session.CombinedOutput("whoami")
		if find := strings.Contains(string(combo), "login"); !find {
			result := fmt.Sprintf("SSH:%-20v %v:%-10v", host, user, pass)
			return result
		}
	}
}
@gobysec gobysec added the bug Something isn't working label Jul 20, 2021
@gobysec
Copy link
Owner

gobysec commented Oct 7, 2023

已收到您的反馈,我们尽快优化,优化后会向您致谢,您可以联系微信号:gobyteam,感谢您对Goby喜爱与支持~

@gobysec
Copy link
Owner

gobysec commented Nov 21, 2023

确实存在该问题,问题成因是SSH Server端没有使用SSH协议自带的鉴权能力来进行身份鉴别,而是与Telnet类似的方式来进行身份鉴别,资产较少,且要完美解决较为复杂,低优先级处理。

@gobysec
Copy link
Owner

gobysec commented Nov 21, 2023

已在Goby最新版本V2.8.1版本解决此问题~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants