(self, context: Context)
| 42 | return config.get_settings("aura.min-blob-size", 100) |
| 43 | |
| 44 | def node_String(self, context: Context): |
| 45 | val = context.node.value |
| 46 | |
| 47 | if BASE64_REGEX.match(val): |
| 48 | try: |
| 49 | result = base64.b64decode(val) |
| 50 | result = result.decode("utf-8") |
| 51 | |
| 52 | yield Detection( |
| 53 | detection_type="Base64Blob", |
| 54 | message="Base64 data blob found", |
| 55 | node=context.node, |
| 56 | score=config.get_score_or_default("base-64-blob", 0), |
| 57 | tags={"base64",}, |
| 58 | extra={"base64_decoded": result}, |
| 59 | signature=f"data_finder#base64_blob#{utils.fast_checksum(result)}#{context.signature}", |
| 60 | ) |
| 61 | except UnicodeError: |
| 62 | pass |
| 63 | except binascii.Error: |
| 64 | pass |
| 65 | |
| 66 | if len(val) >= self.__min_blob_size and self._no_blobs is False: |
| 67 | yield self.__export_blob(val, context) |
| 68 | |
| 69 | def node_Binary(self, context: Context): |
| 70 | if len(context.node.value) >= self.__min_blob_size and self._no_blobs is False: |
nothing calls this directly
no test coverage detected