Skip to content

Getting Error: binascii.Error: Incorrect padding #78

@s4ksh1

Description

@s4ksh1

My IOC is https://example[.]com/k265/aHR0cHM6Ly91NzAwNy5zY29y

iocextract.extract_urls(IOC, refang=True)

Getting error:
File "/usr/local/lib/python3.11/dist-packages/iocextract.py", line 522, in extract_encoded_urls
url = base64.b64decode(url).decode("utf-8", "replace")
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/base64.py", line 88, in b64decode
return binascii.a2b_base64(s, strict_mode=validate)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
binascii.Error: Incorrect padding

How to ignore base64 strings while extracting URL from content (iocextract.extract_urls)??

image

How to ignore extraction of encoded strings present in URI??
Say in above example I want to ignore extraction of 'aHR0cHM6Ly91NzAwNy5zY29y'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions