<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ksh bug, possibly exploitable? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711188#M757282</link>
    <description>It does work under ksh and sh, but not csh nor bash.</description>
    <pubDate>Thu, 25 Apr 2002 21:43:18 GMT</pubDate>
    <dc:creator>A. Daniel King_1</dc:creator>
    <dc:date>2002-04-25T21:43:18Z</dc:date>
    <item>
      <title>ksh bug, possibly exploitable?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711186#M757280</link>
      <description>I've got an unusual bug, and perhaps someone here can explain it.  It has to do with executing commands unintentionally, so I thought I'd start with it from a security perspective.&lt;BR /&gt;&lt;BR /&gt;Double-quote, back-tic, double-quote.&lt;BR /&gt;&lt;BR /&gt;(or is that back-tick?)&lt;BR /&gt;&lt;BR /&gt;We tracked it down this far.  The original command was quite complex, but the problem can be reduced and replicated with:&lt;BR /&gt;&lt;BR /&gt;$"`"&lt;BR /&gt;ksh: : Execute permission denied.&lt;BR /&gt;ksh: : Execute permission denied.&lt;BR /&gt;&lt;BR /&gt;This is pretty toothless as it is, but the way we found this is that it was actually executing a potentially devastating shutdown script.  Plus, it is not expected behavior from ksh.  I cannot seem to reproduce the execution of a named program, though I know the command executed was in the PATH explicitly like "export PATH=$PATH:$SYSTEMDIR/bin"&lt;BR /&gt;&lt;BR /&gt;It is not unusual that a command would be in the path like this, but consider that bin was a *script* and not a directory.  It was probably placed in the bin location by mistake with a "cp $SOURCEFILE $SYSTEMDIR/bin" - the directory was removed some time ago, but the path entry was not removed.&lt;BR /&gt;&lt;BR /&gt;I'm on HP-UX 11.0, v2200.&lt;BR /&gt;&lt;BR /&gt;$what `which ksh`&lt;BR /&gt;/usr/bin/ksh:&lt;BR /&gt;         $Revision: 82.10.1.38 $&lt;BR /&gt;        Version 11/16/88&lt;BR /&gt;         PATCH_11_00: arith.o blok.o ctype.o defs.o edit.o echo.o expand.o fault.o io.o string.o stak.o word.o emacs.o vi.o hpux_rel.o args.o builtin.o cmd.o main.o msg.o print.o xec.o name.o macro.o error.o service.o test.o jobs.o history.o 00/11/12&lt;BR /&gt;&lt;BR /&gt;Any insight would be appreciated.</description>
      <pubDate>Thu, 25 Apr 2002 14:34:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711186#M757280</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-04-25T14:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: ksh bug, possibly exploitable?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711187#M757281</link>
      <description>this works under any shell.&lt;BR /&gt;&lt;BR /&gt;I first noticed this a few years ago on 10.20.&lt;BR /&gt;&lt;BR /&gt;Never actually got around to finding out why though.&lt;BR /&gt;&lt;BR /&gt;It slipped my mind, thanks for reminding me :)</description>
      <pubDate>Thu, 25 Apr 2002 21:37:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711187#M757281</guid>
      <dc:creator>Scott Van Kalken</dc:creator>
      <dc:date>2002-04-25T21:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: ksh bug, possibly exploitable?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711188#M757282</link>
      <description>It does work under ksh and sh, but not csh nor bash.</description>
      <pubDate>Thu, 25 Apr 2002 21:43:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711188#M757282</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-04-25T21:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: ksh bug, possibly exploitable?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711189#M757283</link>
      <description>Someone got rooted, eh?  :-(  That's never a fun cleanup.&lt;BR /&gt;&lt;BR /&gt;I noticed that the same behavior happens without the "$", i.e.:&lt;BR /&gt;&lt;BR /&gt;$ ksh&lt;BR /&gt;$ "`"&lt;BR /&gt;ksh: : cannot execute&lt;BR /&gt;ksh: : cannot execute&lt;BR /&gt;&lt;BR /&gt;I would get a copy of "tusc" (&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x3d9fee3e323bd5118fef0090279cd0f9,00.html)" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x3d9fee3e323bd5118fef0090279cd0f9,00.html)&lt;/A&gt; and check out the system call trace.&lt;BR /&gt;&lt;BR /&gt;It looks like ksh is trying to execve() everything in the path.  So a clever way of hiding a command might be to include it in the PATH (instead of a directory) and then run that wierd "`" command.&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;$ cat &amp;gt; /tmp/testme.sh&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;echo $0 executed&lt;BR /&gt;^D&lt;BR /&gt;$ chmod 700 /tmp/testme.sh&lt;BR /&gt;$ export PATH=$PATH:/tmp/testme.sh&lt;BR /&gt;$ "`"&lt;BR /&gt;ksh: /tmp/testme.sh/ executed: not found&lt;BR /&gt;[note the strange buffering that I saw with the split "ksh: not found" result]&lt;BR /&gt;&lt;BR /&gt;This might be exploitable if you can change a privileged users' PATH and get them to run that "`" command.&lt;BR /&gt;&lt;BR /&gt;  -- Steve&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Apr 2002 21:52:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711189#M757283</guid>
      <dc:creator>Steve Bonds</dc:creator>
      <dc:date>2002-04-25T21:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: ksh bug, possibly exploitable?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711190#M757284</link>
      <description>Followup:&lt;BR /&gt;&lt;BR /&gt;Try it with just:&lt;BR /&gt;&lt;BR /&gt;$ ""&lt;BR /&gt;&lt;BR /&gt;Same thing happens.  Maybe this should go into "stupid shell tricks".  ;-)&lt;BR /&gt;&lt;BR /&gt;  -- Steve&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Apr 2002 21:56:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711190#M757284</guid>
      <dc:creator>Steve Bonds</dc:creator>
      <dc:date>2002-04-25T21:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: ksh bug, possibly exploitable?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711191#M757285</link>
      <description>$"" &lt;BR /&gt;&lt;BR /&gt;is not the same.&lt;BR /&gt;&lt;BR /&gt;However, "`" does give the double error on Solaris Bourne shell (sh), as well.  Go figure.&lt;BR /&gt;&lt;BR /&gt;It would be a stupid shell trick, except that it has caused some serious headaches.</description>
      <pubDate>Thu, 25 Apr 2002 22:10:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug-possibly-exploitable/m-p/2711191#M757285</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-04-25T22:10:33Z</dc:date>
    </item>
  </channel>
</rss>

