weishao 3 years ago
commit
deb511d92a
55 changed files with 66 additions and 0 deletions
  1. BIN
      .DS_Store
  2. BIN
      Command_Injection/Command_Injection.class
  3. BIN
      Create_Boolean_Object/Create_Boolean_Object.class
  4. BIN
      Create_String_Object/Create_String_Object.class
  5. BIN
      Debug_Code/Debug_Code_bad.class
  6. BIN
      Debug_Code/Debug_Code_good.class
  7. BIN
      Empty_Catch_Block/Empty_Catch_Block.class
  8. BIN
      Empty_If_Block/Empty_If_Block.class
  9. BIN
      Empty_Password/Empty_Password.class
  10. BIN
      Empty_String_Compare/Empty_String_Compare.class
  11. BIN
      Empty_Syn_Block/Empty_Syn_Block.class
  12. BIN
      Expression_Always_False/Expression_Always_False_01.class
  13. BIN
      Expression_Always_False/Expression_Always_False_02.class
  14. BIN
      Expression_Always_True/Expression_Always_True_01.class
  15. BIN
      Expression_Always_True/Expression_Always_True_02.class
  16. +13
    -0
      HTML_Comment_in_JSP/HTML_Comment_in_JSP.jsp
  17. BIN
      HTTP_Response_Splitting/HTTP_Response_Splitting.class
  18. BIN
      Hard_Coded_Password/Hard_Coded_Password.class
  19. BIN
      Insecuere_Randomness/Insecuere_Randomness.class
  20. BIN
      J2EE_Bad_Practices_Use_of_System_Exit/J2EE_Bad_Practices_Use_of_System_Exit__Servlet_01.class
  21. BIN
      Just_one_of_Equals_or_hashCode_defined/Just_one_of_Equals_or_hashCode_defined_bad.class
  22. BIN
      Just_one_of_Equals_or_hashCode_defined/Just_one_of_Equals_or_hashCode_defined_good.class
  23. BIN
      LDAP_Injection/LDAP_Injection.class
  24. BIN
      Log_Forging/Log_Forging.class
  25. BIN
      Logging_using_System_output/Logging_using_System_output.class
  26. BIN
      Null_Password/Null_Password.class
  27. BIN
      Obsolete_Method/Obsolete_Method.class
  28. +6
    -0
      Open_Redirect/Open_Redirect_bad.jsp
  29. +8
    -0
      Open_Redirect/Open_Redirect_good.jsp
  30. BIN
      Overly_board_Catch/Overly_board_Catch.class
  31. BIN
      Overly_board_Throws/Overly_board_Throws.class
  32. BIN
      Path_Manipulate/Path_Manipulate.class
  33. BIN
      Persist_XSS/Persist_XSS.class
  34. BIN
      Redundence_Initialize/Redundence_Initialize.class
  35. +19
    -0
      Reflect_XSS/Reflect_XSS_bad.jsp
  36. +20
    -0
      Reflect_XSS/Reflect_XSS_good.jsp
  37. BIN
      Return_in_Finally/Return_in_Finally.class
  38. BIN
      SQL_Injection/SQL_Injection.class
  39. BIN
      Static_Field_Not_Final/Static_Field_Not_Final.class
  40. BIN
      String_Compare_Error/String_Compare_Error.class
  41. BIN
      Stringbuild_in_loop/Stringbuild_in_loop.class
  42. BIN
      System_Information_Leak/System_Information_Leak.class
  43. BIN
      Throws_Excepiton_in_Finally/Throws_Excepiton_in_Finally.class
  44. BIN
      Trust_Boundary_Violation/Trust_Boundary_Violation.class
  45. BIN
      Unchecked_Return_Value/Unchecked_Return_Value.class
  46. BIN
      Unreleased_DB_Resource/Unreleased_DB_Resource.class
  47. BIN
      Unreleased_Stream/Unreleased_Stream.class
  48. BIN
      Unsafe_Hash_Algorithm/Unsafe_Hash_Algorithm.class
  49. BIN
      Unsafe_Reflection/Unsafe_Reflection.class
  50. BIN
      Unused_Filed/Unused_Filed.class
  51. BIN
      Unused_Method/Unused_Method.class
  52. BIN
      Unused_Variable/Unused_Variable.class
  53. BIN
      Use_Float_For_Compute/Use_Float_For_Compute.class
  54. BIN
      Weak_Encryption/Weak_Encryption.class
  55. BIN
      XPath_Injection/XPath_Injection.class

BIN
.DS_Store View File


BIN
Command_Injection/Command_Injection.class View File


BIN
Create_Boolean_Object/Create_Boolean_Object.class View File


BIN
Create_String_Object/Create_String_Object.class View File


BIN
Debug_Code/Debug_Code_bad.class View File


BIN
Debug_Code/Debug_Code_good.class View File


BIN
Empty_Catch_Block/Empty_Catch_Block.class View File


BIN
Empty_If_Block/Empty_If_Block.class View File


BIN
Empty_Password/Empty_Password.class View File


BIN
Empty_String_Compare/Empty_String_Compare.class View File


BIN
Empty_Syn_Block/Empty_Syn_Block.class View File


BIN
Expression_Always_False/Expression_Always_False_01.class View File


BIN
Expression_Always_False/Expression_Always_False_02.class View File


BIN
Expression_Always_True/Expression_Always_True_01.class View File


BIN
Expression_Always_True/Expression_Always_True_02.class View File


+ 13
- 0
HTML_Comment_in_JSP/HTML_Comment_in_JSP.jsp View File

@@ -0,0 +1,13 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>HTTP Splitting</title>
</head>
<body>
<% response.sendRedirect("https://aa.com/test.php"); %> <%-- // good HTML Comment in JSP file --%>
<!-- this is an html comment.it will show up int the response. --> <%-- // bad HTML Comment in JSP file --%>
</body>
</html>

BIN
HTTP_Response_Splitting/HTTP_Response_Splitting.class View File


BIN
Hard_Coded_Password/Hard_Coded_Password.class View File


BIN
Insecuere_Randomness/Insecuere_Randomness.class View File


BIN
J2EE_Bad_Practices_Use_of_System_Exit/J2EE_Bad_Practices_Use_of_System_Exit__Servlet_01.class View File


BIN
Just_one_of_Equals_or_hashCode_defined/Just_one_of_Equals_or_hashCode_defined_bad.class View File


BIN
Just_one_of_Equals_or_hashCode_defined/Just_one_of_Equals_or_hashCode_defined_good.class View File


BIN
LDAP_Injection/LDAP_Injection.class View File


BIN
Log_Forging/Log_Forging.class View File


BIN
Logging_using_System_output/Logging_using_System_output.class View File


BIN
Null_Password/Null_Password.class View File


BIN
Obsolete_Method/Obsolete_Method.class View File


+ 6
- 0
Open_Redirect/Open_Redirect_bad.jsp View File

@@ -0,0 +1,6 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" import="java.util.regex.*"
pageEncoding="ISO-8859-1"%>
<%

String strDest = request.getParameter("dest");
pageContext.forward(strDest); %> <%-- // good Open Redirect --%>

+ 8
- 0
Open_Redirect/Open_Redirect_good.jsp View File

@@ -0,0 +1,8 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" import="java.util.regex.*"
pageEncoding="ISO-8859-1"%>
<%
String[] strURLArray = new String[]{"http://aa.com","http://bb.com","http://cc.com"};
int strDest = Integer.parseInt(request.getParameter("dest"));
if((strDest >= 0) && (strDest <= 15 ))
{ String strFinalURL = strURLArray[strDest];
pageContext.forward(strFinalURL); } %> <%-- // good Open Redirect --%>

BIN
Overly_board_Catch/Overly_board_Catch.class View File


BIN
Overly_board_Throws/Overly_board_Throws.class View File


BIN
Path_Manipulate/Path_Manipulate.class View File


BIN
Persist_XSS/Persist_XSS.class View File


BIN
Redundence_Initialize/Redundence_Initialize.class View File


+ 19
- 0
Reflect_XSS/Reflect_XSS_bad.jsp View File

@@ -0,0 +1,19 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" import="java.util.regex.*"
pageEncoding="ISO-8859-1"%>
<%
String action = request.getParameter("action");
String field1 = request.getParameter("field1");
String regex1 = "^[0-9]{3}$";// any three digits
Pattern pattern1 = Pattern.compile(regex1);

if("Purchase".equals(action))
{
if(!pattern1.matcher(field1).matches())
{
/** If they supplied the right attack, pass them **/
out.write("alert('Whoops: You entered an incorrect access code of \"" + field1 + "\"');"); // bad XSS
}
}
%>

+ 20
- 0
Reflect_XSS/Reflect_XSS_good.jsp View File

@@ -0,0 +1,20 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" import="java.util.regex.*"
pageEncoding="ISO-8859-1"%>
<%
String action = request.getParameter("action");
String field1 = "field1";
String regex1 = "^[0-9]{3}$";// any three digits
Pattern pattern1 = Pattern.compile(regex1);

if("Purchase".equals(action))
{
if(!pattern1.matcher(field1).matches())
{
/** If they supplied the right attack, pass them **/
out.write("alert('Whoops: You entered an incorrect access code of \"" + field1 + "\"');"); // good xss
}
}
%>

BIN
Return_in_Finally/Return_in_Finally.class View File


BIN
SQL_Injection/SQL_Injection.class View File


BIN
Static_Field_Not_Final/Static_Field_Not_Final.class View File


BIN
String_Compare_Error/String_Compare_Error.class View File


BIN
Stringbuild_in_loop/Stringbuild_in_loop.class View File


BIN
System_Information_Leak/System_Information_Leak.class View File


BIN
Throws_Excepiton_in_Finally/Throws_Excepiton_in_Finally.class View File


BIN
Trust_Boundary_Violation/Trust_Boundary_Violation.class View File


BIN
Unchecked_Return_Value/Unchecked_Return_Value.class View File


BIN
Unreleased_DB_Resource/Unreleased_DB_Resource.class View File


BIN
Unreleased_Stream/Unreleased_Stream.class View File


BIN
Unsafe_Hash_Algorithm/Unsafe_Hash_Algorithm.class View File


BIN
Unsafe_Reflection/Unsafe_Reflection.class View File


BIN
Unused_Filed/Unused_Filed.class View File


BIN
Unused_Method/Unused_Method.class View File


BIN
Unused_Variable/Unused_Variable.class View File


BIN
Use_Float_For_Compute/Use_Float_For_Compute.class View File


BIN
Weak_Encryption/Weak_Encryption.class View File


BIN
XPath_Injection/XPath_Injection.class View File


Loading…
Cancel
Save