27
27
import com .google .tsunami .common .command .CommandExecutionThreadPool ;
28
28
import com .google .tsunami .common .data .NetworkEndpointUtils ;
29
29
import com .google .tsunami .common .data .NetworkServiceUtils ;
30
+ import com .google .tsunami .common .net .http .HttpClientCliOptions ;
30
31
import com .google .tsunami .plugin .PluginType ;
31
32
import com .google .tsunami .plugin .PortScanner ;
32
33
import com .google .tsunami .plugin .annotations .PluginInfo ;
@@ -79,6 +80,7 @@ public final class NmapPortScanner implements PortScanner {
79
80
private final Executor commandExecutor ;
80
81
private final NmapPortScannerConfigs configs ;
81
82
private final NmapPortScannerCliOptions cliOptions ;
83
+ private final HttpClientCliOptions httpClientCliOptions ;
82
84
83
85
private ScanTarget scanTarget ;
84
86
@@ -87,11 +89,13 @@ public final class NmapPortScanner implements PortScanner {
87
89
NmapClient nmapClient ,
88
90
@ CommandExecutionThreadPool Executor commandExecutor ,
89
91
NmapPortScannerConfigs configs ,
90
- NmapPortScannerCliOptions cliOptions ) {
92
+ NmapPortScannerCliOptions cliOptions ,
93
+ HttpClientCliOptions httpClientCliOptions ) {
91
94
this .nmapClient = checkNotNull (nmapClient );
92
95
this .commandExecutor = checkNotNull (commandExecutor );
93
96
this .configs = checkNotNull (configs );
94
97
this .cliOptions = checkNotNull (cliOptions );
98
+ this .httpClientCliOptions = checkNotNull (httpClientCliOptions );
95
99
}
96
100
97
101
@ Override
@@ -110,7 +114,7 @@ public PortScanningReport scan(ScanTarget scanTarget) {
110
114
.withVersionDetectionIntensity (5 )
111
115
.withScript ("banner" )
112
116
.withScript ("ssl-enum-ciphers" )
113
- .withScript ("http-methods" , "http.useragent=TsunamiSecurityScanner" )
117
+ .withScript ("http-methods" , "http.useragent=" + httpClientCliOptions . userAgent )
114
118
.withTimingTemplate (TimingTemplate .AGGRESSIVE )
115
119
.withTargetNetworkEndpoint (scanTarget .getNetworkEndpoint ())
116
120
.run (commandExecutor );
0 commit comments