OXIESEC PANEL
- Current Dir:
/
/
home
/
cubot
/
docroot
/
cubcgi
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/03/2023 07:42:40 AM
rwxrwxr-x
📄
admmenu.pl
4.98 KB
08/14/2022 11:11:57 AM
rw-r--r--
📄
common.pl
11.84 KB
08/14/2022 11:11:57 AM
rw-r--r--
📄
config.pl
1.13 KB
08/14/2022 11:11:57 AM
rw-r--r--
📄
cubhealth.cgi
2.81 KB
08/14/2022 11:11:57 AM
rwxr-xr-x
📄
download.cgi
1.02 KB
08/14/2022 11:11:57 AM
rwxr-xr-x
📄
forms.pl
4.53 KB
08/14/2022 11:11:57 AM
rw-r--r--
📄
func.pl
3.08 KB
08/14/2022 11:11:57 AM
rw-r--r--
📄
libhtml.pl
4.05 KB
08/14/2022 11:11:57 AM
rw-r--r--
📄
libtest.pl
1.45 KB
08/14/2022 11:11:57 AM
rw-r--r--
📄
test.cgi
255 bytes
08/14/2022 11:11:57 AM
rwxr-xr-x
📄
tips.cgi
2.08 KB
08/14/2022 11:11:57 AM
rwxr-xr-x
Editing: download.cgi
Close
#!/usr/bin/perl use CGI; use Time::localtime; use File::stat; my $USER=$ENV{'USER'}; my $qry = new CGI; processRequest(); sub processRequest{ my $filename = $qry->param('file'); if(($filename eq '') || ($filename =~ /\//gi)){ return responseMessage("Err-RX1: No such file."); } $actualfilename = "$ENV{'DOCUMENT_ROOT'}/edash/be/gphout//$filename"; my $f = `basename $filename`; my @sh = split(/\./, $f); my $filectime = stat($actualfilename)->ctime; my $tm = time; if($tm > $filectime+15*60){ #5-minute return responseMessage("Err-RX2: $f: File expired to download."); } else{ open(FP, "$actualfilename") or return responseMessage("Err-RX3: $filename No such file."); print "Content-disposition: attachment; filename=detail_$filename\n"; print "Content-type: application/octet-stream\n"; print "\n"; while(<FP>){ print $_; } close(FP); } } sub responseMessage{ my $msg = shift; print $qry->header; print $qry->start_html("CUBOT"), "\n"; print "$msg"; print "\n"; print $qry->end_html, "\n"; }