Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Anon Login, as FTP code never checks for anon login #31

Merged
merged 1 commit into from
Jul 6, 2024

Conversation

luke-goddard
Copy link
Contributor

Hi great project!

I was worried that the scanner tried to log into FTP servers when I saw this.

AnonymousLogin bool   `json:"anonymousLogin"`

After reviewing the FTP module the check is never performed and the field is never filled, so I think it makes sense to delete it from the results struct.

func (p *FTPPlugin) Run(conn net.Conn, timeout time.Duration, target plugins.Target) (*plugins.Service, error) {
	response, err := utils.Recv(conn, timeout)
	if err != nil {
		return nil, err
	}
	if len(response) == 0 {
		return nil, nil
	}

	matches := ftpResponse.FindStringSubmatch(string(response))
	if matches == nil {
		return nil, nil
	}

	payload := plugins.ServiceFTP{
		Banner: string(response),
	}

	return plugins.CreateServiceFrom(target, payload, false, "", plugins.TCP), nil
}

@UNC1739
Copy link
Collaborator

UNC1739 commented Jul 6, 2024

Thanks @luke-goddard!

@UNC1739 UNC1739 merged commit b17ab67 into praetorian-inc:main Jul 6, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants