File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 12
12
sonar . start ( true , 2000 ) ;
13
13
14
14
// It's also possible to specify a target or subnet size
15
- //sonar.start(true, 2000, 192.168.0.1/24);
16
- //sonar.start(true, 2000, /24);
15
+ //sonar.start(true, 2000, " 192.168.0.1/24" );
16
+ //sonar.start(true, 2000, " /24" );
17
17
</ script >
18
18
</ body >
19
19
</ html >
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ var sonar = {
134
134
135
135
for ( var tmp = 0 ; tmp < 4 ; tmp ++ ) {
136
136
137
- // Calculate the number of bits that change of each part
137
+ // Calculate the number of bits that change of the current part
138
138
if ( range > 8 + 8 * tmp ) {
139
139
r = 0 ;
140
140
} else {
@@ -150,23 +150,26 @@ var sonar = {
150
150
}
151
151
152
152
if ( sonar . debug ) {
153
- alert ( '[DEBUG][The samallest IP adress to be scaned is:]' + ip_min [ 0 ] + '.' + ip_min [ 1 ] + '.' + ip_min [ 2 ] + '.' + ip_min [ 3 ] ) ;
153
+ alert ( '[DEBUG][The samallest IP adress to be scaned is:]' + ip_min [ 0 ] + '.' + ip_min [ 1 ] + '.' + ip_min [ 2 ] + '.' + ( ip_min [ 3 ] + 1 ) ) ;
154
154
alert ( '[DEBUG][The largest IP adress to be scaned is:]' + ip_max [ 0 ] + '.' + ip_max [ 1 ] + '.' + ip_max [ 2 ] + '.' + ip_max [ 3 ] ) ;
155
155
}
156
156
157
157
// Queue IP address range
158
158
var ip_parts = ip_min . slice ( ) ;
159
+ var d = ip_min [ 3 ] + 1 ;
159
160
for ( var a = ip_min [ 0 ] ; a <= ip_max [ 0 ] ; a ++ ) {
160
161
ip_parts [ 0 ] = a ;
161
162
for ( var b = ip_min [ 1 ] ; b <= ip_max [ 1 ] ; b ++ ) {
162
163
ip_parts [ 1 ] = b ;
163
164
for ( var c = ip_min [ 2 ] ; c <= ip_max [ 2 ] ; c ++ ) {
164
165
ip_parts [ 2 ] = c ;
165
- for ( var d = ip_min [ 3 ] ; d <= ip_max [ 3 ] ; d ++ ) {
166
+ while ( d <= ip_max [ 3 ] ) {
166
167
ip_parts [ 3 ] = d ;
167
168
var tmp_ip = ip_parts [ 0 ] + '.' + ip_parts [ 1 ] + '.' + ip_parts [ 2 ] + '.' + ip_parts [ 3 ] ;
168
169
sonar . ip_queue . push ( tmp_ip ) ;
170
+ d ++ ;
169
171
}
172
+ d = ip_min [ 3 ]
170
173
}
171
174
}
172
175
}
You can’t perform that action at this time.
0 commit comments