File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,24 @@ func (s *Scanner) Start(c *config.Conf) error {
101
101
// | "x" | "" | true | x |
102
102
// | "x" | "0" | false | - |
103
103
// | "x" | "y" | true | y |
104
- if target .icmpPeriod != "" && target .icmpPeriod != "0" {
105
- target .doPing = true
104
+ switch c .IcmpPeriod {
105
+ case "" , "0" :
106
+ if target .icmpPeriod != "" && target .icmpPeriod != "0" {
107
+ target .doPing = true
108
+ }
109
+ default :
110
+ if target .icmpPeriod != "0" {
111
+ target .doPing = true
112
+ if target .icmpPeriod == "" {
113
+ target .icmpPeriod = c .IcmpPeriod
114
+ }
115
+ }
116
+ }
117
+ // Inform that ping is disabled
118
+ if ! target .doPing {
119
+ s .Logger .Warn ().Msgf ("ping explicitly disabled for %s (%s) in configuration" ,
120
+ target .name ,
121
+ target .ip )
106
122
}
107
123
108
124
// Read target's expected port range
@@ -122,10 +138,6 @@ func (s *Scanner) Start(c *config.Conf) error {
122
138
continue
123
139
}
124
140
125
- if target .icmpPeriod != "" {
126
- target .doPing = true
127
- }
128
-
129
141
// If TCP period or ports range has been provided, it means that we want
130
142
// to do TCP scan on the target
131
143
if target .tcpPeriod != "" || target .ports != "" || len (target .expected ) != 0 {
You can’t perform that action at this time.
0 commit comments