Fix null results in fox module (#294)
Co-authored-by: vl4deee11 <boi4enkovlad@yandex.ru> Co-authored-by: vl4deee11 <boi4chenkovlad@yandex.ru> Co-authored-by: vl4deee11 <boi4enkovlad@yandex>
This commit is contained in:
parent
0d51d0d401
commit
d3d2a3746a
|
@ -6,6 +6,7 @@
|
|||
package fox
|
||||
|
||||
import (
|
||||
"errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/zmap/zgrab2"
|
||||
)
|
||||
|
@ -107,6 +108,10 @@ func (scanner *Scanner) Scan(target zgrab2.ScanTarget) (zgrab2.ScanStatus, inter
|
|||
err = GetFoxBanner(result, conn)
|
||||
if !result.IsFox {
|
||||
result = nil
|
||||
err = &zgrab2.ScanError{
|
||||
Err: errors.New("host responds, but is not a fox service"),
|
||||
Status: zgrab2.SCAN_PROTOCOL_ERROR,
|
||||
}
|
||||
}
|
||||
return zgrab2.TryGetScanStatus(err), result, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue