From owner-freebsd-isp@FreeBSD.ORG Thu Dec 22 15:37:24 2005 Return-Path: X-Original-To: freebsd-isp@freebsd.org Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B857416A41F for ; Thu, 22 Dec 2005 15:37:24 +0000 (GMT) (envelope-from b.candler@pobox.com) Received: from thorn.pobox.com (api.pobox.com [208.210.124.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C81243D60 for ; Thu, 22 Dec 2005 15:37:23 +0000 (GMT) (envelope-from b.candler@pobox.com) Received: from thorn (localhost [127.0.0.1]) by thorn.pobox.com (Postfix) with ESMTP id 0F300E7; Thu, 22 Dec 2005 10:37:44 -0500 (EST) Received: from mappit.local.linnet.org (212-74-113-67.static.dsl.as9105.com [212.74.113.67]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by thorn.sasl.smtp.pobox.com (Postfix) with ESMTP id CA5BF2A35; Thu, 22 Dec 2005 10:37:42 -0500 (EST) Received: from brian by mappit.local.linnet.org with local (Exim 4.60 (FreeBSD)) (envelope-from ) id 1EpSVL-0000qo-Gj; Thu, 22 Dec 2005 15:37:19 +0000 Date: Thu, 22 Dec 2005 15:37:19 +0000 From: Brian Candler To: Marcin Jessa Message-ID: <20051222153719.GA3259@uk.tiscali.com> References: <122020051635.14761.43A832C8000DE4BB000039A922058863609D0A90079D0B02019B9C010D@comcast.net> <17321.26449.603277.510191@canoe.dclg.ca> <20051222132041.GA2830@uk.tiscali.com> <20051222143213.0b98e6c2.lists@yazzy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051222143213.0b98e6c2.lists@yazzy.org> User-Agent: Mutt/1.4.2.1i Cc: freebsd-isp@freebsd.org Subject: Re: ISP's supporting sshd on port 443? X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2005 15:37:24 -0000 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
\n"; if ($p) { print "
\n";
  system($p. " 2>&1 | sed -e 's/&/\\&/g' -e 's//\\>/g'");
  print "
\n"; }