Add support for Kali Linux detection. (#50331)

Signed-off-by: Joseph Benden <joe@benden.us>
pull/50484/head
Joseph Benden 6 years ago committed by Abhijeet Kasurde
parent b81a74f551
commit d810acf7a5

@ -322,6 +322,11 @@ class DistributionFiles:
elif 'SteamOS' in data: elif 'SteamOS' in data:
debian_facts['distribution'] = 'SteamOS' debian_facts['distribution'] = 'SteamOS'
# nothing else to do, SteamOS gets correct info from python functions # nothing else to do, SteamOS gets correct info from python functions
elif path == '/etc/lsb-release' and 'Kali' in data:
debian_facts['distribution'] = 'Kali'
release = re.search('DISTRIB_RELEASE=(.*)', data)
if release:
debian_facts['distribution_release'] = release.groups()[0]
elif 'Devuan' in data: elif 'Devuan' in data:
debian_facts['distribution'] = 'Devuan' debian_facts['distribution'] = 'Devuan'
release = re.search(r"PRETTY_NAME=[^(]+ \(?([^)]+?)\)", data) release = re.search(r"PRETTY_NAME=[^(]+ \(?([^)]+?)\)", data)
@ -446,7 +451,7 @@ class Distribution(object):
'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS', 'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS',
'OEL', 'Amazon', 'Virtuozzo', 'XenServer', 'Alibaba'], 'OEL', 'Amazon', 'Virtuozzo', 'XenServer', 'Alibaba'],
'Debian': ['Debian', 'Ubuntu', 'Raspbian', 'Neon', 'KDE neon', 'Debian': ['Debian', 'Ubuntu', 'Raspbian', 'Neon', 'KDE neon',
'Linux Mint', 'SteamOS', 'Devuan'], 'Linux Mint', 'SteamOS', 'Devuan', 'Kali'],
'Suse': ['SuSE', 'SLES', 'SLED', 'openSUSE', 'openSUSE Tumbleweed', 'Suse': ['SuSE', 'SLES', 'SLED', 'openSUSE', 'openSUSE Tumbleweed',
'SLES_SAP', 'SUSE_LINUX', 'openSUSE Leap'], 'SLES_SAP', 'SUSE_LINUX', 'openSUSE Leap'],
'Archlinux': ['Archlinux', 'Antergos', 'Manjaro'], 'Archlinux': ['Archlinux', 'Antergos', 'Manjaro'],

@ -601,6 +601,31 @@ VERSION_ID="12.04"
"os_family": "Debian", "os_family": "Debian",
'distribution_version': u'12.04'} 'distribution_version': u'12.04'}
}, },
{
'name': 'Kali 2019.1',
'input': {
'/etc/os-release': ("PRETTY_NAME=\"Kali GNU/Linux Rolling\"\nNAME=\"Kali GNU/Linux\"\nID=kali\nVERSION=\"2019.1\"\n"
"VERSION_ID=\"2019.1\"\nID_LIKE=debian\nANSI_COLOR=\"1;31\"\nHOME_URL=\"https://www.kali.org/\"\n"
"SUPPORT_URL=\"https://forums.kali.org/\"\nBUG_REPORT_URL=\"https://bugs.kali.org/\"\n"),
'/etc/lsb-release': ("DISTRIB_ID=Kali\nDISTRIB_RELEASE=kali-rolling\nDISTRIB_CODENAME=kali-rolling\n"
"DISTRIB_DESCRIPTION=\"Kali GNU/Linux Rolling\"\n"),
'/usr/lib/os-release': ("PRETTY_NAME=\"Kali GNU/Linux Rolling\"\nNAME=\"Kali GNU/Linux\"\nID=kali\nVERSION=\"2019.1\"\n"
"VERSION_ID=\"2019.1\"\nID_LIKE=debian\nANSI_COLOR=\"1;31\"\nHOME_URL=\"https://www.kali.org/\"\n"
"SUPPORT_URL=\"https://forums.kali.org/\"\nBUG_REPORT_URL=\"https://bugs.kali.org/\"\n")
},
'platform.dist': [
'kali',
'2019.1',
''
],
'result': {
'distribution': 'Kali',
'distribution_version': '2019.1',
'distribution_release': 'kali-rolling',
'distribution_major_version': '2019',
'os_family': 'Debian'
}
},
{ {
"platform.dist": [ "platform.dist": [
"neon", "neon",

Loading…
Cancel
Save