fuzzing.http.json_data¶
- class asdfuzz.http.json_data.JSONData(json_string: str)¶
Bases:
objectNested structure of JSON data. Can occur in the data section of the HTTP request, but also for example inside of base64-urlencoded cookies or parameters.
- json_string: str¶
String representation of the JSON data.
json_stringis not automatically updated when thejson_nodesare updated: use.to_jsoninstead.
- to_json()¶
After modifying the
json_nodes, call.to_jsonto get a string representation of the JSON data. Thejson_stringis not updated automatically.
- class asdfuzz.http.json_data.Node(keys: List[NodeKey])¶
Bases:
objectA single level in the nested JSON data.
- classmethod from_object(json_object: Any) List[Node]¶
Given an object representing JSON data (the output of
json.loads, e.g. adictorlistof any structure), return theNodeobjects representing the JSON data at this level. Since the outer level of JSON data can be alist, the return type is a list ofNodeobjects, not a singleNode.
- fuzz = True¶
Whether to fuzz the keys in this JSON node.
- class asdfuzz.http.json_data.NodeKey(key_type: NodeType, key: Any)¶
Bases:
objectAbsolute key of a value in the JSON structure.
- key: Any¶
Value of the JSON at this key. The type can be any JSON compatible value.
- class asdfuzz.http.json_data.NodeType(value)¶
Bases:
EnumThe key type of the node can represent either further nested structure (
dictorlist) or a leaf (any JSON compatible value).- DICT = 1¶
Indicates that this key contains further nested structure: specifically, a
dict.
- LIST = 2¶
Indicates that this key contains further nested structure: specifically, a
list.
- VALUE = 3¶
Indicates that this key contains a leaf. The type can be any JSON compatible value.