MCPcopy Index your code
hub / github.com/shadow1ng/fscan / Scan

Method Scan

plugins/services/mysql.go:39–68  ·  view source on GitHub ↗
(ctx context.Context, info *common.HostInfo, session *common.ScanSession)

Source from the content-addressed store, hash-verified

37}
38
39func (p *MySQLPlugin) Scan(ctx context.Context, info *common.HostInfo, session *common.ScanSession) *ScanResult {
40 config := session.Config
41 state := session.State
42 if config.DisableBrute {
43 return p.identifyService(ctx, info, session)
44 }
45
46 credentials := GenerateCredentials("mysql", config)
47 if len(credentials) == 0 {
48 return &ScanResult{
49 Success: false,
50 Service: "mysql",
51 Error: fmt.Errorf("没有可用的测试凭据"),
52 }
53 }
54
55 target := info.Target()
56
57 // 使用公共框架进行并发凭据测试
58 authFn := p.createAuthFunc(info, config, state)
59 testConfig := DefaultConcurrentTestConfigWithTarget(config, info)
60
61 result := TestCredentialsConcurrently(ctx, credentials, authFn, "mysql", testConfig)
62
63 if result.Success {
64 common.LogVuln(i18n.Tr("mysql_credential", target, result.Username, result.Password))
65 }
66
67 return result
68}
69
70// createAuthFunc 创建MySQL认证函数
71func (p *MySQLPlugin) createAuthFunc(info *common.HostInfo, config *common.Config, state *common.State) AuthFunc {

Callers

nothing calls this directly

Calls 8

identifyServiceMethod · 0.95
createAuthFuncMethod · 0.95
LogVulnFunction · 0.92
TrFunction · 0.92
GenerateCredentialsFunction · 0.85
TargetMethod · 0.80

Tested by

no test coverage detected