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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| #!/usr/bin/perl -w
# general
use strict;
use warnings;
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use POSIX qw(strftime);
# package
use coreutils;
coreutils::hostname();
coreutils::domain();
coreutils::visits();
# security
$CGI::POST_MAX=1024*100;
$CGI::DISABLE_UPLOADS=1;
# cgi object
my $cgi=new CGI;
# cookie
my $ctime=strftime("%a %b %d %H:%M:%S",localtime);
my $old_cookie=$cgi->cookie(
-name=>'lastlogin'
);
my $new_cookie=$cgi->cookie(
-name=>'lastlogin',
-value=>$ctime,
-expires=>'+1h',
-path=>'/',
-domain=>'.oregnier.org',
-secure=>0
);
# page
print $cgi->header(
-charset=>'iso-8859-1',
-cookie=>$new_cookie
),
$cgi->start_html(
-lang=>'en',
-title=>'Olivier Regnier',
-meta=>{'distribution'=>'global',
'resource-type'=>'document',
'description'=>'the main oregnier page',
'keywords'=>'oregnier,openbsd'
},
-head=>
[ Link({-rel=>'shortcut icon',-href=>'/favicon.ico'}), ],
-style=>{-src=>'/main.css'}
),
$cgi->pre( "OpenBSD/i386 (itchy.".$coreutils::domain.") (ttyC1)"."\n\n".
"login:","<a href='http://whois.domaintools.com/$coreutils::hostname'>".$coreutils::hostname."</a>"."\n".
"password:"."\n".
"Last login:",$old_cookie || $ctime,"on ttyC1"."\n".
"OpenBSD 4.3-stable (GENERIC) #0: Fri Aug 29 22:23:11 CEST 2008"."\n\n".
"Welcome to ".$coreutils::domain.": This website is reserved for <a href='/cgi-bin/stats.cgi'>".$coreutils::visits_number."</a>","baby monkeys."."\n\n".
"Please use the <a href='/cgi-bin/feedback.cgi'>feedback(1)</a> form to report bugs in the website."."\n\n".
"~ \$ ls -lF_"."\n".
"total 8"."\n".
"drwxr-xr-x 2 olivier olivier 512 Sep 2 15:40 <a href='/'>openbsd/</a>"."\n".
"drwxr-xr-x 2 olivier olivier 512 Aug 2 10:37 <a href='/'>pgp/</a>"."\n".
"lrwxr-xr-x 1 olivier olivier 112 Sep 2 15:42 <a href='/'>whoami@</a> -> /usr/bin/whoami"."\n".
"lrwxr-xr-x 1 olivier olivier 10 Sep 2 15:53 <a href='http://www.google.com'>halt@</a> -> /sbin/halt"."\n".
"~ \$ _"
),
$cgi->end_html(); |
Partager