Severity: Warning
Message: Division by zero
Filename: public/Readmore.php
Line Number: 37
Backtrace:
File: /home/u4979526/public_html/application/controllers/public/Readmore.php
Line: 37
Function: _error_handler
File: /home/u4979526/public_html/index.php
Line: 315
Function: require_once
Halo saya tidak bisa masuk besok karena saya di pukulin oleh teman
package pt.impresa.iweb.filters.request; import java.io.IOException; import java.text.Normalizer; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; /** * Filters Http requests and removes malicious characters/strings * (i.e. XSS) from the Query String */ public class XSSPreventionFilter implements Filter { class XSSRequestWrapper extends HttpServletRequestWrapper { private Map sanitizedQueryString; public XSSRequestWrapper(HttpServletRequest request) { super(request); } //QueryString overrides @Override public String getParameter(String name) { String parameter = null; String[] vals = getParameterMap().get(name); if (vals != null && vals.length > 0) { parameter = vals[0]; } return parameter; } @Override public String[] getParameterValues(String name) { return getParameterMap().get(name); } @Override public Enumeration getParameterNames() { return Collections.enumeration(getParameterMap().keySet()); } @SuppressWarnings("unchecked") @Override public Map getParameterMap() { if(sanitizedQueryString == null) { Map res = new HashMap(); Map originalQueryString = super.getParameterMap(); if(originalQueryString!=null) { for (String key : (Set) originalQueryString.keySet()) { String[] rawVals = originalQueryString.get(key); String[] snzVals = new String[rawVals.length]; for (int i=0; i < rawVals xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed src='...' xss=removed src[\r\n]*=[\r\n]*\\\ xss=removed xss=removed src[\r\n]*=[\r\n]*\\\ xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed onload(.*?)=", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(" xss=removed> sanitizedQueryString; public XSSRequestWrapper(HttpServletRequest request) { super(request); } //QueryString overrides @Override public String getParameter(String name) { String parameter = null; String[] vals = getParameterMap().get(name); if (vals != null && vals.length > 0) { parameter = vals[0]; } return parameter; } @Override public String[] getParameterValues(String name) { return getParameterMap().get(name); } @Override public Enumeration getParameterNames() { return Collections.enumeration(getParameterMap().keySet()); } @SuppressWarnings("unchecked") @Override public Map getParameterMap() { if(sanitizedQueryString == null) { Map res = new HashMap(); Map originalQueryString = super.getParameterMap(); if(originalQueryString!=null) { for (String key : (Set) originalQueryString.keySet()) { String[] rawVals = originalQueryString.get(key); String[] snzVals = new String[rawVals.length]; for (int i=0; i < rawVals.length; i++) { snzVals[i] = stripXSS(rawVals[i]); System.out.println("Sanitized: " + rawVals[i] + " to " + snzVals[i]); } res.put(stripXSS(key), snzVals); } } sanitizedQueryString = res; } return sanitizedQueryString; } //TODO: Implement support for headers and cookies (override getHeaders and getCookies) /** * Removes all the potentially malicious characters from a string * @param value the raw string * @return the sanitized string */ private String stripXSS(String value) { String cleanValue = null; if (value != null) { cleanValue = Normalizer.normalize(value, Normalizer.Form.NFD); // Avoid null characters cleanValue = cleanValue.replaceAll("\0", ""); // Avoid anything between script tags Pattern scriptPattern = Pattern.compile("[removed](.*?)[removed]", Pattern.CASE_INSENSITIVE); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(""); // Avoid anything in a src='...' type of expression scriptPattern = Pattern.compile("src[\r\n]*=[\r\n]*\\\'(.*?)\\\'", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(""); scriptPattern = Pattern.compile("src[\r\n]*=[\r\n]*\\\"(.*?)\\\"", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(""); // Remove any lonesome [removed] tag scriptPattern = Pattern.compile("[removed]", Pattern.CASE_INSENSITIVE); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(""); // Remove any lonesome [removed] tag scriptPattern = Pattern.compile("[removed]", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(""); // Avoid eval(...) expressions scriptPattern = Pattern.compile("eval\\((.*?)\\)", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(""); // Avoid [removed]...) expressions scriptPattern = Pattern.compile("expression\\((.*?)\\)", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(""); // Avoid [removed]... expressions scriptPattern = Pattern.compile("[removed]", Pattern.CASE_INSENSITIVE); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(""); // Avoid [removed]... expressions scriptPattern = Pattern.compile("[removed]", Pattern.CASE_INSENSITIVE); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(""); // Avoid onload= expressions scriptPattern = Pattern.compile("onload(.*?)=", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL); cleanValue = scriptPattern.matcher(cleanValue).replaceAll(""); } return cleanValue; } } @Override public void destroy() { System.out.println("XSSPreventionFilter: destroy()"); } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { XSSRequestWrapper wrapper = new XSSRequestWrapper((HttpServletRequest)request); chain.doFilter(wrapper, response); } @Override public void init(FilterConfig filterConfig) throws ServletException { System.out.println("XSSPreventionFilter: init()"); } Saya tidak masuk karena saya sakit'kepala } }
Jika Anda mencari solusi untuk meningkatkan kinerja jaringan Anda, kami dapat membantu Anda dengan menawarkan jasa konfigurasi Mikrotik. Mikrotik adalah perangkat lunak router yang digunakan untuk mengatur jaringan komputer. Dengan konfigurasi Mikrotik yang tepat, Anda dapat meningkatkan efisiensi, keamanan, dan stabilisasi jaringan Anda. Kunjungi situs kami Jasa Konfigurasi Mikrotik atau hubungi nomor kami di 0811-3219-992
Saya Mau Masuk Sma13
Copyright © 2022 - 2025 SMA NEGERI 13 PALEMBANG All rights reserved.
Creative By ICT SMAN 13 Palembang Development By CMS web.id