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

fix #138, add globbing to stdapi_fs_ls #139

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@timwr
Contributor

timwr commented Oct 6, 2018

This implements support for globbing on stdapi_fs_ls.
This is mostly useful because it fixes the tab completion :)

Unfortunately we still get:

meterpreter > ls me*
File globbing not supported with this session
meterpreter >

even though it is supported by this pr.
To fix that we can either implement stdapi_fs_search (in a separate pull request) or find another way for the framework side of things to know if globbing is supported.
See #138 for more details.

@timwr timwr added the enhancement label Oct 6, 2018

@timwr

This comment has been minimized.

Show comment
Hide comment
@timwr

timwr Oct 20, 2018

Contributor

This is timing out currently on iOS

Contributor

timwr commented Oct 20, 2018

This is timing out currently on iOS

@timwr timwr added the delayed label Oct 20, 2018

@busterb

This comment has been minimized.

Show comment
Hide comment
@busterb

busterb Oct 22, 2018

Contributor

What do you mean by timing out?

Contributor

busterb commented Oct 22, 2018

What do you mean by timing out?

@busterb

This comment has been minimized.

Show comment
Hide comment
@busterb

busterb Oct 22, 2018

Contributor

We might just override glob in iOS's libc with the musl one unconditionally https://git.musl-libc.org/cgit/musl/tree/src/regex/glob.c

Contributor

busterb commented Oct 22, 2018

We might just override glob in iOS's libc with the musl one unconditionally https://git.musl-libc.org/cgit/musl/tree/src/regex/glob.c

@timwr

This comment has been minimized.

Show comment
Hide comment
@timwr

timwr Oct 23, 2018

Contributor

It seems the call to glob (https://github.com/rapid7/mettle/pull/139/files#diff-5bf4b5b8f1b639f9de20cda70d2fdb28R93) never returns so we get:

meterpreter > ls
[-] Error running command ls: Rex::TimeoutError Operation timed out

How would I go about overriding the libc version? Just add it to mettle/src/compat/glob.c?

Contributor

timwr commented Oct 23, 2018

It seems the call to glob (https://github.com/rapid7/mettle/pull/139/files#diff-5bf4b5b8f1b639f9de20cda70d2fdb28R93) never returns so we get:

meterpreter > ls
[-] Error running command ls: Rex::TimeoutError Operation timed out

How would I go about overriding the libc version? Just add it to mettle/src/compat/glob.c?

@busterb

This comment has been minimized.

Show comment
Hide comment
@busterb

busterb Oct 23, 2018

Contributor

That could be one way. If glob is not a weak symbol in libc (meaning you can easily override it via the linker), you could also rename the exported function to 'musl_glob' or something.

If you wanted to selectively redirect 'glob' to 'musl_glob' then, you could do something like this with a preprocessor define, or just call it directly: https://github.com/libressl-portable/portable/blob/master/include/compat/stdio.h#L33

Contributor

busterb commented Oct 23, 2018

That could be one way. If glob is not a weak symbol in libc (meaning you can easily override it via the linker), you could also rename the exported function to 'musl_glob' or something.

If you wanted to selectively redirect 'glob' to 'musl_glob' then, you could do something like this with a preprocessor define, or just call it directly: https://github.com/libressl-portable/portable/blob/master/include/compat/stdio.h#L33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment