0byt3m1n1
Path:
/
data
/
11
/
0
/
19
/
129
/
997781
/
user
/
1027887
/
cgi-bin
/
[
Home
]
File: listen.cgi
#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); $ct{'pls'} = "audio/x-scpls"; $ct{'ram'} = "audio/x-pn-realaudio"; $ct{'m3u'} = "audio/x-mpegurl"; $ct{'asx'} = "video/x-ms-asf"; &io_get_query(); if(($f{'user'} eq "") || ($f{'type'} eq "")) { print "Content-Type: text/html\nLocation: http://www.vinz486.com/\n\n"; exit; } $type = $f{'type'}; $f{'host'} = $ENV{'HTTP_HOST'}; # Real player if($type eq "ram") { $pls = "http://".$f{'host'}."/cgi-bin/picoreader.cgi?user=".$f{'user'}."&r=".time()."&f=file.".$f{'type'}."\n"; print "Content-Type: ".$ct{$type}."\n\n".$pls; exit; } # Winamp if($type eq "pls") { $pls = "[playlist]\n"; $pls .= "NumberOfEntries=1\n"; $pls .= "File1=http://".$f{'host'}."/cgi-bin/picoreader.cgi?user=".$f{'user'}."&r=".time()."&f=file.".$f{'type'}."\n"; $pls .= "Title1=".$f{'inf'}."\n"; $pls .= "Length1=-1\n"; $pls .= "Version=2\n"; print "Content-Type: ".$ct{$type}."\n\n".$pls; exit; } # Generic m3u file if($type eq "m3u") { $pls = "#EXTM3U\n"; $pls .= "#EXTINF:-1,".$f{'inf'}."\n"; $pls .= "http://".$f{'host'}."/cgi-bin/picoreader.cgi?user=".$f{'user'}."&r=".time()."&f=file.".$f{'type'}."\n"; print "Content-Type: ".$ct{$type}."\n\n".$pls; exit; } # Windows Media Player if($type eq "asx") { $pls = "<ASX version=\"3.0\">\n"; $pls .= "<ENTRY>\n"; $pls .= "<TITLE>".$f{'inf'}."</TITLE>\n"; $pls .= "<REF href=\"http://".$f{'host'}."/cgi-bin/picoreader.cgi?user=".$f{'user'}."&r=".time()."&f=file.".$f{'type'}."\" />\n"; $pls .= "</ENTRY>\n"; $pls .= "</ASX>\n"; print "Content-Type: ".$ct{$type}."\n\n".$pls; exit; } print "Content-Type: text/html\nLocation: http://www.vinz486.com/\n\n"; exit; sub io_get_query { my @doubles = split(/&/, $ENV{'QUERY_STRING'}); my $gkv; foreach $gkv (@doubles) { my ($gkey, $gvalue) = split(/=/, $gkv); $gkey =~ tr/+/ /; $gkey =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $gvalue =~ tr/+/ /; $gvalue =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $f{$gkey} = $gvalue; } }