#!/usr/bin/perl $url2countercgi = "http://www.single-line-2000.com/line-2000/data-bin/counterhost/counter.cgi"; # Volle URL zur counter.cgi Datei $digisets = '14'; # Hier die Anzahl der verschiedenen Countergrafiksets angeben $servicename = 'Counter Service'; # Hier den Namen des Services angeben $path = './data'; # Das kann so bleiben, keinen / am Ende notieren $url2digits = "http://www.single-line-2000.com/line-2000/data-bin/counterhost/digits"; # Volle URl zu dem Hauptverzeichnis in dem die Countergrafiksets liegen, keinen / am Ende notieren $header = '/kunden/homepages/6/d34806420/htdocs/line-2000/data-bin/counterhost/html/header.html'; # hier den vollen Systempfad zu der header Datei angeben $footer = '/kunden/homepages/6/d34806420/htdocs/line-2000/data-bin/counterhost/html/footer.html'; # hier den vollen Systempfad zu der footer Datei angeben $hpath = './html'; # Das kann so bleiben, keinen / am Ende notieren $link_text = ''; # Hier den Text angeben der bei dem Counter unterhalb erscheint $link_url = 'http://www.single-line-2000.com/line-2000/data-bin/counterhost/signup.html'; # Hier die URL zu der Seite angeben zu der die User kommen wenn sie auf obigen Link Text klicken $allowlogs = '1'; # Logfunktion aktivieren, ist 1 gesetzt wird ein Logfile geschrieben das der User aufrufen kann # Hierin findet er Informationen über Zeit, Datum, Browser der letzten Besucher $loglimit = "500"; # Hier die Anzahl der Logdateieinträge angeben, sind es mehr werden die ältesten Einträge entfernt ######################################### # Ab hier nichts mehr ändern # ######################################### $fullpath = "$0"; (@split) = split(/\//,$fullpath); foreach $thing (@split){ $ENV{'FILENAME'} = "$thing"; } $lofp = length($fullpath); $lofn = length($ENV{'FILENAME'}); $newlen = $lofp - $lofn; $newlen--; substr($fullpath, $newlen, 9999999) = $nothing; $ENV{'CURRENT_DIR'} = "$fullpath"; if ($path eq "./data"){ $path = "$ENV{'CURRENT_DIR'}/data"; } if ($hpath eq "./html"){ $hpath = "$ENV{'CURRENT_DIR'}/html"; } unless (-e "$ENV{'CURRENT_DIR'}/cgi-lib.pl"){ print < Please make sure you uploaded it to the same directory as $ENV{'FILENAME'} $footer end_of_html exit; } require "$ENV{'CURRENT_DIR'}/cgi-lib.pl"; &ReadParse; $version = "1.0"; sub htmlver { $htmlversion = "$html[0]"; $html[0] = ""; $lohv = length($htmlversion); $lohv--; $lohv--; substr($htmlversion, $lohv, 9999999) = $nothing; substr($htmlversion, 0, 2) = $nothing; } if ($ENV{'QUERY_STRING'} eq "debug"){ print qq~ Script debug ~; print "\n"; foreach $key (sort keys %ENV) { print "\n"; print "\n"; print "\n"; print "\n"; } print "
$key".$ENV{$key}."

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\$version".$version."
\$url2countercgi".$url2countercgi."
\$path".$path."
\$digisets".$digisets."
\$url2digits".$url2digits."
\$header".$header."
\$footer".$footer."
\$hpath".$hpath."
\$allowlogs".$allowlogs."
\$loglimit".$loglimit."
\n"; exit; } if ($in{'id'} eq ""){ #Gets the header and footer code if any if ($header ne ""){ open(HEADER, "<$header") || die("Can't open $header\n"); @header=
; close(HEADER); $header = ''; foreach $line (@header){ if ($header ne ""){ $temp = "$header$line"; $header = "$temp"; } if ($header eq ""){ $header = "$line"; } } } if ($footer ne ""){ open(FOOTER, "<$footer") || die("Can't open $footer\n"); @footer=
; close(FOOTER); $footer = ''; foreach $line (@footer){ if ($footer ne ""){ $temp = "$footer$line"; $footer = "$temp"; } if ($footer eq ""){ $footer = "$line"; } } } # End get header and footer code if ($in{'command'} eq "viewlogs"){ open (DATA,"$path/$in{'username'}.dat"); $userdata=; close (DATA); ($password,$email,$dtype,$img0,$img1,$img2,$img3,$img4,$img5,$img6,$img7,$img8,$img9) = split(/\|/,$userdata); if ($password ne "$in{'password'}"){ # gets the html code from the html file and fixes script variables open(HTML, "<$hpath/admin_incorrect_password.html") || die("Can't open $hpath/admin_incorrect_password.html\n"); @html=; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$in{'username'}/$in{'username'}/g; $line =~ s/\$in{'password'}/$in{'password'}/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <; close (DATA); (@logs) = split(/\+/,$logdata); $logdata = ""; $vlog = "0"; foreach $log (@logs){ $vlog ++; ($date,$time,$ip,$browser,$referer) = split(/\|/,$log); $logdata = "$logdata
"; } # gets the html code from the html file and fixes script variables open(HTML, "<$hpath/admin_controls_logs.html") || die("Can't open $hpath/admin_controls_logs.html\n"); @html=; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$in{'username'}/$in{'username'}/g; $line =~ s/\$in{'password'}/$in{'password'}/g; $line =~ s/\$logdata/$logdata/g; $line =~ s/\$vlog/$vlog/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <; close (DATA); ($password,$email,$dtype,$img0,$img1,$img2,$img3,$img4,$img5,$img6,$img7,$img8,$img9) = split(/\|/,$userdata); if ($password ne "$in{'password'}"){ print <$path/$in{'username'}.dat"); print DATA qq~$password|$email|$dtype|$in{'img0'}|$in{'img1'}|$in{'img2'}|$in{'img3'}|$in{'img4'}|$in{'img5'}|$in{'img6'}|$in{'img7'}|$in{'img8'}|$in{'img9'}~; close (DATA); # gets the html code from the html file and fixes script variables open(HTML, "<$hpath/done_define_image_locations.html") || die("Can't open $hpath/done_define_image_locations.html\n"); @html=; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$in{'username'}/$in{'username'}/g; $line =~ s/\$in{'password'}/$in{'password'}/g; $line =~ s/\$in{'img0'}/$in{'img0'}/g; $line =~ s/\$in{'img1'}/$in{'img1'}/g; $line =~ s/\$in{'img2'}/$in{'img2'}/g; $line =~ s/\$in{'img3'}/$in{'img3'}/g; $line =~ s/\$in{'img4'}/$in{'img4'}/g; $line =~ s/\$in{'img5'}/$in{'img5'}/g; $line =~ s/\$in{'img6'}/$in{'img6'}/g; $line =~ s/\$in{'img7'}/$in{'img7'}/g; $line =~ s/\$in{'img8'}/$in{'img8'}/g; $line =~ s/\$in{'img9'}/$in{'img9'}/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <; close (DATA); ($password,$email,$dtype,$img0,$img1,$img2,$img3,$img4,$img5,$img6,$img7,$img8,$img9) = split(/\|/,$userdata); if ($password ne "$in{'password'}"){ print <; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$in{'username'}/$in{'username'}/g; $line =~ s/\$in{'password'}/$in{'password'}/g; $line =~ s/\$img0/$img0/g; $line =~ s/\$img1/$img1/g; $line =~ s/\$img2/$img2/g; $line =~ s/\$img3/$img3/g; $line =~ s/\$img4/$img4/g; $line =~ s/\$img5/$img5/g; $line =~ s/\$img6/$img6/g; $line =~ s/\$img7/$img7/g; $line =~ s/\$img8/$img8/g; $line =~ s/\$img9/$img9/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <; close (DATA); ($password,$email,$dtype,$img0,$img1,$img2,$img3,$img4,$img5,$img6,$img7,$img8,$img9) = split(/\|/,$userdata); if ($password ne "$in{'password'}"){ # gets the html code from the html file and fixes script variables open(HTML, "<$hpath/admin_incorrect_password.html") || die("Can't open $hpath/admin_incorrect_password.html\n"); @html=; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$in{'username'}/$in{'username'}/g; $line =~ s/\$in{'password'}/$in{'password'}/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <$path/$in{'username'}.dat"); print DATA qq~$in{'new_password'}|$in{'email'}|$dtype|$img0|$img1|$img2|$img3|$img4|$img5|$img6|$img7|$img8|$img9~; close (DATA); if ($in{'newcount'} ne ""){ open (DATA,">$path/$in{'username'}.cnt"); print DATA qq~$in{'newcount'}~; close (DATA); } # gets the html code from the html file and fixes script variables open(HTML, "<$hpath/admin_saved.html") || die("Can't open $hpath/admin_saved.html\n"); @html=; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$in{'username'}/$in{'username'}/g; $line =~ s/\$url2countercgi/$url2countercgi/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print < Pre-Set Digits
$date$time$ip$browser$referer
end_of_html $curimg = "0"; GETIMG: { $curimg ++; print < end_of_html if ($curimg ne "$digisets"){ redo GETIMG ; } } print < end_of_html exit; } if ($in{'command'} eq "login"){ unless (-e "$path/$in{'username'}.dat"){ # gets the html code from the html file and fixes script variables open(HTML, "<$hpath/not_found.html") || die("Can't open $hpath/not_found.html\n"); @html=; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$in{'username'}/$in{'username'}/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <; close (DATA); ($password,$email,$dtype,$img0,$img1,$img2,$img3,$img4,$img5,$img6,$img7,$img8,$img9) = split(/\|/,$userdata); if ($password ne "$in{'password'}"){ # gets the html code from the html file and fixes script variables open(HTML, "<$hpath/admin_incorrect_password.html") || die("Can't open $hpath/admin_incorrect_password.html\n"); @html=; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$in{'username'}/$in{'username'}/g; $line =~ s/\$in{'password'}/$in{'password'}/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <; close(HTML); if ($dtype eq "custom"){ $ps2 = " checked"; } if ($dtype ne "custom"){ $ps1 = " checked"; } $curopt = "0"; GETOPT: { $curopt ++; if ($dtype ne "$curopt"){ $psdigitopt = "$psdigitopt"; } if ($dtype eq "$curopt"){ $psdigitopt = "$psdigitopt"; } if ($curopt ne "$digisets"){ redo GETOPT ; } } &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$in{'username'}/$in{'username'}/g; $line =~ s/\$in{'password'}/$in{'password'}/g; $line =~ s/\$email/$email/g; $line =~ s/\$url2countercgi/$url2countercgi/g; $line =~ s/\$ps1/$ps1/g; $line =~ s/\$ps2/$ps2/g; $line =~ s/\$psdigitopt/$psdigitopt/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser if ($allowlogs ne "1"){ ($html1,$html2,$html3) = split(/\/,$html); $html = "$html1$html3"; } print <; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$et/$et/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <$path/$in{'username'}.dat"); print COUNTERDATA qq~$in{'password'}|$in{'email'}|6~; close (COUNTERDATA); open (DATA,">$path/$in{'username'}.log"); print DATA qq~~; close (DATA); open (DATA,">$path/$in{'username'}.cnt"); print DATA qq~0~; close (DATA); `chmod 777 $path/$in{'username'}.dat`; `chmod 777 $path/$in{'username'}.log`; `chmod 777 $path/$in{'username'}.cnt`; # gets the html code from the html file and fixes script variables open(HTML, "<$hpath/signup_complete.html") || die("Can't open $hpath/signup_complete.html\n"); @html=; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; $line =~ s/\$in{'username'}/$in{'username'}/g; $line =~ s/\$in{'password'}/$in{'password'}/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <; close(HTML); &htmlver; foreach $line (@html){ $line =~ s/\$ENV{'FILENAME'}/$ENV{'FILENAME'}/g; $line =~ s/\$servicename/$servicename/g; $line =~ s/\$header/$header/g; $line =~ s/\$footer/$footer/g; # all html resorting shoud go before this line if ($html ne ""){ $temp = "$html$line"; $html = "$temp"; } if ($html eq ""){ $html = "$line"; } } # end html resorting and compilation, ready to output $html to browser print <COUNTER SERVER ERROR: Cannot find $in{'id'}'\)\;~; exit; } if ($allowlogs eq "1"){ @months=('01','02','03','04','05','06','07','08','09','10','11','12'); @days=('Sun','Mon','Tues','Wed','Thurs','Fri','Sat'); ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; if ($sec < 10) { $sec = "0$sec";} if ($min < 10) { $min = "0$min";} if ($hour < 10) { $hour = "0$hour";} if ($mday < 10) { $mday = "0$mday";} substr($year, 0, 1) = $nothing; $date = "$mday/$months[$mon]/$year"; $time = "$hour:$min"; open (FILE,"$path/$in{'id'}.log"); $logfile=; close (FILE); $new_log = "$date|$time|$ENV{'REMOTE_ADDR'}|$ENV{'HTTP_USER_AGENT'}|$ENV{'HTTP_REFERER'}+$logfile"; (@logs) = split(/\+/,$new_log); $currlog = "0"; $new_log = ""; foreach $log (@logs){ if ($currlog ne "$loglimit"){ $currlog ++; $new_log = "$new_log+$log"; } } substr($new_log, 0, 1) = $nothing; open (FILE,">$path/$in{'id'}.log"); print FILE qq~$new_log~; close (FILE); } open (FILE,"$path/$in{'id'}.dat"); $userdata=; close (FILE); ($password,$email,$dtype,$img0,$img1,$img2,$img3,$img4,$img5,$img6,$img7,$img8,$img9) = split(/\|/,$userdata); open (FILE,"$path/$in{'id'}.cnt"); $count=; close (FILE); $count ++; open (COUNTER,">$path/$in{'id'}.cnt"); print COUNTER qq~$count~; close (COUNTER); if ($dtype eq "custom"){ $img{'0'} = "$img0"; $img{'1'} = "$img1"; $img{'2'} = "$img2"; $img{'3'} = "$img3"; $img{'4'} = "$img4"; $img{'5'} = "$img5"; $img{'6'} = "$img6"; $img{'7'} = "$img7"; $img{'8'} = "$img8"; $img{'9'} = "$img9"; } if ($dtype ne "custom"){ $img{'0'} = "$url2digits/$dtype/0.gif"; $img{'1'} = "$url2digits/$dtype/1.gif"; $img{'2'} = "$url2digits/$dtype/2.gif"; $img{'3'} = "$url2digits/$dtype/3.gif"; $img{'4'} = "$url2digits/$dtype/4.gif"; $img{'5'} = "$url2digits/$dtype/5.gif"; $img{'6'} = "$url2digits/$dtype/6.gif"; $img{'7'} = "$url2digits/$dtype/7.gif"; $img{'8'} = "$url2digits/$dtype/8.gif"; $img{'9'} = "$url2digits/$dtype/9.gif"; } (@count) = split(//,$count); foreach $number (@count){ $output = "$output"; } if ($link_text ne "" && $link_url ne ""){ $done = "1"; print qq~document.write\('$output
$link_text
'\)\;~; } else { print qq~document.write\('$output'\)\;~; } exit;
$curimg