Display nmap warnings correctly before exiting when a fatal error occurs (#285)
This commit is contained in:
committed by
GitHub
parent
80e75061da
commit
4c1493506d
@@ -37,13 +37,12 @@ func (s *Scanner) Scan() ([]Stream, error) {
|
|||||||
|
|
||||||
func (s *Scanner) scan(nmapScanner nmap.ScanRunner) ([]Stream, error) {
|
func (s *Scanner) scan(nmapScanner nmap.ScanRunner) ([]Stream, error) {
|
||||||
results, warnings, err := nmapScanner.Run()
|
results, warnings, err := nmapScanner.Run()
|
||||||
if err != nil {
|
|
||||||
return nil, s.term.FailStepf("error while scanning network: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, warning := range warnings {
|
for _, warning := range warnings {
|
||||||
s.term.Infoln("[Nmap Warning]", warning)
|
s.term.Infoln("[Nmap Warning]", warning)
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, s.term.FailStepf("error while scanning network: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Get streams from nmap results.
|
// Get streams from nmap results.
|
||||||
var streams []Stream
|
var streams []Stream
|
||||||
|
|||||||
Reference in New Issue
Block a user