Advertisement
Guest User

Untitled

a guest
Sep 15th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.39 KB | None | 0 0
  1. import java.awt.Frame;
  2. import java.io.IOException;
  3. import java.net.MalformedURLException;
  4. import java.net.URL;
  5. import java.net.URLConnection;
  6. import java.util.Random;
  7.  
  8. import javax.swing.JOptionPane;
  9.  
  10. public class phisingfucker {
  11.    static String site = "";
  12.    static String username = "username";
  13.    static String password = "password";
  14.    static int timeout = 5;
  15.  
  16.    public static void main(String args[]) throws InterruptedException {
  17.  
  18.       site = (String) JOptionPane.showInputDialog(new Frame(), "URL", "URL",
  19.             JOptionPane.PLAIN_MESSAGE, null, null, null);
  20.       username = (String) JOptionPane.showInputDialog(new Frame(), "user",
  21.             "What is the username field called?",
  22.             JOptionPane.PLAIN_MESSAGE, null, null, null);
  23.       password = (String) JOptionPane.showInputDialog(new Frame(), "pass",
  24.             "What is the password field called?",
  25.             JOptionPane.PLAIN_MESSAGE, null, null, null);
  26.       timeout = Integer.valueOf((String) JOptionPane.showInputDialog(
  27.             new Frame(), "timeout",
  28.             "How long to wait between connections?",
  29.             JOptionPane.PLAIN_MESSAGE, null, null, null));
  30.  
  31.       while (true) {
  32.          String toConnect = site + "?" + username + "="
  33.                + randomString(random(4, 14)) + "&" + password + "="
  34.                + randomString(random(6, 14));
  35.          connectToURL(toConnect);
  36.          Thread.sleep(timeout*100);
  37.       }
  38.    }
  39.  
  40.    private static int random(int i, int j) {
  41.       Random generator = new Random();
  42.       return generator.nextInt(j - i) + i;
  43.    }
  44.  
  45.    public static void connectToURL(String URL) {
  46.       try {
  47.          URL connection = new URL(URL);
  48.          URLConnection toConnect = connection.openConnection();
  49.          toConnect.connect();
  50.          System.out.println("Following to the phiser: "
  51.                + URL.replace(site, ""));
  52.  
  53.       } catch (MalformedURLException e) {
  54.  
  55.       } catch (IOException e) {
  56.  
  57.       }
  58.  
  59.    }
  60.  
  61.    public static String randomString(int length) {
  62.       Random rand = new Random();
  63.       String lettersToUse = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  64.       char[] textArray = new char[length];
  65.       int tlength = lettersToUse.length();
  66.       for (int i = 0; i < length; i++) {
  67.          textArray[i] = lettersToUse.charAt(rand.nextInt(tlength));
  68.       }
  69.       return new String(textArray);
  70.    }
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement