Skip to content

Commit 173d8df

Browse files
Added de-dupe
1 parent 0044bf8 commit 173d8df

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

config/config.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,20 @@ func NewRemoteExploit(implemented ImplementedFeatures, extype ExploitType, suppo
168168
product []string, cpe []string, cve string, protocol string, defaultPort int,
169169
) *Config {
170170
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+
171179
newConf.InitFlagsStructs()
172180
newConf.Impl = implemented
173181
newConf.ExType = extype
174182
newConf.SupportedC2 = supportedC2
175183
newConf.Vendor = vendor
176184
newConf.Products = product
177-
newConf.Product = fmt.Sprintf("%s %s", vendor, strings.Join(product, "/"))
178185
newConf.C2AutoStart = true
179186
newConf.CPE = cpe
180187
newConf.CVE = cve
@@ -189,13 +196,20 @@ func NewLocalExploit(implemented ImplementedFeatures, extype ExploitType, suppor
189196
product []string, cpe []string, cve string,
190197
) *Config {
191198
newConf := new(Config)
199+
200+
joinedProducts := strings.Join(product, "/")
201+
if joinedProducts == vendor {
202+
newConf.Product = vendor // prevents awkward duplicate word output such as "Validating Product Product"
203+
} else {
204+
newConf.Product = fmt.Sprintf("%s %s", vendor, joinedProducts)
205+
}
206+
192207
newConf.InitFlagsStructs()
193208
newConf.Impl = implemented
194209
newConf.ExType = extype
195210
newConf.SupportedC2 = supportedC2
196211
newConf.Vendor = vendor
197212
newConf.Products = product
198-
newConf.Product = fmt.Sprintf("%s %s", vendor, strings.Join(product, "/"))
199213
newConf.C2AutoStart = true
200214
newConf.CPE = cpe
201215
newConf.CVE = cve

0 commit comments

Comments
 (0)