Advertisement
loozr

/usb/modules/sslstrip/js/sslstrip.js

Sep 23rd, 2012
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var auto_refresh;
  2. var showDots;
  3.  
  4. var showLoadingDots = function() {
  5.     clearInterval(showDots);
  6.     if (!$("#loadingDots").length>0) return false;
  7.     showDots = setInterval(function(){            
  8.         var d = $("#loadingDots");
  9.         d.text().length >= 3 ? d.text('') : d.append('.');
  10.     },300);
  11. }
  12.  
  13. function init() {
  14.  
  15.     refresh_history();
  16.    
  17.     $("#tabs ul").idTabs();
  18.                
  19.     $("#auto_refresh").toggle(function() {
  20.             $("#auto_refresh").html('<font color="lime">On</font>');
  21.             $('#auto_time').attr('disabled', 'disabled');
  22.            
  23.             auto_refresh = setInterval(
  24.             function ()
  25.             {
  26.                 refresh();
  27.             },
  28.             $("#auto_time").val());
  29.         }, function() {
  30.             $("#auto_refresh").html('<font color="red">Off</font>');
  31.             $('#auto_time').removeAttr('disabled');
  32.                
  33.             clearInterval(auto_refresh);
  34.             auto_refresh = null;
  35.         });
  36. }
  37.  
  38. function sslstrip_toggle(action) {
  39.    
  40.     if($('#verbose:checkbox:checked').val() == "verbose")
  41.         $('#output').load('sslstrip_actions.php?sslstrip&verbose&'+action);
  42.     else
  43.         $('#output').load('sslstrip_actions.php?sslstrip&'+action);
  44.  
  45.     if(action == 'stop') {
  46.         $("#sslstrip_link").html('<strong>Start</strong>');
  47.         $("#sslstrip_status").html('<font color="red"><strong>disabled</strong></font>');
  48.         $("#sslstrip_link").attr("href", "javascript:sslstrip_toggle('start');");
  49.         $('#output').val('sslstrip has been stopped...');  
  50.        
  51.         $('#verbose').removeAttr('disabled');
  52.        
  53.         refresh_history();
  54.     }
  55.     else {
  56.         $("#sslstrip_link").html('<strong>Stop</strong>');
  57.         $("#sslstrip_status").html('<font color="lime"><strong>enabled</strong></font>');
  58.         $("#sslstrip_link").attr("href", "javascript:sslstrip_toggle('stop');");
  59.         $('#output').val('sslstrip is running...');
  60.        
  61.         $('#verbose').attr('disabled', 'disabled');
  62.        
  63.         refresh_history();
  64.     }
  65. }
  66.  
  67. function refresh() {
  68.     if(auto_refresh == null) {
  69.         $("#refresh_text").html('<em>Loading<span id="loadingDots"></span></em>');
  70.         showLoadingDots();
  71.     }
  72.    
  73.     $.ajax({
  74.         type: "GET",
  75.         data: "lastlog",
  76.         url: "sslstrip_data.php",
  77.         success: function(msg){
  78.             $("#output").val(msg);
  79.             $("#refresh_text").html(''); clearInterval(showDots);
  80.         }
  81.     });
  82. }
  83.  
  84. function refresh_history() {
  85.     $("#refresh_text").html('<em>Loading<span id="loadingDots"></span></em>');
  86.     showLoadingDots();
  87.    
  88.     $.ajax({
  89.         type: "GET",
  90.         data: "history",
  91.         url: "sslstrip_data.php",
  92.         success: function(msg){
  93.             $("#content_history").html(msg);
  94.             $("#refresh_text").html(''); clearInterval(showDots);
  95.         }
  96.     });
  97. }
  98.  
  99. function showTab()
  100. {
  101.     $("#Output").show();
  102.     $("#History").hide();
  103.     $("#History_link").removeClass("selected");
  104.     $("#Output_link").addClass("selected");
  105. }
  106.  
  107. function load_file(what) {
  108.     $("#refresh_text").html('<em>Loading<span id="loadingDots"></span></em>');
  109.     showLoadingDots();
  110.    
  111.     $.ajax({
  112.         type: "GET",
  113.         data: "load&file=" + what,
  114.         url: "sslstrip_actions.php",
  115.         success: function(msg){
  116.             $("#output").val(msg);
  117.             showTab();     
  118.             $("#refresh_text").html(''); clearInterval(showDots);
  119.         }
  120.     });
  121. }
  122.  
  123. function delete_file(what, which) {
  124.     $("#refresh_text").html('<em>Loading<span id="loadingDots"></span></em>');
  125.     showLoadingDots();
  126.    
  127.     $.ajax({
  128.         type: "GET",
  129.         data: "delete&file=" + which + "&" + what,
  130.         url: "sslstrip_actions.php",
  131.         success: function(msg){
  132.             $("#content_history").html(msg);
  133.             $("#refresh_text").html(''); clearInterval(showDots);
  134.             refresh_history();
  135.         }
  136.     });
  137. }
  138.  
  139.  
  140. function clean(what, which) {
  141.     $("#refresh_text").html('<em>Loading<span id="loadingDots"></span></em>');
  142.     showLoadingDots();
  143.    
  144.     $.ajax({
  145.         type: "GET",
  146.         data: "clean&file=" + which + "&" + what,
  147.         url: "sslstrip_actions.php",
  148.         success: function(msg){
  149.             $("#content_history").html(msg);
  150.             $("#refresh_text").html(''); clearInterval(showDots);
  151.             refresh_history();
  152.         }
  153.     });
  154. }
  155.  
  156.  
  157.  
  158. function usb_toggle(action) {
  159.     $('#output').load('sslstrip_actions.php?usb&action='+action);
  160.     if(action == 'enable'){
  161.         $('#data_link').html('<strong>Uninstall from USB</strong>');
  162.         $('#data_status').html('<font color="lime"><strong>on usb</strong></font>');
  163.         $('#data_link').attr("href", "javascript:usb_toggle('disable');");
  164.     }
  165.     else{
  166.         $('#data_link').html('<strong>Install on USB</strong>');
  167.         $('#data_status').html('<font color="red"><strong>not on usb</strong></font>');
  168.         $('#data_link').attr("href", "javascript:usb_toggle('enable');");
  169.     }
  170. }
  171.  
  172. function boot_toggle(action) {
  173.     $('#output').load('sslstrip_actions.php?boot&action='+action);
  174.     if(action == 'disable') {
  175.         $("#boot_link").html('<strong>Enable</strong>');
  176.         $("#boot_status").html('<font color="red"><strong>disabled</strong></font>');
  177.         $("#boot_link").attr("href", "javascript:boot_toggle('enable');");
  178.     }
  179.     else {
  180.         $("#boot_link").html('<strong>Disable</strong>');
  181.         $("#boot_status").html('<font color="lime"><strong>enabled</strong></font>');
  182.         $("#boot_link").attr("href", "javascript:boot_toggle('disable');");
  183.     }
  184. }
  185.  
  186. function install(where) {
  187.     $("#refresh_text").html('<em>Installing<span id="loadingDots"></span></em>');
  188.     showLoadingDots();
  189.    
  190.     $.ajax({
  191.         type: "GET",
  192.         data: "install&where=" + where,
  193.         url: "sslstrip_actions.php",
  194.         success: function(msg){
  195.             $("#output").val(msg);
  196.             $("#refresh_text").html(''); clearInterval(showDots);
  197.             location.reload(true);
  198.         }
  199.     });
  200. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement