Untitled

From Old Xars Cracker v1, 5 Months ago, written in Plain Text, viewed 86 times.
URL https://paste.bugabuse.net/view/34e606ee Embed
Download Paste or View Raw
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. package xarrebornv2;
  7.  
  8. /**
  9.  *
  10.  * @author cohen
  11.  */
  12. import java.io.BufferedReader;
  13. import java.io.File;
  14. import java.io.FileReader;
  15. import java.io.IOException;
  16. import java.util.ArrayList;
  17. import java.util.Scanner;
  18.  
  19. public class Cracker {
  20.  
  21.     private final int threads;
  22.     private final ArrayList<String> usernames;
  23.     private final ArrayList<String> passwords;
  24.     private final ArrayList<String> proxies;
  25.  
  26.     public Cracker()
  27.     {
  28.         File f = new File("Cracks");
  29.         try
  30.         {
  31.             if (!f.exists())
  32.             {
  33.                 if (f.mkdir())
  34.                 {
  35.                 }
  36.                 else
  37.                 {
  38.                     System.out.println("Cannot create directory Cracks");
  39.                     System.exit(1);
  40.                 }
  41.             }
  42.         }
  43.         catch (Exception e)
  44.         {
  45.             e.printStackTrace();
  46.             System.exit(1);
  47.         }
  48.         System.out.println("Xars Reborn v2 (Https Proxies)");
  49.         System.out.println("========G4HQ SOFTWARE========");
  50.         System.out.println("Enter number of threads to use");
  51.         final Scanner scan = new Scanner(System.in);
  52.         threads = scan.nextInt();
  53.         System.out.println("Cracker started using: " + threads + " Threads");
  54.         usernames = readFile("usernames.txt");
  55.         passwords = readFile("passwords.txt");
  56.         proxies = readFile("proxies.txt");
  57.         if (proxies == null || passwords == null || usernames == null)
  58.         {
  59.             System.out.println("Error With reading files");
  60.             System.exit(1);
  61.         }
  62.         calcThreads();
  63.     }
  64.  
  65.     private void calcThreads()
  66.     {
  67.         ArrayList<String>[] tUser = new ArrayList[threads];
  68.         ArrayList<String>[] tProxy = new ArrayList[threads];
  69.         for (int i = 0; i < tUser.length; i++)
  70.         {
  71.             tUser[i] = new ArrayList<String>();
  72.             tProxy[i] = new ArrayList<String>();
  73.         }
  74.         int nThreadUser = usernames.size() / threads;
  75.         int nThreadProxy = proxies.size() / threads;
  76.         for (int i = 0, k = 0, p = 0; i < threads; i++)
  77.         {
  78.             for (int l = 0; l < nThreadUser; l++)
  79.             {
  80.                 if (i != threads - 1)
  81.                 {
  82.                     tUser[i].add(usernames.get(k));
  83.                     k++;
  84.                 }
  85.                 else
  86.                 {
  87.                     while (k <= usernames.size() - 1)
  88.                     {
  89.                         tUser[i].add(usernames.get(k));
  90.                         k++;
  91.                     }
  92.                 }
  93.             }
  94.             for (int l = 0; l < nThreadProxy; l++)
  95.             {
  96.                 if (i != threads - 1)
  97.                 {
  98.                     tProxy[i].add(proxies.get(p));
  99.                     p++;
  100.                 }
  101.                 else
  102.                 {
  103.                     while (p <= proxies.size() - 1)
  104.                     {
  105.                         tProxy[i].add(proxies.get(p));
  106.                         p++;
  107.                     }
  108.                 }
  109.             }
  110.             new CrackThread(tUser[i], tProxy[i], passwords, i + 1);
  111.         }
  112.     }
  113.  
  114.     private ArrayList<String> readFile(String fileName)
  115.     {
  116.         if (fileName == null || fileName.equals(""))
  117.         {
  118.             throw new IllegalArgumentException();
  119.         }
  120.         String line;
  121.         ArrayList<String> file = new ArrayList<String>();
  122.         try
  123.         {
  124.             BufferedReader in = new BufferedReader(new FileReader(fileName));
  125.             if (!in.ready())
  126.             {
  127.                 throw new IOException();
  128.             }
  129.             while ((line = in.readLine()) != null)
  130.             {
  131.                 file.add(line);
  132.             }
  133.             in.close();
  134.         }
  135.         catch (IOException e)
  136.         {
  137.             e.printStackTrace();
  138.             return null;
  139.         }
  140.         return file;
  141.     }
  142.  
  143.     public static void main(String args[])
  144.     {
  145.         new Cracker();
  146.     }
  147. }

Reply to "Untitled"

Here you can reply to the paste above