示例#1
0
def main():
    global SQL
    try:
        # Config
        ConfAnalysis(ConfFile)

        # Output options
        P = VerifyPath()
        LOG.info("Configuration file to use: " + ConfFile)
        LOG.info("Database: " + DBfile)
        SQL = SqliteCmd(DBfile)
        LOG.info("Main table: " + TABLEname)
        SQL.SQLiteCreateTable(TABLEname)
        LOG.info("Investigation table: " + InvTABLEname)
        SQL.SQLiteInvestigCreateTable(InvTABLEname)
        LOG.info("Files directory: " + SrcDir)
        LOG.info("Download directory: " + DLDir)
        LOG.info("Declared Proxy: " + str(PROXY) + "\n")

        # Modules launch
        if OSINTsources is "YES":
            LaunchModules()
        else:
            pass

        # Phishing Kit download launch if activated
        if DLPhishingKit is "YES":
            TryDLPK(TABLEname, InvTABLEname, DLDir, SQL, PROXY, LOG, UAFILE)
        else:
            pass

    except:
        err = sys.exc_info()
        LOG.error("Main error " + str(err))
示例#2
0
def main():
    global SQL
    try:
        # Config
        ConfAnalysis(ConfFile)

        # Output options
        P = VerifyPath()
        LOG.info("Configuration file to use: " + ConfFile)
        LOG.info("Database: " + DBfile)
        SQL = SqliteCmd(DBfile)
        LOG.info("Main table: " + TABLEname)
        SQL.SQLiteCreateTable(TABLEname)
        LOG.info("Investigation table: " + InvTABLEname)
        SQL.SQLiteInvestigCreateTable(InvTABLEname)
        LOG.info("Files directory: " + SrcDir)
        LOG.info("Download directory: " + DLDir)
        LOG.info("Declared Proxy: " + str(PROXY) + "\n")

        # Test proxy connection
        if PROXY:
            proxystring = PROXY.split('//')[1]
            proxyipadd = proxystring.split(':')[0]
            proxyport = proxystring.split(':')[1]
            s = socket.socket()
            try:
                s.connect((proxyipadd, int(proxyport)))
            except:
                LOG.error("Proxy connection error, exiting!")
                sys.exit(10)
        else:
            pass

        # Only add URL into Database
        if UniqueURL is "YES":
            LOG.info("Add URL into database: {}".format(URLadd))
            AddUniqueURL(URLadd, LOG, SQL, TABLEname, PROXY, UAFILE)
            sys.stdout.flush()
            os._exit(0)
        else:
            pass

        # Modules launch
        if OSINTsources is "YES":
            LaunchModules()
        else:
            pass

        # Phishing Kit download launch if activated
        if DLPhishingKit is "YES":
            LOG.info("Starting trying to download phishing kits sources...")
            TryDLPK(TABLEname, InvTABLEname, DLDir, SQL, PROXY, LOG, UAFILE)
        else:
            pass

    except:
        err = sys.exc_info()
        LOG.error("Main error " + str(err))
示例#3
0
def ConfAnalysis(ConfFile):
    global UA
    global UAFILE
    global CONF
    global DBfile
    global DBDir
    global SrcDir
    global DLDir
    global PROXY
    global TABLEname
    global InvTABLEname
    global SearchString
    global LogConf
    global LogDir
    global LogFile
    global LOG

    try:
        CONF = ConfParser(ConfFile)
        P = VerifyPath()

        # Database stuff
        DBfile = CONF.DBfile
        TABLEname = CONF.TABLEname
        InvTABLEname = CONF.InvestigTABLEname

        # Path stuff
        SrcDir = CONF.SrcDir
        P.VerifyOrCreate(SrcDir)
        DBDir = CONF.DatabaseDir
        P.VerifyOrCreate(DBDir)
        DLDir = CONF.DLDir
        P.VerifyOrCreate(DLDir)

        # Connection stuff
        PROXY = CONF.http_proxy
        UA = CONF.http_UA
        UAFILE = CONF.UAfile

        # Search stuff
        if SearchUString:
            SearchString = SearchUString
        else:
            SearchString = CONF.SearchString

        # Logging stuff
        LogConf = CONF.LogConf
        LogDir = CONF.LogDir
        P.VerifyOrCreate(LogDir)
        LogFile = CONF.LogFile
        llog = LogDir + LogFile
        LOG = Logger(llog)

    except:
        err = sys.exc_info()
        LOG.error("ConfAnalysis error " + str(err))