Strength bar
This commit is contained in:
parent
44a9a776bf
commit
06a8bd8b0e
@ -28,6 +28,7 @@ public class CrossSiteScriptingLesson3 extends AssignmentEndpoint {
|
|||||||
public AttackResult completed(@RequestParam String editor) {
|
public AttackResult completed(@RequestParam String editor) {
|
||||||
//https://github.com/OWASP/owasp-java-encoder
|
//https://github.com/OWASP/owasp-java-encoder
|
||||||
//maybe better idea for assignment
|
//maybe better idea for assignment
|
||||||
|
//<e:forHtml value="${param.title}" />
|
||||||
|
|
||||||
String line1 ="";
|
String line1 ="";
|
||||||
String line2 ="";
|
String line2 ="";
|
||||||
|
@ -42,7 +42,14 @@ public class SecurePasswordsAssignment extends AssignmentEndpoint {
|
|||||||
output.append("<b>Your Password: </b>" + password + "</br>");
|
output.append("<b>Your Password: </b>" + password + "</br>");
|
||||||
output.append("<b>Length: </b>" + password.length()+ "</br>");
|
output.append("<b>Length: </b>" + password.length()+ "</br>");
|
||||||
output.append("<b>Estimated guesses needed to crack your password: </b>" + df.format(strength.getGuesses())+ "</br>");
|
output.append("<b>Estimated guesses needed to crack your password: </b>" + df.format(strength.getGuesses())+ "</br>");
|
||||||
output.append("<b>Score: </b>" + strength.getScore()+ "/5 </br>");
|
output.append("<b>Score: </b>" + strength.getScore()+ "/5");
|
||||||
|
if(strength.getScore()<=1){
|
||||||
|
output.append("<div style=\"background-color:red;width: 200px;\"> </div></br>");
|
||||||
|
} else if(strength.getScore()<=3){
|
||||||
|
output.append("<div style=\"background-color:orange;width: 200px;\"> </div></br>");
|
||||||
|
} else{
|
||||||
|
output.append("<div style=\"background-color:green;width: 200px;\"> </div></br>");
|
||||||
|
}
|
||||||
output.append("<b>Estimated cracking time in seconds: </b>" + calculateTime((long) strength.getCrackTimeSeconds().getOnlineNoThrottling10perSecond()));
|
output.append("<b>Estimated cracking time in seconds: </b>" + calculateTime((long) strength.getCrackTimeSeconds().getOnlineNoThrottling10perSecond()));
|
||||||
|
|
||||||
if(strength.getScore() >= 4)
|
if(strength.getScore() >= 4)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user