Esempio n. 1
0
 def connect(self, usr, pwd):
     if 'Basic' in self.parent.data['authenticate']:
         if http_connect.basic_auth_check(self.ip,
                                          self.port,
                                          usr=usr,
                                          pwd=pwd):
             self.parent.data['usr'] = usr
             self.parent.data['pwd'] = pwd
             self.result_queue.put(self.parent.data)
             progress.increment('successful')
             self.parent.sig.change_successful_counter.emit(
                 green(str(progress.get_successful_counter())))
             self.parent.isDone = True
             return True
         else:
             return False
     elif 'Digest' in self.parent.data['authenticate']:
         if http_connect.digest_auth_check(self.ip,
                                           self.port,
                                           usr=usr,
                                           pwd=pwd):
             self.parent.data['usr'] = usr
             self.parent.data['pwd'] = pwd
             self.result_queue.put(self.parent.data)
             progress.increment('successful')
             self.parent.sig.change_successful_counter.emit(
                 green(str(progress.get_successful_counter())))
             self.parent.isDone = True
             return True
         return False
Esempio n. 2
0
def colored(item):
    load = str(cpu_percent()) if item == 'cpu' else str(
        dict(virtual_memory()._asdict())["percent"])
    if float(load) < 50:
        return green(load)
    elif float(load) < 80:
        return yellow(load)
    else:
        return red(load)
Esempio n. 3
0
 def try_for_vuln(self):
     try:
         resp = http_connect.basic_auth_check(self.ip,
                                              self.port,
                                              path=self.vuln_path)
         if resp:
             self.parent.data['vuln'] = True
             progress.increment('successful')
             self.parent.sig.change_successful_counter.emit(
                 green(str(progress.get_successful_counter())))
             self.result_queue.put(self.parent.data)
             self.parent.isDone = True
             return True
     except:
         return False
Esempio n. 4
0
 def connect(self, usr, pwd):
     if http_connect.basic_auth_check(self.ip, self.port, usr=usr, pwd=pwd):
         self.parent.isDone = True
         self.parent.data['usr'] = usr
         self.parent.data['pwd'] = pwd
         self.parent.data['ch'] = self.get_channels_counter(usr, pwd)
         self.result_queue.put(self.parent.data)
         # self.parent.data =
         # self.result_queue.put({'host': self.ip, 'ip': self.ip, 'vendor': 'Hipcam',
         #                        'usr': usr, 'pwd': pwd, 'device': 'IPCAM', 'vuln':None})
         progress.increment('successful')
         self.parent.sig.change_successful_counter.emit(
             green(str(progress.get_successful_counter())))
         return True
     else:
         return False