def __init__(self, name=None, device=None): # The parent app constructor looks for a device configuration and returns that as a # dictionary called self.config App.__init__(self, name, device) self.introMessage = {"message": "Quote App"} self.baseUrl = "http://quotes.rest/qod.json?category=inspire" self.s = requests.Session()
def __init__(self, name=None, device=None): App.__init__(self, name, device) # Required to call superconstructor self.headers = { "Authorization": "Bearer {0}".format(self.get_device().get_password()) } self.name = self.get_device().username self.base_url = 'https://api.lifx.com/v1/lights/'
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.device = self.get_device() self.service = client.connect(host=self.device.ip, port=self.device.port, username=self.device.username, password=self.device.get_password()) self.kwargs_create = {} self.kwargs_results = {"output_mode": "json"}
def __init__(self, name, device, context): App.__init__(self, name, device, context) self.base_url = 'https://%s:%s/api/v1/' % ( self.device_fields['staxx_address'], self.device_fields['staxx_port']) self.headers = {'content-type': 'application/json'} self.staxx_username = self.device_fields['username'] self.staxx_password = self.device.get_encrypted_field('password') self.verify_certificate = self.device_fields['verify_certificate']
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.service = client.connect( host=self.device_fields['ip'], port=self.device_fields['port'], username=self.device_fields['username'], password=self.device.get_encrypted_field('password')) self.kwargs_create = {} self.kwargs_results = {"output_mode": "json"}
def __init__(self, name, device, context): App.__init__(self, name, device, context) # Required to call superconstructor self.headers = { "Authorization": "Bearer {0}".format(self.device.get_encrypted_field('token')) } self.name = device self.base_url = 'https://api.lifx.com/v1/lights'
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.connection = teslajson.Connection(self.device_fields['username'], self.device.get_encrypted_field('password')) try: self.vehicle = self.connection.vehicles[0] except IndexError: logger.error('This account has no tesla vehicles')
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.username = self.device_fields["username"] self.options = {} if self.device_fields["transport"] != "plaintext": self.options["transport"] = self.device_fields["transport"] if self.device_fields["server_cert_validation"] != "validate": self.options["server_cert_validation"] = self.device_fields["server_cert_validation"] if self.device_fields["message_encryption"] != "auto": self.options["message_encryption"] = self.device_fields["message_encryption"] if self.device_fields["read_timeout_sec"] not in (None, 30): self.options["read_timeout_sec"] = self.device_fields["read_timeout_sec"] if self.device_fields["operation_timeout_sec"] not in (None, 20): self.options["operation_timeout_sec"] = self.device_fields["operation_timeout_sec"] if self.options.get("read_timeout_sec", 30) <= self.options.get("operation_timeout_sec", 20): self.options["read_timeout_sec"] = self.options.get("operation_timeout_sec", 20) + 10 if self.device_fields["keytab"] not in (None, ""): self.options["keytab"] = self.device_fields["keytab"] if self.device_fields["ca_trust_path"] not in (None, ""): self.options["ca_trust_path"] = self.device_fields["ca_trust_path"] if self.device_fields["cert_pem"] not in (None, ""): self.options["cert_pem"] = self.device_fields["cert_pem"] if self.device_fields["cert_key_pem"] not in (None, ""): self.options["cert_key_pem"] = self.device_fields["cert_key_pem"] if self.device_fields["kerberos_delegation"]: self.options["kerberos_delegation"] = True if self.device_fields["kerberos_hostname_override"] not in (None, ""): self.options["kerberos_hostname_override"] = self.device_fields["kerberos_hostname_override"] logger.info("Options: {}".format(self.options)) self.timestamp = None if self.device_type == "Remote PowerShell Host": self.host = self.device_fields["host"] if self.device_fields["port"] is not None: self.host += ":" + str(self.device_fields["port"]) self.winrm = winrm.Session(self.host, auth=(self.username, self.device.get_encrypted_field("password")), **self.options)
def __init__(self, name=None, device=None): App.__init__(self, name, device) device = self.get_device() if device is None: self.ip = "" self.username = "" else: self.ip = device.ip self.username = device.username self.baseURL = "http://" + self.ip + "/api/" + self.username self.headers = {'content-type': 'application/json'}
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.is_connected = False self.headers = None self.refresh_token = None self.username = self.device_fields['username'] self.walkoff_address = self.device_fields['ip'] port = self.device_fields['port'] if port: self.walkoff_address += ':{}'.format(port) self.is_https = self.walkoff_address.startswith('https')
def __init__(self, name=None, device=None): App.__init__(self, name, device) device = self.get_device() self.connection = teslajson.Connection(device.username, device.get_password()) try: self.vehicle = self.connection.vehicles[0] except IndexError: logger.error('This account has no tesla vehicles')
def __init__(self, name, device, context): App.__init__(self, name, device, context) self.ssh = paramiko.SSHClient() self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) self.ip = self.device_fields['ip'] self.port = self.device_fields['port'] self.username = self.device_fields['username'] self.ssh.connect(self.ip, self.port, self.username, self.device.get_encrypted_field('password'))
def __init__(self, name, device, context): App.__init__(self, name, device, context) self.is_connected = False self.headers = None self.refresh_token = None self.username = self.device_fields['username'] self.is_https = self.device_fields['https'] if self.is_https: self.walkoff_address = "https://" else: self.walkoff_address = "http://" self.walkoff_address += self.device_fields['ip'] self.walkoff_address += ':{}'.format(self.device_fields['port'])
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.is_connected = False self.headers = None self.refresh_token = None self.username = self.device_fields['username'] self.is_https = self.device_fields['https'] if self.is_https: self.walkoff_address = "https://" else: self.walkoff_address = "http://" self.walkoff_address += self.device_fields['ip'] self.walkoff_address += ':{}'.format(self.device_fields['port'])
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.server = smtplib.SMTP('{0}:{1}'.format(self.device_fields['ip'], self.device_fields['port'])) try: self.server.set_debuglevel(False) self.server.ehlo() if self.server.has_extn('STARTTLS'): self.server.starttls() self.server.ehlo() # re-identify ourselves over TLS connection self.server.login(self.device_fields['username'], self.device.get_encrypted_field('password')) except Exception as e: self.shutdown()
def __init__(self, name, device, context): App.__init__(self, name, device, context) self.base_url = 'https://www.virustotal.com/vtapi/v2/' self.proxy = None if (self.device_fields['proxy_address'] and self.device_fields['proxy_port']): self.proxy = { 'http': 'http://%s:%s' % (self.device_fields['proxy_address'], self.device_fields['proxy_port']), 'https': 'https://%s:%s' % (self.device_fields['proxy_address'], self.device_fields['proxy_port']), } self.api_key = self.device.get_encrypted_field('api_key')
def __init__(self, name=None, device=None): App.__init__(self, name, device) self._device = self.get_device() self.server = smtplib.SMTP('{0}:{1}'.format(self._device.ip, self._device.port)) try: self.server.set_debuglevel(False) self.server.ehlo() if self.server.has_extn('STARTTLS'): self.server.starttls() self.server.ehlo() # re-identify ourselves over TLS connection self.server.login(self._device.username, self._device.get_password()) except Exception as e: self.shutdown()
def __init__(self, name=None, device=None): # The parent app constructor looks for a device configuration and returns that as a dict called self.config App.__init__(self, name, device) device = self.get_device() if device is None: self.ip = "127.0.0.1" self.port = 22 self.username = "" password = "" else: self.ip = device.ip self.port = device.port self.username = device.username password = device.password
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.host = "{}:{}".format(self.device_fields["host"], self.device_fields["port"]) if self.device_fields["https"]: self.host = "https://" + self.host self.username = self.device_fields["username"] self.insecure_mode = {} if self.device_fields["very_insecure_mode_testing_only"]: self.insecure_mode = { "transport": "ntlm", "server_cert_validation": "ignore" } self.winrm = winrm.Session( self.host, auth=(self.username, self.device.get_encrypted_field("password")), **self.insecure_mode)
def __init__(self, name='', device=''): App.__init__(self, name, device) self.ssh = paramiko.SSHClient() self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) device = self.get_device() if device is None: self.ip = "" self.port = 22 self.username = "" password = "" else: self.ip = device.ip self.port = device.port self.username = device.username password = device.password self.ssh.connect(self.ip, self.port, self.username, password)
def __init__(self, app_name, device, context): App.__init__(self, app_name, device, context) self.introMessage = {"message": "Quote App"} self.baseUrl = "http://quotes.rest/qod.json?category=inspire" self.s = requests.Session()
def __init__(self, app_name, device, context): App.__init__(self, app_name, device, context) # Required to call superconstructor
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.h = self.device_fields['host'] self.u = self.device_fields['username'] self.p = self.device_fields['port']
def __init__(self, name=None, device=None): App.__init__(self, name, device)
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.whitelist = [] self.blacklist = []
def __init__(self, name=None, device=None): self.curDirPath = os.path.dirname(os.path.realpath(__file__)) self.greeting = "No greeting provided" self.totalNodes = "2" App.__init__(self, name, device)
def __init__(self, name, device, context): self.user_id = self.device_fields['username'] self.user_access_token = self.device.get_encrypted_field('password') App.__init__(self, name, device, context)
def __init__(self, name=None, device=None): App.__init__(self, name, device) self.introMessage = {"message": "Quote App"} self.baseUrl = "http://quotes.rest/qod.json?category=inspire" self.s = requests.Session()
def __init__(self, name, device, context): App.__init__(self, name, device, context) self.drone = libardrone.ARDrone()
def __init__(self, name, device, context): App.__init__(self, name, device, context) self.plug = SmartPlug(self.device_fields['ip'])
def __init__(self, name=None, device=None): self.is_running = False App.__init__(self, name, device)
def __init__(self, name, device, context): App.__init__(self, name, device, context) self.introMessage = {"message": "HELLO WORLD"}