SoapArrayAttack extends AbstractDosPlugin { @Override public void createTamperedRequest() { String stringSOAPMessage = this.getOptionTextAreaSoapMessage().getValue(); String regex1 = "arrayType=\"[A-Za-z0-9:_-]*\\x5B"; Pattern p1 = Pattern.compile( regex1 ); Matcher m1 = p1.matcher( stringSOAPMessage ); if ( m1.find() ) { int lengthFirstpart = m1.end(); String firstPart = stringSOAPMessage.substring( 0, lengthFirstpart ); String lastPart = stringSOAPMessage.substring( lengthFirstpart, stringSOAPMessage.length() ); String regex2 = "^[0-9]*\\x5D"; Pattern p2 = Pattern.compile( regex2 ); Matcher m2 = p2.matcher( lastPart ); if ( m2.find() ) { lastPart = m2.replaceFirst( "]" ); } else { setAttackPrecheck( false ); } StringBuilder sb = new StringBuilder(); sb.append( firstPart ); sb.append( optionNumberArrayElements.getValue() ); sb.append( lastPart ); Map<String, String> httpHeaderMap = new HashMap<String, String>(); for ( Map.Entry<String, String> entry : getOriginalRequestHeaderFields().entrySet() ) { httpHeaderMap.put( entry.getKey(), entry.getValue() ); } this.setTamperedRequestObject( httpHeaderMap, getOriginalRequest().getEndpoint(), sb.toString() ); } else { Map<String, String> httpHeaderMap = getOriginalRequestHeaderFields(); this.setTamperedRequestObject( httpHeaderMap, getOriginalRequest().getEndpoint(), stringSOAPMessage ); setAttackPrecheck( false ); } }  @Override void initializeDosPlugin(); @Override OptionTextAreaSoapMessage.PayloadPosition getPayloadPosition(); void initData(); @Override boolean attackPrecheck(); @Override void createTamperedRequest();  }
@Test public void testCreateTamperedRequest() { t.testCreateTamperedRequest( attackPlugin ); }