You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Reflect_XSS_good.jsp 551 B

3 years ago
1234567891011121314151617181920
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" import="java.util.regex.*"
  2. pageEncoding="ISO-8859-1"%>
  3. <%
  4. String action = request.getParameter("action");
  5. String field1 = "field1";
  6. String regex1 = "^[0-9]{3}$";// any three digits
  7. Pattern pattern1 = Pattern.compile(regex1);
  8. if("Purchase".equals(action))
  9. {
  10. if(!pattern1.matcher(field1).matches())
  11. {
  12. /** If they supplied the right attack, pass them **/
  13. out.write("alert('Whoops: You entered an incorrect access code of \"" + field1 + "\"');"); // good xss
  14. }
  15. }
  16. %>

No Description

Contributors (1)