def process(self): try: c = CanarioAPI.canary(api_key=str(self.apikeyv)) s = c.search(self.domain) try: if str(s['data']['error_msg']): error = str(s['data']['error_msg']) e = " [!] Check your key and Canar.io limit: " + error print helpers.color(e, warning=True) except: pass if str(s['action_valid']).lower() == 'true': if self.verbose: print helpers.color(' [*] Canario query valid!') refid = [] count = int(s['data']['results']['count']) if self.verbose: e = ' [*] Canario result count: ' + str(count) print helpers.color(e, firewall=True) if count > 0: re = s['data']['results']['results'] # We need to make this a setting ? for i in range(0, count, 1): try: result = re[i] refid.append(str(result['referenceid'])) except Exception as e: print e if len(refid) > 0: # now enumerate the data in each refid for ref in refid: if self.verbose: e = ' [*] Now enumerating refid: ' + str(ref) print helpers.color(e, firewall=True) try: view = c.view(ref) try: emails = view['data']['objects']['email'] for em in emails: self.Html += str(em) + " " except: # just for weired cases where their is no values pass try: body = view['data']['text_data']['body'] self.Html += str(body) + ' ' except: # just for weired cases where their is no values pass except Exception as e: p = " [!] Unable to enumerate Canario ref ID: " + str( e) print helpers.color(p, warning=True) else: # logic to see if the key is bad print "" except Exception as e: l = ' [!] Check your Canario API key: ' + str(e) print helpers.color(l, warning=True)
def process(self): try: c = CanarioAPI.canary(api_key=str(self.apikeyv)) s = c.search(self.domain) try: if str(s['data']['error_msg']): error = str(s['data']['error_msg']) e = " [!] Check your key and Canar.io limit: " + error print helpers.color(e, warning=True) except: pass if str(s['action_valid']).lower() == 'true': if self.verbose: print helpers.color(' [*] Canario query valid!') refid = [] count = int(s['data']['results']['count']) if self.verbose: e = ' [*] Canario result count: ' + str(count) print helpers.color(e, firewall=True) if count > 0: re = s['data']['results']['results'] # We need to make this a setting ? for i in range(0, count, 1): try: result = re[i] refid.append(str(result['referenceid'])) except Exception as e: print e if len(refid) > 0: # now enumerate the data in each refid for ref in refid: if self.verbose: e = ' [*] Now enumerating refid: ' + str(ref) print helpers.color(e, firewall=True) try: view = c.view(ref) try: emails = view['data']['objects']['email'] for em in emails: self.Html += str(em) + " " except: # just for weired cases where their is no values pass try: body = view['data']['text_data']['body'] self.Html += str(body) + ' ' except: # just for weired cases where their is no values pass except Exception as e: p = " [!] Unable to enumerate Canario ref ID: " + str(e) print helpers.color(p, warning=True) else: # logic to see if the key is bad print "" except Exception as e: l = ' [!] Check your Canario API key: ' + str(e) print helpers.color(l, warning=True)
def test_canario(): c = CanarioAPI.canary('thisshouldnotworkapikey')