Details
| ID | RemoveNullBytes |
|---|---|
| Language | python |
| From Version | 6.10.0 |
| Docker Image | demisto/python3:3.12.13.10404775 |
| Tags | general transformer |
README
Removes null bytes from string.
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Tags | general, transformer |
Inputs
| Argument Name | Description |
|---|---|
| value | The string value to remove null bytes |
Outputs
There are no outputs for this script.
import pytest import base64 from RemoveNullBytes import removenullbytes """ First base64 encoded data when decoded contains null bytes """ @pytest.mark.parametrize( "value, expected_result", [ ("cABvAHcAZQByAHMAaABlAGwAbAAuAGUAeABlAA==", "powershell.exe"), ("Y21kLmV4ZQ==", "cmd.exe"), ], ) def test_removenullbytes(value, expected_result): base64decoded = base64.b64decode(value).decode("latin1") value = removenullbytes(base64decoded) assert value == expected_result