/* I recommend that you read the README file before you use it
 * Application that allows to test
 * websites security , from known threates.
 * by cipher.org.uk
 * Usage : java Attack http://Server exploitFile Proxy=true/false Proxy ProxyPort
 */
 
import java.net.*;
import java.io.*;
import java.util.Date;

public class Attack {
  public static void printinfo(URL url_,String line,String ProxyState,String Proxy,String ProxyPort) 
  throws IOException {
  	
  if (ProxyState.equals("Proxy=true")) {
  	System.setProperty( "proxySet", "true" );
	System.setProperty( "http.proxyHost", Proxy );
	System.setProperty( "http.proxyPort", ProxyPort ); 
}

    URLConnection c = url_.openConnection();  c.connect();
    if (c instanceof HttpURLConnection) {
      HttpURLConnection h = (HttpURLConnection) c;
      System.out.println("Request :"+line);
      System.out.println("Message: " + h.getResponseMessage());
      System.out.println("Code: " + h.getResponseCode()+"\n");
    }
  }
  
  public static void main(String[] args) {
    try { 
    String Proxy,ProxyPort,ProxyState="";
    if (args.length<2) {
    	ProxyState="Proxy=false";Proxy=" ";ProxyPort=" ";}
    	
    	else {ProxyState=args[1];Proxy=args[2];ProxyPort=args[3];}
    	
    String thisLine;	
    FileInputStream fin =  new FileInputStream("exploits.txt");
    BufferedReader myInput = new BufferedReader(new InputStreamReader(fin));
    while ((thisLine = myInput.readLine()) != null) 
    {
    
    printinfo(new URL(args[0]+thisLine),thisLine,ProxyState,Proxy,ProxyPort); }}  
    
    catch (Exception e) {
      System.err.println(e);
      System.err.println("Usage: java Attack http://Server exploitFile Proxy=true/false Proxy ProxyPort");
    }
  }
}
