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

Unable to create a shell shellcraft for MIPS #1122

Closed
Arusekk opened this issue Mar 1, 2018 · 0 comments
Closed

Unable to create a shell shellcraft for MIPS #1122

Arusekk opened this issue Mar 1, 2018 · 0 comments

Comments

@Arusekk
Copy link
Member

Arusekk commented Mar 1, 2018

The problem is as follows:

>>> from pwnlib.shellcraft import mips
>>> mips.sh()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 8, in sh
  File "/usr/lib64/python2.7/site-packages/mako/template.py", line 462, in render
    return runtime._render(self, self.callable_, args, data)
  File "/usr/lib64/python2.7/site-packages/mako/runtime.py", line 838, in _render
    **_kwargs_for_callable(callable_, data))
  File "/usr/lib64/python2.7/site-packages/mako/runtime.py", line 873, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/lib64/python2.7/site-packages/mako/runtime.py", line 899, in _exec_template
    callable_(context, *args, **kwargs)
  File "/home/are/.pwntools-cache/mako/mips/linux/sh.asm.py", line 28, in render_body
    __M_writer(unicode(mips.execve('//bin/sh', ['sh'], {})))
  File "<string>", line 8, in execve
  File "/usr/lib64/python2.7/site-packages/mako/template.py", line 462, in render
    return runtime._render(self, self.callable_, args, data)
  File "/usr/lib64/python2.7/site-packages/mako/runtime.py", line 838, in _render
    **_kwargs_for_callable(callable_, data))
  File "/usr/lib64/python2.7/site-packages/mako/runtime.py", line 873, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/lib64/python2.7/site-packages/mako/runtime.py", line 899, in _exec_template
    callable_(context, *args, **kwargs)
  File "/home/are/.pwntools-cache/mako/mips/linux/syscalls/execve.asm.py", line 69, in render_body
    if arg in allregs:
TypeError: unhashable type: 'list'

But it can be fixed by making sure that shellcraft.registers.current() returns a list rather than a dict (mips is the only architecture that it happens for, since type(shellcraft.registers.mips)==dict). A pull request is on its way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant