From 2e12f79a8c127f1ce5ac5b1e5b17aa5ba7dec93e Mon Sep 17 00:00:00 2001
From: Mark Denihan
- The result key for this challenge is stored in the private message for a user that is not listed below...
+ <%= bundle.getString("challenge.whatToDo") %>
- The result key for this challenge is stored in the private message for a user that is not listed below...
+ <%= bundle.getString("challenge.whatToDo") %>
" + privateMessage + " User '" + encoder.encodeForHTML(userId) + "' could not be found or does not exist. " + bundle.getString("response.notFoundMessage.1") + " '" + encoder.encodeForHTML(userId) + "' " + bundle.getString("response.notFoundMessage.2") + " " + privateMessage + " User '" + encoder.encodeForHTML(userId) + "' could not be found or does not exist. " + bundle.getString("response.notFoundMessage.1") + " '" + encoder.encodeForHTML(userId) + "' " + bundle.getString("response.notFoundMessage.2") + " " + bundle.getString("bankForm.yourAccount.balance") + " " + bundle.getString("result.wellDone") + " " + bundle.getString("bankForm.transferFunds.whatToDo") + " " + bundle.getString("bankForm.refreshBalance.whatToDo") + " " + bundle.getString("bankForm.logoutOfAccount.whatToDo") + " Your account balance is currently: " + bundle.getString("bankForm.yourAccount.balance") + " Congradulations, you have sucessfully completed this challenge. Use the following result key at the top of the page to mark this level as complete in the sytem. " + bundle.getString("result.wellDone") + " Use this form to send money to other accounts in this bank. All you need to do is enter their account number and the ammount you want to send! " + bundle.getString("bankForm.transferFunds.whatToDo") + " Use this form to refresh your balance above. That way you can see if any money came in recently! " + bundle.getString("bankForm.refreshBalance.whatToDo") + " Use this form to sign out of your bank account when your done giving your money away. " + bundle.getString("bankForm.logoutOfAccount.whatToDo") + "Insecure Direct Object Reference Challenge One
+ <%= i18nChallengeName %>
@@ -89,7 +97,7 @@ String levelName = "Insecure Direct Object References Challenge One";
$("#resultsDiv").hide("slow", function(){
var ajaxCall = $.ajax({
type: "POST",
- url: "o9a450a64cc2a196f55878e2bd9a27a72daea0f17017253f87e7ebd98c71c98c",
+ url: "<%= levelHash %>",
data: {
userId: optionValue
},
diff --git a/SecurityShepherdCore/src/jsp/challenges/vc9b78627df2c032ceaf7375df1d847e47ed7abac2a4ce4cb6086646e0f313a4.jsp b/SecurityShepherdCore/src/jsp/challenges/vc9b78627df2c032ceaf7375df1d847e47ed7abac2a4ce4cb6086646e0f313a4.jsp
index 3658fa0a4..e16355f6d 100644
--- a/SecurityShepherdCore/src/jsp/challenges/vc9b78627df2c032ceaf7375df1d847e47ed7abac2a4ce4cb6086646e0f313a4.jsp
+++ b/SecurityShepherdCore/src/jsp/challenges/vc9b78627df2c032ceaf7375df1d847e47ed7abac2a4ce4cb6086646e0f313a4.jsp
@@ -1,5 +1,5 @@
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,java.io.*,java.net.*,org.owasp.esapi.ESAPI, org.owasp.esapi.Encoder, dbProcs.*, utils.*" errorPage="" %>
-
+<%@ page import="java.util.Locale, java.util.ResourceBundle"%>
<%
/**
* Insecure Direct Object References Challenge Two
@@ -22,7 +22,15 @@
* @author Mark Denihan
*/
-String levelName = "Insecure Direct Object References Challenge Two";
+ String levelName = "Insecure Direct Object References Challenge Two";
+ String levelHash = "vc9b78627df2c032ceaf7375df1d847e47ed7abac2a4ce4cb6086646e0f313a4";
+
+ //Translation Stuff
+ Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
+ ResourceBundle bundle = ResourceBundle.getBundle("i18n.challenges.directObject." + levelHash, locale);
+ //Used more than once translations
+ String i18nChallengeName = bundle.getString("challenge.challengeName");
+
ShepherdLogManager.logEvent(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), levelName + " Accessed");
if (request.getSession() != null)
{
@@ -48,15 +56,15 @@ String levelName = "Insecure Direct Object References Challenge Two";
-
-
-
+ Insecure Direct Object Reference Challenge Two
+ <%= i18nChallengeName %>
@@ -89,7 +97,7 @@ String levelName = "Insecure Direct Object References Challenge Two";
$("#resultsDiv").hide("slow", function(){
var ajaxCall = $.ajax({
type: "POST",
- url: "vc9b78627df2c032ceaf7375df1d847e47ed7abac2a4ce4cb6086646e0f313a4",
+ url: "<%= levelHash %>",
data: {
userId: optionValue
},
diff --git a/SecurityShepherdCore/src/servlets/module/challenge/DirectObject1.java b/SecurityShepherdCore/src/servlets/module/challenge/DirectObject1.java
index df4544ef3..6c082abb0 100644
--- a/SecurityShepherdCore/src/servlets/module/challenge/DirectObject1.java
+++ b/SecurityShepherdCore/src/servlets/module/challenge/DirectObject1.java
@@ -5,6 +5,8 @@
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
+import java.util.Locale;
+import java.util.ResourceBundle;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -47,7 +49,6 @@ public class DirectObject1 extends HttpServlet
private static org.apache.log4j.Logger log = Logger.getLogger(DirectObject1.class);
private static String levelName = "Insecure Direct Object Challenge Challenge One";
private static String levelHash = "o9a450a64cc2a196f55878e2bd9a27a72daea0f17017253f87e7ebd98c71c98c";
- private static String levelResult = ""; //Stored in DB. Not user Specific
/**
* The user must abuse this functionality to reveal a hidden user. The result key is hidden in this users profile.
* @param userId To be used in generating the HTML output
@@ -58,6 +59,11 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
//Setting IpAddress To Log and taking header for original IP if forwarded from proxy
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));
+ //Translation Stuff
+ Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
+ ResourceBundle errors = ResourceBundle.getBundle("i18n.servlets.errors", locale);
+ ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.directObject.directObjectRef1", locale);
+
HttpSession ses = request.getSession(true);
if(Validate.validateSession(ses))
{
@@ -82,14 +88,14 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
log.debug("Found user: " + resultSet.getString(1));
String userName = resultSet.getString(1);
String privateMessage = resultSet.getString(2);
- htmlOutput = "
-
-
+ " + userName + "'s Message
" +
+ htmlOutput = "" + userName + "'s " + bundle.getString("response.message") + "
" +
"User: 404 - User Not Found
" + bundle.getString("response.notFound") + "
" + userName + "'s Message
" +
+ htmlOutput = "" + userName + "'s " + bundle.getString("response.message") + "
" +
"User: 404 - User Not Found
" + bundle.getString("response.notFound") + "
" + bundle.getString("bankForm.yourAccount") + "
" +
+ "" + bundle.getString("result.complete") + "
"
+ + "" + bundle.getString("result.theKeyIs") + " " + encoder.encodeForHTML(Hash.generateUserSolution(levelResult, (String)ses.getAttribute("userName"))) + "";
+ }
+ bankForm += ""
+ + ""
+ + "" + bundle.getString("bankForm.transferFunds") + "
" + bundle.getString("bankForm.refreshBalance") + "
"
+ + "" + bundle.getString("bankForm.logoutOfAccount") + "
"
+ + "Your Account
" +
- "" + bundle.getString("bankForm.yourAccount") + "
" +
+ "Challenge Complete
"
- + "The result key for this challenge is " + encoder.encodeForHTML(Hash.generateUserSolution(levelResult, (String)ses.getAttribute("userName"))) + "";
+ bankForm += "" + bundle.getString("result.complete") + "
"
+ + "" + bundle.getString("result.theKeyIs") + " " + encoder.encodeForHTML(Hash.generateUserSolution(levelResult, (String)ses.getAttribute("userName"))) + "";
}
bankForm += ""
+ ""
- + "Transfer Funds
" + bundle.getString("bankForm.transferFunds") + "
"
+ + "" + bundle.getString("bankForm.recieverNumber") + " "
+ + "" + bundle.getString("bankForm.amountToSend") + " "
+ + "Refresh Balance
" + bundle.getString("bankForm.refreshBalance") + "
"
- + "
"
+ + "Logout of Account
" + bundle.getString("bankForm.logoutOfAccount") + "
"
- + "
"
+ + " "
+ "";
return bankForm;
}
diff --git a/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankLogout.java b/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankLogout.java
index b2ffd74b6..427e73236 100644
--- a/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankLogout.java
+++ b/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankLogout.java
@@ -2,6 +2,8 @@
import java.io.IOException;
import java.io.PrintWriter;
+import java.util.Locale;
+import java.util.ResourceBundle;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -42,7 +44,7 @@ public class DirectObjectBankLogout extends HttpServlet
private static String levelName = "Insecure Direct Object Bank Challenge (Logout)";
private static String levelHash = "1f0935baec6ba69d79cfb2eba5fdfa6ac5d77fadee08585eb98b130ec524d00c";
/**
- * This Servlet is used to Sign out of a Bank Account
+ * This Servlet is used by a user to Sign out of a Bank Account Session in the Insecure Direct Bank Challenge
*/
public void doPost (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
@@ -50,6 +52,11 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
//Setting IpAddress To Log and taking header for original IP if forwarded from proxy
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));
HttpSession ses = request.getSession(true);
+
+ //Translation Stuff
+ Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
+ ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.directObject.directObjectBank", locale);
+
if(Validate.validateSession(ses))
{
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), ses.getAttribute("userName").toString());
@@ -57,7 +64,7 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
PrintWriter out = response.getWriter();
out.print(getServletInfo());
ses.removeAttribute("directObjectBankAccount");
- out.write("Logged Out");
+ out.write(bundle.getString("logout.loggedOut"));
}
else
{
diff --git a/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankRegistration.java b/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankRegistration.java
index 20ed2b4d8..07b3c8bbf 100644
--- a/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankRegistration.java
+++ b/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankRegistration.java
@@ -5,6 +5,8 @@
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
+import java.util.Locale;
+import java.util.ResourceBundle;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -54,6 +56,12 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
//Setting IpAddress To Log and taking header for original IP if forwarded from proxy
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));
HttpSession ses = request.getSession(true);
+
+ //Translation Stuff
+ Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
+ ResourceBundle errors = ResourceBundle.getBundle("i18n.servlets.errors", locale);
+ ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.directObject.directObjectBank", locale);
+
if(Validate.validateSession(ses))
{
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), ses.getAttribute("userName").toString());
@@ -76,18 +84,18 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
callstmt.execute();
log.debug("Sucessfully ran create account procedure.");
log.debug("Outputting HTML");
- htmlOutput = "User account has been registered! Please Sign in!";
+ htmlOutput = bundle.getString("register.accountCreated");
out.write(htmlOutput);
Database.closeConnection(conn);
}
catch(SQLException e)
{
- out.write("An Error Occurred! You must be getting funky! Could not create account!");
+ out.write(errors.getString("error.funky") + " " + bundle.getString("register.error"));
log.fatal(levelName + " SQL Error - " + e.toString());
}
catch(Exception e)
{
- out.write("An Error Occurred! You must be getting funky!");
+ out.write(errors.getString("error.funky"));
log.fatal(levelName + " - " + e.toString());
}
}
diff --git a/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankTransfer.java b/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankTransfer.java
index b77b2315d..401fec4e1 100644
--- a/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankTransfer.java
+++ b/SecurityShepherdCore/src/servlets/module/challenge/DirectObjectBankTransfer.java
@@ -5,6 +5,8 @@
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
+import java.util.Locale;
+import java.util.ResourceBundle;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -46,7 +48,7 @@ public class DirectObjectBankTransfer extends HttpServlet
private static String levelName = "Insecure Direct Object Bank Challenge (Transfer)";
private static String levelHash = "1f0935baec6ba69d79cfb2eba5fdfa6ac5d77fadee08585eb98b130ec524d00c";
/**
- * This Servlet is used to register a new bank account
+ * This Servlet is used to transfer funds from one bank account to another, insecurely, in the Direct Object Reference Bank challenge
*/
public void doPost (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
@@ -54,6 +56,12 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
//Setting IpAddress To Log and taking header for original IP if forwarded from proxy
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));
HttpSession ses = request.getSession(true);
+
+ //Translation Stuff
+ Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
+ ResourceBundle errors = ResourceBundle.getBundle("i18n.servlets.errors", locale);
+ ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.directObject.directObjectBank", locale);
+
if(Validate.validateSession(ses))
{
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), ses.getAttribute("userName").toString());
@@ -84,10 +92,10 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
performTransfer = true;
}
else
- errorMessage = "Your account does not have the necessary funds to transfer that amount.";
+ errorMessage = bundle.getString("transfer.error.notEnoughCash");
}
else
- errorMessage = "The amount being transfered must be greater than zero.";
+ errorMessage = bundle.getString("transfer.error.moreThanZero");
String htmlOutput = new String();
if(performTransfer)
@@ -100,25 +108,25 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
callstmt.setFloat(3, tranferAmount);
callstmt.execute();
log.debug("Sucessfully ran Transfer Funds procedure.");
- htmlOutput = "Funds have been transfered sucessfully!";
+ htmlOutput = bundle.getString("transfer.success");
Database.closeConnection(conn);
}
else
{
log.debug("Invalid Data Detected: " + errorMessage);
- htmlOutput = "An Error Occured: " + errorMessage;
+ htmlOutput = bundle.getString("transfer.error.occurred") + " " + errorMessage;
}
log.debug("Outputting HTML");
out.write(htmlOutput);
}
catch(SQLException e)
{
- out.write("An Error Occurred! You must be getting funky! Could not get Transfer Funds!");
+ out.write(errors.getString("error.funky") + " " + bundle.getString("transfer.error.couldNotTransfer"));
log.fatal(levelName + " SQL Error - " + e.toString());
}
catch(Exception e)
{
- out.write("An Error Occurred! You must be getting funky!");
+ out.write(errors.getString("error.funky"));
log.fatal(levelName + " - " + e.toString());
}
}
From 73b0ab555b8f58f9c579444757c4ecb0a859ef0b Mon Sep 17 00:00:00 2001
From: Mark Denihan " + bundle.getString("getter.button.finished") + "
\n" +
+ "";
+ }
+ if(output.isEmpty()) //If this method has gone so far without any output, create a error message
+ {
+ output = "
" + bundle.getString("result.youDidIt") + "
" +
- "" + bundle.getString("result.resultKey") + " " +
- encoder.encodeForHTML(
- Hash.generateUserSolution(Getter.getModuleResultFromHash(getServletContext().getRealPath(""), levelHash), (String)ses.getAttribute("userName"))
- ) +
- "";
- }
- log.debug("Adding searchTerm to Html: " + searchTerm);
- htmlOutput += "
" + bundle.getString("response.noResults") + " '" + - searchTerm + - "'
"; - log.debug("Outputting HTML"); - out.write(htmlOutput); - } - } - else - { - log.error(levelName + " accessed with no session"); - out.write(errors.getString("error.noSession")); - } - } - catch(Exception e) - { - out.write(errors.getString("error.funky")); - log.fatal(levelName + " - " + e.toString()); - } - log.debug("End of " + levelName + " Servlet"); - } -} +package servlets.module.lesson; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Locale; +import java.util.ResourceBundle; + +import javax.servlet.ServletException; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.log4j.Logger; +import org.owasp.esapi.ESAPI; +import org.owasp.esapi.Encoder; + +import dbProcs.Getter; +import utils.FindXSS; +import utils.Hash; +import utils.ShepherdLogManager; +import utils.Validate; + +/** + * Cross Site Scripting Lesson + *" + bundle.getString("result.youDidIt") + "
" +
+ "" + bundle.getString("result.resultKey") +
+ Hash.generateUserSolution(Getter.getModuleResultFromHash(getServletContext().getRealPath(""), levelHash), (String)ses.getAttribute("userName"));
+ }
+ log.debug("Adding searchTerm to Html: " + searchTerm);
+ htmlOutput += "
" + bundle.getString("response.noResults") + " '" + + searchTerm + + "'
"; + log.debug("Outputting HTML"); + out.write(htmlOutput); + } + } + else + { + log.error(levelName + " accessed with no session"); + out.write(errors.getString("error.noSession")); + } + } + catch(Exception e) + { + out.write(errors.getString("error.funky")); + log.fatal(levelName + " - " + e.toString()); + } + log.debug("End of " + levelName + " Servlet"); + } +} diff --git a/SecurityShepherdCore/src/utils/Hash.java b/SecurityShepherdCore/src/utils/Hash.java index 1df7f0e19..b3db1f935 100644 --- a/SecurityShepherdCore/src/utils/Hash.java +++ b/SecurityShepherdCore/src/utils/Hash.java @@ -1,418 +1,428 @@ -package utils; - -import java.math.BigInteger; -import java.nio.charset.Charset; -import java.security.GeneralSecurityException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; - -import javax.crypto.Cipher; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; -import javax.servlet.http.Cookie; - -import org.apache.log4j.Logger; -import org.apache.commons.codec.binary.Base64; - -/** - * Class used for miscellaneous Hash use - *" + bundle.getString("result.youDidIt") + "
" +
- bundle.getString("result.resultKey") + " " +
- encoder.encodeForHTML(
- Hash.generateUserSolution(
- Getter.getModuleResultFromHash(getServletContext().getRealPath(""), levelHash
- ), (String)ses.getAttribute("userName")
- )
- ) +
- "";
- }
- if(validUrl)
- {
- log.debug("Adding message to Html: " + messageForAdmin);
- htmlOutput += "
" + bundle.getString("response.sentTo") + ": | administrator@SecurityShepherd.com |
" + bundle.getString("response.message") + ": | " + encoder.encodeForHTML("" + bundle.getString("response.linkFrom") + " " + userName) + - " |
" + bundle.getString("result.youDidIt") + "
" +
+ bundle.getString("result.resultKey") + " " +
+ Hash.generateUserSolution(
+ Getter.getModuleResultFromHash(getServletContext().getRealPath(""), levelHash),
+ (String)ses.getAttribute("userName"))
+ +"";
+ }
+ if(validUrl)
+ {
+ log.debug("Adding message to Html: " + messageForAdmin);
+ htmlOutput += "
" + bundle.getString("response.sentTo") + ": | administrator@SecurityShepherd.com |
" + bundle.getString("response.message") + ": | " + encoder.encodeForHTML("" + bundle.getString("response.linkFrom") + " " + userName) + + " |
- To complete this challenge, you must steal the securityMisconfigLesson cookie of another user. The administrators of the sub application have misconfigured the mechanism which enforces cookie security flags. The cookie set in this lesson has not been given the "secure" flag. This means that in any HTTP requests to the lesson will include this cookie.
- Even though the application (If Shepherd has been correctly configured) redirects to a HTTPs service upon access, the will have been sent across the network in plain text. When players open this lesson, they automatically send a HTTP request thanks to the following <IMG> element.
- Image elements do not follow the mixed content policy and will send HTTP requests even when loaded inside a HTTPs context. This will not work with an iFrame.
+ <%= bundle.getString("securityMisconfig.stealTokens.description") %>
An Error Occurred: " + ajaxCall.status + " " + ajaxCall.statusText + " <%= bundle.getString("error.occurred") %>: " + ajaxCall.status + " " + ajaxCall.statusText + " You cannot complete this challenge with your cookie value. You must get the cookie from another user. ");
+ htmlOutput = new String(" " + bundle.getString("securityMisconfig.servlet.stealTokens.notComplete.message") + " ");
}
else
{
@@ -106,22 +110,22 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
log.debug("Valid Cookie of another User Dectected");
// Get key and add it to the output
String userKey = Hash.generateUserSolution(levelResult, (String)ses.getAttribute("userName"));
- htmlOutput = " " +
- "Congradulations! Your result key is as follows " +
+ bundle.getString("securityMisconfig.servlet.stealTokens.youDidIt") + " " +
"" + userKey + "" +
" You muse submit a valid token of another user. ");
+ htmlOutput = new String(" " + bundle.getString("securityMisconfig.servlet.stealTokens.notComplete.yourToken") + " ");
}
}
}
catch(Exception e)
{
- out.write("An Error Occurred! You must be getting funky!");
+ out.write(errors.getString("securityMisconfig.servlet.stealTokens.notComplete.yourToken"));
log.fatal(levelName + " - " + e.toString());
}
log.debug("Outputting HTML");
From 15da4f3b700e5ba91b50e5186356795a1ce48e18 Mon Sep 17 00:00:00 2001
From: SeanDuggan
- This key to this challenge is the App author's name. Find it to complete the challenge.
+ <%= paragraph1 %>
<%= Analytics.getMobileLevelBlurb("ReverseEngineer2.apk") %>
diff --git a/SecurityShepherdCore/src/utils/Analytics.java b/SecurityShepherdCore/src/utils/Analytics.java
index 16cf6e722..ae0269ff7 100644
--- a/SecurityShepherdCore/src/utils/Analytics.java
+++ b/SecurityShepherdCore/src/utils/Analytics.java
@@ -37,5 +37,6 @@ public class Analytics
public static String getMobileLevelBlurb (String appName)
{
return mobileVmLinkBlurb1 + appName + mobileVmLinkBlurb2;
+ //TODO Extract strings for translation
}
}
From d014def70885763e083bdc986e02ea4eb99350f7 Mon Sep 17 00:00:00 2001
From: Mark Denihan
- *
- * The Security Shepherd project is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the Security Shepherd project. If not, see
+ *
+ * The Security Shepherd project is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the Security Shepherd project. If not, see <%= levelName %>
+ <%= i18nLevelName %>
-
+
" title="<%= bundle.getString("securityMisconfig.stealTokens.whyThisImageIsHere") %>" src="<%= encoder.encodeForHTMLAttribute(challengeUrl) %>">
- If there are no users on your local network, this lesson is very difficult to complete. Please ask your Shepherd Administrator to disable it.
+ <%= bundle.getString("securityMisconfig.stealTokens.haveSomebodyOnYourNetwork") %>
- Once you have stolen another user's securityMisconfigLesson token, click the following button and sub in the other user's token where your own exists.
+ <%= bundle.getString("securityMisconfig.stealTokens.stealTokenThenDoThis") %>
Challenge NOT Complete
"
- + "" + bundle.getString("securityMisconfig.servlet.stealTokens.notComplete") + "
"
+ + "Challenge Complete
" +
+ htmlOutput = "" + bundle.getString("securityMisconfig.servlet.stealTokens.complete") + "
" +
"Challenge NOT Complete
"
- + "" + bundle.getString("securityMisconfig.servlet.stealTokens.notComplete") + "
"
+ + "
- <%= Analytics.getMobileLevelBlurb("ReverseEngineer2.apk") %>
+ <%= Analytics.getMobileLevelBlurb("ReverseEngineer1.apk") %>
<%= levelName %>
- The App for this challenge stores user credentials within a database, the data has not been stored in plain text but it also has not been encrypted. Make the credentials readable to get the key. The key is the Admin's password.
-
+ <%= paragraph1 %>
- <%= Analytics.getMobileLevelBlurb("InsecureData2.apk") %>
+ <%= Analytics.getMobileLevelBlurb("InsecureData1.apk") %>
- If you can buy trolls for free you'll receive the key for this level!
+ <%= bundle.getString("poorValidation.whatToDo") %>
-
<%= bundle.getString("poorValidation.shopping.whatToDo") %>
An Error Occurred: " + ajaxCall.status + " " + ajaxCall.statusText + "
"); + $("#resultsDiv").html("<%= bundle.getString("error.occurred") %>: " + ajaxCall.status + " " + ajaxCall.statusText + "
"); } $("#resultsDiv").show("slow", function(){ $("#loadingSign").hide("fast", function(){ diff --git a/SecurityShepherdCore/src/jsp/challenges/ca0e89caf3c50dbf9239a0b3c6f6c17869b2a1e2edc3aa6f029fd30925d66c7e.jsp b/SecurityShepherdCore/src/jsp/challenges/ca0e89caf3c50dbf9239a0b3c6f6c17869b2a1e2edc3aa6f029fd30925d66c7e.jsp index 87674f34b..3793310c4 100644 --- a/SecurityShepherdCore/src/jsp/challenges/ca0e89caf3c50dbf9239a0b3c6f6c17869b2a1e2edc3aa6f029fd30925d66c7e.jsp +++ b/SecurityShepherdCore/src/jsp/challenges/ca0e89caf3c50dbf9239a0b3c6f6c17869b2a1e2edc3aa6f029fd30925d66c7e.jsp @@ -1,4 +1,5 @@ <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" language="java" import="utils.*" errorPage="" %> +<%@ page import="java.util.Locale, java.util.ResourceBundle"%> <% /** *
- If you can buy trolls for free you'll receive the key for this level!
+ <%= bundle.getString("poorValidation.whatToDo") %>
-
<%= bundle.getString("poorValidation.shopping.whatToDo") %>
An Error Occurred: " + ajaxCall.status + " " + ajaxCall.statusText + "
"); + $("#resultsDiv").html("<%= bundle.getString("error.occurred") %>: " + ajaxCall.status + " " + ajaxCall.statusText + "
"); } $("#resultsDiv").show("slow", function(){ $("#loadingSign").hide("fast", function(){ diff --git a/SecurityShepherdCore/src/servlets/module/challenge/CsrfChallengeJSON.java b/SecurityShepherdCore/src/servlets/module/challenge/CsrfChallengeJSON.java index 45e75b30c..5589d4a97 100644 --- a/SecurityShepherdCore/src/servlets/module/challenge/CsrfChallengeJSON.java +++ b/SecurityShepherdCore/src/servlets/module/challenge/CsrfChallengeJSON.java @@ -20,7 +20,7 @@ import dbProcs.Setter; /** - * Cross Site Request Forgery Challenge New - Does not return result Key + * Cross Site Request Forgery Challenge JSON - Does not return result Key, just sets URL for Class Forum *" + bundle.getString("poorValidation.orderComplete.message")+ "
" + bundle.getString("poorValidation.orderTotal")+ " $" + finalCost + "
"; if (finalCost <= 0 && trollAmount > 0) { - htmlOutput += "" + bundle.getString("poorValidation.freeTrolls")+ " - " + Hash.generateUserSolution(levelSolution, currentUser) + "
"; } } catch(Exception e) { log.debug("Didn't complete order: " + e.toString()); - htmlOutput += "Order Failed - Please try again later
"; + htmlOutput += "" + bundle.getString("poorValidation.badOrder")+ "
"; } try { diff --git a/SecurityShepherdCore/src/servlets/module/challenge/PoorValidation2.java b/SecurityShepherdCore/src/servlets/module/challenge/PoorValidation2.java index 0e2c493ba..a053280c1 100644 --- a/SecurityShepherdCore/src/servlets/module/challenge/PoorValidation2.java +++ b/SecurityShepherdCore/src/servlets/module/challenge/PoorValidation2.java @@ -2,6 +2,8 @@ import java.io.IOException; import java.io.PrintWriter; +import java.util.Locale; +import java.util.ResourceBundle; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -10,8 +12,6 @@ import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; -import org.owasp.esapi.ESAPI; -import org.owasp.esapi.Encoder; import utils.Hash; import utils.ShepherdLogManager; @@ -55,13 +55,16 @@ public void doPost (HttpServletRequest request, HttpServletResponse response) HttpSession ses = request.getSession(true); if(Validate.validateSession(ses)) { + //Translation Stuff + Locale locale = new Locale(Validate.validateLanguage(request.getSession())); + ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.poorValidation.poorValidationStrings", locale); + String currentUser = ses.getAttribute("userName").toString(); ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), currentUser); log.debug(levelName + " servlet accessed by: " + ses.getAttribute("userName").toString()); PrintWriter out = response.getWriter(); out.print(getServletInfo()); String htmlOutput = new String(); - Encoder encoder = ESAPI.encoder(); try { int megustaAmount = validateAmount(Integer.parseInt(request.getParameter("megustaAmount"))); @@ -85,18 +88,18 @@ public void doPost (HttpServletRequest request, HttpServletResponse response) int finalCost = megustaCost + rageCost + notBadCost + trollCost; //Output Order - htmlOutput = "" + bundle.getString("poorValidation.orderComplete.message") + "
" + bundle.getString("poorValidation.orderTotal") + " $" + finalCost + "
"; if (finalCost <= 0 && trollAmount > 0) { - htmlOutput += "" + bundle.getString("poorValidation.freeTrolls") + " - " + Hash.generateUserSolution(levelSolution, currentUser) + "
"; } } catch(Exception e) { log.debug("Didn't complete order: " + e.toString()); - htmlOutput += "Order Failed - Please try again later
"; + htmlOutput += "" + bundle.getString("poorValidation.badOrder") + "
"; } try { From 81e26d77e31d5b000115f6aca547d85e9a198dbd Mon Sep 17 00:00:00 2001 From: SeanDuggan
- Not all Apps will use sqlite to store user data, in some cases SharedPreferences is used. The key to this level can be gained once you log in as a legitimate user.
+ <%= paragraph1 %>
diff --git a/SecurityShepherdCore/src/jsp/challenges/ec09515a304d2de1f552e961ab769967bdc75740ad2363803168b7907c794cd4.jsp b/SecurityShepherdCore/src/jsp/challenges/ec09515a304d2de1f552e961ab769967bdc75740ad2363803168b7907c794cd4.jsp
index 00eb48836..5f60dd5e2 100644
--- a/SecurityShepherdCore/src/jsp/challenges/ec09515a304d2de1f552e961ab769967bdc75740ad2363803168b7907c794cd4.jsp
+++ b/SecurityShepherdCore/src/jsp/challenges/ec09515a304d2de1f552e961ab769967bdc75740ad2363803168b7907c794cd4.jsp
@@ -1,4 +1,5 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" language="java" import="utils.*" errorPage="" %>
+<%@ page import="java.util.Locale, java.util.ResourceBundle"%>
<%
/**
*
@@ -26,6 +27,13 @@ String levelHash = "ec09515a304d2de1f552e961ab769967bdc75740ad2363803168b7907c79
//Level blurb can be written here in HTML OR go into the HTML body and write it there. Nobody will update this but you
String levelBlurb = "";
+//Translation Stuff
+Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
+ResourceBundle bundle = ResourceBundle.getBundle("i18n.challenges.mobile.insecureData.insecureDataStrings", locale);
+//Used more than once translations
+String LevelName = bundle.getString("challenge2.challengeName");
+String paragraph1 = bundle.getString("challenge2.para1");
+
ShepherdLogManager.logEvent(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), levelName + " Accessed");
if (request.getSession() != null)
{
@@ -60,12 +68,11 @@ if (request.getSession() != null)
- The App for this challenge, InsecureData3 uses a hashing algorithm on stored user credentials. However, there are two issues here, firstly the user is using a bad password. Secondly, the App does not use a salt when hashing the data. The result key to this challenge is the user's password.
-
+ <%= paragraph1 %>
- <%= Analytics.getMobileLevelBlurb("InsecureData3.apk") %>
+ <%= Analytics.getMobileLevelBlurb("InsecureData2.apk") %>
" +
"The OWASP Security Shepherd project would like to acknowledge and thank the generous support of our sponsors. Please check out their web pages and follow them on twitter." +
@@ -32,11 +30,5 @@ public class Analytics
"" +
"
" +
"The OWASP Security Shepherd Project would also like to thank Dr. Anthony Keane and the ITB Security Research Lab for hosting the public https://owasp.securityShepherd.eu!" +
- "
- You must log into the App PoorAuthentication2.apk to get the key. The Username and Password have been saved but this App uses a specially generated Authentication Code.
+ <%= paragraph1 %>
-
<%= mobile.getString("mobileBlurb.vmLink.1") + " PoorAuthentication2.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
-
- You are currently using Security Shepherd Version 2.4
+ You are currently using Security Shepherd Version 3.0
The OWASP Security Shepherd project is a web and mobile application security training platform. Security Shepherd has been designed to foster and improve security awareness among a varied skill-set demographic. The aim of this project is to take AppSec novices or experienced engineers and sharpen their penetration testing skill set to security expert status.
For More information, please visit the OWASP Security Shepherd Wiki Page.
Please report any bugs or any feature requests on the OWASP Security Shepherd Git Repository.
" +
- "The OWASP Security Shepherd project would like to acknowledge and thank the generous support of our sponsors. Please check out their web pages and follow them on twitter." +
+ bundle.getString("sponsorship.message.1") +
"
" +
"" +
"
" +
"
" +
"" +
"
" +
- "The OWASP Security Shepherd Project would also like to thank Dr. Anthony Keane and the ITB Security Research Lab for hosting the public https://owasp.securityShepherd.eu!" +
+ bundle.getString("sponsorship.message.2") +
"
<% /* Put Your Blurb Here Instead of the following scriptlet. Not this comment Bren. Jeesh*/ %>
- <%= levelBlurb %>
+ <%= paragraph1 %>
- The App for this challenge uses sloppy filters in an attempt to thwart attackers. These filters can be easily bypassed. Login to get the key.
- <%= mobile.getString("mobileBlurb.vmLink.1") + " CSInjection2.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
+ <%= mobile.getString("mobileBlurb.vmLink.1") + " CSInjection1.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
<% /* Put Your Blurb Here Instead of the following scriptlet. Not this comment Bren. Jeesh*/ %>
<%= levelBlurb %>
<% /* Put Your Blurb Here Instead of the following scriptlet. Not this comment Bren. Jeesh*/ %>
<%= levelBlurb %>
<% /* Put Your Blurb Here Instead of the following scriptlet. Not this comment Bren. Jeesh*/ %>
<%= levelBlurb %>
<% /* Put Your Blurb Here Instead of the following scriptlet. Not this comment Bren. Jeesh*/ %>
<%= levelBlurb %>
<%
/* Put Your Blurb Here Instead of the following scriptlet. Not this comment Bren. Jeesh*/
%>
<%=levelBlurb%>
-
<% /* Put Your Blurb Here Instead of the following scriptlet. Not this comment Bren. Jeesh*/ %>
<%= levelBlurb %>
<%= levelBlurb %>
Try to decrypt this: IAAAAEkQBhEVBwpDHAFJGhYHSBYEGgocAw== <%= bundle.getString("insecureCyrptoStorage.3.tryDecryptThis") %> IAAAAEkQBhEVBwpDHAFJGhYHSBYEGgocAw==
- If you can buy trolls for free you'll receive the key for this level!
+ <%= bundle.getString("insecureCyrptoStorage.4.whatToDo") %>
<%= bundle.getString("insecureCyrptoStorage.4.shop.message.1") %> PleaseTakeARage <%= bundle.getString("insecureCyrptoStorage.4.shop.message.2") %> RageMemeForFree <%= bundle.getString("insecureCyrptoStorage.4.shop.message.3") %> An Error Occurred: " + ajaxCall.status + " " + ajaxCall.statusText + " <%= bundle.getString("insecureCyrptoStorage.errorOccurred") %>: " + ajaxCall.status + " " + ajaxCall.statusText + "
- The result key has been encrypted to ensure that nobody can finish the
- challenge without knowing the secret key to decrypt it. The following form
- can be used to check if you have the correct result key.
+ <%= bundle.getString("insecureCryptoStorage.2.whatToDo") %>
- The result key has been encrypted to ensure that nobody can finish the challenge without knowing the secret key to decrypt it. However, the result key has been encrypted with a famous, but easily broken, Roman cipher.
+ <%= bundle.getString("insecureCryptoStorage.1.whatToDo") %>
Your cipher text was decrypted to the following: " + bundle.getString("insecureCyrptoStorage.3.plaintextResult.message") + " " + bundle.getString("insecureCyrptoStorage.4.orderShipped") + " " + bundle.getString("insecureCyrptoStorage.4.totalCost") + " $" + finalCost + " " + bundle.getString("insecureCyrptoStorage.4.freeTrolls") + " - " + Hash.generateUserSolution(Getter.getModuleResultFromHash(getServletContext().getRealPath(""), levelHash), (String)ses.getAttribute("userName")) + " Order Failed - Please try again later " + bundle.getString("insecureCyrptoStorage.4.orderFailed") + "
<%=levelBlurb%>
-
<%=levelBlurb%>
-
- This App has an upgraded form of filtering. Bypass the filtering, and perform SQL Injection to sign in as a legitimate user.
-
+ <%= paragraph1 %>
- <%= mobile.getString("mobileBlurb.vmLink.1") + " CSInjection3.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
+ <%= mobile.getString("mobileBlurb.vmLink.1") + " CSInjection2.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
<% /* IF you need a form - Present it like this */ %>
<%
From 68c38e68a7ab713104be7f4fb31ff75d7dc199a8 Mon Sep 17 00:00:00 2001
From: SeanDuggan <%= levelName %>
+ <%= LevelName %>
- This App uses a deprecated encryption algorithm (DES) and breaks a vital rule of key management. The key is in the conversation. Decrypt the chat to get the key.
+ <%= paragraph1 %>
- <%= mobile.getString("mobileBlurb.vmLink.1") + " BrokenCrypto2.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
+ <%= mobile.getString("mobileBlurb.vmLink.1") + " BrokenCrypto1.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
<%= levelName %>
+ <%= LevelName %>
- The key for this challenge can be found in the client side database. Get the key to pass this challenge.
+ <%= paragraph1 %>
<%= mobile.getString("mobileBlurb.vmLink.1") + " BrokenCrypto4.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
diff --git a/SecurityShepherdCore/src/jsp/challenges/fb5c9ce0f5539b737e534fd317befff7427f6610ed626dfd43abf35295f106bc.jsp b/SecurityShepherdCore/src/jsp/challenges/fb5c9ce0f5539b737e534fd317befff7427f6610ed626dfd43abf35295f106bc.jsp
index 4115ba9cf..8091d5c2d 100644
--- a/SecurityShepherdCore/src/jsp/challenges/fb5c9ce0f5539b737e534fd317befff7427f6610ed626dfd43abf35295f106bc.jsp
+++ b/SecurityShepherdCore/src/jsp/challenges/fb5c9ce0f5539b737e534fd317befff7427f6610ed626dfd43abf35295f106bc.jsp
@@ -27,9 +27,13 @@ String levelHash = "fb5c9ce0f5539b737e534fd317befff7427f6610ed626dfd43abf35295f1
//Translation Stuff
Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
-//ResourceBundle bundle = ResourceBundle.getBundle("i18n.lessons.example." + levelHash, locale);
+ResourceBundle bundle = ResourceBundle.getBundle("i18n.challenges.mobile.brokenCrypto.brokenCrypto", locale);
ResourceBundle mobile = ResourceBundle.getBundle("i18n.moduleGenerics.mobileGenericStrings", locale);
+//Used more than once translations
+String LevelName = bundle.getString("challenge2.challengeName");
+String paragraph1 = bundle.getString("challenge2.para1");
+
//Level blurb can be written here in HTML OR go into the HTML body and write it there. Nobody will update this but you
String levelBlurb = "";
@@ -56,7 +60,7 @@ if (request.getSession() != null)
<%= levelName %>
+ <%= LevelName %>
- This App uses DES to encrypt it's chat however it's developers have implemented this poorly. The key is in the conversation. Decrypt the chat to get the key.
+ <%= paragraph1 %>
- <%= mobile.getString("mobileBlurb.vmLink.1") + " BrokenCrypto3.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
+ <%= mobile.getString("mobileBlurb.vmLink.1") + " BrokenCrypto2.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
<%=levelName%>
+ <%=LevelName%>
Log in as the user of this App to get the key for this
- challenge. Some data has been logged but it is up to the
- attacker to know what to do with this data.
+
+ <%= paragraph1 %>
+
- <%=mobile.getString("mobileBlurb.vmLink.1") + " UDataLeakage2.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
+ <%=mobile.getString("mobileBlurb.vmLink.1") + " UDataLeakage1.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
<%= levelName %>
+ <%= LevelName %>
-This App is leaking logs. The Key is the winning lotto number!
+ <%= paragraph1 %>
+
<%= mobile.getString("mobileBlurb.vmLink.1") + " UDataLeakage3.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
From 4f9c4ff307396871893e3bc7d9f4afc5438bb95d Mon Sep 17 00:00:00 2001
From: Mark Denihan <%= levelName %>
+ <%= i18nLevelName %>
Cipher text Example
<%= bundle.getString("insecureCyrptoStorage.3.ciphertextExample") %>
+ <%= levelName %>
+ <%= i18nLevelName %>
- Super Meme Shopping
- Hey customers: Due to a shipping mistake we are completely over stocked in rage Memes.
- Use the coupon code PleaseTakeARage or RageMemeForFree to get yours for free!!!.
+ <%= bundle.getString("insecureCyrptoStorage.4.shop") %>
+
@@ -141,7 +146,7 @@ if (request.getSession() != null)
}
else
{
- $("#resultsDiv").html("
* This file is part of the Security Shepherd Project.
*
@@ -22,6 +23,12 @@
*/
String levelName = "Insecure Cryptographic Storage Challenge 2";
+
+ //Translation Stuff
+ Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
+ ResourceBundle bundle = ResourceBundle.getBundle("i18n.challenges.insecureCryptoStorage.insecureCryptoStorage", locale);
+ //Used more than once translations
+ String i18nLevelName = bundle.getString("insecureCryptoStorage.2.challengename");
ShepherdLogManager.logEvent(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), levelName + " Accessed");
if (request.getSession() != null)
{
@@ -46,23 +53,21 @@ String levelName = "Insecure Cryptographic Storage Challenge 2";
- Insecure Cryptographic Storage Challenge Two
+ <%= i18nLevelName %>
Insecure Cryptographic Storage Challenge One
+ <%= i18nLevelName %>
Ymj wjxzqy pjd ktw ymnx qjxxts nx ymj ktqqtbnsl xywnsl; rdqtajqdmtwxjwzssnslymwtzlmymjknjqibmjwjfwjdtzltnslbnymdtzwgnlf
diff --git a/SecurityShepherdCore/src/servlets/module/challenge/BrokenCrypto3.java b/SecurityShepherdCore/src/servlets/module/challenge/BrokenCrypto3.java
index 6774738cd..2b084d3e1 100644
--- a/SecurityShepherdCore/src/servlets/module/challenge/BrokenCrypto3.java
+++ b/SecurityShepherdCore/src/servlets/module/challenge/BrokenCrypto3.java
@@ -2,6 +2,8 @@
import java.io.IOException;
import java.io.PrintWriter;
+import java.util.Locale;
+import java.util.ResourceBundle;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -42,7 +44,7 @@ public class BrokenCrypto3 extends HttpServlet
private static final long serialVersionUID = 1L;
private static org.apache.log4j.Logger log = Logger.getLogger(BrokenCrypto3.class);
private static String levelName = "Broken Crypto Challenge 3";
- private static String levelHash = "2da053b4afb1530a500120a49a14d422ea56705a7e3fc405a77bc269948ccae1";
+ public static String levelHash = "2da053b4afb1530a500120a49a14d422ea56705a7e3fc405a77bc269948ccae1";
public static String levelResult = "thisisthesecurityshepherdabcencryptionkey"; //Is used as encryption key in this level
public void doPost (HttpServletRequest request, HttpServletResponse response)
@@ -53,13 +55,18 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
HttpSession ses = request.getSession(true);
if(Validate.validateSession(ses))
- {
+ {
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), ses.getAttribute("userName").toString());
log.debug(levelName + " servlet accessed by: " + ses.getAttribute("userName").toString());
-
+ String htmlOutput = new String();
+
PrintWriter out = response.getWriter();
out.print(getServletInfo());
- String htmlOutput = new String();
+
+ //Translation Stuff
+ Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
+ ResourceBundle errors = ResourceBundle.getBundle("i18n.servlets.errors", locale);
+ ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.insecureCryptoStorage.insecureCryptoStorage", locale);
try
{
String userData = request.getParameter("userData");
@@ -70,14 +77,14 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
String decryptedUserData = decrypt(userData, levelResult);
log.debug("Decrypted to: " + decryptedUserData);
Encoder encoder = ESAPI.encoder();
- htmlOutput = "Plain text Result:
"
+ htmlOutput = "" + bundle.getString("insecureCyrptoStorage.3.plaintextResult") + "
"
+ encoder.encodeForHTML(decryptedUserData)
+ "
*
* This file is part of the Security Shepherd Project.
@@ -57,13 +57,16 @@ public void doPost (HttpServletRequest request, HttpServletResponse response)
HttpSession ses = request.getSession(true);
if(Validate.validateSession(ses))
{
+ //Translation Stuff
+ Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
+ ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.insecureCryptoStorage.insecureCryptoStorage", locale);
+
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), ses.getAttribute("userName").toString());
log.debug(levelName + " servlet accessed by: " + ses.getAttribute("userName").toString());
PrintWriter out = response.getWriter();
out.print(getServletInfo());
String htmlOutput = new String();
String applicationRoot = getServletContext().getRealPath("");
- Encoder encoder = ESAPI.encoder();
try
{
//Get and validate cart amounts
@@ -138,18 +141,18 @@ else if (coupons.getInt(1) == 4) // NotBad
int finalCost = megustaCost + rageCost + notBadAmount + trollCost;
//Output Order
- htmlOutput = "Order Complete
"
- + "Your order has been made and has been sent to our magic shipping department that knows where you want this to be delivered via brain wave sniffing techniques.
"
- + "Your order comes to a total of $" + finalCost + "";
+ htmlOutput = "" + bundle.getString("insecureCyrptoStorage.4.orderComplete") + "
"
+ + "
Trolls were free, Well Done - " + encoder.encodeForHTML(Hash.generateUserSolution(Getter.getModuleResultFromHash(getServletContext().getRealPath(""), levelHash), (String)ses.getAttribute("userName"))) + "";
+ htmlOutput += "<%=levelName%>
+ <%=LevelName%>
When an attacker reverse engineers an APK, they usually find
- multiple packages containing multiple activities,
- containing multiple methods which have all been obfuscated to
- crawl through. The key for this challenge has been hard coded into the APK for this challenge. To get to
- the key reverse engineer the APK and find the correct Activity which
- performs a conditional statement to check the validity of the key.
+
+ <%= paragraph1 %>
+
- <%= mobile.getString("mobileBlurb.vmLink.1") + " ReverseEngineer3.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
+ <%= mobile.getString("mobileBlurb.vmLink.1") + " ReverseEngineer2.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
<%=levelName%>
+ <%=LevelName%>
The developers of this App, ReverseEngineer4, have decided to use an algorithm to confirm or deny the authenticity of the key. You must Reverse Engineer ReverseEngineer3.APK to find this algorithm. If you are unsure whether or not the key is correct, there is a key validity checker in the App.
+
<%= paragraph1 %>
- <%= mobile.getString("mobileBlurb.vmLink.1") + " ReverseEngineer4.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
+ <%= mobile.getString("mobileBlurb.vmLink.1") + " ReverseEngineer3.apk " + mobile.getString("mobileBlurb.vmLink.2") %>
lWPSErHgFS=Ys5G
za1=R?YS>vlc}I3u>;^Wr!?4T!Lglv8M__D#J@$QJLNH}lKn=+I1WGsbXx^BrRVnul
zV6jvNZpusI*pypTZH@r`s@-cx7C@tzU|W%%lnIXBw2quv`#Q~cfbA!cz8U*k2mQn@
zLQUZ$(vt55pQFSvFxuWpM3`x(7>q|RvY#h>sz?;N0}yzOViY_wfh;43pVuPIi|UhT
zrOMwa^qu68E7*nvdEoA@aBwd+SXPgs2fUjSFXO8^XKRBT6KmCREX))sFltDRPc7!9
zSMbmFxp!wK*AQz@m46$`FYov~wMvmr@^qH#A{N;HJ#oiGDbCt{-_a(~Yeb~%N#2
^tYhyT=P(qJ3vCV28dZps<(M>VnPmXulmc!^hb9VD&qv?4>S{7`WR%pN3J-0Ff`yI6VC0TaP?NI
zB}Vz<_GE`%Wxjc$^ev0;%s3@dvVi`9?d-Yv&SuSCv-$D0_l)(3cp1p16`2ZZgr8Ve32Ogj=OxO$QL
zs01HF6q1hw_nXrF(LPa_Ze?^n)g(!ueRI3e#8;~FR(vi{KmBQNIzY6)=&(@g=!0z4
zi4u&eH;u
g8are3yGuTp_u&{Hw?(-V-JB2B6t_UpuX4_XhkSzrx~(r)(F?kDf%CEu;P
z$D*|W1YXk$osGCt^RDq)`HSmhZ!a&g)M?FB(;LPmY>B~1Z!po;t{
wh$^$DjCm{;Hh5RUQ8gP|eO`~F-zWp%%Q=k?$7ZWLQ*-aU!&
z7db#nTiYz#*`{BBS^6_Ax-#UX*Y)AL41v4yZa%vd0Ej%VO%cQ)+68!ec%;MiI;tWv
zezq*&kRQB!HWz%o?|MskgY~Yg$NB@jw4#?msPUPZ
O(IW{@fJ_V0tO~hEiCVkyCi^tLV~b#Ob6cYzks^I+HX!@-}}k%@xLd
zKI=sFvFC$qTN_e!{+hrd5S682{DYW)mbc>$FD+DEa}h@Em$zbB%|iN@)e)Yro=n<#
z;U{tunKGw(YLR>A|7M631&d=2vJecrg#h!=A;hU;!6sB6tlSl>ygmCa_d$tq73sjk
z#fPw^RzH$8igVV&%)VqHgB3(eQaBk520TXL>UvQX1W7D1y8n2kfptvB1BjPXYd)5^
z#d?LA^V!0~<3@YWJ&4(*V->a@vHW)He3ETCNtP!}L<1J%4-E>_E1h&RVrM>FPE;f(
z6FyCZ2Oyx#qy!ZtG4~W9C$r#Jm7v5>@y~-ObvL)B!}`>I%9C=gdP@8}tQ*Xhpl-@E
zGe0|lts)0^4_cb7`fUn@@#3YJcmOZrIK?e