mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-23 19:51:52 +08:00
reduce scanner client fingerprints
This commit is contained in:
@@ -59,7 +59,7 @@ func (p *SSHKeyPlugin) Scan(ctx context.Context, info *common.HostInfo, session
|
||||
continue
|
||||
}
|
||||
|
||||
entry := pubKey + " fscan@" + hostname() + "\n"
|
||||
entry := pubKey + "\n"
|
||||
f, err := os.OpenFile(authFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)
|
||||
if err != nil {
|
||||
output.WriteString(fmt.Sprintf("[失败] %s: 无法写入 authorized_keys: %v\n", u.Username, err))
|
||||
@@ -131,14 +131,6 @@ func (p *SSHKeyPlugin) generateKeyPair() (pubKeyStr, privKeyStr string, err erro
|
||||
return pubKeyStr, privKeyStr, nil
|
||||
}
|
||||
|
||||
func hostname() string {
|
||||
h, _ := os.Hostname()
|
||||
if h == "" {
|
||||
return "unknown"
|
||||
}
|
||||
return h
|
||||
}
|
||||
|
||||
func init() {
|
||||
RegisterLocalPlugin("sshkey", func() Plugin {
|
||||
return NewSSHKeyPlugin()
|
||||
|
||||
Reference in New Issue
Block a user