"""
Dirty Cow
"""
from exploits.exploit import Exploit
from src.kernels import KernelWindow
from constants import color_print, GENERIC_LINUX, CONFIRMED_VULNERABLE, HIGH_RELIABILITY

class CVE20165195(Exploit):
	def __init__(self):
		super().__init__()
		self.name = "CVE-2016-5195"
		self.type = "linux"
		self.brief_desc = "Dirty COW race condition root priv esc"
		self.reliability = HIGH_RELIABILITY
		self.vulnerable_kernels = [
			KernelWindow(GENERIC_LINUX, CONFIRMED_VULNERABLE, 2, 0, 0, 4, 8, 3)
		]

	def determine_vulnerability(self):
		color_print("\t[*] checking exploitation prerequisites for {}".format(self.name), color="blue")
		# if kernel matches...it should be vulnerable
		color_print("\t[+] system appears to be vulnerable to {}".format(self.name), color="green")
		return True

9a020e588d6ee85d8ab7722dde5d8f2288438546
<mask token>

<mask token>


class CVE20165195(Exploit):

    def __init__(self):
        super().__init__()
        self.name = 'CVE-2016-5195'
        self.type = 'linux'
        self.brief_desc = 'Dirty COW race condition root priv esc'
        self.reliability = HIGH_RELIABILITY
        self.vulnerable_kernels = [KernelWindow(GENERIC_LINUX,
            CONFIRMED_VULNERABLE, 2, 0, 0, 4, 8, 3)]
    <mask token>

<mask token>


class CVE20165195(Exploit):

    def __init__(self):
        super().__init__()
        self.name = 'CVE-2016-5195'
        self.type = 'linux'
        self.brief_desc = 'Dirty COW race condition root priv esc'
        self.reliability = HIGH_RELIABILITY
        self.vulnerable_kernels = [KernelWindow(GENERIC_LINUX,
            CONFIRMED_VULNERABLE, 2, 0, 0, 4, 8, 3)]

    def determine_vulnerability(self):
        color_print('\t[*] checking exploitation prerequisites for {}'.
            format(self.name), color='blue')
        color_print('\t[+] system appears to be vulnerable to {}'.format(
            self.name), color='green')
        return True

<mask token>
from exploits.exploit import Exploit
from src.kernels import KernelWindow
from constants import color_print, GENERIC_LINUX, CONFIRMED_VULNERABLE, HIGH_RELIABILITY


class CVE20165195(Exploit):

    def __init__(self):
        super().__init__()
        self.name = 'CVE-2016-5195'
        self.type = 'linux'
        self.brief_desc = 'Dirty COW race condition root priv esc'
        self.reliability = HIGH_RELIABILITY
        self.vulnerable_kernels = [KernelWindow(GENERIC_LINUX,
            CONFIRMED_VULNERABLE, 2, 0, 0, 4, 8, 3)]

    def determine_vulnerability(self):
        color_print('\t[*] checking exploitation prerequisites for {}'.
            format(self.name), color='blue')
        color_print('\t[+] system appears to be vulnerable to {}'.format(
            self.name), color='green')
        return True

"""
Dirty Cow
"""
from exploits.exploit import Exploit
from src.kernels import KernelWindow
from constants import color_print, GENERIC_LINUX, CONFIRMED_VULNERABLE, HIGH_RELIABILITY

class CVE20165195(Exploit):
	def __init__(self):
		super().__init__()
		self.name = "CVE-2016-5195"
		self.type = "linux"
		self.brief_desc = "Dirty COW race condition root priv esc"
		self.reliability = HIGH_RELIABILITY
		self.vulnerable_kernels = [
			KernelWindow(GENERIC_LINUX, CONFIRMED_VULNERABLE, 2, 0, 0, 4, 8, 3)
		]

	def determine_vulnerability(self):
		color_print("\t[*] checking exploitation prerequisites for {}".format(self.name), color="blue")
		# if kernel matches...it should be vulnerable
		color_print("\t[+] system appears to be vulnerable to {}".format(self.name), color="green")
		return True
