mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
feat: stream large host scans
This commit is contained in:
@@ -57,10 +57,10 @@ func (p *FTPPlugin) Scan(ctx context.Context, info *common.HostInfo, session *co
|
||||
// 成功后重新连接获取文件列表
|
||||
fileList := p.getFileListAfterAuth(info, result.Username, result.Password, config, state)
|
||||
var output strings.Builder
|
||||
output.WriteString(fmt.Sprintf("FTP %s %s:%s", target, result.Username, result.Password))
|
||||
fmt.Fprintf(&output, "FTP %s %s:%s", target, result.Username, result.Password)
|
||||
if len(fileList) > 0 {
|
||||
for _, file := range fileList {
|
||||
output.WriteString(fmt.Sprintf("\n [->] %s", file))
|
||||
fmt.Fprintf(&output, "\n [->] %s", file)
|
||||
}
|
||||
}
|
||||
session.LogVuln(output.String())
|
||||
@@ -205,7 +205,7 @@ func (p *FTPPlugin) testAnonymousAccess(ctx context.Context, info *common.HostIn
|
||||
output.WriteString(i18n.Tr("ftp_anonymous_access_detail", target, cred.Username, cred.Password))
|
||||
if len(fileList) > 0 {
|
||||
for _, file := range fileList {
|
||||
output.WriteString(fmt.Sprintf("\n [->] %s", file))
|
||||
fmt.Fprintf(&output, "\n [->] %s", file)
|
||||
}
|
||||
}
|
||||
session.LogVuln(output.String())
|
||||
|
||||
@@ -143,11 +143,11 @@ func (p *MS17010Plugin) Exploit(ctx context.Context, info *common.HostInfo, cred
|
||||
switch config.Shellcode {
|
||||
case "bind":
|
||||
output.WriteString("\n" + i18n.GetText("ms17010_exploit_bind_hint") + "\n")
|
||||
output.WriteString(fmt.Sprintf(" nc %s 64531\n", info.Host))
|
||||
fmt.Fprintf(&output, " nc %s 64531\n", info.Host)
|
||||
case "add":
|
||||
output.WriteString("\n" + i18n.GetText("ms17010_exploit_add_hint") + "\n")
|
||||
output.WriteString(i18n.GetText("ms17010_exploit_add_credential") + "\n")
|
||||
output.WriteString(fmt.Sprintf(" RDP: mstsc /v:%s\n", info.Host))
|
||||
fmt.Fprintf(&output, " RDP: mstsc /v:%s\n", info.Host)
|
||||
case "guest":
|
||||
output.WriteString("\n" + i18n.GetText("ms17010_exploit_guest_hint") + "\n")
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ func (p *SmbPlugin) testUnauthorizedAccess(ctx context.Context, info *common.Hos
|
||||
}
|
||||
output.WriteString(i18n.Tr("smb_anonymous_access_detail", target, displayUser, cred.Password))
|
||||
for _, share := range shareInfo {
|
||||
output.WriteString(fmt.Sprintf("\n%s", share))
|
||||
fmt.Fprintf(&output, "\n%s", share)
|
||||
}
|
||||
|
||||
common.LogSuccess(output.String())
|
||||
|
||||
Reference in New Issue
Block a user