-
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
Strange Behavior - Encoders #1875
Comments
Your test case is too big; encoders for every arch are separate beings, please split. |
As for the issue where i think the culprit may be when It seems the Encode class does not handle when
But I'm hesitant to submit a PR with this as maybe the right solution is to enforce EDIT: upon looking at the encoders most of them actually seem to expect I'll go ahead and submit a PR for this change as it appears |
Encoders have never been fully ported to python 3 (#529 #1583 #1767 #1761), and were probably broken in the meantime. If you have working small tests reproducing the issues, preferably something as simple as (for polymorphic encoders, setting a random seed just before the test looks reasonable, too) >>> encoders.aarch64.encode(asm(shellcraft.dupsh())) # not even correct, but you get the idea
b'AAASDGHASDBHNPCIiohurnHSDOqnwekPPPPPn' please add a WIP PR adding the tests in documentation of the tested encoders. Like tests for aarch64 encoder named EDIT: if you want to cast text strings to bytes anywhere in encoders, use |
oh for sure. was mostly to highlight some of the inconsistencies and less to be used as an actual test case. At a later date I'll try to build some small and sane tests for the individual encoders under docs. |
First - love pwntools and use it all the time for CTFs. Thanks for all the hardwork!
Multiple issues when working with shellcode encoders:
poc.py
below many encoders fail silently. (hopefully my checking is proper....)message
attribute which results in an exception being raised when callingrepr
on the initial exception. See "Weird behavior 2" in attachedpoc.py
---- EDIT: addressed in add self.message and change sys.exc_type to sys.exec_info() in Pwnlib… #1876encode(sc, avoid=b'\x01')
on certainamd64
shellcode randomly raises an exception. See "Weird behavior 1" in my PoC/test code below.poc.py
poc.py Output
The text was updated successfully, but these errors were encountered: