pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

PHP paste-bin - collaborative debugging tool View Help


Posted by step on Thu 28th Jun 04:28
download | new post

  1. <?
  2.  
  3.         $badip = "127.0.0.1";                        # IP adresas, iš kurio prisijung&#281;s vartotojas, kur&#303; norime atjungti nuo radijos
  4.         $hostname = "localhost";                                                        # Radijos serverio adresas
  5.         $port = 8100;                              # Radijos serverio prieigos prievadas
  6.         $username = "admin";                                # Radijos serverio prieigos slapyvardis
  7.         $password = "admin";                                # Radijos serverio prieigos slaptažodis
  8.  
  9.         $sock = @fsockopen($hostname, $port, $undef, $undef, 5);
  10.         if ($sock)
  11.         {
  12.                 fwrite($sock, "GET /admin.cgi HTTP/1.0\r\nHost: $hostname:$port\r\nUser-Agent: Mozilla/5.0 FireFox/2.0.0.0\r\nAuthorization: Basic " . base64_encode("$username:$password") . "\r\n\r\n");
  13.                 while (!feof($sock)) $response .= fgets($sock, 1024);
  14.                 fclose($sock);
  15.  
  16.                 preg_match("$badip</font></td><td align=center><font class=st>\d+h&nbsp;\d+m&nbsp;\d+s</font></td><td align=center><font class=st>0</font></td><td align=center><font class=st><a id=st href=\"/admin.cgi?mode=kickdst&kickdst=(\d+)\">", $response, $matches);
  17.                 $badid = $matches[1];
  18.  
  19.                 $sock = @fsockopen($hostname, $port, $undef, $undef, 5);
  20.                 if ($sock)
  21.                 {
  22.                         fwrite($sock, "GET /admin.cgi?mode=kickdst&kickdst=$badid HTTP/1.0\r\nHost: $hostname:$port\r\nUser-Agent: Mozilla/5.0 FireFox/2.0.0.0\r\nAuthorization: Basic " . base64_encode("$username:$password") . "\r\n\r\n");
  23.                         while (!feof($sock)) $response .= fgets($sock, 1024);
  24.                         /* neb&#363;tinas duomen&#371; apdorojimas */
  25.                         fclose($sock);
  26.                 }
  27.                 else die("Nepavyko antrasis prisijungimas prie nutolusio serverio\n");
  28.         }
  29.         else die("Nepavyko pirmasis prisijungimas prie nutolusio serverio\n");
  30.  
  31. ?>

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@
:
:
Remember my settings