Whackerz #1

CounterStrike scanner by 27bytes/Whackerz


CSscan.pl it scans cs servers for how many players and which map , there is one slight bug in the script it freezes if the server is invalid you only have to restart the program

#!/usr/bin/perl
use IO: ocket;
$timeout = 5;
$ip =$ARGV[0];
$port = 27015;
print"usage: udpscan.pl \n";
$socket = IO: ocket::INET->new(PeerPort => "$port",
                                 PeerAddr => "$ip",
                                 Proto    => "udp",
                                 Timeout  => $timeout) or die("Gick inte att skapa en anslutning");{

$socket->send("˙˙˙˙infostring\n");
if (!$socket->accept) {
$socket->recv($rdata,2048);

@hlinfo = split /\\/,$rdata;

for ($x=0;$x<100;$x++)
{
$data = @hlinfo[$x+1];
if (@hlinfo[$x] eq "map") { $map = $data };
if (@hlinfo[$x] eq "players") {$players = $data };
if (@hlinfo[$x] eq "max") { $max = $data };
if (@hlinfo[$x] eq "hostname") { $hostname = $data };
}}}
print "$hostname\n$map\n$players / $max\n";