Add CentOS and Alpine Linux detection to Linux system lib

GSoC/Meterpreter_Web_Console
Brendan Coles 2018-11-06 03:16:07 +00:00
parent a8ff9b27f7
commit 08d4e2265d
1 changed files with 16 additions and 6 deletions

View File

@ -23,20 +23,30 @@ module System
# Debian # Debian
if etc_files.include?("debian_version") if etc_files.include?("debian_version")
if kernel_version =~ /Ubuntu/
version = read_file("/etc/issue").gsub(/\n|\\n|\\l/,'') version = read_file("/etc/issue").gsub(/\n|\\n|\\l/,'')
if kernel_version =~ /Ubuntu/
system_data[:distro] = "ubuntu" system_data[:distro] = "ubuntu"
system_data[:version] = version system_data[:version] = version
else else
version = read_file("/etc/issue").gsub(/\n|\\n|\\l/,'')
system_data[:distro] = "debian" system_data[:distro] = "debian"
system_data[:version] = version system_data[:version] = version
end end
# Amazon # Amazon / CentOS
elsif etc_files.include?("system-release") elsif etc_files.include?('system-release')
version = read_file("/etc/system-release").gsub(/\n|\\n|\\l/,'') version = read_file('/etc/system-release').gsub(/\n|\\n|\\l/,'')
system_data[:distro] = "amazon" if version.include? 'CentOS'
system_data[:distro] = 'centos'
system_data[:version] = version
else
system_data[:distro] = 'amazon'
system_data[:version] = version
end
# Alpine
elsif etc_files.include?('alpine-release')
version = read_file('/etc/alpine-release').gsub(/\n|\\n|\\l/,'')
system_data[:distro] = 'alpine'
system_data[:version] = version system_data[:version] = version
# Fedora # Fedora