summaryrefslogtreecommitdiffstats
path: root/cgi-bin/secret/logs.pl
blob: 111fffb65b25788a75d03e929dff8ae18b4fac46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl

#use warnings;
use Data::Dumper;
use strict;
use DBI;

use CGI;
my $cgi = CGI->new;
my %data = %{$cgi->{param}};
my $index = $data{index}->[0];
print "Content-type: text/plain", "\n\n";
if ( !defined($index) ) {
  print "Nice hax!\n";
  exit 0;
}
$index = int $index;
my $i = int($index / 10000) + 1;

if ( -e "/var/www/antispammeta.net/actionlogs/${i}0K.tar.gz") {
  print "tar -Oxf /var/www/antispammeta.net/actionlogs/${i}0K.tar.gz $index.txt\n\n";
  print `tar -Oxf /var/www/antispammeta.net/actionlogs/${i}0K.tar.gz $index.txt`;
} elsif ( -e "/var/www/antispammeta.net/actionlogs/$index.txt.lzma" ) {
  print `lzcat /var/www/antispammeta.net/actionlogs/$index.txt.lzma`;
} elsif ( -e "/var/www/antispammeta.net/actionlogs/$index.txt" ) {
  print `cat /var/www/antispammeta.net/actionlogs/$index.txt`;
} else {
  print "u wot m8?\n";
}