use of org.parosproxy.paros.core.scanner.ScannerParam in project zaproxy by zaproxy.
the class ApiGeneratorUtils method getAllImplementors.
/**
* Return all of the available ApiImplementors. If you implement a new ApiImplementor then you
* must add it to this class.
*
* @return all of the available ApiImplementors.
*/
public static List<ApiImplementor> getAllImplementors() {
List<ApiImplementor> imps = new ArrayList<>();
ApiImplementor api;
imps.add(new AlertAPI(null));
api = new AntiCsrfAPI(null);
api.addApiOptions(new AntiCsrfParam());
imps.add(api);
imps.add(new PassiveScanAPI(null));
imps.add(new SearchAPI(null));
api = new AutoUpdateAPI(null);
api.addApiOptions(new OptionsParamCheckForUpdates());
imps.add(api);
api = new SpiderAPI(null);
api.addApiOptions(new SpiderParam());
imps.add(api);
api = new CoreAPI(new ConnectionParam());
imps.add(api);
imps.add(new ParamsAPI(null));
api = new ActiveScanAPI(null);
api.addApiOptions(new ScannerParam());
imps.add(api);
imps.add(new ContextAPI());
imps.add(new HttpSessionsAPI(null));
imps.add(new BreakAPI(null));
imps.add(new AuthenticationAPI(null));
imps.add(new AuthorizationAPI());
imps.add(new RuleConfigAPI(null));
imps.add(new SessionManagementAPI(null));
imps.add(new UsersAPI(null));
imps.add(new ForcedUserAPI(null));
imps.add(new ScriptAPI(null));
api = new StatsAPI(null);
api.addApiOptions(new StatsParam());
imps.add(api);
return imps;
}
use of org.parosproxy.paros.core.scanner.ScannerParam in project zaproxy by zaproxy.
the class VariantFactoryUnitTest method shouldReturnDefaultVariants.
@Test
void shouldReturnDefaultVariants() {
// Given
ScannerParam scanOptions = new ScannerParam();
HttpMessage message = new HttpMessage();
// When
List<Variant> variants = factory.createVariants(scanOptions, message);
// Then
assertThat(variants.size(), is(equalTo(10)));
assertThat(variants.get(0).getClass(), is(equalTo(VariantURLQuery.class)));
assertThat(variants.get(1).getClass(), is(equalTo(VariantODataIdQuery.class)));
assertThat(variants.get(2).getClass(), is(equalTo(VariantODataFilterQuery.class)));
assertThat(variants.get(3).getClass(), is(equalTo(VariantDdnPath.class)));
assertThat(variants.get(4).getClass(), is(equalTo(VariantFormQuery.class)));
assertThat(variants.get(5).getClass(), is(equalTo(VariantMultipartFormParameters.class)));
assertThat(variants.get(6).getClass(), is(equalTo(VariantXMLQuery.class)));
assertThat(variants.get(7).getClass(), is(equalTo(VariantJSONQuery.class)));
assertThat(variants.get(8).getClass(), is(equalTo(VariantGWTQuery.class)));
assertThat(variants.get(9).getClass(), is(equalTo(VariantDirectWebRemotingQuery.class)));
}
use of org.parosproxy.paros.core.scanner.ScannerParam in project zaproxy by zaproxy.
the class VariantFactoryUnitTest method shouldReturnAllVariantsWhenSet.
@Test
void shouldReturnAllVariantsWhenSet() throws Exception {
// Given
ScannerParam scanOptions = Mockito.mock(ScannerParam.class, withSettings().lenient());
Mockito.when(scanOptions.getConfig()).thenReturn(new ZapXmlConfiguration());
Mockito.when(scanOptions.getTargetParamsInjectable()).thenReturn(-1);
Mockito.when(scanOptions.getTargetParamsEnabledRPC()).thenReturn(-1);
HttpMessage message = new HttpMessage(new URI("https://www.example.com/path?query", true));
// When
List<Variant> variants = factory.createVariants(scanOptions, message);
// Then
assertThat(variants.size(), is(equalTo(13)));
assertThat(variants.get(0).getClass(), is(equalTo(VariantURLQuery.class)));
assertThat(variants.get(1).getClass(), is(equalTo(VariantODataIdQuery.class)));
assertThat(variants.get(2).getClass(), is(equalTo(VariantODataFilterQuery.class)));
assertThat(variants.get(3).getClass(), is(equalTo(VariantFormQuery.class)));
assertThat(variants.get(4).getClass(), is(equalTo(VariantMultipartFormParameters.class)));
assertThat(variants.get(5).getClass(), is(equalTo(VariantXMLQuery.class)));
assertThat(variants.get(6).getClass(), is(equalTo(VariantJSONQuery.class)));
assertThat(variants.get(7).getClass(), is(equalTo(VariantGWTQuery.class)));
assertThat(variants.get(8).getClass(), is(equalTo(VariantDirectWebRemotingQuery.class)));
assertThat(variants.get(9).getClass(), is(equalTo(VariantHeader.class)));
assertThat(variants.get(10).getClass(), is(equalTo(VariantURLPath.class)));
assertThat(variants.get(11).getClass(), is(equalTo(VariantCookie.class)));
assertThat(variants.get(12).getClass(), is(equalTo(VariantUserDefined.class)));
}
use of org.parosproxy.paros.core.scanner.ScannerParam in project zaproxy by zaproxy.
the class OptionsScannerPanel method saveParam.
@Override
public void saveParam(Object obj) throws Exception {
OptionsParam options = (OptionsParam) obj;
ScannerParam param = options.getParamSet(ScannerParam.class);
param.setHostPerScan(getSliderHostPerScan().getValue());
param.setThreadPerHost(getSliderThreadsPerHost().getValue());
param.setDelayInMs(getDelayInMs());
param.setMaxResultsToList(this.getSpinnerMaxResultsList().getValue());
param.setMaxRuleDurationInMins(this.getSpinnerMaxRuleDuration().getValue());
param.setMaxScanDurationInMins(this.getSpinnerMaxScanDuration().getValue());
param.setInjectPluginIdInHeader(getChkInjectPluginIdInHeader().isSelected());
param.setHandleAntiCSRFTokens(getChkHandleAntiCSRFTokens().isSelected());
param.setPromptInAttackMode(getChkPromptInAttackMode().isSelected());
param.setRescanInAttackMode(getChkRescanInAttackMode().isSelected());
param.setDefaultPolicy((String) this.getDefaultAscanPolicyPulldown().getSelectedItem());
param.setAttackPolicy((String) this.getDefaultAttackPolicyPulldown().getSelectedItem());
param.setAllowAttackOnStart(this.getAllowAttackModeOnStart().isSelected());
param.setMaxChartTimeInMins(this.getSpinnerMaxChartTime().getValue());
}
use of org.parosproxy.paros.core.scanner.ScannerParam in project zaproxy by zaproxy.
the class OptionsScannerPanel method initParam.
@Override
public void initParam(Object obj) {
OptionsParam options = (OptionsParam) obj;
ScannerParam param = options.getParamSet(ScannerParam.class);
getSliderHostPerScan().setValue(param.getHostPerScan());
getSliderThreadsPerHost().setValue(param.getThreadPerHost());
getSpinnerDelayInMs().setValue(param.getDelayInMs());
getSpinnerMaxResultsList().setValue(param.getMaxResultsToList());
getSpinnerMaxRuleDuration().setValue(param.getMaxRuleDurationInMins());
getSpinnerMaxScanDuration().setValue(param.getMaxScanDurationInMins());
getChkInjectPluginIdInHeader().setSelected(param.isInjectPluginIdInHeader());
getChkHandleAntiCSRFTokens().setSelected(param.getHandleAntiCSRFTokens());
getChkPromptInAttackMode().setSelected(param.isPromptInAttackMode());
getChkRescanInAttackMode().setSelected(param.isRescanInAttackMode());
getChkRescanInAttackMode().setEnabled(!getChkPromptInAttackMode().isSelected());
initPolicyPulldowns();
getDefaultAscanPolicyPulldown().setSelectedItem(param.getDefaultPolicy());
getDefaultAttackPolicyPulldown().setSelectedItem(param.getAttackPolicy());
getAllowAttackModeOnStart().setSelected(param.isAllowAttackOnStart());
getSpinnerMaxChartTime().setValue(param.getMaxChartTimeInMins());
}
Aggregations