Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistent comparison of sets in encode when using regular expression #2122

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

p0ise
Copy link
Contributor

@p0ise p0ise commented Oct 23, 2022

In this code:

67    if expr:
68        for char in all_chars:
69            if re.search(expr, char):
70                avoid.add(char)

which make avoid something like {'a', 'b'}.

But set() of bytes would be {some ints}.

This will invalidate the following conditions because they can never intersect:

79        if encoder.blacklist & avoid:
...
87        if avoid & set(v):

@p0ise p0ise changed the title Fix inconsistent comparison of sets in encode Fix inconsistent comparison of sets in encode when using regular expression Oct 23, 2022
@Arusekk
Copy link
Member

Arusekk commented Oct 23, 2022

Thank you! Current implementation of shellcode encoders is a mess in general, so I will take a look at it later.

@Arusekk Arusekk self-requested a review December 28, 2022 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants