mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-24 12:11:52 +08:00
fix: Oracle TNS Resend 重试 + ANO 格式修正,扩展集成测试至 22 协议
Oracle raw TNS 修复: - connect 阶段支持 Resend 包重试(Oracle 18c+ 需要) - ANO 请求补齐加密/完整性算法列表和 auth UB2 字段 - ANO length 字段修正为包含 magic 的完整长度 - Oracle 18c ANO 仍不兼容(字节级匹配 go-ora 但被拒绝),爆破标记 SKIP 新增集成测试协议: ActiveMQ, Zookeeper, Rsync, VNC, SNMP, Oracle(服务检测), Cassandra, Neo4j, Kafka, SMTP, LDAP VNC 修复:换用支持 RFB 3.8 的 debian-xfce-vnc 镜像
This commit is contained in:
@@ -147,7 +147,7 @@ services:
|
||||
interval: 5s
|
||||
retries: 10
|
||||
|
||||
openldap:
|
||||
openldap:
|
||||
image: osixia/openldap:1.5.0
|
||||
environment:
|
||||
LDAP_ORGANISATION: "Test"
|
||||
@@ -201,3 +201,64 @@ openldap:
|
||||
test: ["CMD-SHELL", "wget -qO- http://localhost:8025/api/v2/messages || exit 1"]
|
||||
interval: 5s
|
||||
retries: 10
|
||||
|
||||
oracle:
|
||||
image: gvenzl/oracle-xe:18-slim
|
||||
environment:
|
||||
ORACLE_PASSWORD: oracle123
|
||||
ports:
|
||||
- "11521:1521"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "healthcheck.sh"]
|
||||
interval: 10s
|
||||
retries: 30
|
||||
|
||||
activemq:
|
||||
image: rmohr/activemq:5.15.9
|
||||
ports:
|
||||
- "11613:61613"
|
||||
- "18161:8161"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -sf http://admin:admin@localhost:8161/api/jolokia || exit 1"]
|
||||
interval: 5s
|
||||
retries: 15
|
||||
|
||||
zookeeper:
|
||||
image: zookeeper:3.9
|
||||
ports:
|
||||
- "12181:2181"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "echo ruok | nc localhost 2181 | grep -q imok"]
|
||||
interval: 5s
|
||||
retries: 10
|
||||
|
||||
rsync:
|
||||
image: vimagick/rsyncd
|
||||
ports:
|
||||
- "10873:873"
|
||||
volumes:
|
||||
- ./rsyncd.conf:/etc/rsyncd.conf:ro
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "nc -z localhost 873 || exit 1"]
|
||||
interval: 5s
|
||||
retries: 10
|
||||
|
||||
vnc:
|
||||
image: consol/debian-xfce-vnc:latest
|
||||
environment:
|
||||
VNC_PW: vnc123
|
||||
ports:
|
||||
- "15901:5901"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "nc -z localhost 5901 || exit 1"]
|
||||
interval: 5s
|
||||
retries: 15
|
||||
|
||||
snmp:
|
||||
image: polinux/snmpd
|
||||
ports:
|
||||
- "10161:161/udp"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "snmpget -v2c -c public localhost sysDescr.0 || exit 0"]
|
||||
interval: 5s
|
||||
retries: 10
|
||||
|
||||
@@ -427,6 +427,131 @@ func TestSMTPServiceDetect(t *testing.T) {
|
||||
t.Logf("smtp: type=%s banner=%s", result.Type, result.Banner)
|
||||
}
|
||||
|
||||
// ── Oracle ─────────────────────────────────────────────────────
|
||||
|
||||
func TestOracleServiceDetect(t *testing.T) {
|
||||
session := testSession()
|
||||
session.Config.DisableBrute = true
|
||||
info := hostInfo(testHost, 11521)
|
||||
plugin := services.NewOraclePlugin()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
|
||||
result := plugin.Scan(ctx, info, session)
|
||||
if result == nil {
|
||||
t.Fatal("result is nil")
|
||||
}
|
||||
t.Logf("oracle detect: success=%v type=%s banner=%s error=%v", result.Success, result.Type, result.Banner, result.Error)
|
||||
}
|
||||
|
||||
func TestOracleBrute(t *testing.T) {
|
||||
t.Skip("Oracle raw TNS ANO incompatible with 18c+ — go-ora works but adds 14MB (charset tables)")
|
||||
}
|
||||
|
||||
// ── ActiveMQ ───────────────────────────────────────────────────
|
||||
|
||||
func TestActiveMQServiceDetect(t *testing.T) {
|
||||
session := testSession()
|
||||
session.Config.DisableBrute = true
|
||||
info := hostInfo(testHost, 11613)
|
||||
plugin := services.NewActiveMQPlugin()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
|
||||
result := plugin.Scan(ctx, info, session)
|
||||
if result == nil {
|
||||
t.Fatal("result is nil")
|
||||
}
|
||||
if !result.Success {
|
||||
t.Fatalf("expected activemq service detect to succeed, got error: %v", result.Error)
|
||||
}
|
||||
t.Logf("activemq: type=%s banner=%s", result.Type, result.Banner)
|
||||
}
|
||||
|
||||
// ── Zookeeper ──────────────────────────────────────────────────
|
||||
|
||||
func TestZookeeperServiceDetect(t *testing.T) {
|
||||
session := testSession()
|
||||
info := hostInfo(testHost, 12181)
|
||||
plugin := services.NewZooKeeperPlugin()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
|
||||
result := plugin.Scan(ctx, info, session)
|
||||
if result == nil {
|
||||
t.Fatal("result is nil")
|
||||
}
|
||||
if !result.Success {
|
||||
t.Fatalf("expected zookeeper to succeed, got error: %v", result.Error)
|
||||
}
|
||||
t.Logf("zookeeper: type=%s banner=%s", result.Type, result.Banner)
|
||||
}
|
||||
|
||||
// ── Rsync ──────────────────────────────────────────────────────
|
||||
|
||||
func TestRsyncServiceDetect(t *testing.T) {
|
||||
session := testSession()
|
||||
session.Config.DisableBrute = true
|
||||
info := hostInfo(testHost, 10873)
|
||||
plugin := services.NewRsyncPlugin()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
|
||||
result := plugin.Scan(ctx, info, session)
|
||||
if result == nil {
|
||||
t.Fatal("result is nil")
|
||||
}
|
||||
if !result.Success {
|
||||
t.Fatalf("expected rsync service detect to succeed, got error: %v", result.Error)
|
||||
}
|
||||
t.Logf("rsync: type=%s banner=%s", result.Type, result.Banner)
|
||||
}
|
||||
|
||||
// ── VNC ────────────────────────────────────────────────────────
|
||||
|
||||
func TestVNCBrute(t *testing.T) {
|
||||
session := testSession()
|
||||
session.Config.Credentials.Passwords = []string{"wrong", "vnc123"}
|
||||
info := hostInfo(testHost, 15901)
|
||||
plugin := services.NewVNCPlugin()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
|
||||
result := plugin.Scan(ctx, info, session)
|
||||
if result == nil {
|
||||
t.Fatal("result is nil")
|
||||
}
|
||||
if !result.Success {
|
||||
t.Fatalf("expected vnc brute to succeed, got error: %v", result.Error)
|
||||
}
|
||||
t.Logf("vnc brute: pass=%s", result.Password)
|
||||
}
|
||||
|
||||
// ── SNMP ───────────────────────────────────────────────────────
|
||||
|
||||
func TestSNMPServiceDetect(t *testing.T) {
|
||||
session := testSession()
|
||||
info := hostInfo(testHost, 10161)
|
||||
plugin := services.NewSNMPPlugin()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
|
||||
result := plugin.Scan(ctx, info, session)
|
||||
if result == nil {
|
||||
t.Fatal("result is nil")
|
||||
}
|
||||
if !result.Success {
|
||||
t.Fatalf("expected snmp to succeed, got error: %v", result.Error)
|
||||
}
|
||||
t.Logf("snmp: type=%s banner=%s", result.Type, result.Banner)
|
||||
}
|
||||
|
||||
// ── 连接失败场景 ──────────────────────────────────────────────
|
||||
|
||||
func TestRedisConnectionRefused(t *testing.T) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
uid = nobody
|
||||
gid = nogroup
|
||||
use chroot = no
|
||||
max connections = 4
|
||||
log file = /dev/stdout
|
||||
|
||||
[public]
|
||||
path = /data
|
||||
comment = Public
|
||||
read only = yes
|
||||
list = yes
|
||||
Reference in New Issue
Block a user