Adding initial hook to receive the request/response pairs

This commit is contained in:
Louis-Philippe Huberdeau
2017-06-23 09:44:33 -04:00
parent 5ec44b8346
commit 8df4cc3983
6 changed files with 50 additions and 0 deletions

32
lib/utils/collect.py Normal file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.data import logger
class RequestCollectorFactory:
def __init__(self, collect=False):
self.collect = collect
def create(self):
collector = RequestCollector()
if not self.collect:
collector.collectRequest = self._noop
return collector
@staticmethod
def _noop(*args, **kwargs):
pass
class RequestCollector:
def collectRequest(self, requestMessage, responseMessage):
logger.info("Received request/response: %s/%s", len(requestMessage), len(responseMessage))