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

扫描指定网段子掩码结果不同 #25

Open
helloyw opened this issue Nov 19, 2024 · 5 comments
Open

扫描指定网段子掩码结果不同 #25

helloyw opened this issue Nov 19, 2024 · 5 comments

Comments

@helloyw
Copy link

helloyw commented Nov 19, 2024

./k8spider all -c 10.100.207.16/24 使用命令对/24进行扫描可以探测到service

root@ubuntu-pod:/# ./k8spider all  -c 10.100.207.16/24
INFO[0000] kubernetes.default.svc.cluster.local found in dns(<default-dns>)! response: [10.96.0.1] 
WARN[0000] wildcard dns query to any.any.svc.cluster.local. failed: lookup any.any.svc.cluster.local. on 10.96.0.10:53: no such host 
WARN[0000] wildcard dns query to any.any.any.svc.cluster.local. failed: lookup any.any.any.svc.cluster.local. on 10.96.0.10:53: no such host 
ERRO[0000] Transfer failed: dns: bad xfr rcode: 5       
INFO[0000] PTRrecord 10.100.207.16 --> argo-server.argo.svc.cluster.local. 
{"Ip":"10.100.207.16","SvcDomain":"argo-server.argo.svc.cluster.local.","SrvRecords":null}
INFO[0002] Extract Namespaces:                          
INFO[0002] Namespace: argo                              
INFO[0002] Extract Service:                             
INFO[0002] Service: argo-server.argo.svc.cluster.local. 

./k8spider all -c 10.100.207.16/16 这样就扫不到了

root@ubuntu-pod:/# ./k8spider all  -c 10.100.207.16/16
INFO[0000] kubernetes.default.svc.cluster.local found in dns(<default-dns>)! response: [10.96.0.1] 
WARN[0000] wildcard dns query to any.any.svc.cluster.local. failed: lookup any.any.svc.cluster.local. on 10.96.0.10:53: no such host 
WARN[0000] wildcard dns query to any.any.any.svc.cluster.local. failed: lookup any.any.any.svc.cluster.local. on 10.96.0.10:53: no such host 
ERRO[0000] Transfer failed: dns: bad xfr rcode: 5       
WARN[0002] ScanSubnet Found Nothing                     
INFO[0002] Extract Namespaces:                          
INFO[0002] Extract Service:   
@helloyw
Copy link
Author

helloyw commented Nov 19, 2024

我调整了线程-t 10也探测不到

root@ubuntu-pod:/# ./k8spider all  -c 10.100.207.16/16 -t 10
INFO[0000] kubernetes.default.svc.cluster.local found in dns(<default-dns>)! response: [10.96.0.1] 
WARN[0000] wildcard dns query to any.any.svc.cluster.local. failed: lookup any.any.svc.cluster.local. on 10.96.0.10:53: no such host 
WARN[0000] wildcard dns query to any.any.any.svc.cluster.local. failed: lookup any.any.any.svc.cluster.local. on 10.96.0.10:53: no such host 
ERRO[0000] Transfer failed: dns: bad xfr rcode: 5       
INFO[0002] Extract Namespaces:                          
INFO[0002] Extract Service:    

@Esonhugh
Copy link
Owner

-vv 试试呢?
这个问题很奇怪 目前没有环境帮我复现

@Esonhugh
Copy link
Owner

Esonhugh commented Nov 20, 2024

但是目前我有一个小小的猜测 可能是因为 dns 服务接受了过多请求/可能 dns 服务挂起
ctx, _ := context.WithTimeout(context.Background(), time.Duration(DnsTimeout)*time.Second) // I don't think if a inside cluster dns query has more than 2s latency.
并且我默认配置了两秒延迟 可以尝试配置 --dns-timeout=10 来配置十秒延迟来再次测试这个问题

@helloyw
Copy link
Author

helloyw commented Nov 21, 2024

但是目前我有一个小小的猜测 可能是因为 dns 服务接受了过多请求/可能 dns 服务挂起 ctx, _ := context.WithTimeout(context.Background(), time.Duration(DnsTimeout)*time.Second) // I don't think if a inside cluster dns query has more than 2s latency. 并且我默认配置了两秒延迟 可以尝试配置 --dns-timeout=10 来配置十秒延迟来再次测试这个问题

还是识别不到,我的环境是通过minikube搭建的k8s环境进行的测试

root@ubuntu-pod:/# ./k8spider all -c 10.100.207.16/16 --dns-timeout=30
INFO[0000] kubernetes.default.svc.cluster.local found in dns(<default-dns>)! response: [10.96.0.1] 
WARN[0000] wildcard dns query to any.any.svc.cluster.local. failed: lookup any.any.svc.cluster.local. on 10.96.0.10:53: no such host 
WARN[0000] wildcard dns query to any.any.any.svc.cluster.local. failed: lookup any.any.any.svc.cluster.local. on 10.96.0.10:53: no such host 
ERRO[0000] Transfer failed: dns: bad xfr rcode: 5       
WARN[0002] ScanSubnet Found Nothing                     
INFO[0002] Extract Namespaces:                          
INFO[0002] Extract Service:        

@helloyw
Copy link
Author

helloyw commented Nov 21, 2024

同样还有一个问题,除了上面提到的10.100.207.16/24
image
我针对ARGOCD_SERVER_SERVICE_HOST=10.109.104.211,指定子腌码为24也探测不到,但是通过dig命令可以(dig +short -x 10.109.104.211)
./k8spider all -c 10.109.104.211/24 --dns-timeout=30
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants