title: Busting a tough FRAME killer
body: <p>I've been trying to break this up for a few hours now but with no success... I am pretty desperate now :(</p>
  
  <p>I am doing penetration testing for a company and I need to bypass this frame killer JS:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;/* &lt;![CDATA[ */
  if (top != self) {
      try {
          if (parent != top) {
              throw 1;
          }
          var disallowed = ['XXXXXXX.com'];
          var href = top.location.href.toLowerCase();
          for (var i = 0; i &lt; disallowed.length; i++) {
              if (href.indexOf(disallowed[i]) &gt;= 0) {
                  throw 1;
              }
          }
      } catch (e) {
          try {
              window.document.getElementsByTagName('head')[0].innerHTML = '';
          } catch (e) { /* IE */
              var htmlEl = document.getElementsByTagName('html')[0];
              htmlEl.removeChild(document.getElementsByTagName('head')[0]);
              var el = document.createElement('head');
              htmlEl.appendChild(el);
          }
          window.document.body.innerHTML = '&lt;a href="#" onclick="top.location.href=window.location.href" style="text-decoration:none;"&gt;&lt;img src="http://www.XXXXXXX.com/img/XXXXXX.gif" style="border:0px;" /&gt;&lt;br /&gt;Go to XXXXXXX.com&lt;/a&gt;';
      }
  }
  
  /* ]]&gt; */&lt;/script&gt;
  </code></pre>
  
  <p>Thank you very much!</p>