Exemplo n.º 1
0
Arquivo: req.py Projeto: 7Shad0w/doom
 def log(self):
     """all request log into mongodb"""
     #reqHash = hashlib.md5(self.url.split('?')[0].strip()).hexdigest()
     #reqHash = hashlib.md5(self.url.strip()).hexdigest()
     table = MongoTool().conn.request.log
     res = table.find_one({"hash":self.hash})
     if res == None:
         row = self.__dict__
         row['hash'] = self.hash
         row['time'] = int(time.time())
         row['check'] = 0
         row['data'] = row['data'].decode("unicode_escape")
         table.insert(row)
         print "\033[1;31m%s\033[0m" % "Log Request "+row['url']
Exemplo n.º 2
0
 def log(self):
     """all request log into mongodb"""
     #reqHash = hashlib.md5(self.url.split('?')[0].strip()).hexdigest()
     #reqHash = hashlib.md5(self.url.strip()).hexdigest()
     table = MongoTool().conn.request.log
     res = table.find_one({"hash": self.hash})
     if res == None:
         row = self.__dict__
         row['hash'] = self.hash
         row['time'] = int(time.time())
         row['check'] = 0
         row['data'] = row['data'].decode("unicode_escape")
         table.insert(row)
         print "\033[1;31m%s\033[0m" % "Log Request " + row['url']