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

TypeError: a bytes-like object is required, not 'str' #335

Closed
brian-foley opened this issue Aug 17, 2022 · 2 comments
Closed

TypeError: a bytes-like object is required, not 'str' #335

brian-foley opened this issue Aug 17, 2022 · 2 comments
Assignees
Labels

Comments

@brian-foley
Copy link

'snippet' : base64.b64encode(snippet),

Received error message "TypeError: a bytes-like object is required, not 'str'" while running thug on webserver running GlobalLink 2.7.0.8 - ConnectAndEnterRoom ActiveX Control Stack Buffer Overflow exploit. Error is seen here:
thug problem

I changed the code to:
base64.b64encode(snippet.encode("ascii")).decode("ascii")
and it seems to resolve the error. I'm not sure if this will break any other functionality.

@buffer
Copy link
Owner

buffer commented Aug 17, 2022

Thanks for reporting it. Can you try the following patch and confirm it fixes the issue?

base64.b64encode(snippet.encode() if isinstance(snippet, str) else snippet)

@buffer buffer self-assigned this Aug 17, 2022
@buffer buffer added the bug label Aug 17, 2022
buffer added a commit that referenced this issue Aug 17, 2022
@brian-foley
Copy link
Author

This patch fixes the issue. Thanks for the timely response!

buffer added a commit that referenced this issue Oct 20, 2022
buffer added a commit that referenced this issue Oct 20, 2022
buffer added a commit that referenced this issue Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants