Skip to content

Commit

Permalink
fix pylint json_mutator
Browse files Browse the repository at this point in the history
  • Loading branch information
bretfourbe committed Dec 20, 2023
1 parent 018f678 commit fdedb41
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wapitiCore/mutation/json_mutator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,29 @@ def get_item(json_object, path):
return ptr


class JSONMutator:
class JSONMutator():
"""The JSONMutator will only mutate the JSON object within the body,
it won't change parameters in the query string"""
def __init__(
self, methods="FGP", qs_inject=False, max_queries_per_pattern: int = 1000,
skip=None # Must not attack those parameters (blacklist)
self, _methods="FGP", _qs_inject=False, _max_queries_per_pattern: int = 1000,
_skip=None # Must not attack those parameters (blacklist)
):
self._attack_hashes = set()

def mutate(self,
request: Request,
@staticmethod
def mutate(request: Request,
payloads: PayloadSource) -> Iterator[Tuple[Request, Parameter, PayloadInfo]]:
get_params = request.get_params

referer = request.referer

if not request.is_json:
raise StopIteration
return

try:
data = json.loads(request.post_params)
except json.JSONDecodeError:
raise StopIteration
return

injection_points = find_injectable([], data)

Expand Down

0 comments on commit fdedb41

Please sign in to comment.