Package platformids :: Package net :: Module kali

Source Code for Module platformids.net.kali

  1  # -*- coding: utf-8 -*- 
  2  """Kali Linux releases. 
  3  """ 
  4  from __future__ import absolute_import 
  5   
  6  import re 
  7   
  8  from pythonids import PYV35Plus 
  9  from platformids import RTE_KALI, rte2num, num2rte, num2pretty, decode_version_str_to_segments, \ 
 10      DSKORG_ID, DSKORG_VERSION, PlatformIDsFileCheck 
 11   
 12   
 13   
 14  __author__ = 'Arno-Can Uestuensoez' 
 15  __license__ = "Artistic-License-2.0 + Forced-Fairplay-Constraints" 
 16  __copyright__ = "Copyright (C) 2010-2018 Arno-Can Uestuensoez" \ 
 17                  " @Ingenieurbuero Arno-Can Uestuensoez" 
 18  __version__ = '0.1.29' 
 19  __uuid__ = "7add5ded-c39b-4b6e-8c87-1b3a1c150ee9" 
 20   
 21   
 22  # 
 23  # Releases: 
 24  # 
 25  #   Rolling Releases - weekly build with week of the year: 
 26  # 
 27  #     Kali 2019-W11 – 11th March, 2019 – The First weekly release 
 28  #  
 29  #   Rolling Releases with arbitrary increments: 
 30  # 
 31  #     Kali 2019.1 – 18th February, 2019 – The First 2019 Kali Rolling release. Kernel 4.19.13, GNOME 3.30.2 
 32  #  
 33  #     Kali 2018.4 – 29th October, 2018 – The Fourth 2018 Kali Rolling release. Kernel 4.18.0, GNOME 3.30.1 
 34  #     Kali 2018.3 – 27th August, 2018 – The Third 2018 Kali Rolling release. Kernel 4.17.0, GNOME 3.28.2 
 35  #     Kali 2018.2 – 30th April, 2018 – The Second 2018 Kali Rolling release. Kernel 4.15.0, GNOME 3.28.0 
 36  #     Kali 2018.1 – 6th February, 2018 – The first 2018 Kali Rolling release. Kernel 4.14.12, GNOME 3.26.2 
 37  #     Kali 2017.3 – 21st November, 2017 – The third 2017 Kali Rolling release. Kernel 4.13, GNOME 3.26 
 38  #     Kali 2017.2 – 20th September, 2017 – The second 2017 Kali Rolling release. Kernel 4.12, GNOME 3.25. 
 39  #     Kali 2017.1 – 25th April, 2017 – The first 2017 Kali Rolling release. Kernel 4.9, GNOME 3.22. 
 40  #     Kali 2016.2 – 31st August, 2016 – The second Kali Rolling release. Kernel 4.6, GNOME 3.20.2. 
 41  #     Kali 2016.1 – 21st January, 2016 – The first Kali Rolling release. Kernel 4.3, GNOME 3.18. 
 42  # 
 43  #   Two-number version releases: 
 44  # 
 45  #     Kali 2.0 – 11th August, 2015 – Major release, “safi”, now a rolling distribution, major UI changes. 
 46  # 
 47  #   Three-number version releases: 
 48  # 
 49  #     Kali 1.1.0a – 13th March, 2015 – No fanfare release fixing kernel ABI inconsistencies in the installers. 
 50  #     Kali 1.1.0 – 9th Febuary, 2015 – First dot release in 2 years. New kernel, new tools and updates. 
 51  #     Kali 1.0.9a – 6th October, 2014 – Security BugFix release covering shellshock and Debian apt vulnerabilities. 
 52  #     Kali 1.0.9 – 25th August, 2014 – BugFix release including installer and a set of tool updates and package fixes. 
 53  #     Kali 1.0.8 – 22nd July, 2014 – EFI Support for our “full” ISOs and a set of tool updates and package fixes. 
 54  #     Kali 1.0.7 – 27th May, 2014 – Kernel 3.14, tool updates, package fixes, Kali Live Encrypted USB Persistence. 
 55  #     Kali 1.0.6 – 9th January, 2014 – Kernel 3.12, cryptsetup nuke option, Amazon AMI, ARM build scripts. 
 56  #     Kali 1.0.5 – 5th September, 2013 – BugFix rollup. LVM Encrypted installs, Software Defined Radio (SDR) tools. 
 57  #     Kali 1.0.4 – 25th July, 2013 – BugFix rollup. Penetration testing tool additions and updates. 
 58  #     Kali 1.0.3 – 26th April, 2013 – BugFix rollup. New accessibility features. Added live Desktop installer. 
 59  #     Kali 1.0.2 – 27th March, 2013 – Minor BugFix release and update roll-up. 
 60  #     Kali 1.0.1 – 14th March, 2013 – Minor BugFix release (USB Keyboard). 
 61  #     Kali 1.0.0 – 13th March, 2013 – Initial release, “moto”. 
 62  # 
 63   
 64   
 65   
 66  RTE_KALI201911   = RTE_KALI     + 0x00006181  #: KaliLinux-2019-W11 => KaliLinux-2019.03.11  
 67   
 68       
 69  #: mapping of the rte string and numeric representation to the numeric value 
 70  rte2num.update( 
 71      { 
 72          'kali201911':    RTE_KALI201911, 
 73      } 
 74  ) 
 75   
 76   
 77  #: mapping of the rte numeric representation to the string value 
 78  num2rte.update( 
 79      { 
 80          RTE_KALI201911: 'kali201911', 
 81      } 
 82  ) 
 83   
 84  #: mapping of the rte numeric representation to the string value 
 85  num2pretty.update( 
 86      { 
 87          RTE_KALI201911: 'KaliLinux-2019.03.11', 
 88      } 
 89  ) 
 90   
 91   
 92  dist = ['', '', 'KaliLinux-', 'KaliLinux', '', '']  # defaults 
 93   
 94  try: 
 95      with open("/etc/os-release", 'r') as f: 
 96          for l in f: 
 97              if l.startswith('ID='): 
 98                  dist[0] = dist[5] = DSKORG_ID.sub(r'\1', l) 
 99       
100              elif l.startswith('VERSION='):  # priority though more widespread 
101                  dist[1] = DSKORG_VERSION.sub(r'\1', l) 
102                  dist[3] += dist[1] 
103                  dist[0] += re.sub(r'[^0-9]', '', dist[1]) 
104               
105      dist[4] = decode_version_str_to_segments(dist[1]) 
106   
107   
108  except PlatformIDsFileCheck: 
109      # not on KaliLinux platform, so scan will fail 
110      pass     
111   
112  if dist[5] != 'kali': 
113      # does not catually match KaliLinux 
114      dist = ['kali', '0.0.0', 'KaliLinux-0.0.0', 'KaliLinux', (0, 0, 0,), 'kali'] 
115