Esempio n. 1
0
def checkInSkype(args):
    '''
    '''
    if args.query != None:
        return skype.checkInSkype(args.query)
    elif args.file != None:
        results = []
        with open(args.file, "r") as iF:
            queries = iF.read().splitlines()
            
            for q in queries:
                print "Performing query:\t"+q
                results += skype.checkInSkype(args.query)
        return results
def checkInSkype(args):
    '''
    '''
    if args.query != None:
        return skype.checkInSkype(args.query)
    elif args.file != None:
        results = []
        with open(args.file, "r") as iF:
            queries = iF.read().splitlines()

            for q in queries:
                print "Performing query:\t" + q
                results += skype.checkInSkype(args.query)
        return results
Esempio n. 3
0
    def getInfo(self, query=None, process=False, mode="usufy"):
        '''
            Method that checks the presence of a given query and recovers the first list of complains.

            :param query: Phone number to verify.
            :param proces:  Calling the processing function.
            :param mode:    Mode to be executed.

            :return:    Python structure for the html processed.
        '''
        # Defining variables for this process
        results = []
        data = ""
        if not self.modeIsValid(mode=mode):
            # TO-DO: InvalidModeException
            return json.dumps(results)

        try:
            logger = logging.getLogger("osrframework.wrappers")
            # Verifying if the nick is a correct nick
            if self._isValidQuery(query, mode):
                logger.debug("Starting Skype client...")

                logger.warning(
                    "A Skype client must be set up... Note that the program will need a valid session of Skype having been started. If you were performing too many searches, the server may block or ban your account depending on the ToS. Please run this program under your own responsibility."
                )
                # Instantiate Skype object, all further actions are done
                # using this object.

                # Dealing with UTF8
                import codecs
                import sys

                UTF8Writer = codecs.getwriter('utf8')
                sys.stdout = UTF8Writer(sys.stdout)

                # Search for users and display their Skype name, full name
                # and country.
                #print "In skype.py, before sending the query: '" + query + "'"
                data = skype.checkInSkype(query)
                #print "In skype.py, printing the 'data' variable:\n" + json.dumps(data, indent=2)
        except Exception as e:
            print(
                general.warning(
                    "[!] In skype.py, exception caught when checking information in Skype!\n"
                ))
            # No information was found, then we return a null entity
            return json.dumps(results)

        # Verifying if the platform exists
        if mode == "usufy":
            for user in data:
                if user["value"] == "Skype - " + query.lower():
                    results.append(user)
        elif mode == "searchfy":
            results = data

    #print "In skype.py, printing the 'results' variable:\n" + json.dumps(results, indent=2)
        return json.dumps(results)
Esempio n. 4
0
    def getInfo(self, query=None, process = False, mode="usufy"):
        ''' 
            Method that checks the presence of a given query and recovers the first list of complains.

            :param query: Phone number to verify.
            :param proces:  Calling the processing function.
            :param mode:    Mode to be executed.            

            :return:    Python structure for the html processed.
        '''
        # Defining variables for this process
        results = []
        data = ""
        if not self.modeIsValid(mode=mode):
            # TO-DO: InvalidModeException
            #print "InvalidModeException"
            return json.dumps(results)
               
        try:
            logger = logging.getLogger("osrframework.wrappers")
            # Verifying if the nick is a correct nick
            if self._isValidQuery(query, mode):
                logger.debug("Starting Skype client...")

                logger.warning("A Skype client must be set up... Note that the program will need a valid session of Skype having been started. If you were performing too many searches, the server may block or ban your account depending on the ToS. Please run this program under your own responsibility.")
                # Instantiate Skype object, all further actions are done
                # using this object.

                # Dealing with UTF8
                import codecs
                import sys

                UTF8Writer = codecs.getwriter('utf8')
                sys.stdout = UTF8Writer(sys.stdout)
   
                # Search for users and display their Skype name, full name
                # and country.
                #print "In skype.py, before sending the query: '" + query + "'"
                data = skype.checkInSkype(query)
                #print "In skype.py, printing the 'data' variable:\n" + json.dumps(data, indent=2)
        except Exception as e:
            print "[!] In skype.py, exception caught when checking information in Skype!"
            # No information was found, then we return a null entity
            return json.dumps(results)            
                
        # Verifying if the platform exists
        if mode == "usufy":
            for user in data:
                if user["value"] == "Skype - " + query.lower():            
                    results.append(user)
        elif mode == "searchfy":
            results = data

    	#print "In skype.py, printing the 'results' variable:\n" + json.dumps(results, indent=2)              
        return json.dumps(results)
def emailToSkypeAccount(query=None):
    ''' 
        Method that checks if the given email is appears in Skype.

        :param query:    query to verify.

    '''
    me = MaltegoTransform()

    jsonData = skype.checkInSkype(query=query)

    # This returns a dictionary like:
    # [{}]
    newEntities = []

    #print json.dumps(entities, indent=2)
    for user in jsonData:
	    # Defining the main entity
        aux ={}
        aux["type"] = "i3visio.profile"
        aux["value"] =  "Skype - " + str(user["i3visio.alias"])
        aux["attributes"] = []    

        # Defining the attributes recovered
        att ={}
        att["type"] = "i3visio.platform"
        att["value"] =  str("Skype")
        att["attributes"] = []
        aux["attributes"].append(att)

        for field in user.keys():
            # [TO-DO] Appending all the information from the json:
            if user[field] != None:
                try:
                    att ={}
                    att["type"] = field
                    att["value"] =  str(user[field]).encode('utf-8')
                    att["attributes"] = []
                    aux["attributes"].append(att)                
                except:
                    # Something passed...
                    pass
        # Appending the entity
        newEntities.append(aux)

    me.addListOfEntities(newEntities)
        
    # Returning the output text...
    me.returnOutput()
def aliasToSkypeAccounts(query=None):
    ''' 
        Method that checks if a given alias appears in Skype.

        :param query:    query to verify.

    '''
    me = MaltegoTransform()

    jsonData = skype.checkInSkype(query=query)

    # This returns a dictionary like:
    # [{}]
    newEntities = []

    #print json.dumps(entities, indent=2)
    for user in jsonData:
        # Defining the main entity
        aux = {}
        aux["type"] = "i3visio.profile"
        aux["value"] = "Skype - " + str(user["i3visio.alias"])
        aux["attributes"] = []

        # Defining the attributes recovered
        att = {}
        att["type"] = "i3visio.platform"
        att["value"] = str("Skype")
        att["attributes"] = []
        aux["attributes"].append(att)

        for field in user.keys():
            # [TO-DO] Appending all the information from the json:
            if user[field] != None:
                try:
                    att = {}
                    att["type"] = field
                    att["value"] = str(user[field]).encode('utf-8')
                    att["attributes"] = []
                    aux["attributes"].append(att)
                except:
                    # Something passed...
                    pass
        # Appending the entity
        newEntities.append(aux)

    me.addListOfEntities(newEntities)

    # Returning the output text...
    me.returnOutput()
def aliasToSkypeAccounts(query=None):
    ''' 
        Method that checks if a given alias appears in Skype.

        :param query:    query to verify.

    '''
    me = MaltegoTransform()

    jsonData = skype.checkInSkype(query=query)

    # This returns a dictionary like:
    # [{}]

    #print json.dumps(entities, indent=2)
    for user in jsonData:
        newEnt = me.addEntity("i3visio.profile",
                              "Skype - " + str(user["i3visio.alias"]))
        aliasEnt = me.addEntity("i3visio.alias", user["i3visio.alias"])

        newEnt.setDisplayInformation("<h3>" + user["i3visio.alias"] +
                                     "</h3><p>")
        # + json.dumps(user, sort_keys=True, indent=2) + "!</p>");
        newEnt.addAdditionalFields("i3visio.platform", "i3visio.platform",
                                   True, "Skype")
        for field in user.keys():
            #if field != "i3visio.alias":
            # [TO-DO] Appending all the information from the json:
            #if field == "i3visio.aliases":
            #    listAliases = [user["i3visio.alias"]]
            #    listAliases += user[field]
            #    # in this case, this is a list
            #    for alias in user[field]:
            #        aliasEnt = me.addEntity("i3visio.alias",alias.encode('utf-8'))
            #elif user[field] != None:
            if user[field] != None:
                try:
                    newEnt.addAdditionalFields(
                        field, field, True,
                        str(user[field]).encode('utf-8'))
                except:
                    # Something passed...
                    pass

    # Returning the output text...
    me.returnOutput()
Esempio n. 8
0
def aliasToSkypeAccounts(query=None):
    ''' 
        Method that checks if a given alias appears in Skype.

        :param query:    query to verify.

    '''
    me = MaltegoTransform()

    jsonData = skype.checkInSkype(query=query)

    # This returns a dictionary like:
    # [{}]

    #print json.dumps(entities, indent=2)
    for user in jsonData:
        newEnt = me.addEntity("i3visio.profile","Skype - " +str(user["i3visio.alias"]))
        aliasEnt = me.addEntity("i3visio.alias",user["i3visio.alias"])

        newEnt.setDisplayInformation("<h3>" + user["i3visio.alias"] +"</h3><p>");# + json.dumps(user, sort_keys=True, indent=2) + "!</p>");
        newEnt.addAdditionalFields("i3visio.platform","i3visio.platform",True,"Skype")
        for field in user.keys():
            #if field != "i3visio.alias":
            # [TO-DO] Appending all the information from the json:
            #if field == "i3visio.aliases":
            #    listAliases = [user["i3visio.alias"]]
            #    listAliases += user[field]
            #    # in this case, this is a list
            #    for alias in user[field]:
            #        aliasEnt = me.addEntity("i3visio.alias",alias.encode('utf-8'))
            #elif user[field] != None:
            if user[field] != None:
                try:
                    newEnt.addAdditionalFields(field,field,True,str(user[field]).encode('utf-8'))
                except:
                    # Something passed...
                    pass

    # Returning the output text...
    me.returnOutput()