-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Shellcode encoder flakky behaviour #1761
Comments
Yes, this is a bug. We should fix it in some time, but if you wish to help, please submit a PR before I do :) But first what do you mean by "sometimes"? What do you change between invocations so that it behaves differently? |
There's nothing changed between the invocations, that's what's confusing me more. Like if I only re-execute the last line in the python shell
I get crash on some of the subsequent calls and then at one of the executions, there's no error (without any change in the code) and shellcode is generated successfuly. Nothing is changed between these calls and yet I see different behaviour on subsequent executions of same function call. |
Hi, I found the reason for different behaviours for So if I use,
I am getting successful shellcode generation consistently. Whereas, with
I'm getting the crash consistently. The random behaviour is because of line 75 in |
Don't encode `avoid` parameter in `fiddler.py` if type is `bytearray`
Hi @Arusekk, I have opened a PR to fix the issue, please review and let me know if any changes are required. |
Don't encode `avoid` parameter in `fiddler.py` if type is `bytearray`
* Fix i386 encoder issue #1761 Don't encode `avoid` parameter in `fiddler.py` if type is `bytearray` * Pass `avoid` as `bytes` instead of `set` when `encoder.encode()` is called * Requested change: Increase readability * Update doctest in XOR encoder Add my failing testcase to ensure the code is fixed
I'm trying to generate an encoded shellcode with
pwntools
using following code. I'm running it withpython3
This snippet is showing flakky behaviour for generation shellcode, sometimes it generates the shellcode and other times it crash.
During crash following is the traceback I get.
I tried debugging it via traceback, but it appears that for the
bytearray
I'm passing as theavoid
parameter toencode
function, the type of that parameter is somehow being interpreted as aset
in case of failure, which is causing the crash. In case of successful shellcode generation, I'm assuming the type of theavoid
parameter is intact.What I'm unable to understand is how can the same code behaves differently on subsequent executions.
Please suggest. All inputs are much appreciated.
Thanks in advance.
The text was updated successfully, but these errors were encountered: