mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-06-09 17:51:33 +00:00
Adding initial hook to receive the request/response pairs
This commit is contained in:
parent
5ec44b8346
commit
8df4cc3983
6 changed files with 50 additions and 0 deletions
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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue