Example #1
0
def Load_Configuration():
    File_Dir = os.path.dirname(os.path.realpath('__file__'))
    Configuration_File = os.path.join(File_Dir,
                                      'plugins/common/config/config.json')
    logging.info(General.Date() + " - " + __name__.strip('plugins.') +
                 " - Loading configuration data.")

    try:

        with open(Configuration_File) as JSON_File:
            Configuration_Data = json.load(JSON_File)

            for Flickr_Details in Configuration_Data[Plugin_Name.lower()]:

                if Flickr_Details['api_key'] and Flickr_Details['api_secret']:
                    return [
                        Flickr_Details['api_key'], Flickr_Details['api_secret']
                    ]

                else:
                    return None

    except:
        logging.warning(General.Date() + " - " + __name__.strip('plugins.') +
                        " - Failed to load location details.")
Example #2
0
def Load_Configuration():
    File_Dir = os.path.dirname(os.path.realpath('__file__'))
    Configuration_File = os.path.join(File_Dir,
                                      'plugins/common/config/config.json')
    logging.info(General.Date() + " - " + __name__.strip('plugins.') +
                 " - Loading configuration data.")

    try:
        with open(Configuration_File) as JSON_File:
            Configuration_Data = json.load(JSON_File)

            for Reddit_Details in Configuration_Data[Plugin_Name.lower()]:
                Reddit_Client_ID = Reddit_Details['client_id']
                Reddit_Client_Secret = Reddit_Details['client_secret']
                Reddit_User_Agent = Reddit_Details['user_agent']
                Reddit_Username = Reddit_Details['username']
                Reddit_Password = Reddit_Details['password']
                Subreddit_to_Search = Reddit_Details["subreddits"]

                if Reddit_Client_ID and Reddit_Client_Secret and Reddit_User_Agent and Reddit_Username and Reddit_Password and Subreddit_to_Search:
                    return [
                        Reddit_Client_ID, Reddit_Client_Secret,
                        Reddit_User_Agent, Reddit_Username, Reddit_Password,
                        Subreddit_to_Search
                    ]

                else:
                    return None
    except:
        logging.warning(General.Date() + " - " + __name__.strip('plugins.') +
                        " - Failed to load Reddit details.")
Example #3
0
def Search(Query_List, Task_ID, **kwargs):

    if kwargs.get('Limit'):

        if int(kwargs["Limit"]) > 0:
            Limit = kwargs["Limit"]

    else:
        Limit = 10

    Directory = General.Make_Directory(Plugin_Name.lower())

    logger = logging.getLogger()
    logger.setLevel(logging.INFO)

    Log_File = General.Logging(Directory, Plugin_Name.lower())
    handler = logging.FileHandler(os.path.join(Directory, Log_File), "w")
    handler.setLevel(logging.DEBUG)
    formatter = logging.Formatter("%(levelname)s - %(message)s")
    handler.setFormatter(formatter)
    logger.addHandler(handler)

    Twitter_Credentials = Load_Configuration()
    Query_List = General.Convert_to_List(Query_List)

    for Query in Query_List:

        try:
            Authentication = tweepy.OAuthHandler(Twitter_Credentials[0], Twitter_Credentials[1])
            Authentication.set_access_token(Twitter_Credentials[2], Twitter_Credentials[3])
            API = tweepy.API(Authentication)
            General_Pull(Query, Limit, Directory, API, Task_ID)

        except:
            logging.info(General.Date() + " Failed to get results. Are you connected to the internet?")
Example #4
0
    def Search(self):

        try:
            Directory = General.Make_Directory(self.Plugin_Name.lower())
            logger = logging.getLogger()
            logger.setLevel(logging.INFO)
            Log_File = General.Logging(Directory, self.Plugin_Name.lower())
            handler = logging.FileHandler(os.path.join(Directory, Log_File), "w")
            handler.setLevel(logging.DEBUG)
            formatter = logging.Formatter("%(levelname)s - %(message)s")
            handler.setFormatter(formatter)
            logger.addHandler(handler)
            Twitter_Credentials = self.Load_Configuration()

            for Query in self.Query_List:

                try:
                    Authentication = tweepy.OAuthHandler(Twitter_Credentials[0], Twitter_Credentials[1])
                    Authentication.set_access_token(Twitter_Credentials[2], Twitter_Credentials[3])
                    API = tweepy.API(Authentication)
                    self.General_Pull(Query, Directory, API)

                except:
                    logging.info(f"{Common.Date()} - {self.Logging_Plugin_Name} - Failed to get results. Are you connected to the internet?")

        except Exception as e:
            logging.warning(f"{Common.Date()} - {self.Logging_Plugin_Name} - {str(e)}")
Example #5
0
def Load_Configuration():
    File_Dir = os.path.dirname(os.path.realpath('__file__'))
    Configuration_File = os.path.join(File_Dir, 'plugins/common/config/config.json')
    logging.info(General.Date() + " - " + __name__.strip('plugins.') + " - Loading configuration data.")

    try:

        with open(Configuration_File) as JSON_File:  
            Configuration_Data = json.load(JSON_File)

            for YouTube_Details in Configuration_Data[Plugin_Name.lower()]:
                YouTube_Developer_Key = YouTube_Details['developer_key']
                YouTube_Application_Name = YouTube_Details['application_name']
                YouTube_Application_Version = YouTube_Details['application_version']
                YouTube_Location = YouTube_Details['location']
                YouTube_Location_Radius = YouTube_Details['location_radius']

                if YouTube_Developer_Key and YouTube_Application_Name and YouTube_Application_Version and YouTube_Location and YouTube_Location_Radius:
                    return [YouTube_Developer_Key, YouTube_Application_Name, YouTube_Application_Version, YouTube_Location, YouTube_Location_Radius]

                else:
                    return None

    except:
        logging.warning(General.Date() + " - " + __name__.strip('plugins.') + " - Failed to load location details.")
Example #6
0
def Search(Query_List, Task_ID, Limit=10):

    try:
        Directory = General.Make_Directory(Plugin_Name.lower())
        logger = logging.getLogger()
        logger.setLevel(logging.INFO)
        Log_File = General.Logging(Directory, Plugin_Name.lower())
        handler = logging.FileHandler(os.path.join(Directory, Log_File), "w")
        handler.setLevel(logging.DEBUG)
        formatter = logging.Formatter("%(levelname)s - %(message)s")
        handler.setFormatter(formatter)
        logger.addHandler(handler)
        Twitter_Credentials = Load_Configuration()
        Query_List = General.Convert_to_List(Query_List)
        Limit = General.Get_Limit(Limit)

        for Query in Query_List:

            try:
                Authentication = tweepy.OAuthHandler(Twitter_Credentials[0],
                                                     Twitter_Credentials[1])
                Authentication.set_access_token(Twitter_Credentials[2],
                                                Twitter_Credentials[3])
                API = tweepy.API(Authentication)
                General_Pull(Query, Limit, Directory, API, Task_ID)

            except:
                logging.info(
                    f"{Common.Date()} - {__name__.strip('plugins.')} - Failed to get results. Are you connected to the internet?"
                )

    except Exception as e:
        logging.warning(
            f"{Common.Date()} - {__name__.strip('plugins.')} - {str(e)}")
Example #7
0
 def __init__(self, Query_List, Task_ID, Limit=10):
     self.Plugin_Name = "Flickr"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Domain = "flickr.com"
     self.Limit = General.Get_Limit(Limit)
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "SSLMate"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extension = ".json"
     self.Domain = "sslmate.com"
     self.Result_Type = "Certificate Details"
Example #9
0
 def __init__(self, Query_List, Task_ID, Type):
     self.Plugin_Name = "VirusTotal"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Domain = "virustotal.com"
     self.Type = Type
Example #10
0
 def __init__(self, Query_List, Task_ID, Limit=10):
     self.The_File_Extension = ".html"
     self.Plugin_Name = "RSS"
     self.Logging_Plugin_Name = self.Plugin_Name + " Feed Search"
     self.Result_Type = "News Report"
     self.Limit = General.Get_Limit(Limit)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
Example #11
0
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "Kik"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extension = ".html"
     self.Domain = "kik.me"
     self.Result_Type = "Social Media - Person"
Example #12
0
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "Email Verification"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Main_Converted": ".html"}
     self.Concat_Plugin_Name = "emailverify"
     self.Domain = "verify-email.org"
     self.Result_Type = "Email Information"
Example #13
0
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "BuiltWith"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Domain = "builtwith.com"
     self.Result_Type = "Web Application Architecture"
Example #14
0
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "IPStack"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Main_Converted": ".html"}
     self.Domain = "ipstack.com"
     self.Result_Type = "IP Address Information"
Example #15
0
 def __init__(self, Query_List, Task_ID, Limit=10):
     self.Plugin_Name = "DuckDuckGo"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Domain = "duckduckgo.com"
     self.Result_Type = "Search Result"
     self.Limit = General.Get_Limit(Limit)
Example #16
0
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "DNS Reconnaissance"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Concat_Plugin_Name = "dnsrecon"
     self.Result_Type = "Domain Information"
Example #17
0
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "Tumblr"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Domain = "tumblr.com"
     self.Result_Type = "Social Media - Page"
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "CRT"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extension = ".html"
     self.Domain = "crt.sh"
     self.Result_Type = "Certificate Details"
Example #19
0
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "BSB"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extension = ".html"
     self.Domain = "bsbnumbers.com"
     self.Result_Type = "BSB Details"
Example #20
0
 def __init__(self, Query_List, Task_ID, Type):
     self.Plugin_Name = "Threat Crowd"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Domain = "threatcrowd.org"
     self.Type = Type
Example #21
0
    def General_Pull(self, Handle, Directory, API):

        try:
            Data_to_Cache = []
            JSON_Response = []
            Cached_Data_Object = General.Cache(Directory, self.Plugin_Name)
            Cached_Data = Cached_Data_Object.Get_Cache()
            Latest_Tweets = API.user_timeline(screen_name=Handle, count=self.Limit)

            for Tweet in Latest_Tweets:

                try:
                    JSON_Response.append({
                        'id': Tweet.id,
                        'text': Tweet.text,
                        'author_name': Tweet.user.screen_name,
                        'url': Tweet.entities['urls'][0]["expanded_url"]
                    })

                except:
                    JSON_Response.append({
                        'id': Tweet.id,
                        'text': Tweet.text,
                        'author_name': Tweet.user.screen_name
                    })

            JSON_Output = Common.JSON_Handler(JSON_Response).Dump_JSON()
            Output_Connections = General.Connections(Handle, self.Plugin_Name, self.Domain, self.Result_Type, self.Task_ID, self.Plugin_Name.lower())
            Main_File = General.Main_File_Create(Directory, self.Plugin_Name, JSON_Output, Handle, self.The_File_Extensions["Main"])

            for JSON_Item in JSON_Response:

                if all(Item in JSON_Item for Item in ['id', 'url', 'text']):
                    Link = JSON_Item['url']

                    if Link not in Cached_Data and Link not in Data_to_Cache:
                        Title = "Twitter | " + JSON_Item['text']
                        Item_Responses = Common.Request_Handler(Link, Filter=True, Host=f"https://{self.Domain}")
                        Item_Response = Item_Responses["Filtered"]

                        Output_file = General.Create_Query_Results_Output_File(Directory, Handle, self.Plugin_Name, Item_Response, str(JSON_Item['id']), self.The_File_Extensions["Query"])

                        if Output_file:
                            Output_Connections.Output([Main_File, Output_file], Link, Title, self.Plugin_Name.lower())
                            Data_to_Cache.append(Link)

                        else:
                            logging.warning(f"{Common.Date()} - {self.Logging_Plugin_Name} - Output file not returned.")

                else:
                    logging.warning(f"{Common.Date()} - {self.Logging_Plugin_Name} - Insufficient parameters provided.")

            Cached_Data_Object.Write_Cache(Data_to_Cache)

        except Exception as e:
            logging.warning(f"{Common.Date()} - {self.Logging_Plugin_Name} - {str(e)}")
Example #22
0
 def __init__(self, Query_List, Task_ID, Limit=10):
     self.Plugin_Name = "Torrent"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extension = ".json"
     self.Domain = "thepiratebay.org"
     self.Result_Type = "Torrent"
     self.Limit = General.Get_Limit(Limit)
Example #23
0
 def __init__(self, Query_List, Task_ID, Limit=10):
     self.Plugin_Name = "Windows Store"
     self.Concat_Plugin_Name = "windowsstore"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extension = ".html"
     self.Domain = "microsoft.com"
     self.Result_Type = "Application"
     self.Limit = General.Get_Limit(Limit)
Example #24
0
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "Greynoise IP"
     self.Concat_Plugin_Name = "greynoise"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Domain = "greynoise.io"
     self.Result_Type = "IP Address Information"
Example #25
0
 def __init__(self, Query_List, Task_ID, Limit=10):
     self.Plugin_Name = "Library Genesis"
     self.Concat_Plugin_Name = "libgen"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extension = ".html"
     self.Domain = "gen.lib.rus.ec"
     self.Result_Type = "Publication"
     self.Limit = General.Get_Limit(Limit)
Example #26
0
 def __init__(self, Query_List, Task_ID, Limit=10):
     self.Plugin_Name = "Reddit"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extension = ".html"
     self.Domain = "reddit.com"
     self.Result_Type = "Forum"
     self.Limit = General.Get_Limit(Limit)
Example #27
0
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "Doing Business"
     self.Concat_Plugin_Name = "doingbusiness"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Domain = "doingbusiness.org"
     self.Result_Type = "Economic Details"
Example #28
0
 def __init__(self, Query_List, Task_ID, Limit=10):
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Plugin_Name = "YouTube"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.Domain = "youtube.com"
     self.Result_Type = "Social Media - Media"
     self.Limit = General.Get_Limit(Limit)
Example #29
0
 def __init__(self, Query_List, Task_ID, Limit=10):
     self.Plugin_Name = "Phishstats"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Domain = "phishstats.info"
     self.Result_Type = "Phishing"
     self.Limit = General.Get_Limit(Limit)
Example #30
0
 def __init__(self, Query_List, Task_ID):
     self.Plugin_Name = "Email Reputation"
     self.Logging_Plugin_Name = General.Get_Plugin_Logging_Name(
         self.Plugin_Name)
     self.Task_ID = Task_ID
     self.Query_List = General.Convert_to_List(Query_List)
     self.The_File_Extensions = {"Main": ".json", "Query": ".html"}
     self.Concat_Plugin_Name = "emailrep"
     self.Domain = "emailrep.io"
     self.Result_Type = "Email Information"