#!/bin/sh # # Simple CGI for viewing a web server's file system # and reading files that have not been properly secured. # # #DoNotShowThisLine# # restricts browsing to this web site #DoNotShowThisLine# if test "x${PATH_INFO}" != "x";then #DoNotShowThisLine# DIRMASK=`pwd` #DoNotShowThisLine# DIRMASK=`dirname ${DIRMASK}` #DoNotShowThisLine# DIRMASK=`dirname ${DIRMASK}` #DoNotShowThisLine# echo ${PATH_INFO} |grep "^${DIRMASK}" > /dev/null #DoNotShowThisLine# if test $? -ne 0;then #DoNotShowThisLine# echo "Content-type: text/html" #DoNotShowThisLine# echo "" #DoNotShowThisLine# echo "
" #DoNotShowThisLine#
echo "*********************** PERMISSION DENIED ***********************" #DoNotShowThisLine#
echo "" #DoNotShowThisLine#
echo " This script was intended for educational purposes. Access" #DoNotShowThisLine#
echo " to files or directories out side of this web site have been" #DoNotShowThisLine#
echo " restricted." #DoNotShowThisLine#
echo "" #DoNotShowThisLine#
echo "*********************** PERMISSION DENIED ***********************" #DoNotShowThisLine#
echo "" #DoNotShowThisLine#
exit 0 #DoNotShowThisLine#
fi #DoNotShowThisLine#
fi #DoNotShowThisLine#
if test "x${PATH_INFO}" = "x";then
DIR=`dirname ${SCRIPT_FILENAME}`
else
DIR=${PATH_INFO}
fi
if [ -d ${DIR} ];then
echo "Content-type: text/html"
echo ""
cd ${DIR}
echo "${DIR}