@@ -168,14 +168,7 @@ func NewRemoteExploit(implemented ImplementedFeatures, extype ExploitType, suppo
168
168
product []string , cpe []string , cve string , protocol string , defaultPort int ,
169
169
) * Config {
170
170
newConf := new (Config )
171
-
172
- joinedProducts := strings .Join (product , "/" )
173
- if joinedProducts == vendor {
174
- newConf .Product = vendor // prevents awkward duplicate word output such as "Validating Product Product"
175
- } else {
176
- newConf .Product = fmt .Sprintf ("%s %s" , vendor , joinedProducts )
177
- }
178
-
171
+ newConf .Product = deDupeProductName (product , vendor )
179
172
newConf .InitFlagsStructs ()
180
173
newConf .Impl = implemented
181
174
newConf .ExType = extype
@@ -191,19 +184,21 @@ func NewRemoteExploit(implemented ImplementedFeatures, extype ExploitType, suppo
191
184
return newConf
192
185
}
193
186
194
- // Defines a new remote exploit and associates with CVE/Product/Protocol metadata. Usage example:.
195
- func NewLocalExploit (implemented ImplementedFeatures , extype ExploitType , supportedC2 []c2.Impl , vendor string ,
196
- product []string , cpe []string , cve string ,
197
- ) * Config {
198
- newConf := new (Config )
199
-
187
+ func deDupeProductName (product []string , vendor string ) string {
200
188
joinedProducts := strings .Join (product , "/" )
201
189
if joinedProducts == vendor {
202
- newConf . Product = vendor // prevents awkward duplicate word output such as "Validating Product Product"
190
+ return vendor
203
191
} else {
204
- newConf . Product = fmt .Sprintf ("%s %s" , vendor , joinedProducts )
192
+ return fmt .Sprintf ("%s %s" , vendor , joinedProducts )
205
193
}
194
+ }
206
195
196
+ // Defines a new remote exploit and associates with CVE/Product/Protocol metadata. Usage example:.
197
+ func NewLocalExploit (implemented ImplementedFeatures , extype ExploitType , supportedC2 []c2.Impl , vendor string ,
198
+ product []string , cpe []string , cve string ,
199
+ ) * Config {
200
+ newConf := new (Config )
201
+ newConf .Product = deDupeProductName (product , vendor )
207
202
newConf .InitFlagsStructs ()
208
203
newConf .Impl = implemented
209
204
newConf .ExType = extype
0 commit comments