-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fmtstr no dollar payload #2185
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
Fmtstr no dollar payload #2185
Conversation
…out the dollar syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff! Thanks a lot, would you mind adding some extra doctest that would ensure the fmtstr stuff works? It might be beneficial to also launch the examples/fmtstr.py and examples/fmtstr2.py with no_dollars=True in the CI pipeline.
suggested change, dont need comparison in calling the make_payload_dollar Co-authored-by: Arusekk <[email protected]>
suggestion; better use a non null byte thing to fill the values used by the %c to pad before writing. Co-authored-by: Arusekk <[email protected]>
How about some tests now? |
did you see the padding thing? i see that you answered that from my email but cand find your response, could you open another suggestion about that? |
i was looking at the output of the checks that failed, have a look at this, this one fail cause of the new feature added, because he expects to find %1c but we just printng "c" * 1.
|
Yes, the test needs to be updated. Please add another test too, with no_dollars set to True. |
…to save some bytes in the generation of the payload
Time for some tests :) |
not really practical with tests :/ , what am i supposed to do, is there any doc to read about it?i ll check them next mornin, btw, i ll go to sleep now, been awake for too many hours, appreciate yo time mate. I ll link with you tomorrow. good morning/night gang |
just had a look before closing the laptop, are those the test that i am supposed to do?
|
Sure, the tests are just the code snippets in the documentation strings of the functions. You can save time and only run relevant tests with: $ pip install -r docs/requirements.txt
$ python -bb -m sphinx -b doctest docs/source docs/build/doctest docs/source/fmtstr.rst |
ok, appreciate it, i ll do that soon as i wake up. |
@Arusekk added some tests ( just 3 for now ), i ve runned them as you suggested, seems working correctly. let me know, i ll keep doing some test. |
Hello, i ve seen you approved the changes, and added this request to a milestone, thanks. also you added this to the milestone to 4.11, want me to change that in my CHANGELOG? i ve putted it in the 4.12 |
Sure, also make sure the markdown is rendered correctly (i.e. one line added to the list and one to the link section). Never mind the coverage indicator, it is broken and I have been looking for some ways to replace it. |
ok updated the changelog file with correct version. i ve copied the other lines to be sure to do that right, have a look in when u have a second, after this changes gets approved i ll just have to wait right, till the drop of the next milestone? ( sorry newbie in contributing other projects) appreciate it |
* added feature to the fmtstr module, now able to generate payload without the dollar syntax. * made some improvements in the no_dollar feature implemented * reduced different lines * removed some blank lines and debug stuff * (fix) missing check for no_dollar option * (fix) updatet argument type for documentation * updated CHANGELOG.md * (fix) typo in the CHANGELOG.md version * Update pwnlib/fmtstr.py suggested change, dont need comparison in calling the make_payload_dollar Co-authored-by: Arusekk <[email protected]> * Update pwnlib/fmtstr.py suggestion; better use a non null byte thing to fill the values used by the %c to pad before writing. Co-authored-by: Arusekk <[email protected]> * (fix) minor fixes, typos on comments * update pwnlib/fmtstr.py : suggestion from Arusekk, made improvements to save some bytes in the generation of the payload * added tests to fmtstr_payload with no dollar flag * update CHANGELOG.md with correct version --------- Co-authored-by: Arusekk <[email protected]>
No $ notation support for Fmtstr module
Added a new feature in the fmtstr module, the fmtstr_payload(...) function now supports generating payload without using the $ notation.
This can be accomplished with the new flag in the fmstr_payload function parameters
no_dollars
.Function signature
Before
After
Example: