MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / fuzz

Method fuzz

bbot/modules/lightfuzz/submodules/serial.py:81–189  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

79 return False
80
81 async def fuzz(self):
82 cookies = self.event.data.get("assigned_cookies", {})
83 control_payload_hex = self.CONTROL_PAYLOAD_HEX
84 control_payload_base64 = self.CONTROL_PAYLOAD_BASE64
85 control_payload_php_raw = self.CONTROL_PAYLOAD_PHP_RAW
86
87 base64_serialization_payloads = self.BASE64_SERIALIZATION_PAYLOADS
88 hex_serialization_payloads = self.HEX_SERIALIZATION_PAYLOADS
89 php_raw_serialization_payloads = self.PHP_RAW_SERIALIZATION_PAYLOADS
90
91 serialization_errors = self.SERIALIZATION_ERRORS
92 general_errors = self.GENERAL_ERRORS
93
94 probe_value = self.incoming_probe_value(populate_empty=False)
95 if probe_value:
96 if self.is_possibly_serialized(probe_value):
97 self.debug(
98 f"Existing value is not ruled out for being a serialized object, proceeding [{self.event.data['type']}] [{self.event.data['name']}]"
99 )
100 else:
101 self.debug(
102 f"The Serialization Submodule only operates when there is no original value, or when the original value could potentially be a serialized object, aborting [{self.event.data['type']}] [{self.event.data['name']}]"
103 )
104 return
105
106 try:
107 http_compare_hex = self.compare_baseline(self.event.data["type"], control_payload_hex, cookies)
108 http_compare_base64 = self.compare_baseline(self.event.data["type"], control_payload_base64, cookies)
109 http_compare_php_raw = self.compare_baseline(self.event.data["type"], control_payload_php_raw, cookies)
110 except HttpCompareError as e:
111 self.debug(f"HttpCompareError encountered: {e}")
112 return
113
114 # Proceed with payload probes
115 for payload_set, payload_baseline in [
116 (base64_serialization_payloads, http_compare_base64),
117 (hex_serialization_payloads, http_compare_hex),
118 (php_raw_serialization_payloads, http_compare_php_raw),
119 ]:
120 for type, payload in payload_set.items():
121 try:
122 matches_baseline, diff_reasons, reflection, response = await self.compare_probe(
123 payload_baseline, self.event.data["type"], payload, cookies
124 )
125 except HttpCompareError as e:
126 self.debug(f"HttpCompareError encountered: {e}")
127 continue
128
129 if matches_baseline:
130 self.debug(f"Payload {type} matches baseline, skipping")
131 continue
132
133 self.debug(f"Probe result for {type}: {response}")
134
135 status_code = getattr(response, "status_code", 0)
136 if status_code == 0:
137 continue
138

Callers

nothing calls this directly

Calls 7

incoming_probe_valueMethod · 0.80
compare_baselineMethod · 0.80
compare_probeMethod · 0.80
metadataMethod · 0.80
getMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected