Block Alert XSS

Blocked Window Alert - Prompt - Confirm - Open XSS

&& block function Window.Console

To deblock make var DEBUG = true

if i have forget some function you can add here on Comment Thanks

Javascript Code


var DEBUG = false;
if(!DEBUG){

    var xss = ["alert", "prompt", "open", "confirm" ];
    if(!window.xss) window.xss = {};
    for(var i=0;i<xss.length;i++){
        window[xss[i]] = function(text){};
    }

    if(!window.console) window.console = {};
    var methods = ["log", "debug", "warn", "error", "info" , "dir", "dirxml", "trace", "profile", "assert", "count", "group", "groupCollapsed", "time"];
    for(var i=0;i<methods.length;i++){
        console[methods[i]] = function(){};
    }

}

Reference

Share this post




About

Welcome to Cyber-Security.tk my personal blog to share my knowledge
Cyber Security, Ethical Hacking, Web & Network Auditing, Reverse Engineering and Cryptography
This website don't use analytics tracking and is ads-free. JavaScript is enabled .


Contact

Forum : level23hacktools@0x1


2022 © 0x1 | Cyber Security Consulting - Copyright All Rights Reserved