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

target形式和-m参数冲突,导致产生歧义 #16

Closed
zlgxzswjy opened this issue Apr 13, 2023 · 1 comment
Closed

target形式和-m参数冲突,导致产生歧义 #16

zlgxzswjy opened this issue Apr 13, 2023 · 1 comment

Comments

@zlgxzswjy
Copy link

zlgxzswjy commented Apr 13, 2023

代码片段位于:zpscan/pkg/crack/parse.go的 ParseTargets函数中
image

parse.go文件的第16行,tmp = strings.Split(tmp[1], "|")

tmp参数原本来自于对target参数的分割,tmp[0]是ip,tmp[1]是端口。但这里对tmp[1]又用 '|'进行了分割,并且把分割后的值覆盖了原来的tmp,导致下面对tmp的判断永远不可能==2。所以如果target的形式是x.x.x.x:2022这种非标端口,走到这一步后,len(tmp)==2这个判断永远不成立。只能走else分支,但是在预置端口-服务对应关系列表中找不到2022端口,此时及时制定了-m为ssh,也会提示目标为空

下图是证明,都是爆破ssh服务,非标端口时无法正常运行
image

从作者代码看,|应该是为了支持 x.x.x.x:2022|ssh这种形式。不过这里既然有-m参数,建议能够把-m参数和 ip:port|servername这两种形式合并下。比较容易歧义

@zlgxzswjy zlgxzswjy changed the title 疑似一段逻辑错误导致破解模块不能在非标端口执行 target形式和-m参数冲突,导致产生歧义 Apr 13, 2023
@niudaii
Copy link
Owner

niudaii commented Apr 16, 2023

image

我设计 -m 不是为了指定 input,而是加载完 input 后进行过滤,比如多行 input 127.0.0.1:2222|ssh 127.0.0.1:3306|mysql 指定 -m ssh 时只爆破 127.0.0.1:2222|ssh

@niudaii niudaii closed this as completed Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants