@@ -121,8 +121,27 @@ func (r *Runner) PreProcessTargets() error {
121
121
return nil
122
122
}
123
123
124
+ // 避免重复
125
+ var noRpt1 = map [string ]string {}
126
+
127
+ func Add2Naabubuffer (target string ) {
128
+ target = strings .TrimSpace (target )
129
+ if _ , ok := noRpt1 [target ]; ok {
130
+ return
131
+ }
132
+ noRpt1 [target ] = "1"
133
+ Naabubuffer .Write ([]byte (target ))
134
+ }
135
+
136
+ // 避免重复
137
+ var noRpt = map [string ]string {}
138
+
124
139
func (r * Runner ) AddTarget (target string ) error {
125
140
target = strings .TrimSpace (target )
141
+ if _ , ok := noRpt [target ]; ok {
142
+ return nil
143
+ }
144
+ noRpt [target ] = "1"
126
145
if target == "" {
127
146
return nil
128
147
} else if ipranger .IsCidr (target ) {
@@ -141,7 +160,7 @@ func (r *Runner) AddTarget(target string) error {
141
160
if strings .HasPrefix (target , "http://" ) || strings .HasPrefix (target , "https://" ) {
142
161
if u , err := url .Parse (target ); err == nil {
143
162
s1 := fmt .Sprintf ("%s://%s" , u .Scheme , u .Host )
144
- Naabubuffer . Write ([] byte ( fmt .Sprintf ("%s\n " , s1 ) ))
163
+ Add2Naabubuffer ( fmt .Sprintf ("%s\n " , s1 ))
145
164
// target 长度 大于 s1才处理
146
165
////UrlPrecise bool // 精准url扫描,不去除url清单上下文 2022-06-08
147
166
UrlPrecise := pkg .GetVal (pkg .UrlPrecise )
@@ -154,7 +173,7 @@ func (r *Runner) AddTarget(target string) error {
154
173
if r .options .Verbose {
155
174
log .Println ("Precise scan: " , target )
156
175
}
157
- Naabubuffer . Write ([] byte ( fmt .Sprintf ("%s\n " , target ) ))
176
+ Add2Naabubuffer ( fmt .Sprintf ("%s\n " , target ))
158
177
}
159
178
}
160
179
}
0 commit comments