mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 05:01:30 +00:00
Adding initial hook to receive the request/response pairs
This commit is contained in:
32
lib/utils/collect.py
Normal file
32
lib/utils/collect.py
Normal 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))
|
||||
Reference in New Issue
Block a user