端口 30222 并不是某个广泛知名服务的固定端口,它通常不是系统保留或标准服务端口。在实际环境中,端口 30222
可能由某个应用随机使用,也可能是用户或某软件自定义配置的。
但根据你提到的:
Metrics 未授权访问漏洞【原理扫描】
结合经验和漏洞分析,可以推测这个端口 极有可能被用来暴露某些服务的监控 Metrics 接口(如 Prometheus 格式的 /metrics),而且该接口未做鉴权控制,从而被安全扫描工具识别为“未授权访问”漏洞。
🧠 典型原因分析
-
某服务监听 30222 端口,暴露 /metrics 接口
-
例如:
- Java 应用(Spring Boot 默认暴露 /actuator/metrics)
- Node Exporter / 自定义 Exporter
- Prometheus Pushgateway
- Python Flask / FastAPI 等框架通过
prometheus_client.start_http_server(30222)
暴露指标
-
-
接口未授权访问
- 没有 token、IP 白名单、认证头等保护
- 直接暴露给公网或内网所有地址,导致泄露敏感指标信息(如 JVM 内存、数据库连接数、接口调用情况等)
-
被安全工具识别为漏洞
- 如:
漏洞扫描工具(如 AWVS、FOFA、ZoomEye、xray)
发现该端口下/metrics
、/actuator/metrics
、/prometheus
可访问,判定为信息泄露类漏洞
- 如:
🔍 如何确认是哪种服务
你可以用以下方式确认 30222 上到底跑的是什么:
# 1. 查看监听该端口的进程
sudo lsof -i :30222
# 或
netstat -tnlp | grep 30222
# 2. 使用 curl 查看端口暴露内容
curl http://<ip>:30222/metrics
curl http://<ip>:30222/actuator/metrics
# 3. 查看 HTTP 头和响应体,判断框架
curl -I http://<ip>:30222
✅ 修复建议
-
鉴权保护接口
- 增加基本认证、Token、或 OAuth2
- Spring Boot 可配置
management.endpoints.web.exposure.include
和management.endpoints.web.base-path
-
IP 白名单限制
- 仅允许 Prometheus 等采集系统访问
-
不暴露到公网
- 限制监听
127.0.0.1
或使用内网防火墙(iptables、安全组)
- 限制监听
-
添加反向代理做统一认证
- 如使用 nginx 或 envoy proxy 加入 token 校验等中间层认证逻辑
🔗 参考链接
- Spring Boot Metrics 安全配置: https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html
- Prometheus 安全部署建议: https://prometheus.io/docs/operating/security/
如果你能提供该端口返回的部分内容(如 /metrics
的输出或 HTTP 响应头),我可以进一步帮你确认是哪种服务。