Skip to content

Commit

Permalink
fix: pop3 banner checker
Browse files Browse the repository at this point in the history
according to rfc1939, merely +OK is a valid response in the AUTHORIZATION state
  • Loading branch information
developStorm committed May 20, 2024
1 parent add90f4 commit ee76c3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/pop3/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ package pop3

import (
"fmt"
"errors"
"strings"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -179,6 +178,8 @@ func VerifyPOP3Contents(banner string) zgrab2.ScanStatus {
strings.Contains(lowerBanner, "spamhaus"),
strings.Contains(lowerBanner, "relay"):
return zgrab2.SCAN_SUCCESS
case banner == "+OK\r\n":
return zgrab2.SCAN_SUCCESS
default:
return zgrab2.SCAN_PROTOCOL_ERROR
}
Expand Down Expand Up @@ -222,7 +223,7 @@ func (scanner *Scanner) Scan(target zgrab2.ScanTarget) (zgrab2.ScanStatus, inter
// OR save it to return later
sr := VerifyPOP3Contents(banner)
if sr == zgrab2.SCAN_PROTOCOL_ERROR {
return sr, nil, errors.New("Invalid response for POP3")
return sr, nil, fmt.Errorf("Invalid POP3 banner: %s", banner)
}
result.Banner = banner
if scanner.config.SendHELP {
Expand Down

0 comments on commit ee76c3f

Please sign in to comment.