2727import com .google .tsunami .common .command .CommandExecutionThreadPool ;
2828import com .google .tsunami .common .data .NetworkEndpointUtils ;
2929import com .google .tsunami .common .data .NetworkServiceUtils ;
30+ import com .google .tsunami .common .net .http .HttpClientCliOptions ;
3031import com .google .tsunami .plugin .PluginType ;
3132import com .google .tsunami .plugin .PortScanner ;
3233import com .google .tsunami .plugin .annotations .PluginInfo ;
@@ -79,6 +80,7 @@ public final class NmapPortScanner implements PortScanner {
7980 private final Executor commandExecutor ;
8081 private final NmapPortScannerConfigs configs ;
8182 private final NmapPortScannerCliOptions cliOptions ;
83+ private final HttpClientCliOptions httpClientCliOptions ;
8284
8385 private ScanTarget scanTarget ;
8486
@@ -87,11 +89,13 @@ public final class NmapPortScanner implements PortScanner {
8789 NmapClient nmapClient ,
8890 @ CommandExecutionThreadPool Executor commandExecutor ,
8991 NmapPortScannerConfigs configs ,
90- NmapPortScannerCliOptions cliOptions ) {
92+ NmapPortScannerCliOptions cliOptions ,
93+ HttpClientCliOptions httpClientCliOptions ) {
9194 this .nmapClient = checkNotNull (nmapClient );
9295 this .commandExecutor = checkNotNull (commandExecutor );
9396 this .configs = checkNotNull (configs );
9497 this .cliOptions = checkNotNull (cliOptions );
98+ this .httpClientCliOptions = checkNotNull (httpClientCliOptions );
9599 }
96100
97101 @ Override
@@ -110,7 +114,7 @@ public PortScanningReport scan(ScanTarget scanTarget) {
110114 .withVersionDetectionIntensity (5 )
111115 .withScript ("banner" )
112116 .withScript ("ssl-enum-ciphers" )
113- .withScript ("http-methods" , "http.useragent=TsunamiSecurityScanner" )
117+ .withScript ("http-methods" , "http.useragent=" + httpClientCliOptions . userAgent )
114118 .withTimingTemplate (TimingTemplate .AGGRESSIVE )
115119 .withTargetNetworkEndpoint (scanTarget .getNetworkEndpoint ())
116120 .run (commandExecutor );
0 commit comments