ISP's supporting sshd on port 443?

Brian Candler B.Candler at pobox.com
Thu Dec 22 07:37:24 PST 2005


On Thu, Dec 22, 2005 at 02:32:13PM +0000, Marcin Jessa wrote:
> The attached what?

Perl script, cgish.pl. Maybe I forgot to attach it. Here it is in-line:

#!/usr/bin/perl
use CGI;

$a = $ENV{'REMOTE_ADDR'};
if ($a ne "127.0.0.1" and $a ne "192.168.1.1") {
  print "Content-Type: text/html\n\n";
  print "Permission denied";
  exit;
}

$c = new CGI;
$p = $c->param("command");
$d = $c->param("cwd");

chdir($d) if $d;
if ($p =~ /^cd(\s+(.*))$/) {
  chdir($2) if $2;
  chomp($d = `pwd`);
  $p = "pwd";
}

$| = 1;
print "Content-Type: text/html\n\n";
print "Enter command: $d <form method=get><input type=text name=command><input type=hidden name=cwd value=$d></form>\n";

if ($p) {
  print "<pre>\n";
  system($p. " 2>&1 | sed -e 's/&/\\&amp;/g' -e 's/</\\&lt;/g' -e 's/>/\\&gt;/g'");
  print "</pre>\n";
}



More information about the freebsd-isp mailing list