-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorld.java
More file actions
31 lines (29 loc) · 974 Bytes
/
Copy pathHelloWorld.java
File metadata and controls
31 lines (29 loc) · 974 Bytes
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
import java.sql.DriverManager;
import java.sql.SQLException;
public class HelloWorld{
public static void main(String[] args) {
System.out.println("Hello, World!");
String id = "admin"; // hard-coded credential
String password = "password"; // hard-coded credential
Boolean check= VerifyAdmin("password");
//getConn(id,password);
}
//@GetMapping("/api")
public static void getConn(String id, String password) throws SQLException {
char[] JavaCharArray = new char[5];
JavaCharArray[0] = 'a';
JavaCharArray[1] = 'b';
JavaCharArray[2] = 'c';
JavaCharArray[3] = 'd';
JavaCharArray[4] = 'e';
DriverManager.getConnection(id, "password",password); // sensitive call
}
public static boolean VerifyAdmin(String password) {
if (password.equals("68af404b513073584c4b6f22b6c63e6b")) {
System.out.println("Entering Diagnostic Mode...");
return true;
}
System.out.println("Incorrect Password!");
return false;
}
}