def __init__(self, api_data=api_keys.returnListOfAPIKeys()["twitter"]): ''' :param api_data: dictionary containing the credentials for the given platform. ''' # Processing the results received by parameter self.consumer_key= api_data["consumer_key"] self.consumer_secret= api_data["consumer_secret"] self.access_key= api_data["access_key"] self.access_secret = api_data["access_secret"] # The platformName, a bit redundant self.platformName = "Twitter"
def __init__(self, api_data=None): """ :param api_data: dictionary containing the credentials for the given platform. """ if api_data == None: api_data = api_keys.returnListOfAPIKeys()["twitter"] # Processing the results received by parameter self.consumer_key = api_data["consumer_key"] self.consumer_secret = api_data["consumer_secret"] self.access_key = api_data["access_key"] self.access_secret = api_data["access_secret"] # The platformName, a bit redundant self.platformName = "Twitter"
def checkIfHashIsCracked(hash=None, api_key=None): ''' Method that checks if the given hash is stored in the md5crack.com website. :param hash: hash to verify. :param api_key: api_key to be used in md5crack.com. If not provided, the API key will be searched in the config_api_keys.py file. :return: Python structure for the Json received. It has the following structure: { "phrase": "4d186321c1a7f0f354b297e8914ab240", "code": 6, "parsed": "hola", "response": "The MD5 hash was cracked." } ''' # This is for i3visio if api_key==None: #api_key = raw_input("Insert the API KEY here:\t") allKeys = config_api_keys.returnListOfAPIKeys() try: api_key_data = allKeys["md5crack_com"] api_key = api_key_data["api_key"] except: # API_Key not found return {} apiURL = "http://api.md5crack.com/crack/"+ api_key +"/" + hash # Accessing the HIBP API data = urllib2.urlopen(apiURL).read() if "\"parsed\":null" in data: data = data.replace("\"parsed\":null", "\"parsed\":\"\"") # Reading the text data onto python structures jsonData = json.loads(data) #print json.dumps(jsonData, indent = 2) return jsonData
def checkIfHashIsCracked(hash=None, api_key=None): ''' Method that checks if the given hash is stored in the md5crack.com website. :param hash: hash to verify. :param api_key: api_key to be used in md5crack.com. If not provided, the API key will be searched in the config_api_keys.py file. :return: Python structure for the Json received. It has the following structure: { "phrase": "4d186321c1a7f0f354b297e8914ab240", "code": 6, "parsed": "hola", "response": "The MD5 hash was cracked." } ''' # This is for i3visio if api_key == None: #api_key = raw_input("Insert the API KEY here:\t") allKeys = config_api_keys.returnListOfAPIKeys() try: api_key_data = allKeys["md5crack_com"] api_key = api_key_data["api_key"] except: # API_Key not found return {} apiURL = "http://api.md5crack.com/crack/" + api_key + "/" + hash # Accessing the HIBP API data = urllib2.urlopen(apiURL).read() if "\"parsed\":null" in data: data = data.replace("\"parsed\":null", "\"parsed\":\"\"") # Reading the text data onto python structures jsonData = json.loads(data) #print json.dumps(jsonData, indent = 2) return jsonData
def checkInfo(email=None, username=None, api_key=None): ''' Method that checks if the given hash is stored in the pipl.com website. :param email: queries to be launched. :param api_key: api_key to be used in pipl.com. If not provided, the API key will be searched in the config_api_keys.py file. :return: Python structure for the Json received. It has the following structure: ''' # This is for i3visio if api_key == None: #api_key = raw_input("Insert the API KEY here:\t") allKeys = config_api_keys.returnListOfAPIKeys() try: api_key = allKeys["pipl_com"] except: # API_Key not found. The samplekey will be used but it has a limit of 10 queries/day. api_key = "samplekey" results = {} results["person"] = [] results["records"] = [] if username != None: request = SearchAPIRequest(username=username, api_key=api_key) person, records = launchRequest(request) # Appending the results results["person"].append(person) results["records"].append(records) if email != None: request = SearchAPIRequest(email=email, api_key=api_key) person, records = launchRequest(request) # Appending the results results["person"].append(person) results["records"].append(records) return results
def checkInfo(email=None, username=None, api_key=None): ''' Method that checks if the given hash is stored in the pipl.com website. :param email: queries to be launched. :param api_key: api_key to be used in pipl.com. If not provided, the API key will be searched in the config_api_keys.py file. :return: Python structure for the Json received. It has the following structure: ''' # This is for i3visio if api_key==None: #api_key = raw_input("Insert the API KEY here:\t") allKeys = config_api_keys.returnListOfAPIKeys() try: api_key = allKeys["pipl_com"] except: # API_Key not found. The samplekey will be used but it has a limit of 10 queries/day. api_key = "samplekey" results = {} results["person"] = [] results["records"] = [] if username != None: request = SearchAPIRequest( username=username, api_key=api_key) person, records = launchRequest(request) # Appending the results results["person"].append(person) results["records"].append(records) if email != None: request = SearchAPIRequest( email=email, api_key=api_key) person, records = launchRequest(request) # Appending the results results["person"].append(person) results["records"].append(records) return results