Esempio n. 1
0
 def pl_show_all_poc_info(self):
     cursor = self.sql_exec.select()
     desc = '''
     PureLove Modules
     ----------------
     '''
     print desc
     print "   {Name:<55}{DisclosureDate:<20}{Rank:<7}{Descriptions:<35}".format(
         Name="Name",
         DisclosureDate="Disclosure Date",
         Rank="Rank",
         Descriptions="Descriptions")
     print "   {Name:<55}{DisclosureDate:<20}{Rank:<7}{Descriptions:<35}".format(
         Name="----",
         DisclosureDate="---------------",
         Rank="----",
         Descriptions="------------")
     try:
         for row in cursor:
             poc_name = row[0]
             poc_name_path = row[1]
             date = row[2]
             try:
                 poc = getinfo.import_pocs(poc_name_path)  #导入poc主函数
                 print "   {poc_name:<55}{date:<20}{severity:<7}{name:<35}".format(
                     poc_name=pl_del_suffix(poc_name),
                     date=date,
                     severity=poc.info['severity'],
                     name=poc.info['name'])
                 print
             except:
                 pass
         self.sql_exec.db_close()
     except:
         self.sql_exec.db_close()
Esempio n. 2
0
    def print_poc_name_info(self, PL_POC_NAME):
        cursor = self.sql_exec.select()
        desc = '''

    DirFileName
    -----------

        '''
        if PL_POC_NAME:
            print desc
            print "   {FileName:<55}{Name:<25}{Date:<20}".format(
                FileName="FileName",
                Name="Name",
                Date="Date",
            )
            print "   {FileName:<55}{Name:<25}{Date:<20}".format(
                FileName="--------",
                Name="----",
                Date="----",
            )
            print

            try:
                for row in cursor:
                    poc_name = row[0]
                    poc_name_path = row[1]
                    date = row[2]
                    file_name = os.path.split(poc_name_path)[1]  #分割出目录与文件
                    #file_name  = file_name[1]                  #取出文件名

                    if PL_POC_NAME in file_name:
                        file_date = date
                        pname = pl_del_suffix(poc_name)  #模块文件路径
                        pocname = pl_del_suffix(file_name)  #
                        print "   {FileName:<55}{Name:<25}{Date:<20}".format(
                            FileName=pname, Name=pocname, Date=date)
                    else:
                        pass
            except:
                self.sql_exec.db_close()
                return

        else:
            print setcolor.set_red("[-] ") + "Sorry! Not Found Module."
            self.sql_exec.db_close()
        self.sql_exec.db_close()