コード例 #1
0
def kernel_version():
    client = AdbClient(host="127.0.0.1", port=5037)
    device = client.device(options.device)
    result = device.shell("uname -r")
    #result = result.encode('ascii','ignore')
    logging.info(" kernel_version() : result is %s", result)
    result = result.split(".")
    ver = result[0] + '.' + result[1]
    ver = float(ver)

    offset_selinux = []
    # case kernel version is <= 3.10
    if ver <= 3.10:
        offset_to_comm = 0x288
        offset_to_parent = 0xe0
        offset_selinux.append(0xC0A77548)
        offset_selinux.append(0xC0A7754C)
        offset_selinux.append(0xC0A77550)
        ps_cmd = "ps"

    # case kernel version is > 3.10 et <=3.18
    elif ver > 3.10 and ver <= 3.18:
        offset_to_comm = 0x444
        offset_to_parent = 0xe0
        offset_selinux.append(0xC0C4F288)
        offset_selinux.append(0xC0C4F28C)
        offset_selinux.append(0XC0C4F280)
        ps_cmd = "ps -A"

    else:
        logging.info("Sorry. Android kernel version %s not supported yet", ver)
        raise NotImplementedError(
            "Sorry. Android kernel version %s not supported yet", ver)
    return ver, offset_to_comm, offset_to_parent, offset_selinux, ps_cmd
コード例 #2
0
 def __init__(self):
     client = AdbClient(host="127.0.0.1", port=5037)
     devices = client.devices()
     if len(devices) <= 0:
         raise ValueError("No device connected")
     self.device = client.device(str(devices[0].get_serial_no()))
     self.settings = Settings("config.cfg")
     self.adbscreen = ADBScreen(self.device)
コード例 #3
0
ファイル: whatsappbot.py プロジェクト: MezzoSplash/athena
 def __init__(self):
     # Default is "127.0.0.1" and 5037
     client = AdbClient(host="127.0.0.1", port=5037)
     self.device = client.device("ZY2239Q9MP")
     self.GREEN = '\033[92m'
     self.BLUE = '\033[94m'
     self.YELLOW = '\033[93m'
     self.RED = '\033[91m'
     self.ENDC = '\033[0m'
コード例 #4
0
def setConfig(cfg):
    global config_dict, movementCount, client, device
    config_dict = cfg
    print(config_dict)
    movementCount = random.choice(
        range(config_dict["movement"]["stepsMin"],
              config_dict["movement"]["stepsMax"], 1))
    client = AdbClient(host=config_dict["device"]["host"],
                       port=config_dict["device"]["port"])
    device = client.device(config_dict["device"]["name"])
コード例 #5
0
def check_process_is_running(process):
    client = AdbClient(host="127.0.0.1", port=5037)
    device = client.device("emulator-5554")
    ps = device.shell("ps")
    if process in ps:
        logging.debug("[+] OK. %s is running" %(process))
    else:
        logging.debug("[+] NOK. It seems like %s is not running..." %(process))
        logging.debug("[+] Android_Emuroot stopped")
        exit(1)
コード例 #6
0
def check_process_is_running(process, pscmd, device):
    client = AdbClient(host="127.0.0.1", port=5037)
    device = client.device(device)
    ps = device.shell(pscmd)
    if process in ps:
        logging.info("[+] OK. %s is running" % (process))
    else:
        logging.info("[+] NOK. It seems like %s is not running..." % (process))
        logging.info("[+] Android_Emuroot stopped")
        exit(1)
コード例 #7
0
 def __init__(self, init=False):
     client = AdbClient(host="127.0.0.1", port=5037)
     devices = client.devices()
     if len(devices) <= 0:
         raise ValueError("No device connected")
     self.device = client.device(str(devices[0].get_serial_no()))
     self.settings = Settings("config.cfg", init=init)
     self.adbscreen = ADBScreen(self.device)
     self.ENDC = '\033[0m'
     self.WARNING = '\033[93m'
     self.BLUE = '\033[94m'
     self.RED = '\033[91m'
     pytesseract.pytesseract.tesseract_cmd = self.settings.tesseract_dir
コード例 #8
0
ファイル: test.py プロジェクト: pixelpox/python
def screenshot(deviceAddress='ce031713383080fa0c',
               destFolder='screenshot',
               imageName="ADBScreenshot.png"):
    client = AdbClient(host="127.0.0.1", port=5037)
    device = client.device(deviceAddress)

    result = device.screencap()

    try:
        with open(destFolder + "/" + imageName, "wb") as fp:
            fp.write(result)
    except FileNotFoundError:
        print("could not file file or folder")
コード例 #9
0
    def __init__(self, ini_name,init = False):
        #Loading config.cfg
        cparser = configparser.ConfigParser()
        dirname = os.path.dirname(__file__)
        ini_file = Path(os.path.join(dirname, "..\conf\\"+ini_name))

        if ini_file.is_file():
            cparser.read(ini_file)
        else:
            raise ValueError("Config file name not valid")
        self.language = "DE"
        #loads the config information
        try:
            self.language = cparser.get("custom", "language")
            self.speed_multi = cparser.getfloat("custom", "speed_multi")
            self.selected_raid = cparser.get("custom", "selected_raid")
            self.round_robin_raids = eval(cparser.get("custom", "round_robin_raids"), {}, {})
            self.round_robin = cparser.getboolean("custom", "round_robin")
            self.tesseract_dir = cparser.get("custom", "tesseract_directory")
            self.rounds = cparser.getint("custom", "rounds")
            self.rounds_per_raid = cparser.getint("custom", "rounds_per_raid")
            self.debug = cparser.getboolean("custom", "debug")
            self.autodetect_buttons = cparser.get("screen", "autodeteckt_buttons")
            self.taps_resultscreen = cparser.getint("custom", "taps_resultscreen")
            self.auto_remove_pkmn = cparser.getboolean("custom", "auto_remove_pkmn")
        except Exception as e:
            raise ValueError("Couldn´t read config file")

        try:
            with open(os.path.join(dirname, '../conf/languages.json')) as json_file:
                data = json.load(json_file)
                self.language_pack = data[self.language]
        except Exception:
            raise ValueError("Language not found. Check your config file and update the languages.json")

        client = AdbClient(host="127.0.0.1", port=5037)
        devices = client.devices()
        if len(devices) <= 0:
            raise ValueError("No device connected")

        adbscreen = ADBScreen(client.device(str(devices[0].get_serial_no())))
        if not init:
            try:
                with open(os.path.join(dirname, '../conf/screens/'+str(adbscreen.get_model_name()+".json"))) as json_file:
                    data = json.load(json_file)
                    self.screen = data
            except Exception:
                raise ValueError("Screenconfig not found. Start the python script with the --init argument to create a config.")

            self.check_screen_values()
コード例 #10
0
def adb_stager_process(load, devicename):
    '''
    Adb connexion 
    TODO specify the device id
    '''
    logging.info("[+] Launch the stager process")
    client = AdbClient(host="127.0.0.1", port=5037)
    device = client.device(devicename)

    device.shell("echo " + load + " > /data/local/tmp/load.sh")
    device.shell("chmod +x /data/local/tmp/load.sh")
    device.shell("ln -s /system/bin/sh /data/local/tmp/STAGER")

    # Launch STAGER shell

    device.shell("/data/local/tmp/STAGER /data/local/tmp/load.sh")
コード例 #11
0
def check_process_is_running(process, pscmd, devicename):
    client = AdbClient(host="127.0.0.1", port=5037)
    device = client.device(devicename)
    if device == None:
        logging.warning(
            "Device name %s invalid. Check \"adb devices\" to get valid ones",
            device)
        raise Exception(
            "Device name invalid. Check \"adb devices\" to get valid ones")
    ps = device.shell(pscmd)
    if process in ps:
        logging.warning("[+] OK. %s is running" % (process))
    else:
        logging.warning("[+] NOK. It seems like %s is not running..." %
                        (process))
        logging.warning("[+] Android_Emuroot stopped")
        exit(1)
コード例 #12
0
def kernel_version():
    client = AdbClient(host="127.0.0.1", port=5037)
    device = client.device(options.device)
    if device == None:
        logging.warning(
            "Device name %s invalid. Check \"adb devices\" to get valid ones",
            options.device)
        raise Exception(
            "Device name invalid. Check \"adb devices\" to get valid ones")
    result = device.shell("uname -r")
    #result = result.encode('ascii','ignore')
    logging.debug(" kernel_version() : %s", result)
    result = result.split(".")
    ver = result[0] + '.' + result[1]
    ver = float(ver)

    offset_selinux = []
    # case kernel version is <= 3.10
    if ver <= 3.10:
        offset_to_comm = 0x288
        offset_to_parent = 0xe0
        offset_selinux.append(0xC0A77548)
        offset_selinux.append(0xC0A7754C)
        offset_selinux.append(0xC0A77550)
        ps_cmd = "ps"

    # case kernel version is > 3.10 et <=3.18
    elif ver > 3.10 and ver <= 3.18:
        offset_to_comm = 0x444
        offset_to_parent = 0xe0
        offset_selinux.append(0xC0C4F288)
        offset_selinux.append(0xC0C4F28C)
        offset_selinux.append(0XC0C4F280)
        ps_cmd = "ps -A"

    else:
        logging.warning("Sorry. Android kernel version %s not supported yet",
                        str(ver))
        raise NotImplementedError(
            "Sorry. Android kernel version not supported yet")
    return ver, offset_to_comm, offset_to_parent, offset_selinux, ps_cmd
コード例 #13
0
def kernel_version(): 
    client = AdbClient(host="127.0.0.1", port=5037)
    device = client.device("emulator-5554")
    result = device.shell("uname -r")
    result = result.encode('ascii','ignore')
    logging.debug(" kernel_version() : result is %s", result)
    result = result.split('.')
    ver = result[0]+'.'+result[1]
    ver = float(ver)

      # case kernel version is <= 3.10
    if ver <= 3.10 :
        offset_to_comm = 0x288
        offset_to_parent = 0xe0

    # case kernel version is > 3.10 et <=3.18
    elif ver > 3.10 and ver <= 3.18 :
        offset_to_comm = 0x444
        offset_to_parent = 0xe0
    else :
        logging.debug("Sorry. Android kernel version %s not supported yet", ver)
        raise NotImplementedError("Sorry. Android kernel version %s not supported yet", ver)
    return ver,offset_to_comm,offset_to_parent
コード例 #14
0
ファイル: adbutils.py プロジェクト: zhizunbao84/uiautomator2
class Adb(object):
    def __init__(self, serial=None, host="127.0.0.1", port=5037):
        self._serial = serial
        self._client = AdbClient(host=host, port=port)

        try:
            self._client.version()
        except RuntimeError:
            # Can't connect to the adb server, try to start the adb server by command line.
            self._start_adb_server()

        if self._serial:
            self._device = self._client.device(serial)
        else:
            # The serial can be None only when there is only one device/emulator.
            devices = self._client.devices()
            if len(devices) == 0:
                raise RuntimeError("Can't find any android device/emulator")
            elif len(devices) > 1:
                raise RuntimeError(
                    "more than one device/emulator, please specify the serial number"
                )
            else:
                device = devices[0]
                self._serial = device.get_serial_no()
                self._device = device

    @staticmethod
    def list_devices(host="127.0.0.1", port=5037):
        client = AdbClient(host=host, port=port)

        try:
            client.version()
        except RuntimeError:
            # Can't connect to the adb server, try to start the adb server by command line.
            Adb._start_adb_server()

        return client.devices()

    @staticmethod
    def _start_adb_server():
        adb_path = whichcraft.which("adb")
        if adb_path is None:
            raise EnvironmentError(
                "Can't find the adb, please install adb on your PC")

        cmd = [adb_path, "start-server"]
        cmdline = subprocess.list2cmdline(cmd)
        try:
            return subprocess.check_output(cmdline,
                                           stderr=subprocess.STDOUT,
                                           shell=True).decode('utf-8')
        except subprocess.CalledProcessError as e:
            raise EnvironmentError("subprocess", cmdline,
                                   e.output.decode('utf-8', errors='ignore'))

    def devices(self, states=['device', 'offline']):
        """
        Returns:
            [($serial1, "device"), ($serial2, "offline")]
        """
        # TODO: not really checking anything
        return [(d, "device") for d in self.list_devices()]
        output = subprocess.check_output([self.adb_path(), 'devices'])
        pattern = re.compile(r'(?P<serial>[^\s]+)\t(?P<status>device|offline)')
        matches = pattern.findall(output.decode())
        return [(m[0], m[1]) for m in matches]

    @property
    def serial(self):
        return self._serial

    def forward(self, local, remote, rebind=True):
        if isinstance(local, int):
            local = 'tcp:%d' % local
        if isinstance(remote, int):
            remote = 'tcp:%d' % remote

        return self._device.forward(local, remote, norebind=not rebind)

    def forward_list(self):
        """
        Only return tcp:<int> format forwards
        Returns:
            {
                "{RemotePort}": "{LocalPort}"
            }
        """
        forward_list = self._device.list_forward()

        ret = {}

        for local, remote in forward_list.items():
            ltype, lport = local.split(":")
            rtype, rport = remote.split(":")

            if ltype == "tcp" and rtype == "tcp":
                ret[int(rport)] = int(lport)

        return ret

    def forward_port(self, remote_port):
        forwards = self.forward_list()
        lport = forwards.get(remote_port)
        if lport:
            return lport
        free_port = find_free_port()
        self.forward(free_port, remote_port)
        return free_port

    def shell(self, *args, **kwargs):
        return self._device.shell(" ".join(args))

    def getprop(self, prop):
        return self.shell('getprop', prop).strip()

    def push(self, src, dst, mode=0o644):
        self._device.push(src, dst, mode=mode)

    def install(self, apk_path):
        sdk = self.getprop('ro.build.version.sdk')
        if int(sdk) <= 23:
            self._device.install(apk_path, reinstall=True, downgrade=True)
            return
        try:
            # some device is missing -g
            self._device.install(apk_path,
                                 reinstall=True,
                                 downgrade=True,
                                 grand_all_permissions=True)
        except InstallError:
            self._device.install(apk_path, reinstall=True, downgrade=True)

    def uninstall(self, pkg_name):
        return self._device.uninstall(pkg_name)

    def package_info(self, pkg_name):
        output = self.shell('dumpsys', 'package', pkg_name)
        m = re.compile(r'versionName=(?P<name>[\d.]+)').search(output)
        version_name = m.group('name') if m else None
        m = re.search(r'PackageSignatures\{(.*?)\}', output)
        signature = m.group(1) if m else None
        if version_name is None and signature is None:
            return None
        return dict(version_name=version_name, signature=signature)
コード例 #15
0
def record_event(device, filepath, timeout=5):
    global event, cmd
    event = ""
    cmd = ""
    signal.alarm(timeout)
    try:
        k = device.shell("getevent /dev/input/event1", handler=event_handler)
    except:
        pass

    print("Event recorded")
    # print(event)
    generate_cmd()
    # print(cmd)
    write_cmd(filepath)


signal.signal(signal.SIGALRM, handler=sig_handler)
if __name__ == "__main__":
    client = AdbClient(host="127.0.0.1", port=5037)

    print(client.version())

    device = client.device("10.42.0.231:5555")
    signal.signal(signal.SIGALRM, handler=sig_handler)
    record_event(device, "cmd.sh")
    play_event(device, "cmd.sh")

# print(event)
コード例 #16
0
from adb.client import Client as AdbClient
import time
import random
import datetime
# for image recognition
import cv2
import numpy as np
from matplotlib import pyplot as plt

# Connecting to BlueStacks
# Requires ./adb start-server; ./adb devices to be done prior
client = AdbClient(host="127.0.0.1", port=5037)
device = client.device("emulator-5554")

def encounteredreCAPTCHA():
	#template = cv2.imread('recaptcha.png',0)
	template = cv2.imread('images/recaptcha.png',0)
	w, h = template.shape[::-1]
	result = device.screencap()
	#with open("screen.png", "wb") as fp:
	#	fp.write(result)
	npimg = np.fromstring(str(result), np.uint8)
	img = cv2.imdecode(npimg,0)
	#img = cv2.imread('screen.png',0)
	sift = cv2.xfeatures2d.SIFT_create()

	# find the keypoints and descriptors with SIFT
	kp1, des1 = sift.detectAndCompute(template,None)
	kp2, des2 = sift.detectAndCompute(img,None)

	# BFMatcher with default params
コード例 #17
0
ファイル: androidtv.py プロジェクト: hdbjlizhe/HA
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the androidtv platform."""
    if DATA_KEY not in hass.data:
        hass.data[DATA_KEY] = {}

    from adb.client import Client as AdbClient
    client = AdbClient(host="127.0.0.1", port=5037)

    host = config.get(CONF_HOST)
    name = config.get(CONF_NAME)
    port = config.get(CONF_PORT)
    uri = "{}:{}".format(host, port)

    try:
        adb_device = client.device(uri)
        if adb_device is None:
            _LOGGER.error(
                "ADB server not connected to {}".format(name))
            raise PlatformNotReady

        androidtv = AndroidTv(name, uri, client, adb_device)

        add_entities([androidtv])
        if host in hass.data[DATA_KEY]:
            _LOGGER.warning(
                "Platform already setup on {}, skipping.".format(host))
        else:
            hass.data[DATA_KEY][host] = androidtv

    except RuntimeError:
        _LOGGER.error(
            "Can't reach adb server, is it running ?")
        raise PlatformNotReady

    def service_action(service):
        """Dispatch service calls to target entities."""
        params = {key: value for key, value in service.data.items()
                  if key != ATTR_ENTITY_ID}

        entity_id = service.data.get(ATTR_ENTITY_ID)
        target_devices = [dev for dev in hass.data[DATA_KEY].values()
                          if dev.entity_id in entity_id]

        for target_device in target_devices:
            target_device.do_action(params['action'])

    def service_intent(service):
        """Dispatch service calls to target entities."""
        params = {key: value for key, value in service.data.items()
                  if key != ATTR_ENTITY_ID}

        entity_id = service.data.get(ATTR_ENTITY_ID)
        target_devices = [dev for dev in hass.data[DATA_KEY].values()
                          if dev.entity_id in entity_id]

        for target_device in target_devices:
            target_device.start_intent(params['intent'])

    def service_key(service):
        """Dispatch service calls to target entities."""
        params = {key: value for key, value in service.data.items()
                  if key != ATTR_ENTITY_ID}

        entity_id = service.data.get(ATTR_ENTITY_ID)
        target_devices = [dev for dev in hass.data[DATA_KEY].values()
                          if dev.entity_id in entity_id]

        for target_device in target_devices:
            target_device.input_key(params['key'])

    hass.services.register(
        DOMAIN, ACTION_SERVICE, service_action, schema=SERVICE_ACTION_SCHEMA)
    hass.services.register(
        DOMAIN, INTENT_SERVICE, service_intent, schema=SERVICE_INTENT_SCHEMA)
    hass.services.register(
        DOMAIN, KEY_SERVICE, service_key, schema=SERVICE_KEY_SCHEMA)
コード例 #18
0
def stager_clean(devicename):
    logging.info("[+] Clean the stager process")
    client = AdbClient(host="127.0.0.1", port=5037)
    device = client.device(devicename)

    device.shell("rm /data/local/tmp/load.sh /data/local/tmp/STAGER")
コード例 #19
0
ファイル: adb.py プロジェクト: spammer23/MAD
class ADBConnect(object):
    def __init__(self, args):
        self._args = args
        self._useadb = args.use_adb
        self._client = None
        if self._useadb:
            try:
                from adb.client import Client as AdbClient
            except ImportError:
                pass
            self.check_adblib = 'adb.client' in sys.modules
            if not self.check_adblib:
                logger.warning(
                    "Could not find pure-python-adb library - no support for ADB."
                    "If you have no idea what ADB is or not planning to use it - IGNORE :)"
                )
                self._useadb = False
            else:
                self._client = AdbClient(
                    host=self._args.adb_server_ip, port=self._args.adb_server_port)

    def check_adb_status(self, adb):
        if not self._useadb:
            return None
        try:
            if self._client.device(adb) is not None:
                self._client.device(adb).shell('echo checkadb')
                return True
        except RuntimeError as e:
            logger.exception(
                'MADmin: Exception occurred while checking adb status ({}).', str(adb))
        return None

    def return_adb_devices(self):
        if not self._useadb:
            return []
        try:
            return self._client.devices()
        except Exception as e:
            logger.exception(
                'MADmin: Exception occurred while getting adb clients: {}.', e)
        return []

    def send_shell_command(self, adb, origin, command):
        try:
            device = self._client.device(adb)
            if device is not None:
                logger.info(
                    'MADmin: Using ADB shell command ({})', str(origin))
                device.shell(command)
                return True
        except Exception as e:
            logger.exception(
                'MADmin: Exception occurred while sending shell command ({}): {}.', str(origin), e)
        return False

    def make_screenshot(self, adb, origin, extenstion):
        try:
            device = self._client.device(adb)
            if device is not None:
                logger.info('MADmin: Using ADB ({})', str(origin))
                result = device.screencap()
                # TODO: adjust with devicesettings
                with open(os.path.join(self._args.temp_path, 'screenshot_%s.png' % str(origin)), "wb") as fp:
                    fp.write(result)
                if extenstion == "jpg":
                    pngtojpg(os.path.join(self._args.temp_path, 'screenshot_%s.png' % str(origin)))
                return True
        except Exception as e:
            logger.exception(
                'MADmin: Exception occurred while making screenshot ({}): {}.', str(origin), e)
        return False

    def make_screenclick(self, adb, origin, x, y):
        try:
            device = self._client.device(adb)
            if device is not None:
                device.shell("input tap " + str(x) + " " + str(y))
                logger.info('MADMin ADB Click x:{} y:{} ({})',
                            str(x), str(y), str(origin))
                time.sleep(1)
                return True
        except Exception as e:
            logger.exception(
                'MADmin: Exception occurred while making screenclick ({}): {}.', str(origin), e)
        return False

    def make_screenswipe(self, adb, origin, x, y, xe, ye):
        try:
            device = self._client.device(adb)
            if device is not None:
                device.shell("input swipe " + str(x) + " " +
                             str(y) + " " + str(xe) + " " + str(ye) + " 100")
                logger.info('MADMin ADB Swipe x:{} y:{} xe:{} ye:{}({})', str(
                    x), str(y), str(xe), str(ye), str(origin))
                time.sleep(1)
                return True
        except Exception as e:
            logger.exception(
                'MADmin: Exception occurred while making screenswipe ({}): {}.', str(origin), e)
        return False
コード例 #20
0
import requests
import json
import time
from adb.client import Client as AdbClient


client = AdbClient(host="127.0.0.1", port=5037)
device = client.device("57e6b612")

file = open("dane.txt","w") 
with open(("konta.txt")) as f:
    line = f.readlines()
emails = [x.strip() for x in line] 
password=emails[0]
emails=emails[1:]
for email in emails:
        s = requests.Session()
        s.get('https://www.geekbuying.com/main/signin')

        auth = {
                'EmailAddress': email
                , 'PassWord': password
                , 'VerificationCode': ''
                }
        s.post('https://www.geekbuying.com/Main/AjaxSignIn', data=auth)
        promo = {'day': '7'}
        a=s.post('http://promotion.geekbuying.com/LuckyDraw/AddSigned', data=promo, timeout=1)
        print(email)
        print (a.content)
        file.write(email)
        file.write(": ")
コード例 #21
0
def stager_clean():
    logging.info("[+] Launch the stager process")
    client = AdbClient(host="127.0.0.1", port=5037)
    device = client.device("emulator-5554")

    device.shell("rm /data/local/tmp/load.sh /data/local/tmp/STAGER")
コード例 #22
0
ファイル: executer.py プロジェクト: brant-ruan/IDF4APEV
class Executer:
    def __init__(self):
        self.client = AdbClient(host="127.0.0.1", port=5037)

    def load_devices(self, only_number=False):
        try:
            adb_devices = self.client.devices()
            # details not needed, we only need the number of connecting devices
            if only_number:
                return [device.get_serial_no() for device in adb_devices]

            devices = []
            for dev in adb_devices:
                # adb shell getprop ro.boot.serialno
                # adb shell getprop ro.build.version.release
                # adb shell getprop ro.build.version.sdk
                # adb shell getprop ro.build.version.security_patch
                # adb shell getprop ro.debuggable
                # adb shell getprop ro.product.cpu.abi
                # adb shell getprop ro.product.model
                # adb shell getprop ro.secure

                # pure-python-adb supplies device.get_properties()
                # props_str = str(dev.shell("getprop"))
                # trantab = props_str.maketrans('', '', '[] \r')
                # props_list = props_str.translate(trantab).split('\n')
                # props_list = [props for props in props_list if props != '']
                # keys = [props.split(':')[0] for props in props_list]
                # values = [props.split(':')[1] for props in props_list]
                # props = dict(zip(keys, values))
                props = dev.get_properties()
                # adb shell cat /proc/version
                proc_version = str(dev.shell("cat /proc/version")).strip()
                name = dev.get_serial_no()
                # adb shell getenforce
                enforce = str(dev.shell("getenforce")).strip()
                device = Device(name=name,
                                model=props.get('ro.product.model', ''),
                                sdk=props.get('ro.build.version.sdk', ''),
                                security_patch=props.get(
                                    'ro.build.version.security_patch', ''),
                                release=props.get('ro.build.version.release',
                                                  ''),
                                debuggable=props.get('ro.debuggable', ''),
                                abi=props.get('ro.product.cpu.abi', ''),
                                proc_version=proc_version,
                                secure=props.get('ro.secure', ''),
                                enforce=enforce)
                devices.append(device)

            return devices
        except BaseException as e:
            utils.nl_print(e)

    def exec_poc(self, device_name, binary):
        device = self.client.device(device_name)

        dst = consts.DEVICE_TMP + binary.split('/')[-1]

        device.push(binary, dst)

        device.shell("chmod 777 %s" % dst)
        # run poc on device
        res = str(
            device.shell("cd %s; %s &>/dev/null; echo $?" %
                         (consts.DEVICE_TMP, dst))).strip()

        return res