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

Fixed faulty read loop #1239

Merged
merged 6 commits into from Jan 16, 2019
Merged

Fixed faulty read loop #1239

merged 6 commits into from Jan 16, 2019

Conversation

RobertLarsen
Copy link
Member

i386 linux stager had socket in wrong register and did not increment the destination pointer register after each read. This PR fixes this issue.

@zachriggle
Copy link
Member

Can you add a test for this? Probably easiest to use the runners to exec your shellcode.

@RobertLarsen
Copy link
Member Author

That should be doable, but how do I run a doctest from inside a template?

@RobertLarsen
Copy link
Member Author

RobertLarsen commented Jan 14, 2019

@zachriggle I added a doctest the same way as the echo shellcode did it but I don't know how to actually run it. However, if I run the code manually I get the expected result.
I don't know what Travis is whining about. Pretty sure I didn't break anything.


>>> stage_2 = asm(shellcraft.echo('hello') + "\n" + shellcraft.syscalls.exit(42))
>>> p = run_assembly(shellcraft.stager(0, len(stage_2)))
>>> for c in stage_2:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your indentation is incorrect here. Looks like you added a tab. The error on Travis is a bit misleading, but this is the reason.

**********************************************************************
File "shellcraft/i386.rst", line ?, in default
Failed example:
    for c in stage_2:
Exception raised:
    Traceback (most recent call last):
      File "/opt/python/2.7.14/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/sphinx/ext/doctest.py", line 480, in compile
        return compile(code, name, self.type, flags, dont_inherit)
      File "<doctest default[2]>", line 1
        for c in stage_2:
                        ^
    SyntaxError: unexpected EOF while parsing

@zachriggle zachriggle merged commit db8ab63 into dev Jan 16, 2019
@zachriggle zachriggle deleted the fix-i386-stager branch January 21, 2019 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants